JBoss Tools SVN: r10953 - trunk/common/tests/org.jboss.tools.common.test/src/org/jboss/tools/common/test/util.
by jbosstools-commits@lists.jboss.org
Author: dgolovin
Date: 2008-10-18 11:23:45 -0400 (Sat, 18 Oct 2008)
New Revision: 10953
Modified:
trunk/common/tests/org.jboss.tools.common.test/src/org/jboss/tools/common/test/util/TestProjectProvider.java
Log:
fix for JUnit Tests errors
Modified: trunk/common/tests/org.jboss.tools.common.test/src/org/jboss/tools/common/test/util/TestProjectProvider.java
===================================================================
--- trunk/common/tests/org.jboss.tools.common.test/src/org/jboss/tools/common/test/util/TestProjectProvider.java 2008-10-18 13:45:37 UTC (rev 10952)
+++ trunk/common/tests/org.jboss.tools.common.test/src/org/jboss/tools/common/test/util/TestProjectProvider.java 2008-10-18 15:23:45 UTC (rev 10953)
@@ -79,6 +79,7 @@
try {
oldAutoBuilding = ResourcesUtils.setBuildAutomatically(false);
JobUtils.waitForIdle();
+ project.close(null);
project.delete(true, null);
JobUtils.waitForIdle();
} finally {
17 years, 2 months
JBoss Tools SVN: r10952 - branches/jbosstools-3.0.0.Beta1/hibernatetools/tests/org.hibernate.eclipse.jdt.ui.test/src/org/hibernate/eclipse/jdt/ui/test.
by jbosstools-commits@lists.jboss.org
Author: snjeza
Date: 2008-10-18 09:45:37 -0400 (Sat, 18 Oct 2008)
New Revision: 10952
Modified:
branches/jbosstools-3.0.0.Beta1/hibernatetools/tests/org.hibernate.eclipse.jdt.ui.test/src/org/hibernate/eclipse/jdt/ui/test/HibernateErrorsTest2.java
Log:
Checking the hibernate tests.
Modified: branches/jbosstools-3.0.0.Beta1/hibernatetools/tests/org.hibernate.eclipse.jdt.ui.test/src/org/hibernate/eclipse/jdt/ui/test/HibernateErrorsTest2.java
===================================================================
--- branches/jbosstools-3.0.0.Beta1/hibernatetools/tests/org.hibernate.eclipse.jdt.ui.test/src/org/hibernate/eclipse/jdt/ui/test/HibernateErrorsTest2.java 2008-10-18 13:15:43 UTC (rev 10951)
+++ branches/jbosstools-3.0.0.Beta1/hibernatetools/tests/org.hibernate.eclipse.jdt.ui.test/src/org/hibernate/eclipse/jdt/ui/test/HibernateErrorsTest2.java 2008-10-18 13:45:37 UTC (rev 10952)
@@ -7,9 +7,12 @@
import org.eclipse.core.internal.resources.ResourceException;
import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IWorkspaceRunnable;
import org.eclipse.core.resources.IncrementalProjectBuilder;
+import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.core.runtime.Path;
@@ -45,6 +48,8 @@
private ConsoleConfiguration ccfg;
+ private boolean deleted;
+
public HibernateErrorsTest2(String name) {
super(name);
}
@@ -152,18 +157,23 @@
// super.tearDown();
- IProject proj = getProject().getIProject();
+ final IProject proj = getProject().getIProject();
String projRoot = proj.getLocation().toFile().getAbsolutePath();
File file = new File(projRoot);
- boolean deleted = true;
+ deleted = false;
int nTrys = 0;
- while (!deleted && nTrys++ < 5)
- try {
- proj.delete(true, true, null);
- deleted = true;
- } catch (ResourceException re) {
- waitForJobs();
- Thread.sleep(100);
+ while (!deleted && nTrys++ < 5) {
+ ResourcesPlugin.getWorkspace().run(new IWorkspaceRunnable() {
+ public void run(IProgressMonitor monitor) throws CoreException {
+ try {
+ proj.delete(true, true, null);
+ deleted = true;
+ } catch (ResourceException re) {
+ //waitForJobs();
+ delay(1000);
+ }
+ }
+ }, new NullProgressMonitor());
}
waitForJobs();
delete(file);
17 years, 2 months
JBoss Tools SVN: r10951 - trunk/hibernatetools/tests/org.hibernate.eclipse.jdt.ui.test/src/org/hibernate/eclipse/jdt/ui/test.
by jbosstools-commits@lists.jboss.org
Author: snjeza
Date: 2008-10-18 09:15:43 -0400 (Sat, 18 Oct 2008)
New Revision: 10951
Modified:
trunk/hibernatetools/tests/org.hibernate.eclipse.jdt.ui.test/src/org/hibernate/eclipse/jdt/ui/test/HibernateErrorsTest2.java
Log:
Checking the hibernate tests.
Modified: trunk/hibernatetools/tests/org.hibernate.eclipse.jdt.ui.test/src/org/hibernate/eclipse/jdt/ui/test/HibernateErrorsTest2.java
===================================================================
--- trunk/hibernatetools/tests/org.hibernate.eclipse.jdt.ui.test/src/org/hibernate/eclipse/jdt/ui/test/HibernateErrorsTest2.java 2008-10-18 01:27:10 UTC (rev 10950)
+++ trunk/hibernatetools/tests/org.hibernate.eclipse.jdt.ui.test/src/org/hibernate/eclipse/jdt/ui/test/HibernateErrorsTest2.java 2008-10-18 13:15:43 UTC (rev 10951)
@@ -7,9 +7,12 @@
import org.eclipse.core.internal.resources.ResourceException;
import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IWorkspaceRunnable;
import org.eclipse.core.resources.IncrementalProjectBuilder;
+import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.core.runtime.Path;
@@ -45,6 +48,8 @@
private ConsoleConfiguration ccfg;
+ private boolean deleted;
+
public HibernateErrorsTest2(String name) {
super(name);
}
@@ -152,18 +157,23 @@
// super.tearDown();
- IProject proj = getProject().getIProject();
+ final IProject proj = getProject().getIProject();
String projRoot = proj.getLocation().toFile().getAbsolutePath();
File file = new File(projRoot);
- boolean deleted = true;
+ deleted = false;
int nTrys = 0;
- while (!deleted && nTrys++ < 5)
- try {
- proj.delete(true, true, null);
- deleted = true;
- } catch (ResourceException re) {
- waitForJobs();
- Thread.sleep(100);
+ while (!deleted && nTrys++ < 5) {
+ ResourcesPlugin.getWorkspace().run(new IWorkspaceRunnable() {
+ public void run(IProgressMonitor monitor) throws CoreException {
+ try {
+ proj.delete(true, true, null);
+ deleted = true;
+ } catch (ResourceException re) {
+ //waitForJobs();
+ delay(1000);
+ }
+ }
+ }, new NullProgressMonitor());
}
waitForJobs();
delete(file);
@@ -203,8 +213,12 @@
buffer.append(file.getAbsolutePath());
buffer.append(" file. ");
if (file.exists() && file.isDirectory()) {
+ String[] files = file.list();
buffer.append("List=");
- buffer.append(file.list());
+ buffer.append(files);
+ buffer.append("-");
+ for (int i = 0; i < files.length; i++)
+ buffer.append(files[i]);
}
return buffer.toString();
}
17 years, 2 months
JBoss Tools SVN: r10950 - in trunk/as/plugins: org.jboss.ide.eclipse.as.ui and 2 other directories.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2008-10-17 21:27:10 -0400 (Fri, 17 Oct 2008)
New Revision: 10950
Added:
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/eclipse/wst/server/ui/internal/view/servers/provisional/extensions/XPathActionProvider.java
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/eclipse/wst/server/ui/internal/view/servers/provisional/extensions/XPathChangeValueAction.java
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/eclipse/wst/server/ui/internal/view/servers/provisional/extensions/XPathDecorator.java
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/eclipse/wst/server/ui/internal/view/servers/provisional/extensions/XPathTreeContentProvider.java
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/eclipse/wst/server/ui/internal/view/servers/provisional/extensions/XPathTreeLabelProvider.java
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/IPreferenceKeys.java
Removed:
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/eclipse/wst/server/ui/internal/view/servers/provisional/extensions/XPathProvider.java
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/descriptors/XPathModel.java
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/JBossServerUIPlugin.java
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/plugin.xml
Log:
More additions for the beta server's view including an in-line editor inside the view. Also automatically enabling the decorators for the beta view.
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/descriptors/XPathModel.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/descriptors/XPathModel.java 2008-10-17 22:48:29 UTC (rev 10949)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/descriptors/XPathModel.java 2008-10-18 01:27:10 UTC (rev 10950)
@@ -42,6 +42,7 @@
import org.eclipse.wst.server.core.IServerLifecycleListener;
import org.eclipse.wst.server.core.ServerCore;
import org.jboss.ide.eclipse.as.core.JBossServerCorePlugin;
+import org.jboss.ide.eclipse.as.core.extensions.descriptors.XPathFileResult.XPathResultNode;
import org.jboss.ide.eclipse.as.core.server.internal.LocalJBossServerRuntime;
import org.jboss.ide.eclipse.as.core.server.internal.ServerAttributeHelper;
@@ -304,4 +305,39 @@
serverToCategories.put(server.getId(), retVal);
}
+
+
+ /*
+ * Static utility methods
+ */
+
+
+ public static XPathResultNode getResultNode(Object data) {
+ // if we are the node to change, change me
+ if( data instanceof XPathResultNode ) {
+ return (XPathResultNode)data;
+ }
+
+ // if we're a node which represents a file, but only have one matched node, thats the node.
+ if( data instanceof XPathFileResult && ((XPathFileResult)data).getChildren().length == 1 ) {
+ return (XPathResultNode) (((XPathFileResult)data).getChildren()[0]);
+ }
+
+ // if we're a top level tree item (JNDI), with one file child and one mbean grandchild, the grandchild is the node
+ if( data instanceof XPathQuery && ((XPathQuery)data).getResults().length == 1 ) {
+ XPathFileResult item = ((XPathFileResult) ((XPathQuery)data).getResults()[0]);
+ if( item.getChildren().length == 1 )
+ return (XPathResultNode)item.getChildren()[0];
+ }
+ return null;
+ }
+
+ public static XPathResultNode[] getResultNodes(XPathQuery query) {
+ ArrayList<XPathResultNode> l = new ArrayList<XPathResultNode>();
+ XPathFileResult[] files = query.getResults();
+ for( int i = 0; i < files.length; i++ ) {
+ l.addAll(Arrays.asList(files[i].getChildren()));
+ }
+ return l.toArray(new XPathResultNode[l.size()]);
+ }
}
Copied: trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/eclipse/wst/server/ui/internal/view/servers/provisional/extensions/XPathActionProvider.java (from rev 10904, trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/eclipse/wst/server/ui/internal/view/servers/provisional/extensions/XPathProvider.java)
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/eclipse/wst/server/ui/internal/view/servers/provisional/extensions/XPathActionProvider.java (rev 0)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/eclipse/wst/server/ui/internal/view/servers/provisional/extensions/XPathActionProvider.java 2008-10-18 01:27:10 UTC (rev 10950)
@@ -0,0 +1,271 @@
+package org.eclipse.wst.server.ui.internal.view.servers.provisional.extensions;
+
+import org.eclipse.core.filesystem.EFS;
+import org.eclipse.core.filesystem.IFileStore;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.jface.action.Action;
+import org.eclipse.jface.action.IMenuManager;
+import org.eclipse.jface.action.Separator;
+import org.eclipse.jface.viewers.ISelectionProvider;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.viewers.StructuredViewer;
+import org.eclipse.jface.window.Window;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.MessageBox;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.ui.IWorkbench;
+import org.eclipse.ui.IWorkbenchPage;
+import org.eclipse.ui.IWorkbenchWindow;
+import org.eclipse.ui.PartInitException;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.ide.IDE;
+import org.eclipse.ui.navigator.CommonActionProvider;
+import org.eclipse.ui.navigator.CommonViewer;
+import org.eclipse.ui.navigator.ICommonActionExtensionSite;
+import org.eclipse.ui.navigator.ICommonViewerSite;
+import org.eclipse.ui.navigator.ICommonViewerWorkbenchSite;
+import org.eclipse.wst.server.core.IServer;
+import org.eclipse.wst.server.ui.internal.view.servers.provisional.extensions.XPathTreeContentProvider.ServerWrapper;
+import org.jboss.ide.eclipse.as.core.extensions.descriptors.XPathCategory;
+import org.jboss.ide.eclipse.as.core.extensions.descriptors.XPathFileResult;
+import org.jboss.ide.eclipse.as.core.extensions.descriptors.XPathModel;
+import org.jboss.ide.eclipse.as.core.extensions.descriptors.XPathQuery;
+import org.jboss.ide.eclipse.as.core.extensions.descriptors.XPathFileResult.XPathResultNode;
+import org.jboss.ide.eclipse.as.ui.JBossServerUIPlugin;
+import org.jboss.ide.eclipse.as.ui.Messages;
+import org.jboss.ide.eclipse.as.ui.dialogs.XPathDialogs;
+import org.jboss.ide.eclipse.as.ui.dialogs.XPathDialogs.XPathCategoryDialog;
+import org.jboss.ide.eclipse.as.ui.dialogs.XPathDialogs.XPathDialog;
+
+public class XPathActionProvider extends CommonActionProvider {
+
+ private ICommonActionExtensionSite actionSite;
+ public Action newXPathCategoryAction, deleteXPathCategoryAction,
+ newXPathAction, editXPathAction, deleteXPathAction, editFileAction;
+ private XPathChangeValueAction xpathChangeValueAction;
+ private Object selectedNode;
+
+ public void init(ICommonActionExtensionSite aSite) {
+ super.init(aSite);
+ this.actionSite = aSite;
+ ICommonViewerSite site = aSite.getViewSite();
+ if( site instanceof ICommonViewerWorkbenchSite ) {
+ StructuredViewer v = aSite.getStructuredViewer();
+ if( v instanceof CommonViewer ) {
+ CommonViewer cv = (CommonViewer)v;
+ ICommonViewerWorkbenchSite wsSite = (ICommonViewerWorkbenchSite)site;
+ createActions(cv, wsSite.getSelectionProvider());
+ }
+ }
+ }
+
+ public void createActions(CommonViewer tableViewer, ISelectionProvider provider) {
+ Shell shell = tableViewer.getTree().getShell();
+ newXPathCategoryAction = new Action() {
+ public void run() {
+ XPathCategoryDialog d = new XPathCategoryDialog(Display
+ .getCurrent().getActiveShell(), getServer());
+ if (d.open() == Window.OK) {
+ XPathModel.getDefault().addCategory(getServer(),
+ d.getText());
+ XPathModel.getDefault().save(getServer());
+ refreshViewer();
+ }
+ }
+ };
+ newXPathCategoryAction.setText("New Category");
+
+ deleteXPathCategoryAction = new Action() {
+ public void run() {
+ int style = SWT.APPLICATION_MODAL | SWT.YES | SWT.NO;
+ MessageBox messageBox = new MessageBox(Display.getCurrent()
+ .getActiveShell(), style);
+ messageBox
+ .setText(Messages.DescriptorXPathRemoveCategory + "?");
+ messageBox
+ .setMessage(Messages.DescriptorXPathRemoveCategoryDesc);
+ if (messageBox.open() == SWT.YES) {
+ XPathModel.getDefault().removeCategory(getServer(),
+ ((XPathCategory) selectedNode).getName());
+ XPathModel.getDefault().save(getServer());
+ refreshViewer();
+ }
+ }
+ };
+ deleteXPathCategoryAction
+ .setText(Messages.DescriptorXPathRemoveCategory);
+
+ newXPathAction = new Action() {
+ public void run() {
+ XPathCategory category = (XPathCategory) selectedNode;
+ if (category != null) {
+ String categoryName = category.getName();
+ XPathDialog d = new XPathDialog(Display.getCurrent()
+ .getActiveShell(), getServer(), categoryName);
+ if (d.open() == Window.OK) {
+ XPathCategory[] categoryList = XPathModel.getDefault()
+ .getCategories(getServer());
+ XPathCategory categoryItem = null;
+ for (int i = 0; i < categoryList.length; i++) {
+ if (categoryList[i].getName().equals(
+ category.getName()))
+ categoryItem = categoryList[i];
+ }
+ if (categoryItem != null) {
+ XPathQuery query = new XPathQuery(d.getName(),
+ XPathDialogs.getConfigFolder(getServer()),
+ null, d.getXpath(), d.getAttribute());
+ categoryItem.addQuery(query);
+ XPathModel.getDefault().save(getServer());
+ refreshViewer();
+ }
+ }
+ }
+ }
+ };
+ newXPathAction.setText(Messages.DescriptorXPathNewXPath);
+
+ editXPathAction = new Action() {
+ public void run() {
+ Object o = selectedNode;
+ if (o != null && o instanceof XPathQuery) {
+ XPathQuery original = (XPathQuery) o;
+ XPathCategory category = original.getCategory();
+
+ XPathDialog d = new XPathDialog(Display.getCurrent()
+ .getActiveShell(), getServer(), category.getName(),
+ original.getName());
+ d.setAttribute(original.getAttribute());
+ d.setXpath(original.getXpathPattern());
+
+ if (d.open() == Window.OK) {
+ original.setAttribute(d.getAttribute());
+ original.setXpathPattern(d.getXpath());
+ original.setName(d.getName());
+ category.save();
+ refreshViewer();
+ }
+ }
+ }
+ };
+ editXPathAction.setText(Messages.DescriptorXPathEditXPath);
+
+ deleteXPathAction = new Action() {
+ public void run() {
+ Object o = selectedNode;
+ if (o instanceof XPathQuery) {
+ XPathCategory cat = ((XPathQuery) o).getCategory();
+ cat.removeQuery((XPathQuery) o);
+ cat.save();
+ refreshViewer();
+ }
+ }
+ };
+ deleteXPathAction.setText(Messages.DescriptorXPathDeleteXPath);
+
+ editFileAction = new Action() {
+ public void run() {
+ try {
+ Object o = selectedNode;
+ Path p = null;
+ if (o instanceof XPathQuery
+ && ((XPathQuery) o).getResults().length == 1) {
+ o = (XPathFileResult) ((XPathQuery) o).getResults()[0];
+ }
+ if (o instanceof XPathFileResult) {
+ p = new Path(((XPathFileResult) o).getFileLocation());
+ } else if (o instanceof XPathResultNode) {
+ p = new Path(((XPathResultNode) o).getFileLocation());
+ }
+ if (p != null) {
+
+ IFileStore fileStore = EFS.getLocalFileSystem()
+ .getStore(p.removeLastSegments(1));
+ fileStore = fileStore.getChild(p.lastSegment());
+ IWorkbench wb = PlatformUI.getWorkbench();
+ IWorkbenchWindow win = wb.getActiveWorkbenchWindow();
+ IWorkbenchPage page = win.getActivePage();
+
+ if (!fileStore.fetchInfo().isDirectory()
+ && fileStore.fetchInfo().exists()) {
+ try {
+ IDE.openEditorOnFileStore(page, fileStore);
+ } catch (PartInitException e) {
+ }
+ }
+ }
+ } catch (Exception exc) {
+ JBossServerUIPlugin.log("Error running edit file action",
+ exc);
+ }
+ }
+ };
+ editFileAction.setText("Edit File");
+
+ xpathChangeValueAction = new XPathChangeValueAction(shell, tableViewer, provider);
+ }
+
+ public void fillContextMenu(IMenuManager menu) {
+ ICommonViewerSite site = actionSite.getViewSite();
+ IStructuredSelection selection = null;
+ if (site instanceof ICommonViewerWorkbenchSite) {
+ ICommonViewerWorkbenchSite wsSite = (ICommonViewerWorkbenchSite) site;
+ selection = (IStructuredSelection) wsSite.getSelectionProvider()
+ .getSelection();
+ Object first = selection.getFirstElement();
+ if (first == null)
+ return;
+
+ if (first instanceof ServerWrapper) {
+ menu.add(newXPathCategoryAction);
+ menu.add(new Separator());
+ return;
+ }
+
+ if (first instanceof XPathCategory) {
+ menu.add(newXPathAction);
+ menu.add(deleteXPathCategoryAction);
+ menu.add(new Separator());
+ return;
+ }
+
+ if (first instanceof XPathQuery) {
+ selectedNode = first;
+ menu.add(newXPathAction);
+ menu.add(editXPathAction);
+ menu.add(deleteXPathAction);
+ }
+
+ if( xpathChangeValueAction.shouldRun())
+ menu.add(xpathChangeValueAction);
+
+ if ((first instanceof XPathResultNode || first instanceof XPathFileResult)
+ || (first instanceof XPathQuery && ((XPathQuery) first)
+ .getResults().length == 1)) {
+ menu.add(editFileAction);
+ }
+ }
+ }
+
+ protected void refreshViewer() {
+ actionSite.getStructuredViewer().refresh();
+ }
+
+ protected IServer getServer() {
+ Object o = selectedNode;
+ if (o instanceof ServerWrapper)
+ return ((ServerWrapper) o).server;
+ if (o instanceof XPathCategory)
+ return ((XPathCategory) o).getServer();
+ if (o instanceof XPathQuery)
+ return ((XPathQuery) o).getCategory().getServer();
+ if (o instanceof XPathFileResult)
+ return ((XPathFileResult) o).getQuery().getCategory().getServer();
+ if (o instanceof XPathResultNode)
+ return ((XPathResultNode) o).getFile().getQuery().getCategory()
+ .getServer();
+ return null;
+ }
+
+}
\ No newline at end of file
Property changes on: trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/eclipse/wst/server/ui/internal/view/servers/provisional/extensions/XPathActionProvider.java
___________________________________________________________________
Name: svn:mergeinfo
+
Added: trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/eclipse/wst/server/ui/internal/view/servers/provisional/extensions/XPathChangeValueAction.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/eclipse/wst/server/ui/internal/view/servers/provisional/extensions/XPathChangeValueAction.java (rev 0)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/eclipse/wst/server/ui/internal/view/servers/provisional/extensions/XPathChangeValueAction.java 2008-10-18 01:27:10 UTC (rev 10950)
@@ -0,0 +1,364 @@
+/*******************************************************************************
+ * Copyright (c) 2007 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - Initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.server.ui.internal.view.servers.provisional.extensions;
+
+import org.eclipse.jface.viewers.ISelectionProvider;
+import org.eclipse.jface.viewers.TreeViewer;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.custom.TreeEditor;
+import org.eclipse.swt.events.FocusAdapter;
+import org.eclipse.swt.events.FocusEvent;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.graphics.Rectangle;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Event;
+import org.eclipse.swt.widgets.Listener;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.swt.widgets.Text;
+import org.eclipse.swt.widgets.Tree;
+import org.eclipse.swt.widgets.TreeItem;
+import org.eclipse.ui.actions.SelectionProviderAction;
+import org.eclipse.ui.actions.TextActionHandler;
+import org.jboss.ide.eclipse.as.core.extensions.descriptors.XPathModel;
+import org.jboss.ide.eclipse.as.core.extensions.descriptors.XPathQuery;
+import org.jboss.ide.eclipse.as.core.extensions.descriptors.XPathFileResult.XPathResultNode;
+/**
+ * Action to rename a server.
+ */
+public class XPathChangeValueAction extends SelectionProviderAction {
+ protected CustomTreeEditor treeEditor;
+ protected Tree tree;
+ protected TreeViewer viewer;
+ protected Text textEditor;
+ protected Composite textEditorParent;
+ private TextActionHandler textActionHandler;
+ protected Shell shell;
+ protected int width = -1;
+ protected Rectangle newParentBounds;
+
+ protected boolean saving = false;
+
+ public XPathChangeValueAction(Shell shell, TreeViewer viewer, ISelectionProvider selectionProvider) {
+ super(selectionProvider, "Change Value");
+ this.shell = shell;
+ this.viewer = viewer;
+ this.tree = viewer.getTree();
+ this.treeEditor = new CustomTreeEditor(tree);
+ }
+
+ public boolean shouldRun() {
+ if( getStructuredSelection().toArray().length > 1)
+ return false;
+
+ Object o = getStructuredSelection().getFirstElement();
+ if( XPathDecorator.getDecoration(o) != null )
+ return true;
+ return false;
+ }
+
+ public void run() {
+ queryNewValueInline(getStructuredSelection().getFirstElement());
+ }
+
+ /**
+ * On Mac the text widget already provides a border when it has focus, so
+ * there is no need to draw another one. The value of returned by this
+ * method is usd to control the inset we apply to the text field bound's in
+ * order to get space for drawing a border. A value of 1 means a one-pixel
+ * wide border around the text field. A negative value supresses the border.
+ * However, in M9 the system property
+ * "org.eclipse.swt.internal.carbon.noFocusRing" has been introduced as a
+ * temporary workaround for bug #28842. The existence of the property turns
+ * the native focus ring off if the widget is contained in a main window
+ * (not dialog). The check for the property should be removed after a final
+ * fix for #28842 has been provided.
+ */
+ private static int getCellEditorInset(Control c) {
+ // special case for MacOS X
+ if ("carbon".equals(SWT.getPlatform())) { //$NON-NLS-1$
+ if (System
+ .getProperty("org.eclipse.swt.internal.carbon.noFocusRing") == null || c.getShell().getParent() != null) { //$NON-NLS-1$
+ return -2; // native border
+ }
+ }
+ return 1; // one pixel wide black border
+ }
+
+ /**
+ * Get the Tree being edited.
+ *
+ * @returnTree
+ */
+ private Tree getTree() {
+ return tree;
+ }
+
+ private Composite createParent() {
+ Tree tree2 = getTree();
+ Composite result = new Composite(tree2, SWT.NONE);
+ TreeItem[] selectedItems = tree2.getSelection();
+ treeEditor.horizontalAlignment = SWT.LEFT;
+ treeEditor.grabHorizontal = true;
+ treeEditor.setEditor(result, selectedItems[0]);
+ return result;
+ }
+
+ /**
+ * Return the new name to be given to the target resource or
+ * <code>null<code>
+ * if the query was canceled. Rename the currently selected server using the table editor.
+ * Continue the action when the user is done.
+ *
+ * @param server the server to rename
+ */
+ private void queryNewValueInline(final Object node) {
+
+ // Make sure text editor is created only once. Simply reset text
+ // editor when action is executed more than once. Fixes bug 22269
+ if (textEditorParent == null) {
+ createTextEditor(node);
+ }
+ textEditor.setText(XPathModel.getResultNode(node).getText());
+ // Open text editor with initial size
+ Point textSize = textEditor.computeSize(SWT.DEFAULT, SWT.DEFAULT);
+ textSize.x += textSize.y; // Add extra space for new characters
+ Point parentSize = textEditorParent.getSize();
+ int inset = getCellEditorInset(textEditorParent);
+ textEditor.setBounds(2, inset, Math.min(textSize.x, parentSize.x - 4),
+ parentSize.y - 2 * inset);
+ textEditor.setText(new XPathTreeLabelProvider().getText(node));
+ width = textEditor.getSize().x - 10;
+ textEditor.setText(XPathModel.getResultNode(node).getText());
+ treeEditor.layout();
+ textEditorParent.setVisible(true);
+ textEditor.setVisible(true);
+ textEditorParent.redraw();
+ textEditor.selectAll();
+ textEditor.setFocus();
+ }
+
+ /**
+ * Create the text editor widget.
+ *
+ * @param server the server to rename
+ */
+ private void createTextEditor(final Object node) {
+ // Create text editor parent. This draws a nice bounding rect
+ textEditorParent = createParent();
+ textEditorParent.setVisible(false);
+ final int inset = getCellEditorInset(textEditorParent);
+ if (inset > 0) {
+ textEditorParent.addListener(SWT.Paint, new Listener() {
+ public void handleEvent(Event e) {
+ Point textSize = textEditor.getSize();
+ Point parentSize = textEditorParent.getSize();
+ e.gc.drawRectangle(0, 0, Math.min(textSize.x + 4,
+ parentSize.x - 1), parentSize.y - 1);
+ }
+ });
+ }
+ // Create inner text editor
+ textEditor = new Text(textEditorParent, SWT.NONE);
+ textEditor.setFont(tree.getFont());
+ textEditorParent.setBackground(textEditor.getBackground());
+ textEditor.addListener(SWT.Modify, new Listener() {
+ public void handleEvent(Event e) {
+ Point textSize = textEditor.computeSize(SWT.DEFAULT,
+ SWT.DEFAULT);
+ textSize.x += textSize.y; // Add extra space for new
+ // characters.
+ Point parentSize = textEditorParent.getSize();
+
+ textEditor.setBounds(2, inset, Math.min(textSize.x,
+ parentSize.x - 4), parentSize.y - 2 * inset);
+ textEditorParent.redraw();
+ }
+ });
+ textEditor.addListener(SWT.Traverse, new Listener() {
+ public void handleEvent(Event event) {
+
+ // Workaround for Bug 20214 due to extra
+ // traverse events
+ switch (event.detail) {
+ case SWT.TRAVERSE_ESCAPE:
+ // Do nothing in this case
+ disposeTextWidget();
+ event.doit = true;
+ event.detail = SWT.TRAVERSE_NONE;
+ break;
+ case SWT.TRAVERSE_RETURN:
+ saveChangesAndDispose(node);
+ event.doit = true;
+ event.detail = SWT.TRAVERSE_NONE;
+ break;
+ }
+ }
+ });
+ textEditor.addFocusListener(new FocusAdapter() {
+ public void focusLost(FocusEvent fe) {
+ saveChangesAndDispose(node);
+ }
+ });
+
+ if (textActionHandler != null) {
+ textActionHandler.addText(textEditor);
+ }
+ textEditor.setVisible(false);
+ }
+
+ /**
+ * Close the text widget and reset the editorText field.
+ */
+ protected void disposeTextWidget() {
+ width = -1;
+ if (textActionHandler != null)
+ textActionHandler.removeText(textEditor);
+
+ if (textEditorParent != null) {
+ textEditorParent.dispose();
+ textEditorParent = null;
+ textEditor = null;
+ treeEditor.setEditor(null, null);
+ }
+ }
+
+ /**
+ * Save the changes and dispose of the text widget.
+ *
+ * @param server the server to rename
+ */
+ protected void saveChangesAndDispose(Object node) {
+ if (saving == true)
+ return;
+ saving = true;
+
+ // Cache the resource to avoid selection loss since a selection of
+ // another item can trigger this method
+ final String newVal = textEditor.getText();
+ XPathResultNode itemToChange = XPathModel.getResultNode(node);
+ // if its unchanged do nothing
+ if( !itemToChange.getText().equals(newVal)) {
+ // set the text and add the document to the list of dirty ones
+ itemToChange.setText(newVal);
+ if( itemToChange.getDocument() != null ) {
+ itemToChange.saveDescriptor();
+ }
+ }
+
+ // Run this in an async to make sure that the operation that triggered
+ // this action is completed. Otherwise this leads to problems when the
+ // icon of the item being renamed is clicked (i.e., which causes the
+ // rename text widget to lose focus and trigger this method)
+ getTree().getShell().getDisplay().asyncExec(new Runnable() {
+ public void run() {
+ try {
+ // Dispose the text widget regardless
+ disposeTextWidget();
+ // Ensure the Navigator tree has focus, which it may not if
+ // the text widget previously had focus
+ if (tree != null && !tree.isDisposed()) {
+ tree.setFocus();
+ viewer.refresh(getStructuredSelection().getFirstElement());
+ }
+ } finally {
+ saving = false;
+ }
+ }
+ });
+ }
+
+
+ protected class CustomTreeEditor extends TreeEditor {
+ public CustomTreeEditor(Tree tree) {
+ super(tree);
+ }
+
+ public void setItem (TreeItem item) {
+ super.setItem(item);
+ }
+
+ private boolean hadFocus = false;
+ public void layout () {
+ if (tree == null || tree.isDisposed()) return;
+ if (getItem() == null || getItem().isDisposed()) return;
+ int columnCount = tree.getColumnCount();
+ if (columnCount == 0 && getColumn() != 0) return;
+ if (columnCount > 0 && (getColumn() < 0 || getColumn() >= columnCount)) return;
+
+ if (getEditor() == null || getEditor().isDisposed()) return;
+ if (getEditor().getVisible ()) {
+ hadFocus = getEditor().isFocusControl();
+ } // this doesn't work because
+ // resizing the column takes the focus away
+ // before we get here
+ getEditor().setBounds (customComputeBounds (superComputeBounds()));
+ if (hadFocus) {
+ if (getEditor() == null || getEditor().isDisposed()) return;
+ getEditor().setFocus ();
+ }
+ }
+
+ Rectangle customComputeBounds (Rectangle rect) {
+ Rectangle r = new Rectangle(rect.x + (width == -1 ? 0 : width), rect.y, rect.width, rect.height);
+ return r;
+ }
+
+ Rectangle superComputeBounds() {
+ if (getItem() == null || getColumn() == -1 || getItem().isDisposed() ) return new Rectangle(0, 0, 0, 0);
+ Rectangle cell = getItem().getBounds(getColumn());
+ Rectangle rect = getItem().getImageBounds(getColumn());
+ cell.x = rect.x + rect.width;
+ cell.width -= rect.width;
+ Rectangle area = tree.getClientArea();
+ if (cell.x < area.x + area.width) {
+ if (cell.x + cell.width > area.x + area.width) {
+ cell.width = area.x + area.width - cell.x;
+ }
+ }
+ Rectangle editorRect = new Rectangle(cell.x, cell.y, minimumWidth, minimumHeight);
+
+ if (grabHorizontal) {
+ if (tree.getColumnCount() == 0) {
+ // Bounds of tree item only include the text area - stretch out to include
+ // entire client area
+ cell.width = area.x + area.width - cell.x;
+ }
+ editorRect.width = Math.max(cell.width, minimumWidth);
+ }
+
+ if (grabVertical) {
+ editorRect.height = Math.max(cell.height, minimumHeight);
+ }
+
+ if (horizontalAlignment == SWT.RIGHT) {
+ editorRect.x += cell.width - editorRect.width;
+ } else if (horizontalAlignment == SWT.LEFT) {
+ // do nothing - cell.x is the right answer
+ } else { // default is CENTER
+ editorRect.x += (cell.width - editorRect.width)/2;
+ }
+ // don't let the editor overlap with the +/- of the tree
+ editorRect.x = Math.max(cell.x, editorRect.x);
+
+ if (verticalAlignment == SWT.BOTTOM) {
+ editorRect.y += cell.height - editorRect.height;
+ } else if (verticalAlignment == SWT.TOP) {
+ // do nothing - cell.y is the right answer
+ } else { // default is CENTER
+ editorRect.y += (cell.height - editorRect.height)/2;
+ }
+ return editorRect;
+ }
+
+ }
+
+}
\ No newline at end of file
Added: trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/eclipse/wst/server/ui/internal/view/servers/provisional/extensions/XPathDecorator.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/eclipse/wst/server/ui/internal/view/servers/provisional/extensions/XPathDecorator.java (rev 0)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/eclipse/wst/server/ui/internal/view/servers/provisional/extensions/XPathDecorator.java 2008-10-18 01:27:10 UTC (rev 10950)
@@ -0,0 +1,38 @@
+package org.eclipse.wst.server.ui.internal.view.servers.provisional.extensions;
+
+import org.eclipse.jface.viewers.IDecoration;
+import org.eclipse.jface.viewers.ILightweightLabelDecorator;
+import org.eclipse.jface.viewers.LabelProvider;
+import org.jboss.ide.eclipse.as.core.extensions.descriptors.XPathFileResult;
+import org.jboss.ide.eclipse.as.core.extensions.descriptors.XPathModel;
+import org.jboss.ide.eclipse.as.core.extensions.descriptors.XPathQuery;
+import org.jboss.ide.eclipse.as.core.extensions.descriptors.XPathFileResult.XPathResultNode;
+
+public class XPathDecorator extends LabelProvider implements ILightweightLabelDecorator {
+ public void decorate(Object element, IDecoration decoration) {
+ String decoration2 = getDecoration(element);
+ if( decoration2 != null ) {
+ decoration.addSuffix(decoration2);
+ }
+ }
+
+ public static String getDecoration(Object element) {
+ if( element instanceof XPathQuery) {
+ XPathResultNode[] nodes = XPathModel.getResultNodes((XPathQuery)element);
+ if(nodes.length == 1 ) {
+ return " " + nodes[0].getText();
+ }
+ }
+
+ if( element instanceof XPathFileResult ) {
+ XPathResultNode[] nodes = ((XPathFileResult)element).getChildren();
+ if( nodes.length == 1 )
+ return " " + nodes[0].getText();
+ }
+
+ if( element instanceof XPathResultNode ) {
+ return ((XPathResultNode)element).getText();
+ }
+ return null;
+ }
+}
\ No newline at end of file
Deleted: trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/eclipse/wst/server/ui/internal/view/servers/provisional/extensions/XPathProvider.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/eclipse/wst/server/ui/internal/view/servers/provisional/extensions/XPathProvider.java 2008-10-17 22:48:29 UTC (rev 10949)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/eclipse/wst/server/ui/internal/view/servers/provisional/extensions/XPathProvider.java 2008-10-18 01:27:10 UTC (rev 10950)
@@ -1,457 +0,0 @@
-package org.eclipse.wst.server.ui.internal.view.servers.provisional.extensions;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-
-import org.eclipse.core.filesystem.EFS;
-import org.eclipse.core.filesystem.IFileStore;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.core.runtime.jobs.Job;
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.action.IMenuManager;
-import org.eclipse.jface.action.Separator;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.viewers.IDecoration;
-import org.eclipse.jface.viewers.ILightweightLabelDecorator;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.ITreeContentProvider;
-import org.eclipse.jface.viewers.LabelProvider;
-import org.eclipse.jface.viewers.StructuredViewer;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.jface.window.Window;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.MessageBox;
-import org.eclipse.ui.ISharedImages;
-import org.eclipse.ui.IWorkbench;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.PartInitException;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.ide.IDE;
-import org.eclipse.ui.navigator.CommonActionProvider;
-import org.eclipse.ui.navigator.ICommonActionExtensionSite;
-import org.eclipse.ui.navigator.ICommonViewerSite;
-import org.eclipse.ui.navigator.ICommonViewerWorkbenchSite;
-import org.eclipse.wst.server.core.IServer;
-import org.eclipse.wst.server.ui.internal.view.servers.provisional.extensions.XPathProvider.XPathTreeContentProvider.ServerWrapper;
-import org.jboss.ide.eclipse.as.core.extensions.descriptors.XPathCategory;
-import org.jboss.ide.eclipse.as.core.extensions.descriptors.XPathFileResult;
-import org.jboss.ide.eclipse.as.core.extensions.descriptors.XPathModel;
-import org.jboss.ide.eclipse.as.core.extensions.descriptors.XPathQuery;
-import org.jboss.ide.eclipse.as.core.extensions.descriptors.XPathFileResult.XPathResultNode;
-import org.jboss.ide.eclipse.as.ui.JBossServerUIPlugin;
-import org.jboss.ide.eclipse.as.ui.Messages;
-import org.jboss.ide.eclipse.as.ui.dialogs.XPathDialogs;
-import org.jboss.ide.eclipse.as.ui.dialogs.XPathDialogs.XPathCategoryDialog;
-import org.jboss.ide.eclipse.as.ui.dialogs.XPathDialogs.XPathDialog;
-
-public class XPathProvider {
- public static class XPathTreeContentProvider implements
- ITreeContentProvider {
-
- public static class DelayProxy {}
- public static final DelayProxy LOADING = new DelayProxy();
-
- private Viewer viewer;
- private ArrayList<XPathCategory> loading = new ArrayList<XPathCategory>();
-
- public class ServerWrapper {
- public IServer server;
-
- public ServerWrapper(IServer server) {
- this.server = server;
- }
- public int hashCode() {
- return server.getId().hashCode();
- }
- public boolean equals(Object other) {
- return other instanceof ServerWrapper &&
- ((ServerWrapper)other).server.getId().equals(server.getId());
- }
- }
-
- public Object[] getChildren(Object parentElement) {
- if (parentElement == null)
- return new Object[] {};
- if (parentElement instanceof IServer) {
- return new Object[] { new ServerWrapper((IServer) parentElement) };
- }
-
- if (parentElement instanceof ServerWrapper) {
- return XPathModel.getDefault().getCategories(
- ((ServerWrapper) parentElement).server);
- }
-
- if( parentElement instanceof XPathCategory) {
- if( ((XPathCategory)parentElement).isLoaded())
- return ((XPathCategory)parentElement).getQueries();
-
- if( !loading.contains((XPathCategory)parentElement))
- launchLoad((XPathCategory)parentElement);
-
- return new Object[] { LOADING };
- }
-
- // we're the named element (JNDI)
- if( parentElement instanceof XPathQuery) {
- if( XPathProvider.getResultNodes((XPathQuery)parentElement).length == 1 ) {
- return new Object[0];
- } else {
- return ((XPathQuery)parentElement).getResults();
- }
- }
-
- // we're a file node (blah.xml)
- if( parentElement instanceof XPathFileResult ) {
- if( ((XPathFileResult)parentElement).getChildren().length == 1 )
- return new Object[0];
- return ((XPathFileResult)parentElement).getChildren();
- }
-
- if( parentElement instanceof XPathResultNode ) {
- return new Object[0];
- }
-
-
- return new Object[0];
- }
-
-
- protected void launchLoad(final XPathCategory cat) {
- new Job("Loading XPaths") {
- protected IStatus run(IProgressMonitor monitor) {
- loading.add(cat);
- XPathQuery[] queries = cat.getQueries();
- XPathFileResult[] results;
- for( int i = 0; i < queries.length; i++ ) {
- results = queries[i].getResults();
- for( int j = 0; j < results.length; j++ ) {
- results[j].getChildren();
- }
- }
- Display.getDefault().asyncExec(new Runnable() {
- public void run() {
- loading.remove(cat);
- ((StructuredViewer)viewer).refresh(cat.getServer());
- }
- });
- return Status.OK_STATUS;
- }
- }.schedule(200);
- }
-
- public Object getParent(Object element) {
- return null;
- }
-
- public boolean hasChildren(Object element) {
- return getChildren(element).length > 0 ? true : false;
- }
-
- public Object[] getElements(Object inputElement) {
- return new Object[0];
- }
-
- public void dispose() {
- }
-
- public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
- this.viewer = viewer;
- }
- }
-
- public static class XPathTreeLabelProvider extends LabelProvider {
- private Image rootImage;
- public XPathTreeLabelProvider() {
- super();
- ImageDescriptor des = ImageDescriptor.createFromURL(JBossServerUIPlugin.getDefault().getBundle().getEntry("icons/XMLFile.gif"));
- rootImage = des.createImage();
- }
-
- public Image getImage(Object element) {
- if( element instanceof ServerWrapper )
- return rootImage;
-
- if (element instanceof XPathCategory)
- return PlatformUI.getWorkbench().getSharedImages().getImage(
- ISharedImages.IMG_OBJ_FOLDER);
-
- return null;
- }
-
- public String getText(Object element) {
- if( element instanceof ServerWrapper )
- return "XML Configuration";
- if( element == XPathTreeContentProvider.LOADING )
- return "Loading...";
-
- if (element instanceof XPathCategory)
- return ((XPathCategory) element).getName();
-
- if( element instanceof XPathQuery )
- return ((XPathQuery)element).getName();
-
- if( element instanceof XPathFileResult )
- return ((XPathFileResult)element).getFileLocation();
-
- return "";
- }
-
- public XPathResultNode[] getResultNodes(XPathQuery query) {
- ArrayList<XPathResultNode> l = new ArrayList<XPathResultNode>();
- XPathFileResult[] files = query.getResults();
- for( int i = 0; i < files.length; i++ ) {
- l.addAll(Arrays.asList(files[i].getChildren()));
- }
- return l.toArray(new XPathResultNode[l.size()]);
- }
- }
-
- public static class XMLActionProvider extends CommonActionProvider {
-
- private ICommonActionExtensionSite actionSite;
- public Action newXPathCategoryAction, deleteXPathCategoryAction,
- newXPathAction, editXPathAction, deleteXPathAction,
- editFileAction;
- private Object selectedNode;
-
- public void init(ICommonActionExtensionSite aSite) {
- super.init(aSite);
- this.actionSite = aSite;
- createActions();
- }
-
- public void createActions() {
- newXPathCategoryAction = new Action() {
- public void run() {
- XPathCategoryDialog d = new XPathCategoryDialog(Display
- .getCurrent().getActiveShell(), getServer());
- if (d.open() == Window.OK) {
- XPathModel.getDefault()
- .addCategory(getServer(), d.getText());
- XPathModel.getDefault().save(getServer());
- refreshViewer();
- }
- }
- };
- newXPathCategoryAction.setText("New Category");
-
- deleteXPathCategoryAction = new Action() {
- public void run() {
- int style = SWT.APPLICATION_MODAL | SWT.YES | SWT.NO;
- MessageBox messageBox = new MessageBox(Display.getCurrent()
- .getActiveShell(), style);
- messageBox.setText(Messages.DescriptorXPathRemoveCategory
- + "?");
- messageBox
- .setMessage(Messages.DescriptorXPathRemoveCategoryDesc);
- if (messageBox.open() == SWT.YES) {
- XPathModel.getDefault().removeCategory(getServer(),
- ((XPathCategory)selectedNode).getName());
- XPathModel.getDefault().save(getServer());
- refreshViewer();
- }
- }
- };
- deleteXPathCategoryAction
- .setText(Messages.DescriptorXPathRemoveCategory);
-
- newXPathAction = new Action() {
- public void run() {
- XPathCategory category = (XPathCategory)selectedNode;
- if (category != null) {
- String categoryName = category.getName();
- XPathDialog d = new XPathDialog(Display.getCurrent()
- .getActiveShell(), getServer(), categoryName);
- if (d.open() == Window.OK) {
- XPathCategory[] categoryList = XPathModel
- .getDefault().getCategories(getServer());
- XPathCategory categoryItem = null;
- for (int i = 0; i < categoryList.length; i++) {
- if (categoryList[i].getName().equals(
- category.getName()))
- categoryItem = categoryList[i];
- }
- if (categoryItem != null) {
- XPathQuery query = new XPathQuery(d.getName(),
- XPathDialogs.getConfigFolder(getServer()),
- null, d.getXpath(), d.getAttribute());
- categoryItem.addQuery(query);
- XPathModel.getDefault().save(getServer());
- refreshViewer();
- }
- }
- }
- }
- };
- newXPathAction.setText(Messages.DescriptorXPathNewXPath);
-
- editXPathAction = new Action() {
- public void run() {
- Object o = selectedNode;
- if (o != null && o instanceof XPathQuery) {
- XPathQuery original = (XPathQuery) o;
- XPathCategory category = original.getCategory();
-
- XPathDialog d = new XPathDialog(Display.getCurrent()
- .getActiveShell(), getServer(), category.getName(),
- original.getName());
- d.setAttribute(original.getAttribute());
- d.setXpath(original.getXpathPattern());
-
- if (d.open() == Window.OK) {
- original.setAttribute(d.getAttribute());
- original.setXpathPattern(d.getXpath());
- original.setName(d.getName());
- category.save();
- refreshViewer();
- }
- }
- }
- };
- editXPathAction.setText(Messages.DescriptorXPathEditXPath);
-
- deleteXPathAction = new Action() {
- public void run() {
- Object o = selectedNode;
- if (o instanceof XPathQuery) {
- XPathCategory cat = ((XPathQuery) o).getCategory();
- cat.removeQuery((XPathQuery) o);
- cat.save();
- refreshViewer();
- }
- }
- };
- deleteXPathAction.setText(Messages.DescriptorXPathDeleteXPath);
-
- editFileAction = new Action() {
- public void run() {
- try {
- Object o = selectedNode;
- Path p = null;
- if (o instanceof XPathQuery
- && ((XPathQuery) o).getResults().length == 1) {
- o = (XPathFileResult) ((XPathQuery) o).getResults()[0];
- }
- if (o instanceof XPathFileResult) {
- p = new Path(((XPathFileResult) o)
- .getFileLocation());
- } else if (o instanceof XPathResultNode) {
- p = new Path(((XPathResultNode) o)
- .getFileLocation());
- }
- if (p != null) {
-
- IFileStore fileStore = EFS.getLocalFileSystem()
- .getStore(p.removeLastSegments(1));
- fileStore = fileStore.getChild(p.lastSegment());
- IWorkbench wb = PlatformUI.getWorkbench();
- IWorkbenchWindow win = wb
- .getActiveWorkbenchWindow();
- IWorkbenchPage page = win.getActivePage();
-
- if (!fileStore.fetchInfo().isDirectory()
- && fileStore.fetchInfo().exists()) {
- try {
- IDE.openEditorOnFileStore(page, fileStore);
- } catch (PartInitException e) {
- }
- }
- }
- } catch (Exception exc) {
- JBossServerUIPlugin.log(
- "Error running edit file action", exc);
- }
- }
- };
- editFileAction.setText("Edit File");
- }
-
- public void fillContextMenu(IMenuManager menu) {
- ICommonViewerSite site = actionSite.getViewSite();
- IStructuredSelection selection = null;
- if (site instanceof ICommonViewerWorkbenchSite) {
- ICommonViewerWorkbenchSite wsSite = (ICommonViewerWorkbenchSite) site;
- selection = (IStructuredSelection) wsSite
- .getSelectionProvider().getSelection();
- Object first = selection.getFirstElement();
- if( first == null )
- return;
-
- if (first instanceof ServerWrapper) {
- menu.add(newXPathCategoryAction);
- menu.add(new Separator());
- return;
- }
-
- if (first instanceof XPathCategory) {
-
- menu.add(newXPathAction);
- menu.add(deleteXPathCategoryAction);
- menu.add(new Separator());
- return;
- }
-
- if( first instanceof XPathQuery) {
- selectedNode = first;
- menu.add(newXPathAction);
- menu.add(editXPathAction);
- menu.add(deleteXPathAction);
- }
- if( (first instanceof XPathResultNode || first instanceof XPathFileResult ) ||
- (first instanceof XPathQuery && ((XPathQuery)first).getResults().length == 1)) {
- menu.add(editFileAction);
- }
- }
- }
-
- protected void refreshViewer() {
- actionSite.getStructuredViewer().refresh();
- }
-
- protected IServer getServer() {
- Object o = selectedNode;
- if( o instanceof ServerWrapper) return ((ServerWrapper)o).server;
- if( o instanceof XPathCategory) return ((XPathCategory)o).getServer();
- if( o instanceof XPathQuery) return ((XPathQuery)o).getCategory().getServer();
- if( o instanceof XPathFileResult) return ((XPathFileResult)o).getQuery().getCategory().getServer();
- if( o instanceof XPathResultNode) return ((XPathResultNode)o).getFile().getQuery().getCategory().getServer();
- return null;
- }
- }
-
-
- public static class XMLDecorator extends LabelProvider implements ILightweightLabelDecorator {
- public void decorate(Object element, IDecoration decoration) {
- if( element instanceof XPathQuery) {
- XPathResultNode[] nodes = getResultNodes((XPathQuery)element);
- if(nodes.length == 1 ) {
- decoration.addSuffix(" " + nodes[0].getText());
- }
- return;
- }
-
- // we're a file node (blah.xml)
- if( element instanceof XPathFileResult ) {
- XPathResultNode[] nodes = ((XPathFileResult)element).getChildren();
- if( nodes.length == 1 )
- decoration.addSuffix(" " + nodes[0].getText());
- }
- }
- }
-
- public static XPathResultNode[] getResultNodes(XPathQuery query) {
- ArrayList<XPathResultNode> l = new ArrayList<XPathResultNode>();
- XPathFileResult[] files = query.getResults();
- for( int i = 0; i < files.length; i++ ) {
- l.addAll(Arrays.asList(files[i].getChildren()));
- }
- return l.toArray(new XPathResultNode[l.size()]);
- }
-
-}
Added: trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/eclipse/wst/server/ui/internal/view/servers/provisional/extensions/XPathTreeContentProvider.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/eclipse/wst/server/ui/internal/view/servers/provisional/extensions/XPathTreeContentProvider.java (rev 0)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/eclipse/wst/server/ui/internal/view/servers/provisional/extensions/XPathTreeContentProvider.java 2008-10-18 01:27:10 UTC (rev 10950)
@@ -0,0 +1,135 @@
+package org.eclipse.wst.server.ui.internal.view.servers.provisional.extensions;
+
+import java.util.ArrayList;
+
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.jobs.Job;
+import org.eclipse.jface.viewers.ITreeContentProvider;
+import org.eclipse.jface.viewers.StructuredViewer;
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.wst.server.core.IServer;
+import org.jboss.ide.eclipse.as.core.extensions.descriptors.XPathCategory;
+import org.jboss.ide.eclipse.as.core.extensions.descriptors.XPathFileResult;
+import org.jboss.ide.eclipse.as.core.extensions.descriptors.XPathModel;
+import org.jboss.ide.eclipse.as.core.extensions.descriptors.XPathQuery;
+import org.jboss.ide.eclipse.as.core.extensions.descriptors.XPathFileResult.XPathResultNode;
+
+public class XPathTreeContentProvider implements ITreeContentProvider {
+
+ public static class DelayProxy {
+ }
+
+ public static final DelayProxy LOADING = new DelayProxy();
+
+ private Viewer viewer;
+ private ArrayList<XPathCategory> loading = new ArrayList<XPathCategory>();
+
+ public class ServerWrapper {
+ public IServer server;
+
+ public ServerWrapper(IServer server) {
+ this.server = server;
+ }
+
+ public int hashCode() {
+ return server.getId().hashCode();
+ }
+
+ public boolean equals(Object other) {
+ return other instanceof ServerWrapper
+ && ((ServerWrapper) other).server.getId().equals(
+ server.getId());
+ }
+ }
+
+ public Object[] getChildren(Object parentElement) {
+ if (parentElement == null)
+ return new Object[] {};
+ if (parentElement instanceof IServer) {
+ return new Object[] { new ServerWrapper((IServer) parentElement) };
+ }
+
+ if (parentElement instanceof ServerWrapper) {
+ return XPathModel.getDefault().getCategories(
+ ((ServerWrapper) parentElement).server);
+ }
+
+ if (parentElement instanceof XPathCategory) {
+ if (((XPathCategory) parentElement).isLoaded())
+ return ((XPathCategory) parentElement).getQueries();
+
+ if (!loading.contains((XPathCategory) parentElement))
+ launchLoad((XPathCategory) parentElement);
+
+ return new Object[] { LOADING };
+ }
+
+ // we're the named element (JNDI)
+ if (parentElement instanceof XPathQuery) {
+ if (XPathModel.getResultNodes((XPathQuery) parentElement).length == 1) {
+ return new Object[0];
+ } else {
+ return ((XPathQuery) parentElement).getResults();
+ }
+ }
+
+ // we're a file node (blah.xml)
+ if (parentElement instanceof XPathFileResult) {
+ if (((XPathFileResult) parentElement).getChildren().length == 1)
+ return new Object[0];
+ return ((XPathFileResult) parentElement).getChildren();
+ }
+
+ if (parentElement instanceof XPathResultNode) {
+ return new Object[0];
+ }
+
+ return new Object[0];
+ }
+
+ protected void launchLoad(final XPathCategory cat) {
+ new Job("Loading XPaths") {
+ protected IStatus run(IProgressMonitor monitor) {
+ loading.add(cat);
+ XPathQuery[] queries = cat.getQueries();
+ XPathFileResult[] results;
+ for (int i = 0; i < queries.length; i++) {
+ results = queries[i].getResults();
+ for (int j = 0; j < results.length; j++) {
+ results[j].getChildren();
+ }
+ }
+ Display.getDefault().asyncExec(new Runnable() {
+ public void run() {
+ loading.remove(cat);
+ ((StructuredViewer) viewer).refresh(cat.getServer());
+ }
+ });
+ return Status.OK_STATUS;
+ }
+ }.schedule(200);
+ }
+
+
+ public Object getParent(Object element) {
+ return null;
+ }
+
+ public boolean hasChildren(Object element) {
+ return getChildren(element).length > 0 ? true : false;
+ }
+
+ public Object[] getElements(Object inputElement) {
+ return new Object[0];
+ }
+
+ public void dispose() {
+ }
+
+ public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
+ this.viewer = viewer;
+ }
+}
\ No newline at end of file
Added: trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/eclipse/wst/server/ui/internal/view/servers/provisional/extensions/XPathTreeLabelProvider.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/eclipse/wst/server/ui/internal/view/servers/provisional/extensions/XPathTreeLabelProvider.java (rev 0)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/eclipse/wst/server/ui/internal/view/servers/provisional/extensions/XPathTreeLabelProvider.java 2008-10-18 01:27:10 UTC (rev 10950)
@@ -0,0 +1,63 @@
+package org.eclipse.wst.server.ui.internal.view.servers.provisional.extensions;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.jface.viewers.LabelProvider;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.ui.ISharedImages;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.wst.server.ui.internal.view.servers.provisional.extensions.XPathTreeContentProvider.ServerWrapper;
+import org.jboss.ide.eclipse.as.core.extensions.descriptors.XPathCategory;
+import org.jboss.ide.eclipse.as.core.extensions.descriptors.XPathFileResult;
+import org.jboss.ide.eclipse.as.core.extensions.descriptors.XPathQuery;
+import org.jboss.ide.eclipse.as.core.extensions.descriptors.XPathFileResult.XPathResultNode;
+import org.jboss.ide.eclipse.as.ui.JBossServerUIPlugin;
+
+public class XPathTreeLabelProvider extends LabelProvider {
+ private Image rootImage;
+ public XPathTreeLabelProvider() {
+ super();
+ ImageDescriptor des = ImageDescriptor.createFromURL(JBossServerUIPlugin.getDefault().getBundle().getEntry("icons/XMLFile.gif"));
+ rootImage = des.createImage();
+ }
+
+ public Image getImage(Object element) {
+ if( element instanceof ServerWrapper )
+ return rootImage;
+
+ if (element instanceof XPathCategory)
+ return PlatformUI.getWorkbench().getSharedImages().getImage(
+ ISharedImages.IMG_OBJ_FOLDER);
+
+ return null;
+ }
+
+ public String getText(Object element) {
+ if( element instanceof ServerWrapper )
+ return "XML Configuration";
+ if( element == XPathTreeContentProvider.LOADING )
+ return "Loading...";
+
+ if (element instanceof XPathCategory)
+ return ((XPathCategory) element).getName();
+
+ if( element instanceof XPathQuery )
+ return ((XPathQuery)element).getName();
+
+ if( element instanceof XPathFileResult )
+ return ((XPathFileResult)element).getFileLocation();
+
+ return "";
+ }
+
+ public XPathResultNode[] getResultNodes(XPathQuery query) {
+ ArrayList<XPathResultNode> l = new ArrayList<XPathResultNode>();
+ XPathFileResult[] files = query.getResults();
+ for( int i = 0; i < files.length; i++ ) {
+ l.addAll(Arrays.asList(files[i].getChildren()));
+ }
+ return l.toArray(new XPathResultNode[l.size()]);
+ }
+}
Added: trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/IPreferenceKeys.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/IPreferenceKeys.java (rev 0)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/IPreferenceKeys.java 2008-10-18 01:27:10 UTC (rev 10950)
@@ -0,0 +1,6 @@
+package org.jboss.ide.eclipse.as.ui;
+
+
+public interface IPreferenceKeys {
+ public static final String ENABLED_DECORATORS = "org.jboss.ide.eclipse.as.ui.preferences.enabledDecorators";
+}
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/JBossServerUIPlugin.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/JBossServerUIPlugin.java 2008-10-17 22:48:29 UTC (rev 10949)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/JBossServerUIPlugin.java 2008-10-18 01:27:10 UTC (rev 10950)
@@ -25,8 +25,12 @@
import java.util.ResourceBundle;
import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Preferences;
import org.eclipse.core.runtime.Status;
+import org.eclipse.ui.IDecoratorManager;
import org.eclipse.ui.IStartup;
+import org.eclipse.ui.internal.WorkbenchPlugin;
+import org.eclipse.ui.internal.decorators.DecoratorDefinition;
import org.eclipse.ui.plugin.AbstractUIPlugin;
import org.jboss.ide.eclipse.as.core.JBossServerCorePlugin;
import org.osgi.framework.BundleContext;
@@ -59,6 +63,15 @@
*/
public void start(BundleContext context) throws Exception {
super.start(context);
+ Preferences prefs = getPluginPreferences();
+
+ if( !prefs.getBoolean(IPreferenceKeys.ENABLED_DECORATORS)) {
+ IDecoratorManager manager = WorkbenchPlugin.getDefault().getDecoratorManager();
+ manager.setEnabled("org.eclipse.wst.server.ui.navigatorDecorator", true);
+ manager.setEnabled("org.jboss.ide.eclipse.as.ui.extensions.xml.decorator", true);
+ prefs.setValue(IPreferenceKeys.ENABLED_DECORATORS, true);
+ savePluginPreferences();
+ }
}
/**
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.ui/plugin.xml
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.ui/plugin.xml 2008-10-17 22:48:29 UTC (rev 10949)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.ui/plugin.xml 2008-10-18 01:27:10 UTC (rev 10950)
@@ -437,10 +437,10 @@
</navigatorContent>
<navigatorContent
activeByDefault="true"
- contentProvider="org.eclipse.wst.server.ui.internal.view.servers.provisional.extensions.XPathProvider$XPathTreeContentProvider"
+ contentProvider="org.eclipse.wst.server.ui.internal.view.servers.provisional.extensions.XPathTreeContentProvider"
icon="icons/XMLFile.gif"
id="org.jboss.ide.eclipse.as.ui.extensions.xml"
- labelProvider="org.eclipse.wst.server.ui.internal.view.servers.provisional.extensions.XPathProvider$XPathTreeLabelProvider"
+ labelProvider="org.eclipse.wst.server.ui.internal.view.servers.provisional.extensions.XPathTreeLabelProvider"
name="XML Configuration"
priority="normal">
<triggerPoints>
@@ -470,7 +470,7 @@
</instanceof></or>
</possibleChildren>
<actionProvider
- class="org.eclipse.wst.server.ui.internal.view.servers.provisional.extensions.XPathProvider$XMLActionProvider"
+ class="org.eclipse.wst.server.ui.internal.view.servers.provisional.extensions.XPathActionProvider"
id="org.jboss.ide.eclipse.as.ui.extensions.eventLog.actions"
priority="highest">
</actionProvider>
@@ -498,7 +498,7 @@
<!-- Decorator for xpaths / xml-->
<extension point="org.eclipse.ui.decorators">
<decorator
- class="org.eclipse.wst.server.ui.internal.view.servers.provisional.extensions.XPathProvider$XMLDecorator"
+ class="org.eclipse.wst.server.ui.internal.view.servers.provisional.extensions.XPathDecorator"
id="org.jboss.ide.eclipse.as.ui.extensions.xml.decorator"
label="JBoss Server XML Configuration Decorator"
lightweight="true"
17 years, 2 months
JBoss Tools SVN: r10949 - branches/jbosstools-3.0.0.Beta1.
by jbosstools-commits@lists.jboss.org
Author: dgolovin
Date: 2008-10-17 18:48:29 -0400 (Fri, 17 Oct 2008)
New Revision: 10949
Added:
branches/jbosstools-3.0.0.Beta1/archives/
branches/jbosstools-3.0.0.Beta1/as/
branches/jbosstools-3.0.0.Beta1/birt/
branches/jbosstools-3.0.0.Beta1/common/
branches/jbosstools-3.0.0.Beta1/documentation/
branches/jbosstools-3.0.0.Beta1/drools/
branches/jbosstools-3.0.0.Beta1/esb/
branches/jbosstools-3.0.0.Beta1/examples/
branches/jbosstools-3.0.0.Beta1/flow/
branches/jbosstools-3.0.0.Beta1/freemarker/
branches/jbosstools-3.0.0.Beta1/hibernatetools/
branches/jbosstools-3.0.0.Beta1/jbpm/
branches/jbosstools-3.0.0.Beta1/jsf/
branches/jbosstools-3.0.0.Beta1/jst/
branches/jbosstools-3.0.0.Beta1/labs/
branches/jbosstools-3.0.0.Beta1/portlet/
branches/jbosstools-3.0.0.Beta1/seam/
branches/jbosstools-3.0.0.Beta1/smooks/
branches/jbosstools-3.0.0.Beta1/struts/
branches/jbosstools-3.0.0.Beta1/tests/
branches/jbosstools-3.0.0.Beta1/tptp/
branches/jbosstools-3.0.0.Beta1/vpe/
branches/jbosstools-3.0.0.Beta1/ws/
Log:
jbosstools-3.0.0.Beta1 branch created
Copied: branches/jbosstools-3.0.0.Beta1/archives (from rev 10948, trunk/archives)
Copied: branches/jbosstools-3.0.0.Beta1/as (from rev 10948, trunk/as)
Copied: branches/jbosstools-3.0.0.Beta1/birt (from rev 10948, trunk/birt)
Copied: branches/jbosstools-3.0.0.Beta1/common (from rev 10948, trunk/common)
Copied: branches/jbosstools-3.0.0.Beta1/documentation (from rev 10948, trunk/documentation)
Copied: branches/jbosstools-3.0.0.Beta1/drools (from rev 10948, trunk/drools)
Copied: branches/jbosstools-3.0.0.Beta1/esb (from rev 10948, trunk/esb)
Copied: branches/jbosstools-3.0.0.Beta1/examples (from rev 10948, trunk/examples)
Copied: branches/jbosstools-3.0.0.Beta1/flow (from rev 10948, trunk/flow)
Copied: branches/jbosstools-3.0.0.Beta1/freemarker (from rev 10948, trunk/freemarker)
Copied: branches/jbosstools-3.0.0.Beta1/hibernatetools (from rev 10948, trunk/hibernatetools)
Copied: branches/jbosstools-3.0.0.Beta1/jbpm (from rev 10948, trunk/jbpm)
Copied: branches/jbosstools-3.0.0.Beta1/jsf (from rev 10948, trunk/jsf)
Copied: branches/jbosstools-3.0.0.Beta1/jst (from rev 10948, trunk/jst)
Copied: branches/jbosstools-3.0.0.Beta1/labs (from rev 10948, trunk/labs)
Copied: branches/jbosstools-3.0.0.Beta1/portlet (from rev 10948, trunk/portlet)
Copied: branches/jbosstools-3.0.0.Beta1/seam (from rev 10948, trunk/seam)
Copied: branches/jbosstools-3.0.0.Beta1/smooks (from rev 10948, trunk/smooks)
Copied: branches/jbosstools-3.0.0.Beta1/struts (from rev 10948, trunk/struts)
Copied: branches/jbosstools-3.0.0.Beta1/tests (from rev 10948, trunk/tests)
Copied: branches/jbosstools-3.0.0.Beta1/tptp (from rev 10948, trunk/tptp)
Copied: branches/jbosstools-3.0.0.Beta1/vpe (from rev 10948, trunk/vpe)
Copied: branches/jbosstools-3.0.0.Beta1/ws (from rev 10948, trunk/ws)
17 years, 2 months
JBoss Tools SVN: r10948 - branches.
by jbosstools-commits@lists.jboss.org
Author: dgolovin
Date: 2008-10-17 18:47:12 -0400 (Fri, 17 Oct 2008)
New Revision: 10948
Added:
branches/jbosstools-3.0.0.Beta1/
Log:
17 years, 2 months
JBoss Tools SVN: r10947 - trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test.
by jbosstools-commits@lists.jboss.org
Author: dgolovin
Date: 2008-10-17 18:44:32 -0400 (Fri, 17 Oct 2008)
New Revision: 10947
Modified:
trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/ScannerTest.java
Log:
error for project deletion in tearDown() method fixed
Modified: trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/ScannerTest.java
===================================================================
--- trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/ScannerTest.java 2008-10-17 22:40:46 UTC (rev 10946)
+++ trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/ScannerTest.java 2008-10-17 22:44:32 UTC (rev 10947)
@@ -21,6 +21,7 @@
import org.eclipse.core.resources.IResource;
import org.eclipse.core.resources.IncrementalProjectBuilder;
import org.eclipse.core.runtime.NullProgressMonitor;
+import org.jboss.tools.common.test.util.TestProjectProvider;
import org.jboss.tools.seam.core.BeanType;
import org.jboss.tools.seam.core.BijectedAttributeType;
import org.jboss.tools.seam.core.IBijectedAttribute;
@@ -53,6 +54,7 @@
public class ScannerTest extends TestCase {
IProject project = null;
+ TestProjectProvider provider = null;
boolean makeCopy = true;
public ScannerTest() {
@@ -61,8 +63,9 @@
protected void setUp() throws Exception {
boolean save = ResourcesUtils.setBuildAutomatically(false);
- project = ResourcesUtils.importProject(
- "org.jboss.tools.seam.core.test","/projects/TestScanner" , new NullProgressMonitor());
+ provider = new TestProjectProvider("org.jboss.tools.seam.core.test",
+ null,"TestScanner" ,true);
+ project = provider.getProject();
project.refreshLocal(IResource.DEPTH_INFINITE, new NullProgressMonitor());
this.project.build(IncrementalProjectBuilder.FULL_BUILD, null);
//EditorTestHelper.joinBackgroundActivities();
@@ -509,8 +512,6 @@
@Override
protected void tearDown() throws Exception {
- boolean save = ResourcesUtils.setBuildAutomatically(false);
- project.delete(true,true, null);
- ResourcesUtils.setBuildAutomatically(save);
+ provider.dispose();
}
}
17 years, 2 months
JBoss Tools SVN: r10946 - trunk/hibernatetools/tests/org.hibernate.eclipse.jdt.ui.test/src/org/hibernate/eclipse/jdt/ui/test.
by jbosstools-commits@lists.jboss.org
Author: snjeza
Date: 2008-10-17 18:40:46 -0400 (Fri, 17 Oct 2008)
New Revision: 10946
Modified:
trunk/hibernatetools/tests/org.hibernate.eclipse.jdt.ui.test/src/org/hibernate/eclipse/jdt/ui/test/HQLQueryValidatorTest.java
trunk/hibernatetools/tests/org.hibernate.eclipse.jdt.ui.test/src/org/hibernate/eclipse/jdt/ui/test/HibernateErrorsTest.java
trunk/hibernatetools/tests/org.hibernate.eclipse.jdt.ui.test/src/org/hibernate/eclipse/jdt/ui/test/HibernateErrorsTest2.java
Log:
Checking the hibernate tests.
Modified: trunk/hibernatetools/tests/org.hibernate.eclipse.jdt.ui.test/src/org/hibernate/eclipse/jdt/ui/test/HQLQueryValidatorTest.java
===================================================================
--- trunk/hibernatetools/tests/org.hibernate.eclipse.jdt.ui.test/src/org/hibernate/eclipse/jdt/ui/test/HQLQueryValidatorTest.java 2008-10-17 20:14:28 UTC (rev 10945)
+++ trunk/hibernatetools/tests/org.hibernate.eclipse.jdt.ui.test/src/org/hibernate/eclipse/jdt/ui/test/HQLQueryValidatorTest.java 2008-10-17 22:40:46 UTC (rev 10946)
@@ -127,6 +127,7 @@
protected void tearDown() throws Exception {
ccfg.reset();
super.tearDown();
+ waitForJobs();
}
public void testHQLDetector() throws JavaModelException {
Modified: trunk/hibernatetools/tests/org.hibernate.eclipse.jdt.ui.test/src/org/hibernate/eclipse/jdt/ui/test/HibernateErrorsTest.java
===================================================================
--- trunk/hibernatetools/tests/org.hibernate.eclipse.jdt.ui.test/src/org/hibernate/eclipse/jdt/ui/test/HibernateErrorsTest.java 2008-10-17 20:14:28 UTC (rev 10945)
+++ trunk/hibernatetools/tests/org.hibernate.eclipse.jdt.ui.test/src/org/hibernate/eclipse/jdt/ui/test/HibernateErrorsTest.java 2008-10-17 22:40:46 UTC (rev 10946)
@@ -173,9 +173,9 @@
private void deleteFile(File file) {
try {
if (!file.delete())
- throw new RuntimeException("Cannot remove the " + file.getAbsolutePath() + " file. (" + Platform.getOS() + ")");
+ throw new RuntimeException("Cannot remove the " + file.getAbsolutePath() + " file.");
} catch (Throwable e) {
- throw new RuntimeException("Cannot remove the " + file.getAbsolutePath() + " file. (" + Platform.getOS() + ")",e);
+ throw new RuntimeException("Cannot remove the " + file.getAbsolutePath() + " file.",e);
}
}
Modified: trunk/hibernatetools/tests/org.hibernate.eclipse.jdt.ui.test/src/org/hibernate/eclipse/jdt/ui/test/HibernateErrorsTest2.java
===================================================================
--- trunk/hibernatetools/tests/org.hibernate.eclipse.jdt.ui.test/src/org/hibernate/eclipse/jdt/ui/test/HibernateErrorsTest2.java 2008-10-17 20:14:28 UTC (rev 10945)
+++ trunk/hibernatetools/tests/org.hibernate.eclipse.jdt.ui.test/src/org/hibernate/eclipse/jdt/ui/test/HibernateErrorsTest2.java 2008-10-17 22:40:46 UTC (rev 10946)
@@ -5,10 +5,12 @@
import java.io.File;
import java.io.IOException;
+import org.eclipse.core.internal.resources.ResourceException;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IncrementalProjectBuilder;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.core.runtime.Path;
import org.eclipse.core.runtime.Platform;
@@ -153,8 +155,16 @@
IProject proj = getProject().getIProject();
String projRoot = proj.getLocation().toFile().getAbsolutePath();
File file = new File(projRoot);
-
- getProject().getIProject().delete(false, true, null);
+ boolean deleted = true;
+ int nTrys = 0;
+ while (!deleted && nTrys++ < 5)
+ try {
+ proj.delete(true, true, null);
+ deleted = true;
+ } catch (ResourceException re) {
+ waitForJobs();
+ Thread.sleep(100);
+ }
waitForJobs();
delete(file);
}
@@ -179,12 +189,25 @@
private void deleteFile(File file) {
try {
- if (!file.delete())
- throw new RuntimeException("Cannot remove the " + file.getAbsolutePath() + " file. (" + Platform.getOS() + ")");
+ if (!file.delete()) {
+ throw new RuntimeException(getMessage(file));
+ }
} catch (Throwable e) {
- throw new RuntimeException("Cannot remove the " + file.getAbsolutePath() + " file. (" + Platform.getOS() + ")",e);
+ throw new RuntimeException(getMessage(file),e);
}
}
+
+ private String getMessage(File file) {
+ StringBuffer buffer = new StringBuffer();
+ buffer.append("Cannot remove the ");
+ buffer.append(file.getAbsolutePath());
+ buffer.append(" file. ");
+ if (file.exists() && file.isDirectory()) {
+ buffer.append("List=");
+ buffer.append(file.list());
+ }
+ return buffer.toString();
+ }
protected SimpleTestProject getProject() {
return this.project;
17 years, 2 months
JBoss Tools SVN: r10945 - trunk/jsf/features/org.jboss.tools.richfaces.feature.
by jbosstools-commits@lists.jboss.org
Author: dgolovin
Date: 2008-10-17 16:14:28 -0400 (Fri, 17 Oct 2008)
New Revision: 10945
Modified:
trunk/jsf/features/org.jboss.tools.richfaces.feature/feature.xml
Log:
new plugin included in build: jsf.text.ext.reachfaces
Modified: trunk/jsf/features/org.jboss.tools.richfaces.feature/feature.xml
===================================================================
--- trunk/jsf/features/org.jboss.tools.richfaces.feature/feature.xml 2008-10-17 20:13:31 UTC (rev 10944)
+++ trunk/jsf/features/org.jboss.tools.richfaces.feature/feature.xml 2008-10-17 20:14:28 UTC (rev 10945)
@@ -307,6 +307,12 @@
version="0.0.0"/>
<plugin
+ id="org.jboss.tools.jsf.text.ext.richfaces"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"/>
+
+ <plugin
id="org.jboss.tools.jsf.ui"
download-size="0"
install-size="0"
17 years, 2 months
JBoss Tools SVN: r10944 - in trunk/seam: tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/wizard and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: dgolovin
Date: 2008-10-17 16:13:31 -0400 (Fri, 17 Oct 2008)
New Revision: 10944
Modified:
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/OpenSeamComponentDialog.java
trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/wizard/AbstractSeamNewOperationTest.java
trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/wizard/OpenSeamComponentDialogTest.java
trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/wizard/SeamProjectNewWizardTest.java
Log:
Example how coverage report should be used to achieve maximum coverage for JUnitTests
Modified: trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/OpenSeamComponentDialog.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/OpenSeamComponentDialog.java 2008-10-17 18:09:05 UTC (rev 10943)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/OpenSeamComponentDialog.java 2008-10-17 20:13:31 UTC (rev 10944)
@@ -15,8 +15,10 @@
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
+import java.util.Collections;
import java.util.Comparator;
import java.util.Iterator;
+import java.util.List;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.ResourcesPlugin;
@@ -24,6 +26,7 @@
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
import org.eclipse.core.runtime.jobs.Job;
import org.eclipse.jface.dialogs.DialogSettings;
import org.eclipse.jface.dialogs.IDialogSettings;
@@ -50,6 +53,7 @@
*
*/
public class OpenSeamComponentDialog extends FilteredItemsSelectionDialog {
+
private static final String FILE_NAME = "OpenSeamComponentHistory.xml"; //$NON-NLS-1$
private static final String ROOT_NODE = "historyRootNode"; //$NON-NLS-1$
private static final String INFO_NODE = "infoNode"; //$NON-NLS-1$
@@ -73,14 +77,21 @@
getSelectionHistory().load(memento);
}
- public void beginTest() {
- create();
+ public void startSearch() {
applyFilter();
}
- public void endTest() {
+ @Override
+ public void okPressed() {
+ // TODO Auto-generated method stub
+ super.okPressed();
+ }
+
+ public void stopSearchAndShowResults() {
refresh();
- setResult(getSelectedItems().toList());
+ List list = getSelectedItems().toList();
+ Collections.sort(list,getItemsComparator());
+ setResult(list);
}
protected Control createExtendedContentArea(Composite parent) {
@@ -198,7 +209,7 @@
}
protected IStatus validateItem(Object item) {
- return new SeamComponentStatus();
+ return new Status(getSelectedItems().size() >= 0?IStatus.OK:IStatus.ERROR,SeamGuiPlugin.PLUGIN_ID,null);
}
public class SeamComponentComparator implements
@@ -239,48 +250,6 @@
}
}
- public class SeamComponentStatus implements IStatus {
- public IStatus[] getChildren() {
- return null;
- }
-
- public int getCode() {
- return 0;
- }
-
- public Throwable getException() {
- return null;
- }
-
- public String getMessage() {
- return ""; //$NON-NLS-1$
- }
-
- public String getPlugin() {
- return ""; //$NON-NLS-1$
- }
-
- public int getSeverity() {
- return 0;
- }
-
- public boolean isMultiStatus() {
- return false;
- }
-
- public boolean isOK() {
- if (getSelectedItems().size() < 0)
- return false;
-
- return true;
- }
-
- public boolean matches(int severityMask) {
- return false;
- }
-
- }
-
public class SeamComponentSelectionHistory extends SelectionHistory {
public SeamComponentSelectionHistory() {
@@ -368,18 +337,10 @@
return componentName;
}
- public void setComponentName(String componentName) {
- this.componentName = componentName;
- }
-
public String getProjectName() {
return projectName;
}
- public void setProjectName(String projectName) {
- this.projectName = projectName;
- }
-
public ISeamComponent getComponent() {
if (component == null) {
IProject project = ResourcesPlugin.getWorkspace().getRoot()
@@ -398,10 +359,6 @@
return component;
}
- public void setComponent(ISeamComponent component) {
- this.component = component;
- }
-
}
public static void validateHistory(ISeamProject seamProject) {
Modified: trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/wizard/AbstractSeamNewOperationTest.java
===================================================================
--- trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/wizard/AbstractSeamNewOperationTest.java 2008-10-17 18:09:05 UTC (rev 10943)
+++ trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/wizard/AbstractSeamNewOperationTest.java 2008-10-17 20:13:31 UTC (rev 10944)
@@ -84,13 +84,12 @@
}
protected void setUp() throws Exception {
- super.setUp();
- try {
+
JobUtils.waitForIdle();
- } catch (Exception e) {
- JUnitUtils.fail(e.getMessage(), e);
- }
- JobUtils.delay(3000);
+
+
+
+
}
abstract protected IProject getProject();
Modified: trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/wizard/OpenSeamComponentDialogTest.java
===================================================================
--- trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/wizard/OpenSeamComponentDialogTest.java 2008-10-17 18:09:05 UTC (rev 10943)
+++ trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/wizard/OpenSeamComponentDialogTest.java 2008-10-17 20:13:31 UTC (rev 10944)
@@ -43,10 +43,8 @@
"projects/TestComponentView",
"TestComponentView");
project = setup.importProject();
- this.project.refreshLocal(IResource.DEPTH_INFINITE, null);
}
this.project = project.getProject();
- this.project.build(IncrementalProjectBuilder.FULL_BUILD, null);
JobUtils.waitForIdle();
}
@@ -69,45 +67,44 @@
}
public void testOpenSeamComponentDialogSearch() {
-
find("m", "mockSecureEntity", true);
find("o", "org.jboss.seam.captcha.captcha", false);
find("p", "org.jboss.seam.core.pageContext", false);
-
}
-
//JBIDE-1879
public void testFindShortHand() {
find("o*jbpm", "org.jboss.seam.core.jbpm", true);
find("jbpm", "org.jboss.seam.core.jbpm", false);
-
-
}
private void find(String pattern, String componentName, boolean wait){
OpenSeamComponentDialog dialog = new OpenSeamComponentDialog(
PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell());
+ dialog.setBlockOnOpen(false);
dialog.setInitialPattern(pattern);
- dialog.beginTest();
- if(wait){
- try {
- JobUtils.waitForIdle();
- }catch(Exception ex){
- ex.printStackTrace();
+ dialog.open();
+ try {
+ dialog.startSearch();
+ if(wait){
+ JobUtils.waitForIdle();
+ JobUtils.delay(2000);
}
- }
- dialog.endTest();
- Object[] objects = dialog.getResult();
+ dialog.stopSearchAndShowResults();
+ Object[] objects = dialog.getResult();
+
+ assertNotNull("Search dialog returned null when searching for " + pattern, objects);
+
+ assertTrue("Component "+componentName+" not found", objects.length != 0);
- assertNotNull("Search dialog returned null when searching for " + pattern, objects);
+ SeamComponentWrapper wrapper = (SeamComponentWrapper)objects[0];
+ assertNotNull(wrapper.getComponent());
- assertTrue("Component "+componentName+" not found", objects.length != 0);
-
- SeamComponentWrapper wrapper = (SeamComponentWrapper)objects[0];
-
- assertEquals("Component "+componentName+" not found with " + pattern, wrapper.getComponentName(), componentName);
+ assertEquals("Component "+componentName+" not found with " + pattern, componentName, wrapper.getComponentName());
+ } finally {
+ dialog.okPressed();
+ }
}
}
Modified: trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/wizard/SeamProjectNewWizardTest.java
===================================================================
--- trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/wizard/SeamProjectNewWizardTest.java 2008-10-17 18:09:05 UTC (rev 10943)
+++ trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/wizard/SeamProjectNewWizardTest.java 2008-10-17 20:13:31 UTC (rev 10944)
@@ -26,6 +26,7 @@
import org.eclipse.ui.PlatformUI;
import org.eclipse.wst.common.componentcore.datamodel.properties.IFacetDataModelProperties;
import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
+import org.eclipse.wst.common.frameworks.internal.operations.IProjectCreationPropertiesNew;
import org.eclipse.wst.server.core.IServerWorkingCopy;
import org.eclipse.wst.web.ui.internal.wizards.NewProjectDataModelFacetWizard;
import org.jboss.tools.common.util.WorkbenchUtils;
@@ -70,6 +71,7 @@
wizard);
dialog.create();
startSeamPrjWzPg = wizard.getStartingPage();
+ wizard.getDataModel().setStringProperty("IProjectCreationPropertiesNew.PROJECT_NAME","testName");
assertNotNull("Cannot create seam start wizard page", startSeamPrjWzPg);
}
17 years, 2 months
JBoss Tools SVN: r10943 - trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet.
by jbosstools-commits@lists.jboss.org
Author: akazakov
Date: 2008-10-17 14:09:05 -0400 (Fri, 17 Oct 2008)
New Revision: 10943
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamFacetAbstractInstallDelegate.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-2731
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamFacetAbstractInstallDelegate.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamFacetAbstractInstallDelegate.java 2008-10-17 18:06:39 UTC (rev 10942)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamFacetAbstractInstallDelegate.java 2008-10-17 18:09:05 UTC (rev 10943)
@@ -38,6 +38,7 @@
import org.eclipse.core.runtime.preferences.IScopeContext;
import org.eclipse.datatools.connectivity.IConnectionProfile;
import org.eclipse.datatools.connectivity.ProfileManager;
+import org.eclipse.emf.common.util.EList;
import org.eclipse.jdt.core.IJavaProject;
import org.eclipse.jdt.core.IPackageFragmentRoot;
import org.eclipse.jdt.core.JavaConventions;
@@ -45,6 +46,10 @@
import org.eclipse.jdt.internal.compiler.impl.CompilerOptions;
import org.eclipse.jface.dialogs.ErrorDialog;
import org.eclipse.jst.common.project.facet.core.ClasspathHelper;
+import org.eclipse.jst.j2ee.application.Application;
+import org.eclipse.jst.j2ee.application.ApplicationFactory;
+import org.eclipse.jst.j2ee.application.EjbModule;
+import org.eclipse.jst.j2ee.componentcore.util.EARArtifactEdit;
import org.eclipse.jst.j2ee.model.IModelProvider;
import org.eclipse.jst.j2ee.model.ModelProviderManager;
import org.eclipse.jst.j2ee.project.facet.IJ2EEFacetConstants;
@@ -456,8 +461,8 @@
new File(seamGenResFolder, "META-INF/jboss-app.xml"), //$NON-NLS-1$
metaInfFolder, new FilterSetCollection(earFilterSet), false);
- if(!applicationXml.exists()) {
- // TODO configure application.xml
+ if(applicationXml.exists()) {
+ configureApplicationXml(project, monitor);
}
// Copy configuration files from template
try {
@@ -476,6 +481,39 @@
viewFilterSetCollection, false);
}
+ protected void configureApplicationXml(IProject project, IProgressMonitor monitor) {
+ EARArtifactEdit earArtifactEdit = null;
+ try {
+ earArtifactEdit = EARArtifactEdit.getEARArtifactEditForWrite(project);
+ if(earArtifactEdit!=null) {
+ Application application = earArtifactEdit.getApplication();
+ EList modules = application.getModules();
+ boolean moduleExists = false;
+ for (Iterator iterator = modules.iterator(); iterator.hasNext();) {
+ Object module = iterator.next();
+ if(module instanceof EjbModule) {
+ EjbModule ejbModule = (EjbModule)module;
+ if("jboss-seam.jar".equals(ejbModule.getUri())) {
+ moduleExists = true;
+ break;
+ }
+ }
+ }
+ if(!moduleExists) {
+ EjbModule module = ApplicationFactory.eINSTANCE.createEjbModule();
+ module.setUri("jboss-seam.jar");
+ application.getModules().add(module);
+ }
+
+ earArtifactEdit.save(monitor);
+ }
+ } finally {
+ if(earArtifactEdit!=null) {
+ earArtifactEdit.dispose();
+ }
+ }
+ }
+
/**
* Fill ear contents
*/
17 years, 2 months
JBoss Tools SVN: r10942 - trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/text/java.
by jbosstools-commits@lists.jboss.org
Author: vrubezhny
Date: 2008-10-17 14:06:39 -0400 (Fri, 17 Oct 2008)
New Revision: 10942
Modified:
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/text/java/SeamELProposalProcessor.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-2397 Make EL code completions beautifull and context relevant
The relevance is fixed for the SEAm EL proposals
Modified: trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/text/java/SeamELProposalProcessor.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/text/java/SeamELProposalProcessor.java 2008-10-17 17:24:39 UTC (rev 10941)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/text/java/SeamELProposalProcessor.java 2008-10-17 18:06:39 UTC (rev 10942)
@@ -271,7 +271,7 @@
* Returns the relevance of the proposal
*/
public int getRelevance() {
- return XMLRelevanceConstants.R_XML_ATTRIBUTE_VALUE;
+ return XMLRelevanceConstants.R_XML_ATTRIBUTE_VALUE+10;
}
}
17 years, 2 months
JBoss Tools SVN: r10941 - in trunk/jst/plugins/org.jboss.tools.jst.firstrun: src/org/jboss/tools/jst/firstrun and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: dazarov
Date: 2008-10-17 13:24:39 -0400 (Fri, 17 Oct 2008)
New Revision: 10941
Modified:
trunk/jst/plugins/org.jboss.tools.jst.firstrun/META-INF/MANIFEST.MF
trunk/jst/plugins/org.jboss.tools.jst.firstrun/src/org/jboss/tools/jst/firstrun/JBossASAdapterInitializer.java
Log:
https://jira.jboss.org/jira/browse/JBDS-425
Modified: trunk/jst/plugins/org.jboss.tools.jst.firstrun/META-INF/MANIFEST.MF
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.firstrun/META-INF/MANIFEST.MF 2008-10-17 17:04:52 UTC (rev 10940)
+++ trunk/jst/plugins/org.jboss.tools.jst.firstrun/META-INF/MANIFEST.MF 2008-10-17 17:24:39 UTC (rev 10941)
@@ -11,7 +11,8 @@
org.eclipse.jdt.launching,
org.eclipse.jface,
org.eclipse.datatools.connectivity;visibility:=reexport,
- org.eclipse.datatools.connectivity.db.generic
+ org.eclipse.datatools.connectivity.db.generic,
+ org.jboss.tools.common;bundle-version="2.0.0"
Bundle-Activator: org.jboss.tools.jst.firstrun.JstFirstRunPlugin
Eclipse-LazyStart: true
Export-Package: org.jboss.tools.jst.firstrun
Modified: trunk/jst/plugins/org.jboss.tools.jst.firstrun/src/org/jboss/tools/jst/firstrun/JBossASAdapterInitializer.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.firstrun/src/org/jboss/tools/jst/firstrun/JBossASAdapterInitializer.java 2008-10-17 17:04:52 UTC (rev 10940)
+++ trunk/jst/plugins/org.jboss.tools.jst.firstrun/src/org/jboss/tools/jst/firstrun/JBossASAdapterInitializer.java 2008-10-17 17:24:39 UTC (rev 10941)
@@ -48,6 +48,7 @@
import org.eclipse.wst.server.core.ServerUtil;
import org.eclipse.wst.server.core.internal.RuntimeWorkingCopy;
import org.eclipse.wst.server.core.internal.ServerWorkingCopy;
+import org.jboss.tools.common.util.FileUtil;
/**
* @author eskimo
@@ -56,6 +57,8 @@
public class JBossASAdapterInitializer implements IStartup {
public static final String JBOSS_AS_HOME = "../../../../jboss-eap/jboss-as"; // JBoss AS home directory (relative to plugin)- <RHDS_HOME>/jbossas.
+
+ public static final String SERVERS_FILE = "../../../application_platforms.properties";
public static final String JBOSS_AS_RUNTIME_TYPE_ID
= "org.jboss.ide.eclipse.as.runtime.42";
@@ -98,7 +101,51 @@
return;
}
JstFirstRunPlugin.getDefault().getPreferenceStore().setValue(FIRST_START_PREFERENCE_NAME, false);
+
+ File serversFile = new File(SERVERS_FILE);
+ if(serversFile.exists()){
+ String str = FileUtil.readFile(serversFile);
+ int position = 0;
+ while(true){
+ String jbossASLocation = null;
+
+ position = str.indexOf("=",position);
+ if(position < 0) break;
+
+ // server name
+ position = str.indexOf(",",position);
+ if(position < 0) break;
+ // server type
+ position = str.indexOf(",",position);
+ if(position < 0) break;
+
+ // server location
+ position = str.indexOf(",",position);
+ if(position < 0) break;
+
+ int next = str.indexOf("server",position);
+
+ if(next < 0)
+ jbossASLocation = str.substring(position+1,str.length()-1);
+ else
+ jbossASLocation = str.substring(position+1,next);
+
+ jbossASLocation = jbossASLocation.trim();
+
+ IRuntimeWorkingCopy runtime = null;
+ IProgressMonitor progressMonitor = new NullProgressMonitor();
+ if (runtime == null) {
+ runtime = createRuntime(jbossASLocation, progressMonitor);
+ }
+ if (runtime != null) {
+ createServer(progressMonitor, runtime);
+ }
+
+ createDriver(jbossASLocation);
+ }
+ }
+
String jbossASLocation = null;
String pluginLocation = FileLocator.resolve(JstFirstRunPlugin.getDefault().getBundle().getEntry("/")).getPath();
File jbossASDir = new File(pluginLocation, JBOSS_AS_HOME);
17 years, 2 months
JBoss Tools SVN: r10940 - trunk/birt/docs/en/modules.
by jbosstools-commits@lists.jboss.org
Author: abogachuk
Date: 2008-10-17 13:04:52 -0400 (Fri, 17 Oct 2008)
New Revision: 10940
Modified:
trunk/birt/docs/en/modules/birt_designer.xml
Log:
style and language verification
Modified: trunk/birt/docs/en/modules/birt_designer.xml
===================================================================
--- trunk/birt/docs/en/modules/birt_designer.xml 2008-10-17 16:55:28 UTC (rev 10939)
+++ trunk/birt/docs/en/modules/birt_designer.xml 2008-10-17 17:04:52 UTC (rev 10940)
@@ -52,16 +52,16 @@
<title>BIRT Report Designer Features</title>
<para>Here are the main BIRT Report Designer features:</para>
<itemizedlist><listitem><para><emphasis role="bold">Palette</emphasis> - contains tables, labels, and charts. It is used in conjunction with the Layout View to design reports.</para></listitem>
- <listitem><para><emphasis role="bold">Data Explorer</emphasis> - Organizes your data sources and data sets. The Data Sets editor enables testing your data set to check whether the report receives the correct data. You can also create cubes using your data sets (when building any dynamic cross tables) and design necessary report parameters.</para></listitem>
+ <listitem><para><emphasis role="bold">Data Explorer</emphasis> - organizes your data sources and data sets. The Data Sets editor enables testing your data set to check whether the report receives the correct data. You can also create cubes using your data sets (when building any dynamic cross tables) and design necessary report parameters.</para></listitem>
<listitem><para><emphasis role="bold">Resource Explorer</emphasis> - BIRT allows the reuse of report objects, such as tables, data sources and styles. Objects created for reuse are stored in a library file. To browse the contents of report libraries BIRT supplies the Resource Explorer view. This view lists all libraries within the resource folder, in addition to other shared content such as images and JavaScript files.</para></listitem>
- <listitem><para><emphasis role="bold">Property Editor</emphasis> - Shows the most commonly used properties. BIRT also integrates with the standard Eclipse property view to display a detailed listing of all properties for an item.</para></listitem>
+ <listitem><para><emphasis role="bold">Property Editor</emphasis> - shows the most commonly used properties. BIRT also integrates with the standard Eclipse property view to display a detailed listing of all properties for an item.</para></listitem>
<listitem><para><emphasis role="bold">Layout View</emphasis> - WYSIWYG editor. You can select any element from the Palette, drag and drop it to the report and then edit the way you like.</para></listitem>
- <listitem><para><emphasis role="bold">Script Editor</emphasis> - Scripting adds business logic to reports during data access, during report generation, or during viewing. The code editor provides standard Eclipse features for editing your scripts: syntax coloring, auto-complete and more. An interesting new feature, for BIRT 2.3 is the ability to debug scripts while the report is running.</para></listitem>
- <listitem><para><emphasis role="bold">Report Preview</emphasis> - You can test your report at any time with real data. The preview is a window directly within Eclipse.</para></listitem>
- <listitem><para><emphasis role="bold">Chart Builder</emphasis> - Adding Charts to BIRT designs is expedited with the Chart Builder. Chart creation is separated into three phases: Select Chart Type, Select Data, and Format Chart.</para></listitem>
- <listitem><para><emphasis role="bold">Expression Builder </emphasis> - BIRT expressions are really just simple scripts that return a value. Expressions are used for assigning data values to report elements, building image locations, hyperlinks, parameter default values and many other places. Expressions are constructed within BIRT using the Expression Builder.</para></listitem>
- <listitem><para><emphasis role="bold">Cheat Sheets</emphasis> - Learning a new tool is always a challenge, but Eclipse offers an innovative solution: cheat sheets. These are short bits of documentation that walk you through new tasks.</para></listitem>
- <listitem><para><emphasis role="bold">Outline</emphasis> - BIRT reports are organized as a tree structure with the overall report as the root, and separate categories for styles, report content, data sources, data sets, report parameters and more. The Outline view provides a compact overview of your entire report structure.</para></listitem>
+ <listitem><para><emphasis role="bold">Script Editor</emphasis> - scripting adds business logic to reports during data access, report generation, or viewing. The code editor provides standard features for editing scripts: syntax coloring, auto-complete etc. You also can debug scripts when the report is running.</para></listitem>
+ <listitem><para><emphasis role="bold">Report Preview</emphasis> - Report Preview is used to test your newly created report with some real data.</para></listitem>
+ <listitem><para><emphasis role="bold">Chart Builder</emphasis> - using the Chart Builder you can add any charts to the design of your report. Just select a chart type, then data and, finally, format the chart.</para></listitem>
+ <listitem><para><emphasis role="bold">Expression Builder </emphasis> - expressions are simple scripts that return a value. They are used to assign data values to report elements, build image locations, hyperlinks, parameter default values etc.</para></listitem>
+ <listitem><para><emphasis role="bold">Cheat Sheets</emphasis> - Cheat sheets are small pices of useful dosumentation that lead you through a report creation process. Just select when you need and then follow the instructions.</para></listitem>
+ <listitem><para><emphasis role="bold">Outline</emphasis> - this view provides a compact overview of the entire report structure.</para></listitem>
</itemizedlist>
17 years, 2 months
JBoss Tools SVN: r10939 - trunk/jsf/plugins/org.jboss.tools.jsf.text.ext.richfaces.
by jbosstools-commits@lists.jboss.org
Author: vrubezhny
Date: 2008-10-17 12:55:28 -0400 (Fri, 17 Oct 2008)
New Revision: 10939
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf.text.ext.richfaces/.project
Log:
Share project 'org.jboss.tools.jsf.text.ext.richfaces' into 'https://svn.jboss.org/repos/jbosstools/trunk'
JBIDE-1898 OpenOns for attributes of richfaces tags
JBIDE-2406 openon doesn't work for "viewId" attribute of <a4j:include> component.
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.text.ext.richfaces/.project
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.text.ext.richfaces/.project 2008-10-17 16:53:14 UTC (rev 10938)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.text.ext.richfaces/.project 2008-10-17 16:55:28 UTC (rev 10939)
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
- <name>org.jboss.tools.jsf.text.ext.facelets</name>
+ <name>org.jboss.tools.jsf.text.ext.richfaces</name>
<comment></comment>
<projects>
</projects>
17 years, 2 months
JBoss Tools SVN: r10938 - in documentation/trunk/movies: Reverse_engineering_and_code_generation and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: msorokin
Date: 2008-10-17 12:53:14 -0400 (Fri, 17 Oct 2008)
New Revision: 10938
Added:
documentation/trunk/movies/Reverse_engineering_and_code_generation/
documentation/trunk/movies/Reverse_engineering_and_code_generation/Reverse_engineering_and_code_generation.wnk
Log:
Added: documentation/trunk/movies/Reverse_engineering_and_code_generation/Reverse_engineering_and_code_generation.wnk
===================================================================
(Binary files differ)
Property changes on: documentation/trunk/movies/Reverse_engineering_and_code_generation/Reverse_engineering_and_code_generation.wnk
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
17 years, 2 months
JBoss Tools SVN: r10937 - trunk.
by jbosstools-commits@lists.jboss.org
Author: vrubezhny
Date: 2008-10-17 12:50:27 -0400 (Fri, 17 Oct 2008)
New Revision: 10937
Removed:
trunk/trunk/
Log:
Deleting after incorrect checkin.
17 years, 2 months
JBoss Tools SVN: r10936 - trunk/trunk.
by jbosstools-commits@lists.jboss.org
Author: vrubezhny
Date: 2008-10-17 12:50:05 -0400 (Fri, 17 Oct 2008)
New Revision: 10936
Removed:
trunk/trunk/jsf/
Log:
Deleting after incorrect checkin.
17 years, 2 months
JBoss Tools SVN: r10935 - trunk/trunk/jsf.
by jbosstools-commits@lists.jboss.org
Author: vrubezhny
Date: 2008-10-17 12:49:48 -0400 (Fri, 17 Oct 2008)
New Revision: 10935
Removed:
trunk/trunk/jsf/plugins/
Log:
Deleting after incorrect checkin.
17 years, 2 months
JBoss Tools SVN: r10934 - in trunk: trunk/jsf/plugins and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: vrubezhny
Date: 2008-10-17 12:47:54 -0400 (Fri, 17 Oct 2008)
New Revision: 10934
Added:
trunk/jsf/plugins/org.jboss.tools.jsf.text.ext.richfaces/
Removed:
trunk/trunk/jsf/plugins/org.jboss.tools.jsf.text.ext.richfaces/
Log:
Moving the plugin to the correct place
Copied: trunk/jsf/plugins/org.jboss.tools.jsf.text.ext.richfaces (from rev 10933, trunk/trunk/jsf/plugins/org.jboss.tools.jsf.text.ext.richfaces)
17 years, 2 months
JBoss Tools SVN: r10933 - trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet.
by jbosstools-commits@lists.jboss.org
Author: akazakov
Date: 2008-10-17 12:40:54 -0400 (Fri, 17 Oct 2008)
New Revision: 10933
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/AntCopyUtils.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/Seam2FacetInstallDelegate.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/Seam2ProjectCreator.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamFacetAbstractInstallDelegate.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamFacetInstallDelegate.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamProjectCreator.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-2731
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/AntCopyUtils.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/AntCopyUtils.java 2008-10-17 16:35:57 UTC (rev 10932)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/AntCopyUtils.java 2008-10-17 16:40:54 UTC (rev 10933)
@@ -189,9 +189,9 @@
}
}
- public static void copyFiles(File source, File dest, FileFilter filter) {
+ public static void copyFiles(File source, File dest, FileFilter filter, boolean override) {
dest.mkdir();
-
+
File[] listFiles = source.listFiles(filter);
if(listFiles==null) {
throw new IllegalArgumentException(NLS.bind(SeamCoreMessages.ANT_COPY_UTILS_COULD_NOT_FIND_FOLDER,source));
@@ -199,12 +199,16 @@
for (File file:listFiles) {
if(file.isDirectory())continue;
try {
- FileUtils.getFileUtils().copyFile(file, new File(dest,file.getName()),new FilterSetCollection(),true);
+ FileUtils.getFileUtils().copyFile(file, new File(dest, file.getName()), new FilterSetCollection(), override);
} catch (IOException e) {
SeamCorePlugin.getPluginLog().logError(e);
}
}
}
+
+ public static void copyFiles(File source, File dest, FileFilter filter) {
+ copyFiles(source, dest, filter, true);
+ }
public static void copyFiles(String[] files, File dest) {
copyFiles(files,dest, true);
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/Seam2FacetInstallDelegate.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/Seam2FacetInstallDelegate.java 2008-10-17 16:35:57 UTC (rev 10932)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/Seam2FacetInstallDelegate.java 2008-10-17 16:40:54 UTC (rev 10933)
@@ -13,8 +13,6 @@
import java.io.File;
import java.util.Iterator;
-import org.apache.tools.ant.types.FilterSet;
-import org.apache.tools.ant.types.FilterSetCollection;
import org.eclipse.core.resources.IContainer;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IResource;
@@ -36,7 +34,17 @@
// TODO: why not just *one* global filter set to avoid any missing names ? (assert for it in our unittests!
public class Seam2FacetInstallDelegate extends SeamFacetAbstractInstallDelegate{
- public static AntCopyUtils.FileSet JBOSS_WAR_LIB_FILESET_WAR_CONFIG = new AntCopyUtils.FileSet()
+ public static final AntCopyUtils.FileSet JBOSS_EAR_CONTENT = new AntCopyUtils.FileSet()
+ .include("antlr-runtime.jar") //$NON-NLS-1$
+ .include("drools-compiler.*\\.jar") //$NON-NLS-1$
+ .include("drools-core.*\\.jar") //$NON-NLS-1$
+ .include("jboss-seam.jar") //$NON-NLS-1$
+ .include("jboss-el.*.jar") //$NON-NLS-1$
+ .include("mvel.*\\.jar") //$NON-NLS-1$
+ .include("jbpm-jpdl.*\\.jar") //$NON-NLS-1$
+ .include("richfaces-api.*\\.jar"); //$NON-NLS-1$
+
+ public static final AntCopyUtils.FileSet JBOSS_WAR_LIB_FILESET_WAR_CONFIG = new AntCopyUtils.FileSet()
.include("ajax4jsf.*\\.jar") //$NON-NLS-1$
.include("richfaces.*\\.jar")
.include("antlr-runtime.*\\.jar") //$NON-NLS-1$
@@ -63,7 +71,7 @@
.include("mvel.*\\.jar") //$NON-NLS-1$
.include("jboss-el.jar"); //$NON-NLS-1$
- public static AntCopyUtils.FileSet JBOSS_WAR_LIB_FILESET_EAR_CONFIG = new AntCopyUtils.FileSet()
+ public static final AntCopyUtils.FileSet JBOSS_WAR_LIB_FILESET_EAR_CONFIG = new AntCopyUtils.FileSet()
.include("richfaces-impl\\.jar") //$NON-NLS-1$
.include("richfaces-ui\\.jar") //$NON-NLS-1$
.include("commons-beanutils\\.jar") //$NON-NLS-1$
@@ -85,14 +93,7 @@
@Override
protected void doExecuteForEjb(final IProject project, IProjectFacetVersion fv,
IDataModel model, IProgressMonitor monitor) throws CoreException {
- FilterSet jdbcFilterSet = SeamFacetFilterSetFactory.createJdbcFilterSet(model);
- FilterSet projectFilterSet = SeamFacetFilterSetFactory.createProjectFilterSet(model);
- ejbViewFilterSetCollection = new FilterSetCollection();
- ejbViewFilterSetCollection.addFilterSet(jdbcFilterSet);
- ejbViewFilterSetCollection.addFilterSet(projectFilterSet);
-
super.doExecuteForEjb(project, fv, model, monitor);
-
IResource src = getSrcFolder(project);
if(src!=null && seamHomeFolder!=null) {
File srcFile = src.getLocation().toFile();
@@ -125,6 +126,20 @@
/*
* (non-Javadoc)
+ * @see org.jboss.tools.seam.internal.core.project.facet.SeamFacetAbstractInstallDelegate#fillEarContents()
+ */
+ @Override
+ protected void fillEarContents() {
+ final File droolsLibFolder = new File(seamHomePath, DROOLS_LIB_SEAM_RELATED_PATH);
+ AntCopyUtils.copyFiles(seamHomeFolder, earContentsFolder, new AntCopyUtils.FileSetFileFilter(new AntCopyUtils.FileSet(JBOSS_EAR_CONTENT).dir(seamHomeFolder)), false);
+ AntCopyUtils.copyFiles(seamLibFolder, earContentsFolder, new AntCopyUtils.FileSetFileFilter(new AntCopyUtils.FileSet(JBOSS_EAR_CONTENT).dir(seamLibFolder)), false);
+ AntCopyUtils.copyFiles(droolsLibFolder, earContentsFolder, new AntCopyUtils.FileSetFileFilter(new AntCopyUtils.FileSet(JBOSS_EAR_CONTENT).dir(droolsLibFolder)), false);
+ AntCopyUtils.copyFiles(seamLibFolder, earContentsFolder, new AntCopyUtils.FileSetFileFilter(new AntCopyUtils.FileSet(JBOSS_EAR_CONTENT).dir(seamLibFolder)), false);
+ AntCopyUtils.copyFiles(seamGenResFolder, earContentsFolder, new AntCopyUtils.FileSetFileFilter(new AntCopyUtils.FileSet(JBOSS_EAR_CONTENT).dir(seamGenResFolder)), false);
+ }
+
+ /*
+ * (non-Javadoc)
* @see org.jboss.tools.seam.internal.core.project.facet.SeamFacetAbstractInstallDelegate#configureFacesConfigXml(org.eclipse.core.resources.IProject, org.eclipse.core.runtime.IProgressMonitor, java.lang.String)
*/
@Override
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/Seam2ProjectCreator.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/Seam2ProjectCreator.java 2008-10-17 16:35:57 UTC (rev 10932)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/Seam2ProjectCreator.java 2008-10-17 16:40:54 UTC (rev 10933)
@@ -48,16 +48,6 @@
.exclude(".*/CVS") //$NON-NLS-1$
.exclude(".*/\\.svn"); //$NON-NLS-1$
- private static AntCopyUtils.FileSet JBOSS_EAR_CONTENT = new AntCopyUtils.FileSet()
- .include("antlr-runtime.jar") //$NON-NLS-1$
- .include("drools-compiler.*\\.jar") //$NON-NLS-1$
- .include("drools-core.*\\.jar") //$NON-NLS-1$
- .include("jboss-seam.jar") //$NON-NLS-1$
- .include("jboss-el.*.jar") //$NON-NLS-1$
- .include("mvel.*\\.jar") //$NON-NLS-1$
- .include("jbpm-jpdl.*\\.jar") //$NON-NLS-1$
- .include("richfaces-api.*\\.jar"); //$NON-NLS-1$
-
/**
* @param model Seam facet data model
* @param seamWebProject Seam web project
@@ -186,6 +176,6 @@
}
protected AntCopyUtils.FileSet getJbossEarContent() {
- return JBOSS_EAR_CONTENT;
+ return Seam2FacetInstallDelegate.JBOSS_EAR_CONTENT;
}
}
\ No newline at end of file
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamFacetAbstractInstallDelegate.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamFacetAbstractInstallDelegate.java 2008-10-17 16:35:57 UTC (rev 10932)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamFacetAbstractInstallDelegate.java 2008-10-17 16:40:54 UTC (rev 10933)
@@ -326,19 +326,8 @@
*/
protected void copyFilesToWarProject(IProject project, IProjectFacetVersion fv,
IDataModel model, IProgressMonitor monitor) throws CoreException {
- final FilterSet jdbcFilterSet = SeamFacetFilterSetFactory.createJdbcFilterSet(model);
- final FilterSet projectFilterSet = SeamFacetFilterSetFactory.createProjectFilterSet(model);
- final FilterSet filtersFilterSet = SeamFacetFilterSetFactory.createFiltersFilterSet(model);
- // ****************************************************************
- // Copy view folder from seam-gen installation to WebContent folder
- // ****************************************************************
final AntCopyUtils.FileSet viewFileSet = new AntCopyUtils.FileSet(VIEW_FILESET).dir(seamGenViewSource);
- final FilterSetCollection viewFilterSetCollection = new FilterSetCollection();
- viewFilterSetCollection.addFilterSet(jdbcFilterSet);
- viewFilterSetCollection.addFilterSet(projectFilterSet);
- viewFilterSetCollection.addFilterSet(SeamFacetFilterSetFactory.createHibernateDialectFilterSet(model));
-
AntCopyUtils.copyFilesAndFolders(
seamGenViewSource,
webContentFolder,
@@ -436,6 +425,8 @@
}
}
+ protected File earContentsFolder;
+
/**
*
* @param project
@@ -446,61 +437,50 @@
*/
protected void doExecuteForEar(IProject project, IProjectFacetVersion fv,
IDataModel model, IProgressMonitor monitor) throws CoreException {
-/*
if(seamHomePath==null) {
return;
}
model.setProperty(ISeamFacetDataModelProperties.SEAM_EAR_PROJECT, project.getName());
IVirtualComponent component = ComponentCore.createComponent(project);
IVirtualFolder rootVirtFolder = component.getRootFolder().getFolder(new Path("/")); //$NON-NLS-1$
- IContainer earContentsContainer = rootVirtFolder.getUnderlyingFolder();
- File earContentsFolder = earContentsFolder.getAbsoluteFile();
+ earContentsFolder = rootVirtFolder.getUnderlyingFolder().getLocation().toFile();
+ File metaInfFolder = new File(earContentsFolder, "META-INF"); //$NON-NLS-1$
+ File applicationXml = new File(metaInfFolder, "application.xml");
File earProjectFolder = project.getLocation().toFile();
- File ejbTemplateDir;
- AntCopyUtils.FileSet excludeCvsSvn;
-
- try {
- ejbTemplateDir = new File(SeamFacetInstallDataModelProvider.getTemplatesFolder(), "ejb");
- } catch (IOException e) {
- SeamCorePlugin.getPluginLog().logError(e);
- }
- excludeCvsSvn = new AntCopyUtils.FileSet(SeamFacetAbstractInstallDelegate.CVS_SVN).dir(ejbTemplateDir);
-
FilterSet earFilterSet = new FilterSet();
earFilterSet.addFilter("projectName", project.getName() + ".ear"); //$NON-NLS-1$ //$NON-NLS-2$
AntCopyUtils.copyFileToFolder(
new File(seamGenResFolder, "META-INF/jboss-app.xml"), //$NON-NLS-1$
- new File(earContentsFolder, "META-INF"), //$NON-NLS-1$
- new FilterSetCollection(earFilterSet), false);
+ metaInfFolder, new FilterSetCollection(earFilterSet), false);
+ if(!applicationXml.exists()) {
+ // TODO configure application.xml
+ }
// Copy configuration files from template
try {
AntCopyUtils.copyFilesAndFolders(
new File(SeamFacetInstallDataModelProvider.getTemplatesFolder(), "ear"), //$NON-NLS-1$
- earProjectFolder, new AntCopyUtils.FileSetFileFilter(excludeCvsSvn),
- new FilterSetCollection(ejbFilterSet), true);
+ earProjectFolder, new FilterSetCollection(ejbFilterSet), false);
} catch (IOException e) {
SeamCorePlugin.getPluginLog().logError(e);
}
- // Fill ear contents
- AntCopyUtils.copyFiles(seamHomeFolder, earContentsFolder, new AntCopyUtils.FileSetFileFilter(new AntCopyUtils.FileSet(getJbossEarContent()).dir(seamHomeFolder)));
- AntCopyUtils.copyFiles(seamLibFolder, earContentsFolder, new AntCopyUtils.FileSetFileFilter(new AntCopyUtils.FileSet(getJbossEarContent()).dir(seamLibFolder)));
- AntCopyUtils.copyFiles(droolsLibFolder, earContentsFolder, new AntCopyUtils.FileSetFileFilter(new AntCopyUtils.FileSet(getJbossEarContent()).dir(droolsLibFolder)));
- AntCopyUtils.copyFiles(seamLibFolder, earContentsFolder, new AntCopyUtils.FileSetFileFilter(new AntCopyUtils.FileSet(getJbossEarContent()).dir(seamLibFolder)));
- AntCopyUtils.copyFiles(seamGenResFolder, earContentsFolder, new AntCopyUtils.FileSetFileFilter(new AntCopyUtils.FileSet(getJbossEarContent()).dir(seamGenResFolder)));
+ fillEarContents();
File resources = new File(earProjectFolder, "resources");
AntCopyUtils.copyFileToFile(
- dataSourceDsFile,
- new File(resources, seamWebProject.getName() + "-ds.xml"), //$NON-NLS-1$ //$NON-NLS-2$
- viewFilterSetCollection, true);
-*/
+ dataSourceDsFile, new File(resources, project.getName() + "-ds.xml"), //$NON-NLS-1$
+ viewFilterSetCollection, false);
}
+ /**
+ * Fill ear contents
+ */
+ abstract protected void fillEarContents();
+
protected IResource getSrcFolder(IProject project) throws JavaModelException {
IJavaProject javaProject = EclipseResourceUtil.getJavaProject(project);
@@ -517,8 +497,6 @@
return null;
}
- protected FilterSetCollection ejbViewFilterSetCollection;
-
/**
*
* @param project
@@ -545,11 +523,9 @@
IResource src = getSrcFolder(project);
if(src!=null) {
- if(ejbViewFilterSetCollection==null) {
- ejbViewFilterSetCollection = new FilterSetCollection();
- ejbViewFilterSetCollection.addFilterSet(jdbcFilterSet);
- ejbViewFilterSetCollection.addFilterSet(projectFilterSet);
- }
+ viewFilterSetCollection = new FilterSetCollection();
+ viewFilterSetCollection.addFilterSet(jdbcFilterSet);
+ viewFilterSetCollection.addFilterSet(projectFilterSet);
File srcFile = src.getLocation().toFile();
// Copy sources to EJB project in case of EAR configuration
@@ -561,7 +537,7 @@
File persistentXml = new File(srcFile, "META-INF/persistence.xml"); //$NON-NLS-1$
if(!persistentXml.exists()) {
AntCopyUtils.copyFileToFile(persistenceFile, new File(srcFile, "META-INF/persistence.xml"), //$NON-NLS-1$
- ejbViewFilterSetCollection, false);
+ viewFilterSetCollection, false);
} else {
// TODO modify persistence.xml
}
@@ -572,18 +548,16 @@
}
AntCopyUtils.FileSet ejbSrcResourcesSet = new AntCopyUtils.FileSet(JBOOS_EJB_WEB_INF_CLASSES_SET).dir(seamGenResFolder);
- AntCopyUtils.copyFilesAndFolders(seamGenResFolder, srcFile, new AntCopyUtils.FileSetFileFilter(ejbSrcResourcesSet), ejbViewFilterSetCollection, false);
+ AntCopyUtils.copyFilesAndFolders(seamGenResFolder, srcFile, new AntCopyUtils.FileSetFileFilter(ejbSrcResourcesSet), viewFilterSetCollection, false);
File ejbJarXml = new File(srcFile, "META-INF/ejb-jar.xml");
if(!ejbJarXml.exists()) {
AntCopyUtils.copyFileToFolder(new File(seamGenResFolder, "META-INF/ejb-jar.xml"), //$NON-NLS-1$
- new File(srcFile, "META-INF"), ejbViewFilterSetCollection, false); //$NON-NLS-1$
+ new File(srcFile, "META-INF"), viewFilterSetCollection, false); //$NON-NLS-1$
} else {
// TODO modify ejb-jar.xml
}
}
- FilterSet ejbFilterSet = new FilterSet();
- ejbFilterSet.addFilter("projectName", ejbProjectFolder.getName()); //$NON-NLS-1$
AntCopyUtils.copyFileToFile(hibernateConsoleLaunchFile, new File(
ejbProjectFolder, ejbProjectFolder.getName() + ".launch"), //$NON-NLS-1$
@@ -600,6 +574,11 @@
}
protected ProjectType projectType;
+ protected FilterSet ejbFilterSet;
+ protected FilterSetCollection viewFilterSetCollection;
+ protected FilterSet jdbcFilterSet;
+ protected FilterSet projectFilterSet;
+ protected FilterSet filtersFilterSet;
/**
*
@@ -611,7 +590,6 @@
*/
public void doExecute(final IProject project, IProjectFacetVersion fv,
Object config, IProgressMonitor monitor) throws CoreException {
- ejbViewFilterSetCollection = null;
final IDataModel model = (IDataModel)config;
IFacetedProject facetedProject = ProjectFacetsManager.create(project);
IProjectFacetVersion ejbVersion = facetedProject.getProjectFacetVersion(IJ2EEFacetConstants.EJB_FACET);
@@ -631,6 +609,19 @@
model.setProperty(ISeamFacetDataModelProperties.HIBERNATE_HBM2DDL_AUTO, "create-drop"); //$NON-NLS-1$
}
+ jdbcFilterSet = SeamFacetFilterSetFactory.createJdbcFilterSet(model);
+ projectFilterSet = SeamFacetFilterSetFactory.createProjectFilterSet(model);
+ filtersFilterSet = SeamFacetFilterSetFactory.createFiltersFilterSet(model);
+
+ // ****************************************************************
+ // Copy view folder from seam-gen installation to WebContent folder
+ // ****************************************************************
+ final AntCopyUtils.FileSet viewFileSet = new AntCopyUtils.FileSet(VIEW_FILESET).dir(seamGenViewSource);
+ viewFilterSetCollection = new FilterSetCollection();
+ viewFilterSetCollection.addFilterSet(jdbcFilterSet);
+ viewFilterSetCollection.addFilterSet(projectFilterSet);
+ viewFilterSetCollection.addFilterSet(SeamFacetFilterSetFactory.createHibernateDialectFilterSet(model));
+
Object runtimeName = model.getProperty(ISeamFacetDataModelProperties.SEAM_RUNTIME_NAME);
if(runtimeName!=null) {
final SeamRuntime selectedRuntime = SeamRuntimeManager.getInstance().findRuntimeByName(runtimeName.toString());
@@ -650,6 +641,19 @@
hibernateConsolePropsFile = new File(seamGenHomeFolder, "hibernatetools/hibernate-console.properties"); //$NON-NLS-1$
//final File hibernateConsolePref = new File(seamGenHomeFolder, "hibernatetools/.settings/org.hibernate.eclipse.console.prefs"); //$NON-NLS-1$
persistenceFile = new File(seamGenResFolder, "META-INF/persistence-" + (isWarConfiguration(model) ? DEV_WAR_PROFILE : DEV_EAR_PROFILE) + ".xml"); //$NON-NLS-1$ //$NON-NLS-2$
+
+ ejbFilterSet = new FilterSet();
+ ejbFilterSet.addFilter("projectName", project.getName()); //$NON-NLS-1$
+ String serverRuntimeName = WtpUtils.getServerRuntimeName(project);
+ if(serverRuntimeName!=null) {
+ ejbFilterSet.addFilter("runtimeName", serverRuntimeName); //$NON-NLS-1$
+ }
+ if (model.getProperty(ISeamFacetDataModelProperties.JDBC_DRIVER_JAR_PATH) != null) {
+ File driver = new File(((String[]) model.getProperty(ISeamFacetDataModelProperties.JDBC_DRIVER_JAR_PATH))[0]);
+ ejbFilterSet.addFilter("driverJar", " " + driver.getName() + "\n"); //$NON-NLS-1$ //$NON-NLS-2$
+ } else {
+ ejbFilterSet.addFilter("driverJar", ""); //$NON-NLS-1$ //$NON-NLS-2$
+ }
} else {
seamHomePath = null;
}
@@ -665,9 +669,11 @@
doExecuteForEar(project, fv, model, monitor);
}
- ClasspathHelper.addClasspathEntries(project, fv);
- createSeamProjectPreferenes(project, model);
- EclipseResourceUtil.addNatureToProject(project, ISeamProject.NATURE_ID);
+ if(projectType != ProjectType.EAR) {
+ ClasspathHelper.addClasspathEntries(project, fv);
+ createSeamProjectPreferenes(project, model);
+ EclipseResourceUtil.addNatureToProject(project, ISeamProject.NATURE_ID);
+ }
project.refreshLocal(IResource.DEPTH_INFINITE, monitor);
}
@@ -749,9 +755,6 @@
*/
protected void createSeamProjectPreferenes(final IProject project,
final IDataModel model) {
- if(projectType == ProjectType.EAR) {
- return;
- }
IScopeContext projectScope = new ProjectScope(project);
IEclipsePreferences prefs = projectScope.getNode(SeamCorePlugin.PLUGIN_ID);
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamFacetInstallDelegate.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamFacetInstallDelegate.java 2008-10-17 16:35:57 UTC (rev 10932)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamFacetInstallDelegate.java 2008-10-17 16:40:54 UTC (rev 10933)
@@ -48,6 +48,20 @@
private static final String ORG_AJAX4JSF_SKIN = "org.ajax4jsf.SKIN";
+ public static final AntCopyUtils.FileSet JBOSS_EAR_CONTENT = new AntCopyUtils.FileSet()
+ .include("antlr.*\\.jar") //$NON-NLS-1$
+ .include("commons-jci-core.*\\.jar") //$NON-NLS-1$
+ .include("commons-jci-janino.*\\.jar") //$NON-NLS-1$
+ .include("drools-compiler.*\\.jar") //$NON-NLS-1$
+ .include("drools-core.*\\.jar") //$NON-NLS-1$
+ .include("janino.*\\.jar") //$NON-NLS-1$
+ .include("jboss-seam.jar") //$NON-NLS-1$
+ .include("jbpm.*\\.jar") //$NON-NLS-1$
+ .include("security\\.drl") //$NON-NLS-1$
+ .include("stringtemplate.*\\.jar") //$NON-NLS-1$
+ // el-ri needed for JBIDE-939
+ .include("el-ri.*\\.jar"); //$NON-NLS-1$
+
public static final AntCopyUtils.FileSet JBOSS_WAR_LIB_FILESET_WAR_CONFIG = new AntCopyUtils.FileSet()
.include("ajax4jsf.*\\.jar") //$NON-NLS-1$
.include("richfaces.*\\.jar") //$NON-NLS-1$
@@ -74,7 +88,7 @@
// el-ri needed for JBIDE-939
.include("el-ri.*\\.jar"); //$NON-NLS-1$
- public static AntCopyUtils.FileSet JBOSS_WAR_LIB_FILESET_EAR_CONFIG = new AntCopyUtils.FileSet()
+ public static final AntCopyUtils.FileSet JBOSS_WAR_LIB_FILESET_EAR_CONFIG = new AntCopyUtils.FileSet()
.include("ajax4jsf.*\\.jar") //$NON-NLS-1$
.include("richfaces.*\\.jar") //$NON-NLS-1$
.include("commons-beanutils.*\\.jar") //$NON-NLS-1$
@@ -125,6 +139,20 @@
/*
* (non-Javadoc)
+ * @see org.jboss.tools.seam.internal.core.project.facet.SeamFacetAbstractInstallDelegate#fillEarContents()
+ */
+ @Override
+ protected void fillEarContents() {
+ final File droolsLibFolder = new File(seamHomePath, DROOLS_LIB_SEAM_RELATED_PATH);
+ AntCopyUtils.copyFiles(seamHomeFolder, earContentsFolder, new AntCopyUtils.FileSetFileFilter(new AntCopyUtils.FileSet(JBOSS_EAR_CONTENT).dir(seamHomeFolder)), false);
+ AntCopyUtils.copyFiles(seamLibFolder, earContentsFolder, new AntCopyUtils.FileSetFileFilter(new AntCopyUtils.FileSet(JBOSS_EAR_CONTENT).dir(seamLibFolder)), false);
+ AntCopyUtils.copyFiles(droolsLibFolder, earContentsFolder, new AntCopyUtils.FileSetFileFilter(new AntCopyUtils.FileSet(JBOSS_EAR_CONTENT).dir(droolsLibFolder)), false);
+ AntCopyUtils.copyFiles(seamLibFolder, earContentsFolder, new AntCopyUtils.FileSetFileFilter(new AntCopyUtils.FileSet(JBOSS_EAR_CONTENT).dir(seamLibFolder)), false);
+ AntCopyUtils.copyFiles(seamGenResFolder, earContentsFolder, new AntCopyUtils.FileSetFileFilter(new AntCopyUtils.FileSet(JBOSS_EAR_CONTENT).dir(seamGenResFolder)), false);
+ }
+
+ /*
+ * (non-Javadoc)
* @see org.jboss.tools.seam.internal.core.project.facet.SeamFacetAbstractInstallDelegate#configureFacesConfigXml(org.eclipse.core.resources.IProject, org.eclipse.core.runtime.IProgressMonitor, java.lang.String)
*/
@Override
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamProjectCreator.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamProjectCreator.java 2008-10-17 16:35:57 UTC (rev 10932)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamProjectCreator.java 2008-10-17 16:40:54 UTC (rev 10933)
@@ -63,20 +63,6 @@
.exclude(".*/CVS") //$NON-NLS-1$
.exclude(".*/\\.svn"); //$NON-NLS-1$
- private static AntCopyUtils.FileSet JBOSS_EAR_CONTENT = new AntCopyUtils.FileSet()
- .include("antlr.*\\.jar") //$NON-NLS-1$
- .include("commons-jci-core.*\\.jar") //$NON-NLS-1$
- .include("commons-jci-janino.*\\.jar") //$NON-NLS-1$
- .include("drools-compiler.*\\.jar") //$NON-NLS-1$
- .include("drools-core.*\\.jar") //$NON-NLS-1$
- .include("janino.*\\.jar") //$NON-NLS-1$
- .include("jboss-seam.jar") //$NON-NLS-1$
- .include("jbpm.*\\.jar") //$NON-NLS-1$
- .include("security\\.drl") //$NON-NLS-1$
- .include("stringtemplate.*\\.jar") //$NON-NLS-1$
- // el-ri needed for JBIDE-939
- .include("el-ri.*\\.jar"); //$NON-NLS-1$
-
protected IDataModel model;
protected IProject seamWebProject;
protected SeamRuntime seamRuntime;
@@ -198,7 +184,7 @@
}
protected AntCopyUtils.FileSet getJbossEarContent() {
- return JBOSS_EAR_CONTENT;
+ return SeamFacetInstallDelegate.JBOSS_EAR_CONTENT;
}
/**
17 years, 2 months
JBoss Tools SVN: r10932 - trunk/jsf/features/org.jboss.tools.richfaces.feature.
by jbosstools-commits@lists.jboss.org
Author: dgolovin
Date: 2008-10-17 12:35:57 -0400 (Fri, 17 Oct 2008)
New Revision: 10932
Modified:
trunk/jsf/features/org.jboss.tools.richfaces.feature/feature.xml
Log:
Unshared plugin jsf.ext.text.richfaces removed from build to keep it running
Modified: trunk/jsf/features/org.jboss.tools.richfaces.feature/feature.xml
===================================================================
--- trunk/jsf/features/org.jboss.tools.richfaces.feature/feature.xml 2008-10-17 15:31:50 UTC (rev 10931)
+++ trunk/jsf/features/org.jboss.tools.richfaces.feature/feature.xml 2008-10-17 16:35:57 UTC (rev 10932)
@@ -307,12 +307,6 @@
version="0.0.0"/>
<plugin
- id="org.jboss.tools.jsf.text.ext.richfaces"
- download-size="0"
- install-size="0"
- version="0.0.0"/>
-
- <plugin
id="org.jboss.tools.jsf.ui"
download-size="0"
install-size="0"
17 years, 2 months
JBoss Tools SVN: r10931 - trunk/seam/docs/reference/en/images/crud_database_application.
by jbosstools-commits@lists.jboss.org
Author: ochikvina
Date: 2008-10-17 11:31:50 -0400 (Fri, 17 Oct 2008)
New Revision: 10931
Added:
trunk/seam/docs/reference/en/images/crud_database_application/crud_database_application_14.png
Log:
https://jira.jboss.org/jira/browse/JBDS-446 - adding new screen;
Added: trunk/seam/docs/reference/en/images/crud_database_application/crud_database_application_14.png
===================================================================
(Binary files differ)
Property changes on: trunk/seam/docs/reference/en/images/crud_database_application/crud_database_application_14.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
17 years, 2 months
JBoss Tools SVN: r10930 - trunk/seam/docs/reference/en/modules.
by jbosstools-commits@lists.jboss.org
Author: ochikvina
Date: 2008-10-17 11:29:08 -0400 (Fri, 17 Oct 2008)
New Revision: 10930
Modified:
trunk/seam/docs/reference/en/modules/crud_database_application.xml
Log:
https://jira.jboss.org/jira/browse/JBDS-446 - adding new screen;
Modified: trunk/seam/docs/reference/en/modules/crud_database_application.xml
===================================================================
--- trunk/seam/docs/reference/en/modules/crud_database_application.xml 2008-10-17 15:17:31 UTC (rev 10929)
+++ trunk/seam/docs/reference/en/modules/crud_database_application.xml 2008-10-17 15:29:08 UTC (rev 10930)
@@ -286,7 +286,18 @@
</emphasis> will be created.</para>
</listitem>
</itemizedlist>
-
+
+ <figure>
+ <title>CRUDAPP Seam Project</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata
+ fileref="images/crud_database_application/crud_database_application_14.png"
+ />
+ </imageobject>
+ </mediaobject>
+ </figure>
+
<itemizedlist>
<listitem>
<para>Have a look at the created projects. You can expand
17 years, 2 months
JBoss Tools SVN: r10929 - trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/jpa/actions.
by jbosstools-commits@lists.jboss.org
Author: vyemialyanchyk
Date: 2008-10-17 11:17:31 -0400 (Fri, 17 Oct 2008)
New Revision: 10929
Modified:
trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/jpa/actions/JPAMapToolActor.java
Log:
JBIDE-2922
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/jpa/actions/JPAMapToolActor.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/jpa/actions/JPAMapToolActor.java 2008-10-17 14:38:07 UTC (rev 10928)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/jpa/actions/JPAMapToolActor.java 2008-10-17 15:17:31 UTC (rev 10929)
@@ -21,12 +21,19 @@
import org.eclipse.core.internal.resources.File;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.jdt.core.ICompilationUnit;
+import org.eclipse.jdt.core.IJavaElement;
import org.eclipse.jdt.core.IJavaProject;
+import org.eclipse.jdt.core.IPackageFragmentRoot;
import org.eclipse.jdt.core.JavaCore;
+import org.eclipse.jdt.core.JavaModelException;
import org.eclipse.jdt.core.dom.AST;
import org.eclipse.jdt.core.dom.ASTParser;
import org.eclipse.jdt.core.dom.TypeDeclaration;
import org.eclipse.jdt.internal.core.JavaElement;
+import org.eclipse.jdt.internal.core.JavaElementInfo;
+import org.eclipse.jdt.internal.core.JavaProject;
+import org.eclipse.jdt.internal.core.PackageFragment;
+import org.eclipse.jdt.internal.core.PackageFragmentRoot;
import org.eclipse.jdt.internal.ui.javaeditor.CompilationUnitEditor;
import org.eclipse.jface.text.IDocument;
import org.eclipse.jface.text.TextSelection;
@@ -193,37 +200,85 @@
Iterator it = treeSelection.iterator();
while (it.hasNext()) {
Object obj = it.next();
- if (obj instanceof ICompilationUnit) {
- ICompilationUnit cu = (ICompilationUnit)obj;
- addCompilationUnit(cu);
- }
- else if (obj instanceof File) {
- File file = (File)obj;
- if (file != null && file.getProject() != null) {
- IJavaProject javaProject = JavaCore.create(file.getProject());
- ICompilationUnit[] cus = Utils.findCompilationUnits(javaProject,
- file.getFullPath());
- if (cus != null) {
- for (int i = 0; i < cus.length; i++) {
- addCompilationUnit(cus[i]);
- }
- }
+ processJavaElements(obj);
+ }
+ }
+ else {
+ //System.out.println("2 Blah! " + selection); //$NON-NLS-1$
+ selection = null;
+ }
+ }
+
+ protected void processJavaElements(Object obj) {
+ if (obj instanceof ICompilationUnit) {
+ ICompilationUnit cu = (ICompilationUnit)obj;
+ addCompilationUnit(cu);
+ }
+ else if (obj instanceof File) {
+ File file = (File)obj;
+ if (file != null && file.getProject() != null) {
+ IJavaProject javaProject = JavaCore.create(file.getProject());
+ ICompilationUnit[] cus = Utils.findCompilationUnits(javaProject,
+ file.getFullPath());
+ if (cus != null) {
+ for (int i = 0; i < cus.length; i++) {
+ addCompilationUnit(cus[i]);
}
}
- else if (obj instanceof JavaElement) {
- JavaElement javaElement = (JavaElement)obj;
- ICompilationUnit cu = javaElement.getCompilationUnit();
- addCompilationUnit(cu);
+ }
+ }
+ else if (obj instanceof JavaProject) {
+ JavaProject javaProject = (JavaProject)obj;
+ IPackageFragmentRoot[] pfr = null;
+ try {
+ pfr = javaProject.getAllPackageFragmentRoots();
+ } catch (JavaModelException e) {
+ HibernateConsolePlugin.getDefault().logErrorMessage("JavaModelException: ", e); //$NON-NLS-1$
+ }
+ if (pfr != null) {
+ for (int i = 0; i < pfr.length; i++) {
+ processJavaElements(pfr[i]);
}
- else {
- // ignore
- //System.out.println("1 Blah! " + selection); //$NON-NLS-1$
+ }
+ }
+ else if (obj instanceof PackageFragment) {
+ PackageFragment packageFragment = (PackageFragment)obj;
+ ICompilationUnit[] cus = null;
+ try {
+ cus = packageFragment.getCompilationUnits();
+ } catch (JavaModelException e) {
+ HibernateConsolePlugin.getDefault().logErrorMessage("JavaModelException: ", e); //$NON-NLS-1$
+ }
+ if (cus != null) {
+ for (int i = 0; i < cus.length; i++) {
+ addCompilationUnit(cus[i]);
}
}
}
+ else if (obj instanceof PackageFragmentRoot) {
+ PackageFragmentRoot packageFragmentRoot = (PackageFragmentRoot)obj;
+ JavaElement javaElement = (JavaElement)obj;
+ JavaElementInfo javaElementInfo = null;
+ try {
+ javaElementInfo = (JavaElementInfo)javaElement.getElementInfo();
+ } catch (JavaModelException e) {
+ HibernateConsolePlugin.getDefault().logErrorMessage("JavaModelException: ", e); //$NON-NLS-1$
+ }
+ if (javaElementInfo != null) {
+ IJavaElement[] je = javaElementInfo.getChildren();
+ for (int i = 0; i < je.length; i++) {
+ processJavaElements(je[i]);
+ }
+ }
+ }
+ else if (obj instanceof JavaElement) {
+ JavaElement javaElement = (JavaElement)obj;
+ ICompilationUnit cu = javaElement.getCompilationUnit();
+ addCompilationUnit(cu);
+ }
else {
- //System.out.println("2 Blah! " + selection); //$NON-NLS-1$
- selection = null;
+ // ignore
+ //System.out.println("1 Blah! " + selection); //$NON-NLS-1$
}
}
}
17 years, 2 months
JBoss Tools SVN: r10928 - trunk/jsf/features/org.jboss.tools.jsf.feature.
by jbosstools-commits@lists.jboss.org
Author: vrubezhny
Date: 2008-10-17 10:38:07 -0400 (Fri, 17 Oct 2008)
New Revision: 10928
Modified:
trunk/jsf/features/org.jboss.tools.jsf.feature/feature.xml
Log:
Share project 'org.jboss.tools.jsf.text.ext.richfaces' into 'https://svn.jboss.org/repos/jbosstools/trunk'
JBIDE-1898 OpenOns for attributes of richfaces tags
JBIDE-2406 openon doesn't work for "viewId" attribute of <a4j:include> component.
Added to the org.jboss.tools.jsf.feature feature
Modified: trunk/jsf/features/org.jboss.tools.jsf.feature/feature.xml
===================================================================
--- trunk/jsf/features/org.jboss.tools.jsf.feature/feature.xml 2008-10-17 14:21:42 UTC (rev 10927)
+++ trunk/jsf/features/org.jboss.tools.jsf.feature/feature.xml 2008-10-17 14:38:07 UTC (rev 10928)
@@ -250,6 +250,12 @@
version="0.0.0"/>
<plugin
+ id="org.jboss.tools.jsf.text.ext.richfaces"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"/>
+
+ <plugin
id="org.jboss.tools.jsf.vpe.facelets"
download-size="0"
install-size="0"
17 years, 2 months
JBoss Tools SVN: r10927 - trunk/jsf/features/org.jboss.tools.richfaces.feature.
by jbosstools-commits@lists.jboss.org
Author: vrubezhny
Date: 2008-10-17 10:21:42 -0400 (Fri, 17 Oct 2008)
New Revision: 10927
Modified:
trunk/jsf/features/org.jboss.tools.richfaces.feature/feature.xml
Log:
Share project 'org.jboss.tools.jsf.text.ext.richfaces' into 'https://svn.jboss.org/repos/jbosstools/trunk'
JBIDE-1898 OpenOns for attributes of richfaces tags
JBIDE-2406 openon doesn't work for "viewId" attribute of <a4j:include> component.
Added to the org.jboss.tools.richfaces.feature feature
Modified: trunk/jsf/features/org.jboss.tools.richfaces.feature/feature.xml
===================================================================
--- trunk/jsf/features/org.jboss.tools.richfaces.feature/feature.xml 2008-10-17 14:00:17 UTC (rev 10926)
+++ trunk/jsf/features/org.jboss.tools.richfaces.feature/feature.xml 2008-10-17 14:21:42 UTC (rev 10927)
@@ -307,6 +307,12 @@
version="0.0.0"/>
<plugin
+ id="org.jboss.tools.jsf.text.ext.richfaces"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"/>
+
+ <plugin
id="org.jboss.tools.jsf.ui"
download-size="0"
install-size="0"
17 years, 2 months
JBoss Tools SVN: r10926 - trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2008-10-17 10:00:17 -0400 (Fri, 17 Oct 2008)
New Revision: 10926
Modified:
trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/SeamBigProjectTest.java
Log:
JBIDE-1982
Added performance test for validating a long page in a large project.
Modified: trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/SeamBigProjectTest.java
===================================================================
--- trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/SeamBigProjectTest.java 2008-10-17 13:49:56 UTC (rev 10925)
+++ trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/SeamBigProjectTest.java 2008-10-17 14:00:17 UTC (rev 10926)
@@ -10,6 +10,7 @@
******************************************************************************/
package org.jboss.tools.seam.core.test;
+import java.io.ByteArrayInputStream;
import java.io.File;
import java.io.IOException;
import java.net.URL;
@@ -18,19 +19,23 @@
import junit.framework.TestCase;
+import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IFolder;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IncrementalProjectBuilder;
+import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.FileLocator;
import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.core.runtime.Path;
import org.eclipse.core.runtime.Platform;
import org.jboss.tools.common.test.util.TestProjectProvider;
+import org.jboss.tools.common.util.FileUtil;
import org.jboss.tools.seam.core.ISeamComponent;
import org.jboss.tools.seam.core.ISeamProject;
import org.jboss.tools.seam.internal.core.SeamProject;
import org.jboss.tools.test.util.JUnitUtils;
import org.jboss.tools.test.util.JobUtils;
+import org.jboss.tools.test.util.ResourcesUtils;
import org.osgi.framework.Bundle;
/**
@@ -102,6 +107,8 @@
+ "of seam model loading than in the beginning.\n"
+ "That implies that time depends as N*N on the number of components N.");
}
+
+ generateLongXHTML(cs);
}
@@ -125,4 +132,43 @@
provider.dispose();
}
+ private void generateLongXHTML(Set<ISeamComponent> cs) {
+ StringBuffer sb = new StringBuffer();
+
+ IFolder webContent = project.getFolder("WebContent");
+ IFile tmpl = webContent.getFile("login.xhtml");
+ String s = FileUtil.readFile(tmpl.getLocation().toFile());
+ int i = s.indexOf("<h:form");
+ int j = s.indexOf(">", i) + 1;
+ sb.append(s.substring(0, j));
+
+ int k = 0;
+ for (ISeamComponent c: cs) {
+ k++;
+ String n = c.getName();
+ if(!n.startsWith("x")) continue;
+ String q = "\n<h:inputText id=\"k" + k + "\" " +
+ "value=\"#{" + n + ".value}\"/>\n";
+ sb.append(q);
+ }
+
+ sb.append(s.substring(j));
+ IFile file = webContent.getFile("long.xhtml");
+ try {
+ boolean save = ResourcesUtils.setBuildAutomatically(false);
+ file.create(new ByteArrayInputStream(sb.toString().getBytes()), true, new NullProgressMonitor());
+ long time = System.currentTimeMillis();
+ project.build(IncrementalProjectBuilder.INCREMENTAL_BUILD, new NullProgressMonitor());
+
+ long dt = System.currentTimeMillis() - time;
+ System.out.println("validated in " + dt);
+
+ ResourcesUtils.setBuildAutomatically(save);
+
+ assertTrue("Validator takes more than 5s (" + (dt/1000d) + ") for validating generated long.xhtml", dt < 5000);
+ } catch (CoreException e) {
+ JUnitUtils.fail("", e);
+ }
+ }
+
}
17 years, 2 months
JBoss Tools SVN: r10925 - trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/jpa/process.
by jbosstools-commits@lists.jboss.org
Author: max.andersen(a)jboss.com
Date: 2008-10-17 09:49:56 -0400 (Fri, 17 Oct 2008)
New Revision: 10925
Modified:
trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/jpa/process/AllEntitiesProcessor.java
Log:
replace ugly text field with java label tabel view for entities going to be changed.
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/jpa/process/AllEntitiesProcessor.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/jpa/process/AllEntitiesProcessor.java 2008-10-17 13:42:06 UTC (rev 10924)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/jpa/process/AllEntitiesProcessor.java 2008-10-17 13:49:56 UTC (rev 10925)
@@ -30,10 +30,20 @@
import org.eclipse.jdt.core.dom.rewrite.ASTRewrite;
import org.eclipse.jdt.internal.ui.refactoring.RefactoringSaveHelper;
import org.eclipse.jdt.internal.ui.refactoring.actions.RefactoringStarter;
+import org.eclipse.jdt.internal.ui.viewsupport.JavaElementImageProvider;
+import org.eclipse.jdt.ui.JavaElementLabelProvider;
import org.eclipse.jface.dialogs.IDialogConstants;
import org.eclipse.jface.layout.GridDataFactory;
import org.eclipse.jface.text.BadLocationException;
import org.eclipse.jface.text.IDocument;
+import org.eclipse.jface.viewers.ISelectionChangedListener;
+import org.eclipse.jface.viewers.IStructuredContentProvider;
+import org.eclipse.jface.viewers.LabelProvider;
+import org.eclipse.jface.viewers.ListViewer;
+import org.eclipse.jface.viewers.SelectionChangedEvent;
+import org.eclipse.jface.viewers.StyledString;
+import org.eclipse.jface.viewers.TableViewer;
+import org.eclipse.jface.viewers.Viewer;
import org.eclipse.ltk.core.refactoring.Change;
import org.eclipse.ltk.core.refactoring.CompositeChange;
import org.eclipse.ltk.core.refactoring.DocumentChange;
@@ -42,8 +52,11 @@
import org.eclipse.ltk.ui.refactoring.RefactoringWizard;
import org.eclipse.ltk.ui.refactoring.UserInputWizardPage;
import org.eclipse.swt.SWT;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Text;
import org.eclipse.text.edits.MalformedTreeException;
@@ -57,14 +70,14 @@
import org.hibernate.eclipse.jdt.ui.internal.jpa.common.Utils;
/**
- *
- *
+ *
+ *
* @author Vitali
*/
public class AllEntitiesProcessor {
protected IJavaProject javaProject;
-
+
protected class ChangeStructure {
public String fullyQualifiedName;
public IPath path;
@@ -75,14 +88,14 @@
};
protected ArrayList<ChangeStructure> changes = new ArrayList<ChangeStructure>();
- public void modify(IJavaProject project, Map<String, EntityInfo> entities,
+ public void modify(IJavaProject project, Map<String, EntityInfo> entities,
boolean askConfirmation) {
changes.clear();
setJavaProject(project);
// get the buffer manager
ITextFileBufferManager bufferManager = FileBuffers.getTextFileBufferManager();
Iterator<Map.Entry<String, EntityInfo>> it = entities.entrySet().iterator();
- String outText = ""; //$NON-NLS-1$
+ /*String outText = ""; //$NON-NLS-1$
String ls = System.getProperties().getProperty("line.separator", "\n"); //$NON-NLS-1$//$NON-NLS-2$
while (it.hasNext()) {
Map.Entry<String, EntityInfo> entry = it.next();
@@ -93,16 +106,16 @@
// TODO: save entity name as has compiler problems
}
outText += entry.getKey() + (it.hasNext() ? ls : ""); //$NON-NLS-1$
- }
+ }*/
boolean performChange = true;
int res = 0;
if (askConfirmation) {
/** /
final String outText2 = outText;
- MessageDialog dialog = new MessageDialog(JavaPlugin.getActiveWorkbenchShell(),
- JdtUiMessages.AllEntitiesProcessor_header, null,
- JdtUiMessages.AllEntitiesProcessor_message,
- MessageDialog.QUESTION,
+ MessageDialog dialog = new MessageDialog(JavaPlugin.getActiveWorkbenchShell(),
+ JdtUiMessages.AllEntitiesProcessor_header, null,
+ JdtUiMessages.AllEntitiesProcessor_message,
+ MessageDialog.QUESTION,
new String[] { IDialogConstants.OK_LABEL, IDialogConstants.CANCEL_LABEL }, 0) {
protected Control createCustomArea(Composite parent) {
Text messageText = new Text(parent, SWT.WRAP | SWT.V_SCROLL);
@@ -151,7 +164,7 @@
}
//
if (askConfirmation) {
- if (!showRefactoringDialog(outText)) {
+ if (!showRefactoringDialog(entities)) {
performChange = false;
}
}
@@ -194,7 +207,7 @@
}
}
- public void collectModification(ITextFileBufferManager bufferManager, String fullyQualifiedName,
+ public void collectModification(ITextFileBufferManager bufferManager, String fullyQualifiedName,
EntityInfo entityInfo) throws CoreException {
ChangeStructure cs = new ChangeStructure();
@@ -224,9 +237,9 @@
HibernateConsolePlugin.getDefault().logErrorMessage("MalformedTreeException: ", e); //$NON-NLS-1$
}
}
-
- public boolean showRefactoringDialog(final String text) {
+ public boolean showRefactoringDialog(final Map<String, EntityInfo> entities) {
+
final String wizard_title = JdtUiMessages.AllEntitiesProcessor_header;
Refactoring ref = new Refactoring(){
@@ -277,19 +290,66 @@
Label label = new Label(container, SWT.NULL);
label.setText(JdtUiMessages.AllEntitiesProcessor_message);
- Text messageText = new Text(container, SWT.WRAP | SWT.V_SCROLL);
- messageText.setText(text);
- messageText.setEditable(false);
- GridDataFactory.fillDefaults().align(SWT.FILL, SWT.FILL)
+ TableViewer listViewer = new TableViewer(container, SWT.SINGLE | SWT.H_SCROLL
+ | SWT.V_SCROLL | SWT.BORDER);
+ //listViewer.setComparator(getViewerComparator());
+ Control control = listViewer.getControl();
+ GridData data = new GridData(GridData.FILL_BOTH
+ | GridData.GRAB_HORIZONTAL | GridData.GRAB_VERTICAL);
+ data.heightHint = convertHeightInCharsToPixels(10);
+ control.setLayoutData(data);
+ listViewer.setContentProvider(new IStructuredContentProvider() {
+ public Object[] getElements(Object inputElement) {
+ return entities.values().toArray();
+ }
+
+ public void dispose() {
+
+ }
+
+ public void inputChanged(Viewer viewer, Object oldInput,
+ Object newInput) {
+
+ }
+ });
+
+ listViewer.setLabelProvider(new LabelProvider() {
+
+ private Image classImage;
+
+ {
+ classImage = JavaElementImageProvider.getTypeImageDescriptor(false, false, 0, false).createImage();
+
+ }
+ @Override
+ public String getText(Object element) {
+ EntityInfo info = (EntityInfo) element;
+ return info.getFullyQualifiedName();
+ }
+
+ @Override
+ public Image getImage(Object element) {
+ return classImage;
+ }
+
+ @Override
+ public void dispose() {
+ classImage.dispose();
+ super.dispose();
+ }
+ });
+
+ listViewer.setInput(entities);
+ GridDataFactory.fillDefaults().align(SWT.FILL, SWT.FILL)
.grab(true, true)
.hint(convertHorizontalDLUsToPixels(IDialogConstants.MINIMUM_MESSAGE_AREA_WIDTH),
- convertHorizontalDLUsToPixels(2 * IDialogConstants.BUTTON_BAR_HEIGHT)).applyTo(messageText);
+ convertHorizontalDLUsToPixels(2 * IDialogConstants.BUTTON_BAR_HEIGHT)).applyTo(listViewer.getControl());
setControl(container);
}
};
addPage(page);
}
-
+
};
wizard.setWindowTitle(wizard_title);
17 years, 2 months
JBoss Tools SVN: r10924 - in trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/jpa: collect and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: vyemialyanchyk
Date: 2008-10-17 09:42:06 -0400 (Fri, 17 Oct 2008)
New Revision: 10924
Modified:
trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/jpa/actions/JPAMapToolActionDelegate.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/jpa/actions/JPAMapToolActionPulldownDelegate.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/jpa/actions/JPAMapToolActor.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/jpa/collect/CollectEntityInfo.java
Log:
JBIDE-2077 popup menu enable bugfix, null pointer bugfix
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/jpa/actions/JPAMapToolActionDelegate.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/jpa/actions/JPAMapToolActionDelegate.java 2008-10-17 13:36:44 UTC (rev 10923)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/jpa/actions/JPAMapToolActionDelegate.java 2008-10-17 13:42:06 UTC (rev 10924)
@@ -31,7 +31,7 @@
public class JPAMapToolActionDelegate implements IObjectActionDelegate,
IEditorActionDelegate, IViewActionDelegate, IHandler {
- public JPAMapToolActor actor = new JPAMapToolActor();
+ public JPAMapToolActor actor = JPAMapToolActor.getInstance();
public void setActivePart(IAction action, IWorkbenchPart targetPart) {
}
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/jpa/actions/JPAMapToolActionPulldownDelegate.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/jpa/actions/JPAMapToolActionPulldownDelegate.java 2008-10-17 13:36:44 UTC (rev 10923)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/jpa/actions/JPAMapToolActionPulldownDelegate.java 2008-10-17 13:42:06 UTC (rev 10924)
@@ -42,7 +42,7 @@
private Menu fMenu;
protected boolean fRecreateMenu = false;
- public JPAMapToolActor actor = new JPAMapToolActor();
+ public JPAMapToolActor actor = JPAMapToolActor.getInstance();
public Menu getMenu(Menu parent) {
setMenu(new Menu(parent));
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/jpa/actions/JPAMapToolActor.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/jpa/actions/JPAMapToolActor.java 2008-10-17 13:36:44 UTC (rev 10923)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/jpa/actions/JPAMapToolActor.java 2008-10-17 13:42:06 UTC (rev 10924)
@@ -48,11 +48,21 @@
*/
public class JPAMapToolActor {
+ protected static JPAMapToolActor actor = null;
protected Set<ICompilationUnit> selectionCU = new HashSet<ICompilationUnit>();
protected AllEntitiesInfoCollector collector = new AllEntitiesInfoCollector();
protected AllEntitiesProcessor processor = new AllEntitiesProcessor();
+ protected JPAMapToolActor() {
+ }
+ public static JPAMapToolActor getInstance() {
+ if (actor == null) {
+ actor = new JPAMapToolActor();
+ }
+ return actor;
+ }
+
protected org.eclipse.jdt.core.dom.CompilationUnit getCompilationUnit(ICompilationUnit source) {
ASTParser parser = ASTParser.newParser(AST.JLS3);
parser.setSource(source);
@@ -127,7 +137,7 @@
return selectionCU.size();
}
- public void updateSelectedItems(ISelection selection) {
+ synchronized public void updateSelectedItems(ISelection selection) {
//System.out.println("Blah! " + selection); //$NON-NLS-1$
if (selection instanceof TextSelection) {
String fullyQualifiedName = ""; //$NON-NLS-1$
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/jpa/collect/CollectEntityInfo.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/jpa/collect/CollectEntityInfo.java 2008-10-17 13:36:44 UTC (rev 10923)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/jpa/collect/CollectEntityInfo.java 2008-10-17 13:42:06 UTC (rev 10924)
@@ -216,17 +216,19 @@
Type superType = node.getSuperclassType();
if (superType != null) {
ITypeBinding tb = superType.resolveBinding();
- String entityFullyQualifiedName = ""; //$NON-NLS-1$
- if (tb.getJavaElement() instanceof SourceType) {
- SourceType sourceT = (SourceType)tb.getJavaElement();
- try {
- entityFullyQualifiedName = sourceT.getFullyQualifiedParameterizedName();
- } catch (JavaModelException e) {
- HibernateConsolePlugin.getDefault().logErrorMessage("error", e);
+ if (tb != null) {
+ String entityFullyQualifiedName = ""; //$NON-NLS-1$
+ if (tb.getJavaElement() instanceof SourceType) {
+ SourceType sourceT = (SourceType)tb.getJavaElement();
+ try {
+ entityFullyQualifiedName = sourceT.getFullyQualifiedParameterizedName();
+ } catch (JavaModelException e) {
+ HibernateConsolePlugin.getDefault().logErrorMessage("error", e);
+ }
}
+ entityInfo.addDependency(entityFullyQualifiedName);
+ entityInfo.setFullyQualifiedParentName(entityFullyQualifiedName);
}
- entityInfo.addDependency(entityFullyQualifiedName);
- entityInfo.setFullyQualifiedParentName(entityFullyQualifiedName);
}
List superInterfaces = node.superInterfaceTypes();
Iterator it = superInterfaces.iterator();
@@ -266,33 +268,35 @@
} else if (node.getType().isSimpleType()) {
SimpleType st = (SimpleType)node.getType();
ITypeBinding tb = st.resolveBinding();
- String entityFullyQualifiedName = ""; //$NON-NLS-1$
- if (tb.getJavaElement() instanceof SourceType) {
- SourceType sourceT = (SourceType)tb.getJavaElement();
- try {
- entityFullyQualifiedName = sourceT.getFullyQualifiedParameterizedName();
- } catch (JavaModelException e) {
- HibernateConsolePlugin.getDefault().logErrorMessage("JavaModelException: ", e); //$NON-NLS-1$
- }
- entityInfo.addDependency(entityFullyQualifiedName);
- Iterator itVarNames = node.fragments().iterator();
- while (itVarNames.hasNext()) {
- VariableDeclarationFragment var = (VariableDeclarationFragment)itVarNames.next();
- String name = var.getName().getIdentifier();
- entityInfo.addReference(name, entityFullyQualifiedName, RefType.ONE2ONE);
- }
- }
- else if (tb.getJavaElement() instanceof BinaryType) {
- ITypeBinding tbParent = tb.getTypeDeclaration().getSuperclass();
- if (tbParent != null && "java.lang.Number".equals(tbParent.getBinaryName())) { //$NON-NLS-1$
- // this is candidate for primary id
+ if (tb != null) {
+ String entityFullyQualifiedName = ""; //$NON-NLS-1$
+ if (tb.getJavaElement() instanceof SourceType) {
+ SourceType sourceT = (SourceType)tb.getJavaElement();
+ try {
+ entityFullyQualifiedName = sourceT.getFullyQualifiedParameterizedName();
+ } catch (JavaModelException e) {
+ HibernateConsolePlugin.getDefault().logErrorMessage("JavaModelException: ", e); //$NON-NLS-1$
+ }
+ entityInfo.addDependency(entityFullyQualifiedName);
Iterator itVarNames = node.fragments().iterator();
while (itVarNames.hasNext()) {
VariableDeclarationFragment var = (VariableDeclarationFragment)itVarNames.next();
String name = var.getName().getIdentifier();
- entityInfo.addPrimaryIdCandidate(name);
+ entityInfo.addReference(name, entityFullyQualifiedName, RefType.ONE2ONE);
}
}
+ else if (tb.getJavaElement() instanceof BinaryType) {
+ ITypeBinding tbParent = tb.getTypeDeclaration().getSuperclass();
+ if (tbParent != null && "java.lang.Number".equals(tbParent.getBinaryName())) { //$NON-NLS-1$
+ // this is candidate for primary id
+ Iterator itVarNames = node.fragments().iterator();
+ while (itVarNames.hasNext()) {
+ VariableDeclarationFragment var = (VariableDeclarationFragment)itVarNames.next();
+ String name = var.getName().getIdentifier();
+ entityInfo.addPrimaryIdCandidate(name);
+ }
+ }
+ }
}
} else if (node.getType().isArrayType()) {
ArrayType at = (ArrayType)node.getType();
@@ -301,38 +305,40 @@
ParameterizedType pt = (ParameterizedType)node.getType();
Type type = (Type)pt.getType();
ITypeBinding tb = type.resolveBinding();
- ITypeBinding[] interfaces = tb.getTypeDeclaration().getInterfaces();
- String fullyQualifiedNameTypeName = ""; //$NON-NLS-1$
- for (int i = 0; i < interfaces.length; i++) {
- if (interfaces[i].getJavaElement() instanceof BinaryType) {
- BinaryType binaryT = (BinaryType)interfaces[i].getJavaElement();
- String tmp = binaryT.getFullyQualifiedName('.');
- if (0 == "java.util.Collection".compareTo(tmp)) { //$NON-NLS-1$
- fullyQualifiedNameTypeName = tmp;
- break;
+ if (tb != null) {
+ ITypeBinding[] interfaces = tb.getTypeDeclaration().getInterfaces();
+ String fullyQualifiedNameTypeName = ""; //$NON-NLS-1$
+ for (int i = 0; i < interfaces.length; i++) {
+ if (interfaces[i].getJavaElement() instanceof BinaryType) {
+ BinaryType binaryT = (BinaryType)interfaces[i].getJavaElement();
+ String tmp = binaryT.getFullyQualifiedName('.');
+ if (0 == "java.util.Collection".compareTo(tmp)) { //$NON-NLS-1$
+ fullyQualifiedNameTypeName = tmp;
+ break;
+ }
}
}
- }
- if (fullyQualifiedNameTypeName.length() > 0) {
- Iterator typeArgsIt = pt.typeArguments().iterator();
- while (typeArgsIt.hasNext()) {
- type = (Type)typeArgsIt.next();
- tb = type.resolveBinding();
- String entityFullyQualifiedName = ""; //$NON-NLS-1$
- if (tb.getJavaElement() instanceof SourceType) {
- SourceType sourceT = (SourceType)tb.getJavaElement();
- try {
- entityFullyQualifiedName = sourceT.getFullyQualifiedParameterizedName();
- } catch (JavaModelException e) {
- HibernateConsolePlugin.getDefault().logErrorMessage("JavaModelException: ", e); //$NON-NLS-1$
+ if (fullyQualifiedNameTypeName.length() > 0) {
+ Iterator typeArgsIt = pt.typeArguments().iterator();
+ while (typeArgsIt.hasNext()) {
+ type = (Type)typeArgsIt.next();
+ tb = type.resolveBinding();
+ String entityFullyQualifiedName = ""; //$NON-NLS-1$
+ if (tb.getJavaElement() instanceof SourceType) {
+ SourceType sourceT = (SourceType)tb.getJavaElement();
+ try {
+ entityFullyQualifiedName = sourceT.getFullyQualifiedParameterizedName();
+ } catch (JavaModelException e) {
+ HibernateConsolePlugin.getDefault().logErrorMessage("JavaModelException: ", e); //$NON-NLS-1$
+ }
+ entityInfo.addDependency(entityFullyQualifiedName);
+ Iterator itVarNames = node.fragments().iterator();
+ while (itVarNames.hasNext()) {
+ VariableDeclarationFragment var = (VariableDeclarationFragment)itVarNames.next();
+ String name = var.getName().getIdentifier();
+ entityInfo.addReference(name, entityFullyQualifiedName, RefType.ONE2MANY);
+ }
}
- entityInfo.addDependency(entityFullyQualifiedName);
- Iterator itVarNames = node.fragments().iterator();
- while (itVarNames.hasNext()) {
- VariableDeclarationFragment var = (VariableDeclarationFragment)itVarNames.next();
- String name = var.getName().getIdentifier();
- entityInfo.addReference(name, entityFullyQualifiedName, RefType.ONE2MANY);
- }
}
}
}
17 years, 2 months
JBoss Tools SVN: r10923 - trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2008-10-17 09:36:44 -0400 (Fri, 17 Oct 2008)
New Revision: 10923
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/SeamCoreBuilder.java
Log:
JBIDE-2056
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/SeamCoreBuilder.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/SeamCoreBuilder.java 2008-10-17 13:17:39 UTC (rev 10922)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/SeamCoreBuilder.java 2008-10-17 13:36:44 UTC (rev 10923)
@@ -56,15 +56,13 @@
IResource resource = delta.getResource();
switch (delta.getKind()) {
case IResourceDelta.ADDED:
- getResourceVisitor().getVisitor().visit(resource);
- break;
+ return getResourceVisitor().getVisitor().visit(resource);
case IResourceDelta.REMOVED:
SeamProject p = getSeamProject();
if(p != null) p.pathRemoved(resource.getFullPath());
break;
case IResourceDelta.CHANGED:
- getResourceVisitor().getVisitor().visit(resource);
- break;
+ return getResourceVisitor().getVisitor().visit(resource);
}
//return true to continue visiting children.
return true;
17 years, 2 months
JBoss Tools SVN: r10922 - in trunk/trunk/jsf/plugins/org.jboss.tools.jsf.text.ext.richfaces: META-INF and 8 other directories.
by jbosstools-commits@lists.jboss.org
Author: vrubezhny
Date: 2008-10-17 09:17:39 -0400 (Fri, 17 Oct 2008)
New Revision: 10922
Added:
trunk/trunk/jsf/plugins/org.jboss.tools.jsf.text.ext.richfaces/.classpath
trunk/trunk/jsf/plugins/org.jboss.tools.jsf.text.ext.richfaces/.cvsignore
trunk/trunk/jsf/plugins/org.jboss.tools.jsf.text.ext.richfaces/.project
trunk/trunk/jsf/plugins/org.jboss.tools.jsf.text.ext.richfaces/META-INF/
trunk/trunk/jsf/plugins/org.jboss.tools.jsf.text.ext.richfaces/META-INF/MANIFEST.MF
trunk/trunk/jsf/plugins/org.jboss.tools.jsf.text.ext.richfaces/about.html
trunk/trunk/jsf/plugins/org.jboss.tools.jsf.text.ext.richfaces/build.properties
trunk/trunk/jsf/plugins/org.jboss.tools.jsf.text.ext.richfaces/plugin.properties
trunk/trunk/jsf/plugins/org.jboss.tools.jsf.text.ext.richfaces/plugin.xml
trunk/trunk/jsf/plugins/org.jboss.tools.jsf.text.ext.richfaces/src/
trunk/trunk/jsf/plugins/org.jboss.tools.jsf.text.ext.richfaces/src/org/
trunk/trunk/jsf/plugins/org.jboss.tools.jsf.text.ext.richfaces/src/org/jboss/
trunk/trunk/jsf/plugins/org.jboss.tools.jsf.text.ext.richfaces/src/org/jboss/tools/
trunk/trunk/jsf/plugins/org.jboss.tools.jsf.text.ext.richfaces/src/org/jboss/tools/jsf/
trunk/trunk/jsf/plugins/org.jboss.tools.jsf.text.ext.richfaces/src/org/jboss/tools/jsf/text/
trunk/trunk/jsf/plugins/org.jboss.tools.jsf.text.ext.richfaces/src/org/jboss/tools/jsf/text/ext/
trunk/trunk/jsf/plugins/org.jboss.tools.jsf.text.ext.richfaces/src/org/jboss/tools/jsf/text/ext/richfaces/
trunk/trunk/jsf/plugins/org.jboss.tools.jsf.text.ext.richfaces/src/org/jboss/tools/jsf/text/ext/richfaces/RichfacesExtensionsPlugin.java
Log:
Share project 'org.jboss.tools.jsf.text.ext.richfaces' into 'https://svn.jboss.org/repos/jbosstools/trunk'
JBIDE-1898 OpenOns for attributes of richfaces tags
JBIDE-2406 openon doesn't work for "viewId" attribute of <a4j:include> component.
Added: trunk/trunk/jsf/plugins/org.jboss.tools.jsf.text.ext.richfaces/.classpath
===================================================================
--- trunk/trunk/jsf/plugins/org.jboss.tools.jsf.text.ext.richfaces/.classpath (rev 0)
+++ trunk/trunk/jsf/plugins/org.jboss.tools.jsf.text.ext.richfaces/.classpath 2008-10-17 13:17:39 UTC (rev 10922)
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
Added: trunk/trunk/jsf/plugins/org.jboss.tools.jsf.text.ext.richfaces/.cvsignore
===================================================================
--- trunk/trunk/jsf/plugins/org.jboss.tools.jsf.text.ext.richfaces/.cvsignore (rev 0)
+++ trunk/trunk/jsf/plugins/org.jboss.tools.jsf.text.ext.richfaces/.cvsignore 2008-10-17 13:17:39 UTC (rev 10922)
@@ -0,0 +1 @@
+bin
Added: trunk/trunk/jsf/plugins/org.jboss.tools.jsf.text.ext.richfaces/.project
===================================================================
--- trunk/trunk/jsf/plugins/org.jboss.tools.jsf.text.ext.richfaces/.project (rev 0)
+++ trunk/trunk/jsf/plugins/org.jboss.tools.jsf.text.ext.richfaces/.project 2008-10-17 13:17:39 UTC (rev 10922)
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.jboss.tools.jsf.text.ext.facelets</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
Added: trunk/trunk/jsf/plugins/org.jboss.tools.jsf.text.ext.richfaces/META-INF/MANIFEST.MF
===================================================================
--- trunk/trunk/jsf/plugins/org.jboss.tools.jsf.text.ext.richfaces/META-INF/MANIFEST.MF (rev 0)
+++ trunk/trunk/jsf/plugins/org.jboss.tools.jsf.text.ext.richfaces/META-INF/MANIFEST.MF 2008-10-17 13:17:39 UTC (rev 10922)
@@ -0,0 +1,17 @@
+Manifest-Version: 1.0
+Eclipse-LazyStart: true
+Bundle-Name: Richfaces Text Editors Extensions
+Bundle-ClassPath: jsfrichfacesextensions.jar
+Bundle-Activator: org.jboss.tools.jsf.text.ext.richfaces.RichfacesExtensionsPlugin
+Bundle-ManifestVersion: 2
+Bundle-Vendor: %providerName
+Bundle-SymbolicName: org.jboss.tools.jsf.text.ext.richfaces; singleton:=true
+Bundle-Localization: plugin
+Require-Bundle:
+ org.eclipse.ui,org.eclipse.core.runtime,
+ org.eclipse.core.resources,org.eclipse.jface.text,
+ org.jboss.tools.common.text.ext,
+ org.jboss.tools.jsf.text.ext
+Export-Package: org.jboss.tools.jsf.text.ext.richfaces
+Bundle-Version: 2.0.0
+
Added: trunk/trunk/jsf/plugins/org.jboss.tools.jsf.text.ext.richfaces/about.html
===================================================================
--- trunk/trunk/jsf/plugins/org.jboss.tools.jsf.text.ext.richfaces/about.html (rev 0)
+++ trunk/trunk/jsf/plugins/org.jboss.tools.jsf.text.ext.richfaces/about.html 2008-10-17 13:17:39 UTC (rev 10922)
@@ -0,0 +1,34 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
+<HTML>
+
+<head>
+<title>About</title>
+<meta http-equiv=Content-Type content="text/html; charset=ISO-8859-1">
+</head>
+
+<BODY lang="EN-US">
+
+<H3>About This Content</H3>
+
+<P>©2007 Red Hat, Inc. All rights reserved</P>
+
+<H3>License</H3>
+
+<P>Red Hat Inc., through its JBoss division, makes available all content in this plug-in
+("Content"). Unless otherwise indicated below, the Content is provided to you
+under the terms and conditions of the Eclipse Public License Version 1.0
+("EPL"). A copy of the EPL is available at
+<A href="http://www.eclipse.org/org/documents/epl-v10.php">http://www.eclipse.org/org/documents/epl-v10.php</A>.
+For purposes of the EPL, "Program" will mean the Content.</P>
+
+<P>If you did not receive this Content directly from Red Hat Inc., the
+Content is being redistributed by another party ("Redistributor") and different
+terms and conditions may apply to your use of any object code in the Content.
+Check the Redistributor's license that was provided with the Content. If no such
+license exists, contact the Redistributor. Unless otherwise indicated below, the
+terms and conditions of the EPL still apply to any source code in the Content
+and such source code may be obtained at
+ <A href="http://www.jboss.org/tools">http://www.jboss.org/tools</A>.</P>
+
+</BODY>
+</HTML>
\ No newline at end of file
Added: trunk/trunk/jsf/plugins/org.jboss.tools.jsf.text.ext.richfaces/build.properties
===================================================================
--- trunk/trunk/jsf/plugins/org.jboss.tools.jsf.text.ext.richfaces/build.properties (rev 0)
+++ trunk/trunk/jsf/plugins/org.jboss.tools.jsf.text.ext.richfaces/build.properties 2008-10-17 13:17:39 UTC (rev 10922)
@@ -0,0 +1,8 @@
+bin.includes = META-INF/,\
+ plugin.xml,\
+ jsfextensions.jar,\
+ about.html,\
+ plugin.properties
+jars.compile.order = jsfextensions.jar
+source.jsfextensions.jar = src/
+output.jsfextensions.jar = bin/
Added: trunk/trunk/jsf/plugins/org.jboss.tools.jsf.text.ext.richfaces/plugin.properties
===================================================================
--- trunk/trunk/jsf/plugins/org.jboss.tools.jsf.text.ext.richfaces/plugin.properties (rev 0)
+++ trunk/trunk/jsf/plugins/org.jboss.tools.jsf.text.ext.richfaces/plugin.properties 2008-10-17 13:17:39 UTC (rev 10922)
@@ -0,0 +1 @@
+providerName=Red Hat, Inc.
Added: trunk/trunk/jsf/plugins/org.jboss.tools.jsf.text.ext.richfaces/plugin.xml
===================================================================
--- trunk/trunk/jsf/plugins/org.jboss.tools.jsf.text.ext.richfaces/plugin.xml (rev 0)
+++ trunk/trunk/jsf/plugins/org.jboss.tools.jsf.text.ext.richfaces/plugin.xml 2008-10-17 13:17:39 UTC (rev 10922)
@@ -0,0 +1,45 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.0"?>
+<plugin>
+
+ <extension
+ point="org.jboss.tools.common.text.ext.hyperlinkPartitioner"
+ id="org.jboss.tools.common.text.ext.jsf.richfaces.hyperlinkPartitioner"
+ name="org.jboss.tools.common.text.ext.jsf.richfaces.hyperlinkPartitioner">
+
+ <hyperlinkPartitioner
+ id="org.jboss.tools.common.text.ext.jsf.richfaces.hyperlink.jsp.JSPLinkHyperlinkPartitioner"
+ class="org.jboss.tools.common.text.ext.hyperlink.jsp.JSPLinkHyperlinkPartitioner">
+ <contentType id="org.eclipse.jst.jsp.core.jspsource">
+ <partitionType id="org.jboss.tools.common.text.ext.xml.XML_ATTRIBUTE_VALUE">
+ <axis path="*/[http://richfaces.org/a4j]:include/viewId/" />
+ <axis path="*/[http://richfaces.org/rich]:insert/src/" />
+ </partitionType>
+ </contentType>
+ <contentType id="org.eclipse.wst.html.core.htmlsource">
+ <partitionType id="org.jboss.tools.common.text.ext.xml.XML_ATTRIBUTE_VALUE">
+ <axis path="*/[http://richfaces.org/a4j]:include/viewId/" />
+ <axis path="*/[http://richfaces.org/rich]:insert/src/" />
+ </partitionType>
+ </contentType>
+ </hyperlinkPartitioner>
+
+ <hyperlinkPartitioner
+ id="org.jboss.tools.common.text.ext.jsf.richfaces.hyperlink.JSFJSPLinkHyperlinkPartitioner"
+ class="org.jboss.tools.jsf.text.ext.hyperlink.JSFJSPLinkHyperlinkPartitioner">
+ <contentType id="org.eclipse.jst.jsp.core.jspsource">
+ <partitionType id="org.jboss.tools.common.text.ext.jsp.JSP_LINK" >
+ <axis path="*/[http://richfaces.org/a4j]:include/viewId/" />
+ <axis path="*/[http://richfaces.org/rich]:insert/src/" />
+ </partitionType>
+ </contentType>
+ <contentType id="org.eclipse.wst.html.core.htmlsource">
+ <partitionType id="org.jboss.tools.common.text.ext.jsp.JSP_LINK" >
+ <axis path="*/[http://richfaces.org/a4j]:include/viewId/" />
+ <axis path="*/[http://richfaces.org/rich]:insert/src/" />
+ </partitionType>
+ </contentType>
+ </hyperlinkPartitioner>
+
+ </extension>
+</plugin>
Added: trunk/trunk/jsf/plugins/org.jboss.tools.jsf.text.ext.richfaces/src/org/jboss/tools/jsf/text/ext/richfaces/RichfacesExtensionsPlugin.java
===================================================================
--- trunk/trunk/jsf/plugins/org.jboss.tools.jsf.text.ext.richfaces/src/org/jboss/tools/jsf/text/ext/richfaces/RichfacesExtensionsPlugin.java (rev 0)
+++ trunk/trunk/jsf/plugins/org.jboss.tools.jsf.text.ext.richfaces/src/org/jboss/tools/jsf/text/ext/richfaces/RichfacesExtensionsPlugin.java 2008-10-17 13:17:39 UTC (rev 10922)
@@ -0,0 +1,107 @@
+/*******************************************************************************
+ * Copyright (c) 2007 Exadel, Inc. and Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Exadel, Inc. and Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.jsf.text.ext.richfaces;
+
+import java.util.MissingResourceException;
+import java.util.ResourceBundle;
+
+import org.eclipse.ui.plugin.*;
+import org.eclipse.core.resources.IWorkspace;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.osgi.framework.BundleContext;
+
+/**
+ * The main plugin class to be used in the desktop.
+ */
+public class RichfacesExtensionsPlugin extends AbstractUIPlugin {
+
+ //The shared instance.
+ private static RichfacesExtensionsPlugin plugin;
+ //Resource bundle.
+ private ResourceBundle resourceBundle;
+
+ public static final String PLUGIN_ID = "org.jboss.tools.jsf.text.ext.richfaces";
+
+
+ /**
+ * The constructor.
+ */
+ public RichfacesExtensionsPlugin() {
+ plugin = this;
+ try {
+ resourceBundle= ResourceBundle.getBundle("org.jboss.tools.jsf.text.ext.richfaces.RichfacesExtensionsPlugin");
+ } catch (MissingResourceException x) {
+ resourceBundle = null;
+ }
+ }
+
+ /**
+ * This method is called upon plug-in activation
+ */
+ public void start(BundleContext context) throws Exception {
+ super.start(context);
+ }
+
+ /**
+ * This method is called when the plug-in is stopped
+ */
+ public void stop(BundleContext context) throws Exception {
+ super.stop(context);
+ plugin = null;
+ }
+
+ /**
+ * Returns the shared instance.
+ */
+ public static RichfacesExtensionsPlugin getDefault() {
+ return plugin;
+ }
+
+ /**
+ * Returns an image descriptor for the image file at the given
+ * plug-in relative path.
+ *
+ * @param path the path
+ * @return the image descriptor
+ */
+ public static ImageDescriptor getImageDescriptor(String path) {
+ return AbstractUIPlugin.imageDescriptorFromPlugin("org.jboss.tools.jsf.text.ext.richfaces", path);
+ }
+
+ /**
+ * Returns the workspace instance.
+ */
+ public static IWorkspace getWorkspace() {
+ return ResourcesPlugin.getWorkspace();
+ }
+
+ /**
+ * Returns the string from the plugin's resource bundle,
+ * or 'key' if not found.
+ */
+ public static String getResourceString(String key) {
+ ResourceBundle bundle= RichfacesExtensionsPlugin.getDefault().getResourceBundle();
+ try {
+ return bundle.getString(key);
+ } catch (MissingResourceException e) {
+ return key;
+ }
+ }
+
+ /**
+ * Returns the plugin's resource bundle,
+ */
+ public ResourceBundle getResourceBundle() {
+ return resourceBundle;
+ }
+
+}
17 years, 2 months
JBoss Tools SVN: r10921 - in trunk: trunk and 2 other directories.
by jbosstools-commits@lists.jboss.org
Author: vrubezhny
Date: 2008-10-17 09:15:59 -0400 (Fri, 17 Oct 2008)
New Revision: 10921
Added:
trunk/trunk/
trunk/trunk/jsf/
trunk/trunk/jsf/plugins/
trunk/trunk/jsf/plugins/org.jboss.tools.jsf.text.ext.richfaces/
Log:
Share project 'org.jboss.tools.jsf.text.ext.richfaces' into 'https://svn.jboss.org/repos/jbosstools/trunk'
JBIDE-1898 OpenOns for attributes of richfaces tags
JBIDE-2406 openon doesn't work for "viewId" attribute of <a4j:include> component.
17 years, 2 months
JBoss Tools SVN: r10920 - in trunk/hibernatetools/plugins/org.jboss.tools.hibernate.xml: resources/meta and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2008-10-17 09:14:43 -0400 (Fri, 17 Oct 2008)
New Revision: 10920
Added:
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.xml/src/org/jboss/tools/hibernate/xml/model/impl/HibConfigListenerImpl.java
Modified:
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.xml/plugin.xml
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.xml/resources/meta/hibconfig3.meta
Log:
JBIDE-2778
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.xml/plugin.xml
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.xml/plugin.xml 2008-10-17 12:50:52 UTC (rev 10919)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.xml/plugin.xml 2008-10-17 13:14:43 UTC (rev 10920)
@@ -65,6 +65,8 @@
class="org.jboss.tools.hibernate.xml.model.impl.HibConfigCacheImpl"/>
<xclass id="org.jboss.tools.hibernate.xml.model.impl.HibConfigMappingImpl"
class="org.jboss.tools.hibernate.xml.model.impl.HibConfigMappingImpl"/>
+ <xclass id="org.jboss.tools.hibernate.xml.model.impl.HibConfigListenerImpl"
+ class="org.jboss.tools.hibernate.xml.model.impl.HibConfigListenerImpl"/>
<xclass id="org.jboss.tools.hibernate.xml.model.impl.HibernateAuxFolderImpl"
class="org.jboss.tools.hibernate.xml.model.impl.HibernateAuxFolderImpl"/>
<xclass id="org.jboss.tools.hibernate.xml.model.impl.HibernateClassImpl"
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.xml/resources/meta/hibconfig3.meta
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.xml/resources/meta/hibconfig3.meta 2008-10-17 12:50:52 UTC (rev 10919)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.xml/resources/meta/hibconfig3.meta 2008-10-17 13:14:43 UTC (rev 10920)
@@ -658,7 +658,7 @@
</XActionItem>
<XDependencies/>
</XModelEntity>
- <XModelEntity ImplementingClass="%Regular2%" XMLSUBPATH="listener" name="HibConfig3Listener">
+ <XModelEntity ImplementingClass="org.jboss.tools.hibernate.xml.model.impl.HibConfigListenerImpl" XMLSUBPATH="listener" name="HibConfig3Listener">
<XChildrenEntities/>
<XEntityRenderer>
<ICONS>
Added: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.xml/src/org/jboss/tools/hibernate/xml/model/impl/HibConfigListenerImpl.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.xml/src/org/jboss/tools/hibernate/xml/model/impl/HibConfigListenerImpl.java (rev 0)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.xml/src/org/jboss/tools/hibernate/xml/model/impl/HibConfigListenerImpl.java 2008-10-17 13:14:43 UTC (rev 10920)
@@ -0,0 +1,18 @@
+package org.jboss.tools.hibernate.xml.model.impl;
+
+public class HibConfigListenerImpl extends RegularObject2Impl {
+
+ private static final long serialVersionUID = 1L;
+
+ public HibConfigListenerImpl() {}
+
+ public String getPathPart() {
+ String pp = super.getPathPart();
+ String type = getAttributeValue("type");
+ if(type != null && type.length() > 0) {
+ pp += ":" + type;
+ }
+ return pp;
+ }
+
+}
17 years, 2 months
JBoss Tools SVN: r10919 - in trunk/seam/plugins/org.jboss.tools.seam.xml: schemas and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2008-10-17 08:50:52 -0400 (Fri, 17 Oct 2008)
New Revision: 10919
Added:
trunk/seam/plugins/org.jboss.tools.seam.xml/schemas/pdf-2.1.xsd
Modified:
trunk/seam/plugins/org.jboss.tools.seam.xml/resources/meta/seam-components.meta
trunk/seam/plugins/org.jboss.tools.seam.xml/resources/meta/seam-core.meta
trunk/seam/plugins/org.jboss.tools.seam.xml/resources/meta/seam-framework.meta
trunk/seam/plugins/org.jboss.tools.seam.xml/resources/meta/seam-remoting.meta
trunk/seam/plugins/org.jboss.tools.seam.xml/resources/meta/seam-security.meta
trunk/seam/plugins/org.jboss.tools.seam.xml/resources/meta/seam-web.meta
trunk/seam/plugins/org.jboss.tools.seam.xml/resources/meta/seam-wicket.meta
Log:
JBIDE-2855
Modified: trunk/seam/plugins/org.jboss.tools.seam.xml/resources/meta/seam-components.meta
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.xml/resources/meta/seam-components.meta 2008-10-17 12:22:09 UTC (rev 10918)
+++ trunk/seam/plugins/org.jboss.tools.seam.xml/resources/meta/seam-components.meta 2008-10-17 12:50:52 UTC (rev 10919)
@@ -451,8 +451,8 @@
<XModelAttribute PROPERTIES="id=true;category=general"
name="component-name" xmlname="name"/>
<XModelAttributeReference
- attributes="class,scope,precedence,installed,auto-create,jndi-name,startup"
- entity="SeamComponent20" name="component"/>
+ attributes="class,scope,precedence,installed,auto-create,jndi-name,startup,startupDepends"
+ entity="SeamComponent21" name="component"/>
<XModelAttribute default="xml" name="extension" xmlname="EXTENSION">
<Editor name="Uneditable"/>
</XModelAttribute>
@@ -1062,7 +1062,7 @@
PROPERTIES="formFactory=%Default%;formLayout=org.jboss.tools.seam.xml.ui.editor.form.SeamXMLFormLayoutData"
XMLSUBPATH="components" name="FileSeamComponents21">
<XChildrenEntities>
- <XChildEntity name="SeamComponent20"/>
+ <XChildEntity name="SeamComponent21"/>
<XChildEntity name="SeamFactory20"/>
<XChildEntity name="SeamEvent20"/>
<XChildEntity name="SeamImport"/>
@@ -1123,7 +1123,7 @@
ICON="action.new.struts.webapp.res_ref"
PROPERTIES="validator.add=true" WizardClassName="%Default%"
displayName="Component..." kind="action" name="AddComponent">
- <EntityData EntityName="SeamComponent20">
+ <EntityData EntityName="SeamComponent21">
<AttributeData AttributeName="name"/>
<AttributeData AttributeName="class" Mandatory="no"/>
</EntityData>
@@ -1493,26 +1493,73 @@
kind="action" name="AddAnyProperty"/>
</XActionItem>
<XActionItem ICON="action.empty" displayName="Create" kind="list" name="EditActions"/>
- <XActionItem ICON="action.copy" displayName="Copy" kind="list" name="CopyActions">
- <XActionItem BaseActionName="Copy" HandlerClassName="%Copy%"
- ICON="action.copy" displayName="Copy" kind="action" name="Copy"/>
- <XActionItem BaseActionName="Cut" HandlerClassName="%Cut%"
- ICON="action.cut" displayName="Cut" kind="action" name="Cut"/>
- <XActionItem BaseActionName="Paste" HandlerClassName="%Paste%"
- ICON="action.paste" displayName="Paste" kind="action" name="Paste"/>
+ <XActionItemReference entity="SeamComponent" name="CopyActions" path="CopyActions"/>
+ <XActionItemReference entity="SeamComponent" name="DeleteActions" path="DeleteActions"/>
+ <XActionItemReference entity="SeamComponent" name="Properties" path="Properties"/>
+ <XActionItemReference entity="SeamComponent" name="MoveActions" path="MoveActions"/>
+ </XActionItem>
+ <XDependencies/>
+ </XModelEntity>
+ <XModelEntity ImplementingClass="%Custom%"
+ PROPERTIES="formFactory=%Default%;formLayout=org.jboss.tools.seam.xml.ui.editor.form.SeamXMLFormLayoutData;children=%Ordered%"
+ XMLSUBPATH="component" name="SeamComponent21">
+ <XChildrenEntities>
+ <XChildEntity name="SeamProperty"/>
+ <XChildEntity name="SeamPropertyList"/>
+ <XChildEntity name="SeamPropertyMap"/>
+ </XChildrenEntities>
+ <XEntityRenderer>
+ <ICONS>
+ <ICON info="main.seam.component" type="main"/>
+ </ICONS>
+ </XEntityRenderer>
+ <XModelAttributes>
+ <XModelAttribute default="component" loader="ElementType" name="element type">
+ <Editor name="Uneditable"/>
+ </XModelAttribute>
+ <XModelAttributeReference
+ attributes="name,class,scope,precedence,installed,auto-create,startup"
+ entity="SeamComponent20" name="component"/>
+ <XModelAttribute PROPERTIES="category=advanced" name="startupDepends" xmlname="startupDepends"/>
+ <XModelAttribute PROPERTIES="category=advanced" name="jndi-name" xmlname="jndi-name"/>
+ <XModelAttribute TRIM="no" name="comment" visibility="false" xmlname="#comment">
+ <Editor name="Note"/>
+ </XModelAttribute>
+ </XModelAttributes>
+ <XActionItem kind="list">
+ <XActionItem kind="list" name="CreateActions">
+ <XActionItem HandlerClassName="%Create%" ICON="action.empty"
+ PROPERTIES="validator.add=true" WizardClassName="%Default%"
+ displayName="Add Simple Property..." kind="action" name="AddProperty">
+ <EntityData EntityName="SeamProperty">
+ <AttributeData AttributeName="name"/>
+ <AttributeData AttributeName="value" Mandatory="no"/>
+ </EntityData>
+ </XActionItem>
+ <XActionItem HandlerClassName="%Create%" ICON="action.empty"
+ PROPERTIES="validator.add=true" WizardClassName="%Default%"
+ displayName="Add List Property..." kind="action" name="AddListProperty">
+ <EntityData EntityName="SeamPropertyList">
+ <AttributeData AttributeName="name"/>
+ </EntityData>
+ </XActionItem>
+ <XActionItem HandlerClassName="%Create%" ICON="action.empty"
+ PROPERTIES="validator.add=true" WizardClassName="%Default%"
+ displayName="Add Map Property..." kind="action" name="AddMapProperty">
+ <EntityData EntityName="SeamPropertyMap">
+ <AttributeData AttributeName="name"/>
+ </EntityData>
+ </XActionItem>
+ <XActionItem HIDE="always"
+ HandlerClassName="org.jboss.tools.common.meta.action.impl.handlers.ShowMenuHandler"
+ PROPERTIES="actionList=CreateActions" displayName="Property..."
+ kind="action" name="AddAnyProperty"/>
</XActionItem>
- <XActionItem ICON="action.delete" displayName="Delete" kind="list" name="DeleteActions">
- <XActionItem BaseActionName="Delete" HandlerClassName="%Delete%"
- ICON="action.delete" displayName="Delete" kind="action" name="Delete"/>
- </XActionItem>
- <XActionItem ICON="action.empty" kind="list" name="Properties">
- <XActionItem HandlerClassName="%Properties%" ICON="action.empty"
- displayName="Properties..." kind="action" name="Properties"/>
- </XActionItem>
- <XActionItem displayName="move" kind="list" name="MoveActions">
- <XActionItem HIDE="always" HandlerClassName="%Move%"
- ICON="action.move" displayName="Move" kind="action" name="Move"/>
- </XActionItem>
+ <XActionItem ICON="action.empty" displayName="Create" kind="list" name="EditActions"/>
+ <XActionItemReference entity="SeamComponent" name="CopyActions" path="CopyActions"/>
+ <XActionItemReference entity="SeamComponent" name="DeleteActions" path="DeleteActions"/>
+ <XActionItemReference entity="SeamComponent" name="Properties" path="Properties"/>
+ <XActionItemReference entity="SeamComponent" name="MoveActions" path="MoveActions"/>
</XActionItem>
<XDependencies/>
</XModelEntity>
Modified: trunk/seam/plugins/org.jboss.tools.seam.xml/resources/meta/seam-core.meta
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.xml/resources/meta/seam-core.meta 2008-10-17 12:22:09 UTC (rev 10918)
+++ trunk/seam/plugins/org.jboss.tools.seam.xml/resources/meta/seam-core.meta 2008-10-17 12:50:52 UTC (rev 10919)
@@ -763,8 +763,8 @@
<XModelAttribute PROPERTIES="id=true;category=general"
default="org.jboss.seam.core.init" name="name" xmlname="name"/>
<XModelAttributeReference
- attributes="class,scope,precedence,installed,auto-create,startup"
- entity="SeamComponent20" name="component"/>
+ attributes="class,scope,precedence,installed,auto-create,startup,startupDepends"
+ entity="SeamComponent21" name="component"/>
<XModelAttributeReference
attributes="debug,jndi-pattern,transaction-management-enabled,user-transaction-name"
entity="SeamCoreInit20" name="init"/>
@@ -1044,8 +1044,8 @@
<XModelAttribute PROPERTIES="id=true;category=general"
default="org.jboss.seam.core.manager" name="name" xmlname="name"/>
<XModelAttributeReference
- attributes="class,scope,precedence,installed,auto-create"
- entity="SeamComponent" name="component"/>
+ attributes="class,scope,precedence,installed,auto-create,startup,startupDepends"
+ entity="SeamComponent21" name="component"/>
<XModelAttributeReference
attributes="conversation-timeout,concurrent-request-timeout,conversation-id-parameter,parent-conversation-id-parameter"
entity="SeamCoreManager" name="manager"/>
Modified: trunk/seam/plugins/org.jboss.tools.seam.xml/resources/meta/seam-framework.meta
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.xml/resources/meta/seam-framework.meta 2008-10-17 12:22:09 UTC (rev 10918)
+++ trunk/seam/plugins/org.jboss.tools.seam.xml/resources/meta/seam-framework.meta 2008-10-17 12:50:52 UTC (rev 10919)
@@ -205,8 +205,8 @@
<Editor name="Uneditable"/>
</XModelAttribute>
<XModelAttributeReference
- attributes="name,class,scope,precedence,installed,auto-create"
- entity="SeamComponent" name="component"/>
+ attributes="name,class,scope,precedence,installed,auto-create,startup,startupDepends"
+ entity="SeamComponent21" name="component"/>
<XModelAttribute PROPERTIES="category=general" name="ejbql" xmlname="ejbql"/>
<XModelAttribute PROPERTIES="category=advanced" name="order" xmlname="order"/>
<XModelAttribute PROPERTIES="category=advanced" name="max-results" xmlname="max-results">
@@ -399,8 +399,8 @@
<Editor name="Uneditable"/>
</XModelAttribute>
<XModelAttributeReference
- attributes="name,class,scope,precedence,installed,auto-create"
- entity="SeamComponent" name="component"/>
+ attributes="name,class,scope,precedence,installed,auto-create,startup,startupDepends"
+ entity="SeamComponent21" name="component"/>
<XModelAttribute PROPERTIES="category=general" name="ejbql" xmlname="ejbql"/>
<XModelAttribute PROPERTIES="category=advanced" name="order" xmlname="order"/>
<XModelAttribute PROPERTIES="category=advanced" name="max-results" xmlname="max-results"/>
Modified: trunk/seam/plugins/org.jboss.tools.seam.xml/resources/meta/seam-remoting.meta
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.xml/resources/meta/seam-remoting.meta 2008-10-17 12:22:09 UTC (rev 10918)
+++ trunk/seam/plugins/org.jboss.tools.seam.xml/resources/meta/seam-remoting.meta 2008-10-17 12:50:52 UTC (rev 10919)
@@ -45,8 +45,8 @@
<XModelAttribute PROPERTIES="id=true;category=general"
default="org.jboss.seam.remoting.remoting" name="name" xmlname="name"/>
<XModelAttributeReference
- attributes="class,scope,precedence,installed,auto-create,startup"
- entity="SeamComponent20" name="component"/>
+ attributes="class,scope,precedence,installed,auto-create,startup,startupDepends"
+ entity="SeamComponent21" name="component"/>
<XModelAttributeReference
attributes="poll-interval,poll-timeout,debug"
entity="SeamRemotingConfig20" name="remoting"/>
Modified: trunk/seam/plugins/org.jboss.tools.seam.xml/resources/meta/seam-security.meta
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.xml/resources/meta/seam-security.meta 2008-10-17 12:22:09 UTC (rev 10918)
+++ trunk/seam/plugins/org.jboss.tools.seam.xml/resources/meta/seam-security.meta 2008-10-17 12:50:52 UTC (rev 10919)
@@ -11,6 +11,7 @@
<MAPPING name="SeamSchemas">
<PAIR name="security" value="http://jboss.com/products/seam/security-1.2.xsd"/>
<PAIR name="security$20" value="http://jboss.com/products/seam/security-2.0.xsd"/>
+ <PAIR name="security$21" value="http://jboss.com/products/seam/security-2.1.xsd"/>
</MAPPING>
</MAPPINGS>
<ICONS>
@@ -96,7 +97,7 @@
<XModelAttribute PROPERTIES="category=general"
name="authenticate-method" xmlname="authenticate-method"/>
<XModelAttribute PROPERTIES="category=advanced" name="remember-me" xmlname="remember-me">
- <Constraint loader="List">
+ <Constraint loader="%ListEL%">
<value/>
<value name="true"/>
<value name="false"/>
@@ -178,27 +179,363 @@
<XActionItem kind="list">
<XActionItem kind="list" name="CreateActions"/>
<XActionItem ICON="action.empty" displayName="Create" kind="list" name="EditActions"/>
- <XActionItem ICON="action.copy" displayName="Copy" kind="list" name="CopyActions">
- <XActionItem BaseActionName="Copy" HandlerClassName="%Copy%"
- ICON="action.copy" displayName="Copy" kind="action" name="Copy"/>
- <XActionItem BaseActionName="Cut" HandlerClassName="%Cut%"
- ICON="action.cut" displayName="Cut" kind="action" name="Cut"/>
- </XActionItem>
- <XActionItem ICON="action.delete" displayName="Delete" kind="list" name="DeleteActions">
- <XActionItem BaseActionName="Delete" HandlerClassName="%Delete%"
- ICON="action.delete" displayName="Delete" kind="action" name="Delete"/>
- </XActionItem>
- <XActionItem ICON="action.empty" kind="list" name="Properties">
- <XActionItem HandlerClassName="%Properties%" ICON="action.empty"
- displayName="Properties..." kind="action" name="Properties"/>
- </XActionItem>
- <XActionItem displayName="move" kind="list" name="MoveActions">
- <XActionItem HIDE="always" HandlerClassName="%Move%"
- ICON="action.move" displayName="Move" kind="action" name="Move"/>
- </XActionItem>
+ <XActionItemReference entity="SeamSecurityIdentity"
+ name="CopyActions" path="CopyActions"/>
+ <XActionItemReference entity="SeamSecurityIdentity"
+ name="DeleteActions" path="DeleteActions"/>
+ <XActionItemReference entity="SeamSecurityIdentity" name="Properties" path="Properties"/>
+ <XActionItemReference entity="SeamSecurityIdentity"
+ name="MoveActions" path="MoveActions"/>
</XActionItem>
<XDependencies/>
</XModelEntity>
+ <XModelEntity ImplementingClass="%Custom%"
+ PROPERTIES="formFactory=%Default%;formLayout=org.jboss.tools.seam.xml.ui.editor.form.core.SeamComponentsCoreFormLayoutData"
+ XMLSUBPATH="security:identity" name="SeamSecurityIdentity21">
+ <XChildrenEntities/>
+ <XEntityRenderer>
+ <ICONS>
+ <ICON info="main.seam.security.identity" type="main"/>
+ </ICONS>
+ </XEntityRenderer>
+ <XModelAttributes>
+ <XModelAttribute default="identity" loader="ElementType" name="element type">
+ <Editor name="Uneditable"/>
+ </XModelAttribute>
+ <XModelAttribute PROPERTIES="id=true;category=general"
+ default="org.jboss.seam.security.identity" name="name" xmlname="name"/>
+ <XModelAttributeReference
+ attributes="class,scope,precedence,installed,auto-create,startup,startupDepends"
+ entity="SeamComponent21" name="component"/>
+ <XModelAttributeReference
+ attributes="authenticate-method,remember-me,jaas-config-name"
+ entity="SeamSecurityIdentity" name="sequrity"/>
+ <XModelAttribute TRIM="no" name="comment" visibility="false" xmlname="#comment">
+ <Editor name="Note"/>
+ </XModelAttribute>
+ </XModelAttributes>
+ <XActionItem kind="list">
+ <XActionItem kind="list" name="CreateActions"/>
+ <XActionItem ICON="action.empty" displayName="Create" kind="list" name="EditActions"/>
+ <XActionItemReference entity="SeamSecurityIdentity"
+ name="CopyActions" path="CopyActions"/>
+ <XActionItemReference entity="SeamSecurityIdentity"
+ name="DeleteActions" path="DeleteActions"/>
+ <XActionItemReference entity="SeamSecurityIdentity" name="Properties" path="Properties"/>
+ <XActionItemReference entity="SeamSecurityIdentity"
+ name="MoveActions" path="MoveActions"/>
+ </XActionItem>
+ <XDependencies/>
+ </XModelEntity>
+ <XModelEntity ImplementingClass="%Custom%"
+ PROPERTIES="formFactory=%Default%;formLayout=org.jboss.tools.seam.xml.ui.editor.form.core.SeamComponentsCoreFormLayoutData"
+ XMLSUBPATH="security:identity-manager" name="SeamSecurityIdentityManager21">
+ <XChildrenEntities/>
+ <XEntityRenderer>
+ <ICONS>
+ <ICON info="main.seam.security.identity" type="main"/>
+ </ICONS>
+ </XEntityRenderer>
+ <XModelAttributes>
+ <XModelAttribute default="identity-manager" loader="ElementType" name="element type">
+ <Editor name="Uneditable"/>
+ </XModelAttribute>
+ <XModelAttribute PROPERTIES="id=true;category=general"
+ default="org.jboss.seam.security.identityManager" name="name" xmlname="name"/>
+ <XModelAttributeReference
+ attributes="class,scope,precedence,installed,auto-create,startup,startupDepends"
+ entity="SeamComponent21" name="component"/>
+ <XModelAttribute PROPERTIES="category=general" name="identity-store" xmlname="identity-store"/>
+ <XModelAttribute PROPERTIES="category=general"
+ name="role-identity-store" xmlname="role-identity-store"/>
+ <XModelAttribute TRIM="no" name="comment" visibility="false" xmlname="#comment">
+ <Editor name="Note"/>
+ </XModelAttribute>
+ </XModelAttributes>
+ <XActionItem kind="list">
+ <XActionItem kind="list" name="CreateActions"/>
+ <XActionItem ICON="action.empty" displayName="Create" kind="list" name="EditActions"/>
+ <XActionItemReference entity="SeamSecurityIdentity"
+ name="CopyActions" path="CopyActions"/>
+ <XActionItemReference entity="SeamSecurityIdentity"
+ name="DeleteActions" path="DeleteActions"/>
+ <XActionItemReference entity="SeamSecurityIdentity" name="Properties" path="Properties"/>
+ <XActionItemReference entity="SeamSecurityIdentity"
+ name="MoveActions" path="MoveActions"/>
+ </XActionItem>
+ <XDependencies/>
+ </XModelEntity>
+ <XModelEntity ImplementingClass="%Custom%"
+ PROPERTIES="formFactory=%Default%;formLayout=org.jboss.tools.seam.xml.ui.editor.form.core.SeamComponentsCoreFormLayoutData"
+ XMLSUBPATH="security:jpa-identity-store" name="SeamSecurityJPAIdentityStore21">
+ <XChildrenEntities/>
+ <XEntityRenderer>
+ <ICONS>
+ <ICON info="main.seam.security.identity" type="main"/>
+ </ICONS>
+ </XEntityRenderer>
+ <XModelAttributes>
+ <XModelAttribute default="jpa-identity-store" loader="ElementType" name="element type">
+ <Editor name="Uneditable"/>
+ </XModelAttribute>
+ <XModelAttribute PROPERTIES="id=true;category=general"
+ default="org.jboss.seam.security.jpaIdentityStore" name="name" xmlname="name"/>
+ <XModelAttributeReference
+ attributes="class,scope,precedence,installed,auto-create,startup,startupDepends"
+ entity="SeamComponent21" name="component"/>
+ <XModelAttribute PROPERTIES="category=general" name="entity-manager" xmlname="entity-manager"/>
+ <XModelAttribute PROPERTIES="category=general;save=always"
+ name="user-class" xmlname="user-class"/>
+ <XModelAttribute PROPERTIES="category=advanced" name="role-class" xmlname="role-class"/>
+ <XModelAttribute PROPERTIES="category=advanced" name="features" xmlname="features"/>
+ <XModelAttribute TRIM="no" name="comment" visibility="false" xmlname="#comment">
+ <Editor name="Note"/>
+ </XModelAttribute>
+ </XModelAttributes>
+ <XActionItem kind="list">
+ <XActionItem kind="list" name="CreateActions"/>
+ <XActionItem ICON="action.empty" displayName="Create" kind="list" name="EditActions"/>
+ <XActionItemReference entity="SeamSecurityIdentity"
+ name="CopyActions" path="CopyActions"/>
+ <XActionItemReference entity="SeamSecurityIdentity"
+ name="DeleteActions" path="DeleteActions"/>
+ <XActionItemReference entity="SeamSecurityIdentity" name="Properties" path="Properties"/>
+ <XActionItemReference entity="SeamSecurityIdentity"
+ name="MoveActions" path="MoveActions"/>
+ </XActionItem>
+ <XDependencies/>
+ </XModelEntity>
+ <XModelEntity ImplementingClass="%Custom%"
+ PROPERTIES="formFactory=%Default%;formLayout=org.jboss.tools.seam.xml.ui.editor.form.core.SeamComponentsCoreFormLayoutData"
+ XMLSUBPATH="security:jpa-permission-store" name="SeamSecurityJPAPermissionStore21">
+ <XChildrenEntities/>
+ <XEntityRenderer>
+ <ICONS>
+ <ICON info="main.seam.security.identity" type="main"/>
+ </ICONS>
+ </XEntityRenderer>
+ <XModelAttributes>
+ <XModelAttribute default="jpa-permission-store" loader="ElementType" name="element type">
+ <Editor name="Uneditable"/>
+ </XModelAttribute>
+ <XModelAttribute PROPERTIES="id=true;category=general"
+ default="org.jboss.seam.security.jpaPermissionStore" name="name" xmlname="name"/>
+ <XModelAttributeReference
+ attributes="class,scope,precedence,installed,auto-create,startup,startupDepends"
+ entity="SeamComponent21" name="component"/>
+ <XModelAttribute PROPERTIES="category=general" name="entity-manager" xmlname="entity-manager"/>
+ <XModelAttribute PROPERTIES="category=general;save=always"
+ name="user-permission-class" xmlname="user-permission-class"/>
+ <XModelAttribute PROPERTIES="category=advanced"
+ name="role-permission-class" xmlname="role-permission-class"/>
+ <XModelAttribute PROPERTIES="category=advanced" name="features" xmlname="features"/>
+ <XModelAttribute TRIM="no" name="comment" visibility="false" xmlname="#comment">
+ <Editor name="Note"/>
+ </XModelAttribute>
+ </XModelAttributes>
+ <XActionItem kind="list">
+ <XActionItem kind="list" name="CreateActions"/>
+ <XActionItem ICON="action.empty" displayName="Create" kind="list" name="EditActions"/>
+ <XActionItemReference entity="SeamSecurityIdentity"
+ name="CopyActions" path="CopyActions"/>
+ <XActionItemReference entity="SeamSecurityIdentity"
+ name="DeleteActions" path="DeleteActions"/>
+ <XActionItemReference entity="SeamSecurityIdentity" name="Properties" path="Properties"/>
+ <XActionItemReference entity="SeamSecurityIdentity"
+ name="MoveActions" path="MoveActions"/>
+ </XActionItem>
+ <XDependencies/>
+ </XModelEntity>
+ <XModelEntity ImplementingClass="%Custom%"
+ PROPERTIES="formFactory=%Default%;formLayout=org.jboss.tools.seam.xml.ui.editor.form.core.SeamComponentsCoreFormLayoutData"
+ XMLSUBPATH="security:ldap-identity-store" name="SeamSecurityLDAPIdentityStore21">
+ <XChildrenEntities/>
+ <XEntityRenderer>
+ <ICONS>
+ <ICON info="main.seam.security.identity" type="main"/>
+ </ICONS>
+ </XEntityRenderer>
+ <XModelAttributes>
+ <XModelAttribute default="ldap-identity-store" loader="ElementType" name="element type">
+ <Editor name="Uneditable"/>
+ </XModelAttribute>
+ <XModelAttribute PROPERTIES="id=true;category=general"
+ default="org.jboss.seam.security.ldapIdentityStore" name="name" xmlname="name"/>
+ <XModelAttributeReference
+ attributes="class,scope,precedence,installed,auto-create,startup,startupDepends"
+ entity="SeamComponent21" name="component"/>
+ <XModelAttribute PROPERTIES="category=general" name="server-address" xmlname="server-address"/>
+ <XModelAttribute PROPERTIES="category=general" name="server-port" xmlname="server-port"/>
+ <XModelAttribute PROPERTIES="category=advanced" name="bind-DN" xmlname="bind-DN"/>
+ <XModelAttribute PROPERTIES="category=advanced"
+ name="bind-credentials" xmlname="bind-credentials"/>
+ <XModelAttribute PROPERTIES="category=advanced" name="user-DN-prefix" xmlname="user-DN-prefix"/>
+ <XModelAttribute PROPERTIES="category=advanced" name="user-DN-suffix" xmlname="user-DN-suffix"/>
+ <XModelAttribute PROPERTIES="category=advanced" name="role-DN-prefix" xmlname="role-DN-prefix"/>
+ <XModelAttribute PROPERTIES="category=advanced" name="role-DN-suffix" xmlname="role-DN-suffix"/>
+ <XModelAttribute PROPERTIES="category=advanced"
+ name="user-context-DN" xmlname="user-context-DN"/>
+ <XModelAttribute PROPERTIES="category=advanced"
+ name="role-context-DN" xmlname="role-context-DN"/>
+ <XModelAttribute PROPERTIES="category=advanced"
+ name="user-role-attribute" xmlname="user-role-attribute"/>
+ <XModelAttribute PROPERTIES="category=advanced"
+ name="user-name-attribute" xmlname="user-name-attribute"/>
+ <XModelAttribute PROPERTIES="category=advanced"
+ name="role-name-attribute" xmlname="role-name-attribute"/>
+ <XModelAttribute PROPERTIES="category=advanced"
+ name="role-attribute-is-DN" xmlname="role-attribute-is-DN">
+ <Constraint loader="%ListEL%">
+ <value/>
+ <value name="true"/>
+ <value name="false"/>
+ </Constraint>
+ <Editor name="ListString"/>
+ </XModelAttribute>
+ <XModelAttribute PROPERTIES="category=advanced"
+ name="user-object-classes" xmlname="user-object-classes"/>
+ <XModelAttribute PROPERTIES="category=advanced"
+ name="role-object-classes" xmlname="role-object-classes"/>
+ <XModelAttribute PROPERTIES="category=advanced"
+ name="enabled-attribute" xmlname="enabled-attribute"/>
+ <XModelAttribute PROPERTIES="category=advanced" name="search-scope" xmlname="search-scope"/>
+ <XModelAttribute PROPERTIES="category=advanced"
+ name="first-name-attribute" xmlname="first-name-attribute"/>
+ <XModelAttribute PROPERTIES="category=advanced"
+ name="last-name-attribute" xmlname="first-name-attribute"/>
+ <XModelAttribute PROPERTIES="category=advanced"
+ name="user-password-attribute" xmlname="user-password-attribute"/>
+ <XModelAttribute TRIM="no" name="comment" visibility="false" xmlname="#comment">
+ <Editor name="Note"/>
+ </XModelAttribute>
+ </XModelAttributes>
+ <XActionItem kind="list">
+ <XActionItem kind="list" name="CreateActions"/>
+ <XActionItem ICON="action.empty" displayName="Create" kind="list" name="EditActions"/>
+ <XActionItemReference entity="SeamSecurityIdentity"
+ name="CopyActions" path="CopyActions"/>
+ <XActionItemReference entity="SeamSecurityIdentity"
+ name="DeleteActions" path="DeleteActions"/>
+ <XActionItemReference entity="SeamSecurityIdentity" name="Properties" path="Properties"/>
+ <XActionItemReference entity="SeamSecurityIdentity"
+ name="MoveActions" path="MoveActions"/>
+ </XActionItem>
+ <XDependencies/>
+ </XModelEntity>
+ <XModelEntity ImplementingClass="%Custom%"
+ PROPERTIES="formFactory=%Default%;formLayout=org.jboss.tools.seam.xml.ui.editor.form.core.SeamComponentsCoreFormLayoutData"
+ XMLSUBPATH="security:permission-manager" name="SeamSecurityPermissionManager21">
+ <XChildrenEntities/>
+ <XEntityRenderer>
+ <ICONS>
+ <ICON info="main.seam.security.identity" type="main"/>
+ </ICONS>
+ </XEntityRenderer>
+ <XModelAttributes>
+ <XModelAttribute default="permission-manager" loader="ElementType" name="element type">
+ <Editor name="Uneditable"/>
+ </XModelAttribute>
+ <XModelAttribute PROPERTIES="id=true;category=general"
+ default="org.jboss.seam.security.permissionManager" name="name" xmlname="name"/>
+ <XModelAttributeReference
+ attributes="class,scope,precedence,installed,auto-create,startup,startupDepends"
+ entity="SeamComponent21" name="component"/>
+ <XModelAttribute PROPERTIES="category=general"
+ name="permission-store" xmlname="permission-store"/>
+ <XModelAttribute TRIM="no" name="comment" visibility="false" xmlname="#comment">
+ <Editor name="Note"/>
+ </XModelAttribute>
+ </XModelAttributes>
+ <XActionItem kind="list">
+ <XActionItem kind="list" name="CreateActions"/>
+ <XActionItem ICON="action.empty" displayName="Create" kind="list" name="EditActions"/>
+ <XActionItemReference entity="SeamSecurityIdentity"
+ name="CopyActions" path="CopyActions"/>
+ <XActionItemReference entity="SeamSecurityIdentity"
+ name="DeleteActions" path="DeleteActions"/>
+ <XActionItemReference entity="SeamSecurityIdentity" name="Properties" path="Properties"/>
+ <XActionItemReference entity="SeamSecurityIdentity"
+ name="MoveActions" path="MoveActions"/>
+ </XActionItem>
+ <XDependencies/>
+ </XModelEntity>
+ <XModelEntity ImplementingClass="%Custom%"
+ PROPERTIES="formFactory=%Default%;formLayout=org.jboss.tools.seam.xml.ui.editor.form.core.SeamComponentsCoreFormLayoutData"
+ XMLSUBPATH="security:persistent-permission-resolver" name="SeamSecurityPersistentPermissionResolver21">
+ <XChildrenEntities/>
+ <XEntityRenderer>
+ <ICONS>
+ <ICON info="main.seam.security.identity" type="main"/>
+ </ICONS>
+ </XEntityRenderer>
+ <XModelAttributes>
+ <XModelAttribute default="persistent-permission-resolver"
+ loader="ElementType" name="element type">
+ <Editor name="Uneditable"/>
+ </XModelAttribute>
+ <XModelAttribute PROPERTIES="id=true;category=general"
+ default="org.jboss.seam.security.persistentPermissionResolver"
+ name="name" xmlname="name"/>
+ <XModelAttributeReference
+ attributes="class,scope,precedence,installed,auto-create,startup,startupDepends"
+ entity="SeamComponent21" name="component"/>
+ <XModelAttribute PROPERTIES="category=general"
+ name="permission-store" xmlname="permission-store"/>
+ <XModelAttribute TRIM="no" name="comment" visibility="false" xmlname="#comment">
+ <Editor name="Note"/>
+ </XModelAttribute>
+ </XModelAttributes>
+ <XActionItem kind="list">
+ <XActionItem kind="list" name="CreateActions"/>
+ <XActionItem ICON="action.empty" displayName="Create" kind="list" name="EditActions"/>
+ <XActionItemReference entity="SeamSecurityIdentity"
+ name="CopyActions" path="CopyActions"/>
+ <XActionItemReference entity="SeamSecurityIdentity"
+ name="DeleteActions" path="DeleteActions"/>
+ <XActionItemReference entity="SeamSecurityIdentity" name="Properties" path="Properties"/>
+ <XActionItemReference entity="SeamSecurityIdentity"
+ name="MoveActions" path="MoveActions"/>
+ </XActionItem>
+ <XDependencies/>
+ </XModelEntity>
+ <XModelEntity ImplementingClass="%Custom%"
+ PROPERTIES="formFactory=%Default%;formLayout=org.jboss.tools.seam.xml.ui.editor.form.core.SeamComponentsCoreFormLayoutData"
+ XMLSUBPATH="security:rule-based-permission-resolver" name="SeamSecurityRuleBasedPermissionResolver21">
+ <XChildrenEntities/>
+ <XEntityRenderer>
+ <ICONS>
+ <ICON info="main.seam.security.identity" type="main"/>
+ </ICONS>
+ </XEntityRenderer>
+ <XModelAttributes>
+ <XModelAttribute default="rule-based-permission-resolver"
+ loader="ElementType" name="element type">
+ <Editor name="Uneditable"/>
+ </XModelAttribute>
+ <XModelAttribute PROPERTIES="id=true;category=general"
+ default="org.jboss.seam.security.ruleBasedPermissionResolver"
+ name="name" xmlname="name"/>
+ <XModelAttributeReference
+ attributes="class,scope,precedence,installed,auto-create,startup,startupDepends"
+ entity="SeamComponent21" name="component"/>
+ <XModelAttribute PROPERTIES="category=general" name="security-rules" xmlname="security-rules"/>
+ <XModelAttribute TRIM="no" name="comment" visibility="false" xmlname="#comment">
+ <Editor name="Note"/>
+ </XModelAttribute>
+ </XModelAttributes>
+ <XActionItem kind="list">
+ <XActionItem kind="list" name="CreateActions"/>
+ <XActionItem ICON="action.empty" displayName="Create" kind="list" name="EditActions"/>
+ <XActionItemReference entity="SeamSecurityIdentity"
+ name="CopyActions" path="CopyActions"/>
+ <XActionItemReference entity="SeamSecurityIdentity"
+ name="DeleteActions" path="DeleteActions"/>
+ <XActionItemReference entity="SeamSecurityIdentity" name="Properties" path="Properties"/>
+ <XActionItemReference entity="SeamSecurityIdentity"
+ name="MoveActions" path="MoveActions"/>
+ </XActionItem>
+ <XDependencies/>
+ </XModelEntity>
<XEntityExtension name="FileSeamComponents12">
<XChildrenEntities>
<XChildEntity name="SeamSecurityIdentity"/>
@@ -271,16 +608,27 @@
</XActionItem>
</XActionItem>
</XEntityExtension>
- <XEntityExtension name="FileSeamComponents20_EditorActionList">
- <XChildrenEntities/>
+ <XEntityExtension name="FileSeamComponents21">
+ <XChildrenEntities>
+ <XChildEntity name="SeamSecurityIdentity21"/>
+ <XChildEntity name="SeamFacesSecurityEvents20"/>
+ <XChildEntity name="SeamSecurityIdentityManager21"/>
+ <XChildEntity name="SeamSecurityJPAIdentityStore21"/>
+ <XChildEntity name="SeamSecurityLDAPIdentityStore21"/>
+ <XChildEntity name="SeamSecurityPermissionManager21"/>
+ <XChildEntity name="SeamSecurityJPAPermissionStore21"/>
+ <XChildEntity name="SeamSecurityRuleBasedPermissionResolver21"/>
+ <XChildEntity name="SeamSecurityPersistentPermissionResolver21"/>
+ </XChildrenEntities>
<XActionItem kind="list">
- <XActionItem ICON="action.empty" displayName="New" kind="list" name="CreateActions">
+ <XActionItem ICON="action.empty" displayName="New" group="1"
+ kind="list" name="CreateActions">
<XActionItem ICON="action.empty" displayName="Security" group="1"
kind="list" name="Security">
<XActionItem HandlerClassName="%Create%" ICON="action.empty"
PROPERTIES="validator.add=true" WizardClassName="%Default%"
displayName="Identity..." kind="action" name="AddIdentity">
- <EntityData EntityName="SeamSecurityIdentity20">
+ <EntityData EntityName="SeamSecurityIdentity21">
<AttributeData AttributeName="name"/>
<AttributeData AttributeName="authenticate-method" Mandatory="no"/>
<AttributeData AttributeName="remember-me" Mandatory="no"/>
@@ -294,6 +642,65 @@
<AttributeData AttributeName="cookie-max-age" Mandatory="no"/>
</EntityData>
</XActionItem>
+ <XActionItem HandlerClassName="%Create%" ICON="action.empty"
+ PROPERTIES="validator.add=true" WizardClassName="%Default%"
+ displayName="Identity Manager..." kind="action" name="AddIdentityManager">
+ <EntityData EntityName="SeamSecurityIdentityManager21">
+ <AttributeData AttributeName="name"/>
+ <AttributeData AttributeName="identity-store" Mandatory="no"/>
+ </EntityData>
+ </XActionItem>
+ <XActionItem HandlerClassName="%Create%" ICON="action.empty"
+ PROPERTIES="validator.add=true" WizardClassName="%Default%"
+ displayName="JPA Identity Store..." kind="action" name="AddJPAIdentityStore">
+ <EntityData EntityName="SeamSecurityJPAIdentityStore21">
+ <AttributeData AttributeName="name"/>
+ <AttributeData AttributeName="user-class"/>
+ <AttributeData AttributeName="entity-manager" Mandatory="no"/>
+ </EntityData>
+ </XActionItem>
+ <XActionItem HandlerClassName="%Create%" ICON="action.empty"
+ PROPERTIES="validator.add=true" WizardClassName="%Default%"
+ displayName="LDAP Identity Store..." kind="action" name="AddLDAPIdentityStore">
+ <EntityData EntityName="SeamSecurityLDAPIdentityStore21">
+ <AttributeData AttributeName="name"/>
+ <AttributeData AttributeName="server-address" Mandatory="no"/>
+ <AttributeData AttributeName="server-port" Mandatory="no"/>
+ </EntityData>
+ </XActionItem>
+ <XActionItem HandlerClassName="%Create%" ICON="action.empty"
+ PROPERTIES="validator.add=true" WizardClassName="%Default%"
+ displayName="Permission Manager..." kind="action" name="AddPermissionManager">
+ <EntityData EntityName="SeamSecurityPermissionManager21">
+ <AttributeData AttributeName="name"/>
+ <AttributeData AttributeName="permission-store" Mandatory="no"/>
+ </EntityData>
+ </XActionItem>
+ <XActionItem HandlerClassName="%Create%" ICON="action.empty"
+ PROPERTIES="validator.add=true" WizardClassName="%Default%"
+ displayName="JPA Permission Store..." kind="action" name="AddJPAPermissionStore">
+ <EntityData EntityName="SeamSecurityJPAPermissionStore21">
+ <AttributeData AttributeName="name"/>
+ <AttributeData AttributeName="user-permission-class" Mandatory="no"/>
+ <AttributeData AttributeName="entity-manager" Mandatory="no"/>
+ </EntityData>
+ </XActionItem>
+ <XActionItem HandlerClassName="%Create%" ICON="action.empty"
+ PROPERTIES="validator.add=true" WizardClassName="%Default%"
+ displayName="Rule Based Permission Resolver..." kind="action" name="AddRuleBasedPermissionResolver">
+ <EntityData EntityName="SeamSecurityRuleBasedPermissionResolver21">
+ <AttributeData AttributeName="name"/>
+ <AttributeData AttributeName="security-rules" Mandatory="no"/>
+ </EntityData>
+ </XActionItem>
+ <XActionItem HandlerClassName="%Create%" ICON="action.empty"
+ PROPERTIES="validator.add=true" WizardClassName="%Default%"
+ displayName="Persistent Permission Resolver..." kind="action" name="AddPersistentPermissionResolver">
+ <EntityData EntityName="SeamSecurityPersistentPermissionResolver21">
+ <AttributeData AttributeName="name"/>
+ <AttributeData AttributeName="permission-store" Mandatory="no"/>
+ </EntityData>
+ </XActionItem>
</XActionItem>
</XActionItem>
</XActionItem>
Modified: trunk/seam/plugins/org.jboss.tools.seam.xml/resources/meta/seam-web.meta
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.xml/resources/meta/seam-web.meta 2008-10-17 12:22:09 UTC (rev 10918)
+++ trunk/seam/plugins/org.jboss.tools.seam.xml/resources/meta/seam-web.meta 2008-10-17 12:50:52 UTC (rev 10919)
@@ -349,8 +349,8 @@
<XModelAttribute PROPERTIES="id=true;category=general"
default="org.jboss.seam.web.identityFilter" name="name" xmlname="name"/>
<XModelAttributeReference
- attributes="class,scope,precedence,installed,auto-create,startup"
- entity="SeamComponent20" name="component"/>
+ attributes="class,scope,precedence,installed,auto-create,startup,startupDepends"
+ entity="SeamComponent21" name="component"/>
<XModelAttributeReference
attributes="url-pattern,disabled,regex-url-pattern"
entity="SeamWebContextFilter20" name="filter"/>
@@ -627,8 +627,8 @@
</XModelAttribute>
<XModelAttribute PROPERTIES="id=true;category=general" name="name" xmlname="name"/>
<XModelAttributeReference
- attributes="class,scope,precedence,installed,auto-create,startup"
- entity="SeamComponent20" name="component"/>
+ attributes="class,scope,precedence,installed,auto-create,startup,startupDepends"
+ entity="SeamComponent21" name="component"/>
<XModelAttribute PROPERTIES="category=general"
name="invalidate-on-scheme-change" xmlname="invalidate-on-scheme-change">
<Constraint loader="%ListEL%">
@@ -669,8 +669,8 @@
<XModelAttribute PROPERTIES="id=true;category=general"
default="org.jboss.seam.web.wicketFilter" name="name" xmlname="name"/>
<XModelAttributeReference
- attributes="class,scope,precedence,installed,auto-create,startup"
- entity="SeamComponent20" name="component"/>
+ attributes="class,scope,precedence,installed,auto-create,startup,startupDepends"
+ entity="SeamComponent21" name="component"/>
<XModelAttributeReference
attributes="url-pattern,disabled,regex-url-pattern"
entity="SeamWebContextFilter20" name="filter"/>
Modified: trunk/seam/plugins/org.jboss.tools.seam.xml/resources/meta/seam-wicket.meta
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.xml/resources/meta/seam-wicket.meta 2008-10-17 12:22:09 UTC (rev 10918)
+++ trunk/seam/plugins/org.jboss.tools.seam.xml/resources/meta/seam-wicket.meta 2008-10-17 12:50:52 UTC (rev 10919)
@@ -43,8 +43,8 @@
<XModelAttribute PROPERTIES="id=true;category=general"
default="org.jboss.seam.wicket.webApplication" name="name" xmlname="name"/>
<XModelAttributeReference
- attributes="class,scope,precedence,installed,auto-create,startup"
- entity="SeamComponent20" name="component"/>
+ attributes="class,scope,precedence,installed,auto-create,startup,startupDepends"
+ entity="SeamComponent21" name="component"/>
<XModelAttribute PROPERTIES="category=general"
name="application-class" xmlname="application-class">
<Editor name="AccessibleJava"/>
Added: trunk/seam/plugins/org.jboss.tools.seam.xml/schemas/pdf-2.1.xsd
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.xml/schemas/pdf-2.1.xsd (rev 0)
+++ trunk/seam/plugins/org.jboss.tools.seam.xml/schemas/pdf-2.1.xsd 2008-10-17 12:50:52 UTC (rev 10919)
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
+ elementFormDefault="qualified"
+ targetNamespace="http://jboss.com/products/seam/pdf"
+ xmlns:pdf="http://jboss.com/products/seam/pdf"
+ xmlns:components="http://jboss.com/products/seam/components"
+ attributeFormDefault="unqualified">
+ <xs:import namespace="http://jboss.com/products/seam/components"
+ schemaLocation="components-2.1.xsd" />
+
+ <xs:element name="key-store-config">
+ <xs:annotation>
+ <xs:documentation>
+ The key stores holds the encryption keys for creating signed PDF
+ documents
+ </xs:documentation>
+ </xs:annotation>
+ <xs:complexType mixed="true">
+ <xs:attributeGroup ref="components:attlist.component" />
+ <xs:attributeGroup ref="pdf:attlist.keystore" />
+ </xs:complexType>
+ </xs:element>
+ <xs:attributeGroup name="attlist.keystore">
+ <xs:attribute name="key-store" type="components:string" />
+ <xs:attribute name="key-store-password" type="components:string" />
+ <xs:attribute name="key-password" type="components:string" />
+ <xs:attribute name="key-alias" type="components:string" />
+ </xs:attributeGroup>
+</xs:schema>
17 years, 2 months
JBoss Tools SVN: r10918 - trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui.
by jbosstools-commits@lists.jboss.org
Author: max.andersen(a)jboss.com
Date: 2008-10-17 08:22:09 -0400 (Fri, 17 Oct 2008)
New Revision: 10918
Modified:
trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/plugin.xml
Log:
add ... for generate hibernate actions since it shows an dialog
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/plugin.xml
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/plugin.xml 2008-10-17 11:47:51 UTC (rev 10917)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/plugin.xml 2008-10-17 12:22:09 UTC (rev 10918)
@@ -37,7 +37,7 @@
<super type="org.eclipse.core.resources.problemmarker"/>
<super type="org.eclipse.core.resources.textmarker"/>
<persistent value="true"/>
-</extension>
+</extension>
<extension point="org.eclipse.ui.actionSets">
<!-- main menu -->
<actionSet label="Java Coding" description="Action set containing coding related Java actions"
@@ -54,7 +54,7 @@
<action
class="org.hibernate.eclipse.jdt.ui.internal.jpa.actions.JPAMapToolActionPulldownDelegate"
id="org.hibernate.eclipse.jdt.ui.run_jpaaction"
- label="Generate &Hibernate/JPA annotations"
+ label="Generate &Hibernate/JPA annotations..."
menubarPath="org.eclipse.jdt.ui.source.menu/generateGroup"
style="push">
</action>
@@ -77,7 +77,7 @@
<action
class="org.hibernate.eclipse.jdt.ui.internal.jpa.actions.JPAMapToolActionDelegate"
id="org.hibernate.eclipse.jdt.ui.run_jpaaction2"
- label="Generate &Hibernate/JPA annotations"
+ label="Generate &Hibernate/JPA annotations..."
menubarPath="org.eclipse.jdt.ui.source.menu/generateGroup"
style="push">
</action>
17 years, 2 months
JBoss Tools SVN: r10917 - trunk/jbpm/plugins/org.jboss.tools.jbpm.convert.
by jbosstools-commits@lists.jboss.org
Author: max.andersen(a)jboss.com
Date: 2008-10-17 07:47:51 -0400 (Fri, 17 Oct 2008)
New Revision: 10917
Modified:
trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/.classpath
Log:
Removed bogus bin lib directory from .classpath so project can build/compile.
Modified: trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/.classpath
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/.classpath 2008-10-17 10:27:20 UTC (rev 10916)
+++ trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/.classpath 2008-10-17 11:47:51 UTC (rev 10917)
@@ -1,6 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
- <classpathentry exported="true" kind="lib" path="bin/" sourcepath="src/org/jboss/tools/jbpm/convert/b2j/messages"/>
<classpathentry exported="true" kind="lib" path="lib/dom4j-1.6.1.jar"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
17 years, 2 months
JBoss Tools SVN: r10916 - trunk/seam/docs/reference/en/images/create_new_seam.
by jbosstools-commits@lists.jboss.org
Author: ochikvina
Date: 2008-10-17 06:27:20 -0400 (Fri, 17 Oct 2008)
New Revision: 10916
Modified:
trunk/seam/docs/reference/en/images/create_new_seam/create_seam_1.png
trunk/seam/docs/reference/en/images/create_new_seam/create_seam_15.png
trunk/seam/docs/reference/en/images/create_new_seam/create_seam_16.png
trunk/seam/docs/reference/en/images/create_new_seam/create_seam_7.png
trunk/seam/docs/reference/en/images/create_new_seam/create_seam_8.png
Log:
https://jira.jboss.org/jira/browse/JBDS-446 - retaking and replacing the screenshots;
Modified: trunk/seam/docs/reference/en/images/create_new_seam/create_seam_1.png
===================================================================
(Binary files differ)
Modified: trunk/seam/docs/reference/en/images/create_new_seam/create_seam_15.png
===================================================================
(Binary files differ)
Modified: trunk/seam/docs/reference/en/images/create_new_seam/create_seam_16.png
===================================================================
(Binary files differ)
Modified: trunk/seam/docs/reference/en/images/create_new_seam/create_seam_7.png
===================================================================
(Binary files differ)
Modified: trunk/seam/docs/reference/en/images/create_new_seam/create_seam_8.png
===================================================================
(Binary files differ)
17 years, 2 months
JBoss Tools SVN: r10915 - trunk/seam/docs/reference/en/modules.
by jbosstools-commits@lists.jboss.org
Author: ochikvina
Date: 2008-10-17 06:25:31 -0400 (Fri, 17 Oct 2008)
New Revision: 10915
Modified:
trunk/seam/docs/reference/en/modules/crud_database_application.xml
Log:
https://jira.jboss.org/jira/browse/JBDS-446 - updating the chapter;
Modified: trunk/seam/docs/reference/en/modules/crud_database_application.xml
===================================================================
--- trunk/seam/docs/reference/en/modules/crud_database_application.xml 2008-10-17 10:24:30 UTC (rev 10914)
+++ trunk/seam/docs/reference/en/modules/crud_database_application.xml 2008-10-17 10:25:31 UTC (rev 10915)
@@ -27,24 +27,27 @@
<property>CRUD</property> at some point. A <property>CRUD</property> application is one
that uses forms to get data into and out of a database. </para>
<para> In the next section we will create <link linkend="intro">Seam</link> Web application,
- connect it to the <ulink url="http://www.hsqldb.org/">HSQL</ulink> database
- and add <property>CRUD</property> support. </para>
+ connect it to the <ulink url="http://www.hsqldb.org/">HSQL</ulink> database and add
+ <property>CRUD</property> support. </para>
</section>
<section>
<title>How to create the CRUD Database Application with Seam</title>
<itemizedlist>
- <listitem><para>First, you should <ulink url="http://docs.jboss.org/tools/resources/"
- >download</ulink> a database and start it by running <emphasis>
- <property>./runDBServer.sh</property></emphasis> or <emphasis>
- <property>runDBServer.bat</property></emphasis>
- from the database directory.</para></listitem>
<listitem>
- <para>Create a new Seam Web Project using New Project wizard or main menu
- <emphasis><property>File > New > Seam Web
- Project</property>.</emphasis></para>
+ <para>First, you should <ulink url="http://docs.jboss.org/tools/resources/"
+ >download</ulink> a database and start it by running <emphasis>
+ <property>./runDBServer.sh</property>
+ </emphasis> or <emphasis>
+ <property>runDBServer.bat</property>
+ </emphasis> from the database directory.</para>
</listitem>
+ <listitem>
+ <para>Create a new Seam Web Project using <property>New Seam Project
+ wizard</property> or main menu <emphasis><property>File > New > Seam Web
+ Project</property>.</emphasis></para>
+ </listitem>
</itemizedlist>
<figure>
<title>Seam Web Project Creation</title>
@@ -60,14 +63,10 @@
<itemizedlist>
<listitem>
<para>Name your project as <emphasis>
- <property>crudapp</property>
+ <property>crudapp</property>, </emphasis> specify Target Runtime, Server and
+ Seam Runtime configuration. Then press <emphasis>
+ <property>Next</property>
</emphasis> and follow the next wizard steps keeping default settings.</para>
- <para>Please have a look <link linkend="create_seam">here</link> how to create <emphasis>
- <property>Target Runtime</property>
- </emphasis> and <emphasis>
- <property>Seam Runtime</property>
- </emphasis> in order to get started creating, running, and debugging J2EE
- applications.</para>
</listitem>
</itemizedlist>
<figure>
@@ -81,13 +80,21 @@
</mediaobject>
</figure>
+ <tip>
+ <title>Tip:</title>
+ <para>Please have a look <link linkend="create_seam">here</link> how to create Target
+ Runtime and Seam Runtime in order to get started creating, running, and debugging
+ J2EE applications.</para>
+ </tip>
+
<itemizedlist>
<listitem>
<para>On <emphasis>
<property>Seam Facet</property>
</emphasis> page click <emphasis>
<property>New...</property>
- </emphasis> to create a new <property>Connection profile</property>.</para>
+ </emphasis> next to the <property>Connection profile</property> section to
+ create a new <property>Connection profile</property>.</para>
</listitem>
</itemizedlist>
<figure>
@@ -104,12 +111,15 @@
<itemizedlist>
<listitem>
<para>On <property>New Connection Profile</property> dialog select the <emphasis>
- <property>HSQLDB Connection Profile</property>
- </emphasis> type and click <emphasis>
- <property>Next</property>
- </emphasis>.</para>
+ <property>HSQLDB</property>
+ </emphasis> connection profile type, name it <emphasis>
+ <property>cruddb</property>
+ </emphasis> and click <emphasis>
+ <property>Next</property>.
+ </emphasis></para>
</listitem>
</itemizedlist>
+
<figure>
<title>New JDBC Connection Profile</title>
<mediaobject>
@@ -123,19 +133,17 @@
<itemizedlist>
<listitem>
- <para>Name your profile as <emphasis>
- <property>cruddb</property>
- </emphasis> and press <emphasis>
- <property>Next</property>
- </emphasis>.</para>
+ <para>On the next page click the round icon next to the <emphasis>
+ <property>Drivers</property>
+ </emphasis> field to select a database driver.</para>
</listitem>
</itemizedlist>
<figure>
- <title>New JDBC Connection Profile Name</title>
+ <title>New JDBC Connection Profile Database Driver</title>
<mediaobject>
<imageobject>
<imagedata
- fileref="images/crud_database_application/crud_database_application_05.png"
+ fileref="images/crud_database_application/crud_database_application_06.png"
/>
</imageobject>
</mediaobject>
@@ -143,17 +151,20 @@
<itemizedlist>
<listitem>
- <para>On the next page click <emphasis>
- <property>...</property>
- </emphasis> to select a database driver.</para>
+ <para>Now you should see the <property>New Driver Definition</property> dialog. On
+ the first tab select the <emphasis>
+ <property>HSQLDB JBDC Driver</property>.
+ </emphasis> Underneath in the <emphasis>
+ <property>Driver name</property>
+ </emphasis> field you can change its name if you need.</para>
</listitem>
</itemizedlist>
<figure>
- <title>New JDBC Connection Profile Database Driver</title>
+ <title>Database Driver Type</title>
<mediaobject>
<imageobject>
<imagedata
- fileref="images/crud_database_application/crud_database_application_06.png"
+ fileref="images/crud_database_application/crud_database_application_07.png"
/>
</imageobject>
</mediaobject>
@@ -161,19 +172,19 @@
<itemizedlist>
<listitem>
- <para>On <property>Driver Definitions</property> dialog select the <emphasis>
- <property>Hypersonic DB</property>
- </emphasis> and click <emphasis>
- <property>Add...</property>
- </emphasis>.</para>
+ <para>You may notice the note on the previous figure. It prompts that you should
+ specify the driver of the type you pointed. Set the location of the driver by switching to the
+ next tab and press <emphasis>
+ <property>Add JAR/Zip</property>
+ </emphasis> button.</para>
</listitem>
</itemizedlist>
<figure>
- <title>Driver Definitions List</title>
+ <title>Driver Definition</title>
<mediaobject>
<imageobject>
<imagedata
- fileref="images/crud_database_application/crud_database_application_07.png"
+ fileref="images/crud_database_application/crud_database_application_09.png"
/>
</imageobject>
</mediaobject>
@@ -181,26 +192,24 @@
<itemizedlist>
<listitem>
- <para>Set the location of <property>JDBC driver</property> and fill all other
- necessary fields (<emphasis>
- <property>URL</property>
- </emphasis>, <emphasis>
+ <para>On the <property>Properties</property> tab set the
+ <emphasis><property>Connection URL</property>,</emphasis>
+ <emphasis>
<property>Database Name</property>
- </emphasis>, <emphasis>
- <property>Password</property>
- </emphasis>, <emphasis>
- <property>User Id</property>
- </emphasis>) and click <emphasis>
- <property>OK</property>
- </emphasis>.</para>
+ </emphasis> and <emphasis>
+ <property>User ID</property>
+ </emphasis> and click <emphasis>
+ <property>OK</property>.
+ </emphasis></para>
</listitem>
</itemizedlist>
+
<figure>
- <title>Edit Driver Definition</title>
+ <title>Driver Definitions Properties</title>
<mediaobject>
<imageobject>
<imagedata
- fileref="images/crud_database_application/crud_database_application_09.png"
+ fileref="images/crud_database_application/crud_database_application_10.png"
/>
</imageobject>
</mediaobject>
@@ -210,15 +219,16 @@
<listitem>
<para>After clicking <emphasis>
<property>OK</property>
- </emphasis> to submit the newly created driver you can observe and if you need edit all specified connection details.</para>
+ </emphasis> to submit the newly created driver you can observe and if you need
+ edit all specified connection details.</para>
</listitem>
</itemizedlist>
<figure>
- <title>Driver Definitions List</title>
+ <title>Driver and Connection Details</title>
<mediaobject>
<imageobject>
<imagedata
- fileref="images/crud_database_application/crud_database_application_10.png"
+ fileref="images/crud_database_application/crud_database_application_11.png"
/>
</imageobject>
</mediaobject>
@@ -228,11 +238,10 @@
<listitem>
<para>Now click <emphasis>
<property>Test Connection</property>
- </emphasis> to be sure that connection can be
- established.</para>
+ </emphasis> to be sure that connection can be established.</para>
</listitem>
</itemizedlist>
-
+
<figure>
<title>JDBC Connection is OK</title>
<mediaobject>
@@ -268,28 +277,15 @@
<itemizedlist>
<listitem>
- <para>Observe that newly created profile has been selected on <emphasis>
- <property>Seam Facet</property>
- </emphasis> page and click <emphasis>
+ <para>After clicking <emphasis>
<property>Finish</property>
- </emphasis>.</para>
- <para>This will create 2 projects - <emphasis>
+ </emphasis> two projects <emphasis>
<property>crudapp</property>
</emphasis> and <emphasis>
<property>crudapp-test</property>
- </emphasis>.</para>
+ </emphasis> will be created.</para>
</listitem>
</itemizedlist>
- <figure>
- <title>Last Step of New Seam Project Wizard</title>
- <mediaobject>
- <imageobject>
- <imagedata
- fileref="images/crud_database_application/crud_database_application_14.png"
- />
- </imageobject>
- </mediaobject>
- </figure>
<itemizedlist>
<listitem>
17 years, 2 months
JBoss Tools SVN: r10914 - trunk/seam/docs/reference/en/modules.
by jbosstools-commits@lists.jboss.org
Author: ochikvina
Date: 2008-10-17 06:24:30 -0400 (Fri, 17 Oct 2008)
New Revision: 10914
Modified:
trunk/seam/docs/reference/en/modules/creating_new_seam.xml
Log:
https://jira.jboss.org/jira/browse/JBDS-446 - updating the chapter;
Modified: trunk/seam/docs/reference/en/modules/creating_new_seam.xml
===================================================================
--- trunk/seam/docs/reference/en/modules/creating_new_seam.xml 2008-10-17 10:23:44 UTC (rev 10913)
+++ trunk/seam/docs/reference/en/modules/creating_new_seam.xml 2008-10-17 10:24:30 UTC (rev 10914)
@@ -51,10 +51,10 @@
<para>Clicking on <emphasis>
<property>New...</property>
- </emphasis> button in the Target Runtime section will bring you to another dialog. Here,
- you can specify a new installed Runtime environment or the other type of runtime
- appropriate for configuring your project. Let's create a JBoss 4.2 Runtime. For that
- after choosing it click on <emphasis>
+ </emphasis> button in the <proeprty>Target Runtime</proeprty> section will bring you to
+ another dialog. Here, you can specify a new installed Runtime environment or the other
+ type of runtime appropriate for configuring your project. Let's create a JBoss 4.2
+ Runtime. For that after choosing it click on <emphasis>
<property>Next</property>
</emphasis> button.</para>
@@ -88,8 +88,8 @@
dialog</link>. The next step is to define an installed server that you can do by
clicking on <emphasis>
<property>New...</property>
- </emphasis> button in the Target Server section. In appeared Server Dialog it's possible
- to select a server version. </para>
+ </emphasis> button in the <property>Target Server</property> section. In appeared Server
+ Dialog it's possible to select a server version. </para>
<para> If the chosen server has already got an installed runtime, there appears a combo box
with all declared runtimes under the servers view. Here, you can indicate a server
@@ -136,10 +136,17 @@
</figure>
- <para>After clicking on <emphasis>
+ <para>Once you have the Target Server defined click on <emphasis>
<property>Finish</property>
- </emphasis> button you should have the following wizard view:</para>
+ </emphasis> button to return to the first page of the <property>New Seam Project
+ wizard</property>.</para>
+ <tip>
+ <title>Tip:</title>
+ <para>We suggest that you look through our <ulink url="&aslink;">AS manager
+ guide</ulink> to find out more about runtimes and servers.</para>
+ </tip>
+
<figure>
<title>Completion of Runtime and Server Configuration</title>
<mediaobject>
@@ -149,30 +156,26 @@
</mediaobject>
</figure>
- <para>The last section on this wizard step is <property>Configurations</property>. Here, you
+ <para>The last section on this wizard step is <property>Configuration</property>. Here, you
can select one of the pre-defined project configurations either associated with Seam 1.2
- or with Seam 2.0 that is the latest release but just only a technology preview. In
- addition, you can create your own configuration. Choosing <emphasis>
- <property>Default Configuration for jBoss 4.2 Runtime</property>
- </emphasis> allows you later to specify your own set of facets for adding extra
- functionality to your project. For more details about facets, see next section. Besides,
- we suggest that you look through our <ulink url="&aslink;">AS manager guide</ulink> to find out more about runtimes
- and servers.</para>
+ or with Seam 2.0. Furthermore, you can create your own configuration by pressing the <emphasis>
+ <property>Modify...</property>
+ </emphasis> button. It will open the dialog which allows to configure your own set of
+ facets for adding extra functionality to your project.</para>
- <para>Having all necessary options arranged, click on <emphasis>
- <property>Next</property>
- </emphasis> to pass on to the other wizard.</para>
+ <para>Pass to the next section to find out more details on this dialog.</para>
</section>
<section id="projectFacets">
<title>Select the Project Facets</title>
- <para>This page of the wizard allows you to enable or disable specific facets that define
- necessary characteristics for the project. In time you switch to this wizard form, all
- critical facets are already checked for the chosen Dynamic Web Project.</para>
+ <para>The <property>Project Facets wizard</property> allows you to enable or disable
+ specific facets which define necessary characteristics for the project. In time you
+ switch to this wizard form, all critical facets are already checked for the chosen
+ Configuration.</para>
- <para>Notice that this page of the wizard also allows you to specify the necessary version
- for any facet. </para>
+ <para>Notice that this page of the wizard also allows you to set the necessary version for
+ any facet. </para>
<figure>
<title>Project Facets Selection</title>
@@ -183,8 +186,8 @@
</mediaobject>
</figure>
- <para>Moreover, you can specify your own preset of selected facets by checking needed ones
- in project facets window and clicking on <emphasis>
+ <para>Moreover, here you can specify your own preset of selected facets by checking needed
+ ones in project facets window and clicking on <emphasis>
<property>Save</property>
</emphasis> button.</para>
@@ -197,11 +200,13 @@
</mediaobject>
</figure>
- <para>You can also see all available runtimes after clicking on <emphasis>
- <property>Show Runtimes</property>
- </emphasis> or create new ones using the <emphasis>
+ <para>To see all available Server runtimes click on <property>Runtimes</property> tab on the
+ left. You can create a new one using the <emphasis>
<property>New</property>
- </emphasis> button.</para>
+ </emphasis> button. If more than one runtimes are checked here, the <emphasis>
+ <property>Make Primary</property>
+ </emphasis> button won't be dimmed yet. So you can make use of it to mark
+ primary runtime.</para>
<figure>
<title>Runtime Manipulations</title>
@@ -212,13 +217,10 @@
</mediaobject>
</figure>
- <para>Here, if more than one runtimes are checked, the <emphasis>
- <property>Make Primary</property>
- </emphasis> button won't be dimmed yet. So you can make use of it to mark
- primary runtime.</para>
<para><emphasis>
<property>Next</property>
- </emphasis> button will bring you to the Web Module wizard form.</para>
+ </emphasis> button will bring you to the <property>Web Module</property> wizard
+ form.</para>
</section>
<section id="configureWebModule">
@@ -280,7 +282,8 @@
</figure>
<para>In the Component Libraries section of the wizard you can also add <property>Component
- Libraries</property> (e.g. <ulink url="http://www.jboss.org/jbossrichfaces">Richfaces</ulink>). Just click on <emphasis>
+ Libraries</property> (e.g. <ulink url="http://www.jboss.org/jbossrichfaces"
+ >Richfaces</ulink>). Just click on <emphasis>
<property>New</property>
</emphasis> button. Appeared dialog will ask you to type the Library name, supported
version and add necessary jar's. Press <emphasis>
17 years, 2 months
JBoss Tools SVN: r10913 - trunk/seam/docs/reference/en/images/crud_database_application.
by jbosstools-commits@lists.jboss.org
Author: ochikvina
Date: 2008-10-17 06:23:44 -0400 (Fri, 17 Oct 2008)
New Revision: 10913
Modified:
trunk/seam/docs/reference/en/images/crud_database_application/crud_database_application_02.png
trunk/seam/docs/reference/en/images/crud_database_application/crud_database_application_03.png
trunk/seam/docs/reference/en/images/crud_database_application/crud_database_application_04.png
trunk/seam/docs/reference/en/images/crud_database_application/crud_database_application_06.png
trunk/seam/docs/reference/en/images/crud_database_application/crud_database_application_07.png
trunk/seam/docs/reference/en/images/crud_database_application/crud_database_application_09.png
trunk/seam/docs/reference/en/images/crud_database_application/crud_database_application_10.png
trunk/seam/docs/reference/en/images/crud_database_application/crud_database_application_11.png
trunk/seam/docs/reference/en/images/crud_database_application/crud_database_application_12.png
trunk/seam/docs/reference/en/images/crud_database_application/crud_database_application_13.png
Log:
https://jira.jboss.org/jira/browse/JBDS-446 - retaking and replacing the screenshots;
Modified: trunk/seam/docs/reference/en/images/crud_database_application/crud_database_application_02.png
===================================================================
(Binary files differ)
Modified: trunk/seam/docs/reference/en/images/crud_database_application/crud_database_application_03.png
===================================================================
(Binary files differ)
Modified: trunk/seam/docs/reference/en/images/crud_database_application/crud_database_application_04.png
===================================================================
(Binary files differ)
Modified: trunk/seam/docs/reference/en/images/crud_database_application/crud_database_application_06.png
===================================================================
(Binary files differ)
Modified: trunk/seam/docs/reference/en/images/crud_database_application/crud_database_application_07.png
===================================================================
(Binary files differ)
Modified: trunk/seam/docs/reference/en/images/crud_database_application/crud_database_application_09.png
===================================================================
(Binary files differ)
Modified: trunk/seam/docs/reference/en/images/crud_database_application/crud_database_application_10.png
===================================================================
(Binary files differ)
Modified: trunk/seam/docs/reference/en/images/crud_database_application/crud_database_application_11.png
===================================================================
(Binary files differ)
Modified: trunk/seam/docs/reference/en/images/crud_database_application/crud_database_application_12.png
===================================================================
(Binary files differ)
Modified: trunk/seam/docs/reference/en/images/crud_database_application/crud_database_application_13.png
===================================================================
(Binary files differ)
17 years, 2 months
JBoss Tools SVN: r10910 - in trunk/smooks/plugins: org.jboss.tools.smooks.javabean/src/org/jboss/tools/smooks/javabean/analyzer and 8 other directories.
by jbosstools-commits@lists.jboss.org
Author: DartPeng
Date: 2008-10-17 05:55:10 -0400 (Fri, 17 Oct 2008)
New Revision: 10910
Added:
trunk/smooks/plugins/org.jboss.tools.smooks.ui/icons/full/obj16/blank.gif
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/analyzer/DesignTimeAnalyzeResult.java
Modified:
trunk/smooks/plugins/org.jboss.tools.smooks.java2xml/src/org/jboss/tools/smooks/java2xml/analyzer/Java2XMLAnalyzer.java
trunk/smooks/plugins/org.jboss.tools.smooks.javabean/src/org/jboss/tools/smooks/javabean/analyzer/JavaBeanAnalyzer.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/analyzer/IMappingAnalyzer.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/SmooksUIActivator.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/editors/SmooksGraphicalFormPage.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/editors/TypeIDSelectionWizard.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/editors/TypeIDSelectionWizardPage.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/modelparser/SmooksConfigurationFileGenerateContext.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/utils/SmooksGraphConstants.java
trunk/smooks/plugins/org.jboss.tools.smooks.xml/src/org/jboss/tools/smooks/xml2xml/XML2XMLAnalyzer.java
trunk/smooks/plugins/org.jboss.tools.smooks.xml2java/src/org/jboss/tools/smooks/xml2java/analyzer/XML2JavaAnalyzer.java
Log:
JBIDE-2867
Add notify information GUI above the graphical panel
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.java2xml/src/org/jboss/tools/smooks/java2xml/analyzer/Java2XMLAnalyzer.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.java2xml/src/org/jboss/tools/smooks/java2xml/analyzer/Java2XMLAnalyzer.java 2008-10-17 07:27:04 UTC (rev 10909)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.java2xml/src/org/jboss/tools/smooks/java2xml/analyzer/Java2XMLAnalyzer.java 2008-10-17 09:55:10 UTC (rev 10910)
@@ -19,6 +19,7 @@
import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.swt.widgets.Shell;
import org.jboss.tools.smooks.analyzer.AbstractAnalyzer;
+import org.jboss.tools.smooks.analyzer.DesignTimeAnalyzeResult;
import org.jboss.tools.smooks.analyzer.MappingResourceConfigList;
import org.jboss.tools.smooks.analyzer.SmooksAnalyzerException;
import org.jboss.tools.smooks.javabean.model.JavaBeanModel;
@@ -62,7 +63,7 @@
return;
}
- GraphRootModel rootModel = context.getDataMappingRootModel();
+ GraphRootModel rootModel = context.getGraphicalRootModel();
List<SourceModel> sourceModelList = rootModel.loadSourceModelList();
List<TargetModel> targetModelList = rootModel.loadTargetModelList();
@@ -173,4 +174,10 @@
return "${" + name + "}";
}
+ public DesignTimeAnalyzeResult analyzeGraphModel(
+ SmooksConfigurationFileGenerateContext context) {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
}
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.javabean/src/org/jboss/tools/smooks/javabean/analyzer/JavaBeanAnalyzer.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.javabean/src/org/jboss/tools/smooks/javabean/analyzer/JavaBeanAnalyzer.java 2008-10-17 07:27:04 UTC (rev 10909)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.javabean/src/org/jboss/tools/smooks/javabean/analyzer/JavaBeanAnalyzer.java 2008-10-17 09:55:10 UTC (rev 10910)
@@ -33,6 +33,7 @@
import org.eclipse.jdt.core.JavaModelException;
import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.swt.widgets.Shell;
+import org.jboss.tools.smooks.analyzer.DesignTimeAnalyzeResult;
import org.jboss.tools.smooks.analyzer.IMappingAnalyzer;
import org.jboss.tools.smooks.analyzer.ISourceModelAnalyzer;
import org.jboss.tools.smooks.analyzer.ITargetModelAnalyzer;
@@ -356,6 +357,50 @@
}
+ private DesignTimeAnalyzeResult checkOtherNodeConnected(
+ SmooksConfigurationFileGenerateContext context) {
+ GraphRootModel root = context.getGraphicalRootModel();
+ List sourceList = root.loadSourceModelList();
+ List targetList = root.loadTargetModelList();
+ StringBuffer buffer = new StringBuffer();
+ for (Iterator iterator = targetList.iterator(); iterator.hasNext();) {
+ AbstractStructuredDataModel targetm = (AbstractStructuredDataModel) iterator
+ .next();
+ if (targetm instanceof IConnectableModel) {
+ if (((IConnectableModel) targetm).getModelTargetConnections()
+ .isEmpty()) {
+ continue;
+ }
+
+ JavaBeanModel javaModel = (JavaBeanModel) targetm
+ .getReferenceEntityModel();
+ JavaBeanModel parent = javaModel.getParent();
+ if (parent != null) {
+ AbstractStructuredDataModel pgm = UIUtils.findGraphModel(
+ root, parent);
+ if (pgm != null && pgm instanceof IConnectableModel) {
+ if (((IConnectableModel) pgm)
+ .getModelTargetConnections().isEmpty()) {
+ buffer
+ .append("The parent of Java node \""
+ + javaModel.getName()
+ + "\" : \""
+ + parent.getName()
+ + "\" doesn't be connected by any source node!\n");
+ }
+ }
+ }
+ }
+ }
+ String result = buffer.toString();
+ if ("".equals(result)) {
+ return null;
+ }
+ DesignTimeAnalyzeResult dr = new DesignTimeAnalyzeResult();
+ dr.setErrorMessage(result);
+ return dr;
+ }
+
/**
* If root node don't connect , it will ask user to connect them .
*
@@ -363,7 +408,7 @@
*/
private void checkRootNodeConnected(
SmooksConfigurationFileGenerateContext context) {
- GraphRootModel root = context.getDataMappingRootModel();
+ GraphRootModel root = context.getGraphicalRootModel();
List sourceList = root.loadSourceModelList();
List targetList = root.loadTargetModelList();
@@ -424,7 +469,7 @@
.openQuestion(
displayParent,
"Connection Question",
- "The root models don't be connected , maybe it will make some errors with the generation config file contents.\nDo you wan to connect them?");
+ "The root models don't be connected , it will make some errors with the generation config file contents.\nDo you wan to connect them?");
if (connectAuto) {
// connect root model
LineConnectionModel connectionModel = new LineConnectionModel();
@@ -448,22 +493,21 @@
public void analyzeMappingGraphModel(
SmooksConfigurationFileGenerateContext context)
throws SmooksAnalyzerException {
- GraphRootModel root = context.getDataMappingRootModel();
- checkRootNodeConnected(context);
+ GraphRootModel root = context.getGraphicalRootModel();
this.analyzeGraphicalModel(root, context.getGeneratorResourceList());
}
public MappingResourceConfigList analyzeMappingSmooksModel(
SmooksResourceListType listType, Object sourceObject,
Object targetObject) {
- if(sourceObject instanceof List){
- if(!((List)sourceObject).isEmpty()){
- sourceObject = (JavaBeanModel) ((List)sourceObject).get(0);
+ if (sourceObject instanceof List) {
+ if (!((List) sourceObject).isEmpty()) {
+ sourceObject = (JavaBeanModel) ((List) sourceObject).get(0);
}
}
- if(targetObject instanceof List){
- if(!((List)targetObject).isEmpty()){
- targetObject = (JavaBeanModel) ((List)targetObject).get(0);
+ if (targetObject instanceof List) {
+ if (!((List) targetObject).isEmpty()) {
+ targetObject = (JavaBeanModel) ((List) targetObject).get(0);
}
}
if (!(sourceObject instanceof JavaBeanModel)
@@ -659,7 +703,8 @@
current, classLoader);
}
List list = new ArrayList();
- if(model != null) list.add(model);
+ if (model != null)
+ list.add(model);
return list;
}
@@ -957,4 +1002,10 @@
}
return null;
}
+
+ public DesignTimeAnalyzeResult analyzeGraphModel(
+ SmooksConfigurationFileGenerateContext context) {
+ checkRootNodeConnected(context);
+ return checkOtherNodeConnected(context);
+ }
}
Added: trunk/smooks/plugins/org.jboss.tools.smooks.ui/icons/full/obj16/blank.gif
===================================================================
(Binary files differ)
Property changes on: trunk/smooks/plugins/org.jboss.tools.smooks.ui/icons/full/obj16/blank.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/analyzer/DesignTimeAnalyzeResult.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/analyzer/DesignTimeAnalyzeResult.java (rev 0)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/analyzer/DesignTimeAnalyzeResult.java 2008-10-17 09:55:10 UTC (rev 10910)
@@ -0,0 +1,27 @@
+/**
+ *
+ */
+package org.jboss.tools.smooks.analyzer;
+
+/**
+ * @author dart
+ *
+ */
+public class DesignTimeAnalyzeResult {
+ public String errorMessage;
+ public String warningMessage;
+ public String getErrorMessage() {
+ return errorMessage;
+ }
+ public void setErrorMessage(String errorMessage) {
+ this.errorMessage = errorMessage;
+ }
+ public String getWarningMessage() {
+ return warningMessage;
+ }
+ public void setWarningMessage(String warningMessage) {
+ this.warningMessage = warningMessage;
+ }
+
+
+}
Property changes on: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/analyzer/DesignTimeAnalyzeResult.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/analyzer/IMappingAnalyzer.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/analyzer/IMappingAnalyzer.java 2008-10-17 07:27:04 UTC (rev 10909)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/analyzer/IMappingAnalyzer.java 2008-10-17 09:55:10 UTC (rev 10910)
@@ -26,4 +26,6 @@
public MappingResourceConfigList analyzeMappingSmooksModel(
SmooksResourceListType listType,Object sourceObject,Object targetObject);
+ public DesignTimeAnalyzeResult analyzeGraphModel(SmooksConfigurationFileGenerateContext context);
+
}
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/SmooksUIActivator.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/SmooksUIActivator.java 2008-10-17 07:27:04 UTC (rev 10909)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/SmooksUIActivator.java 2008-10-17 09:55:10 UTC (rev 10910)
@@ -45,6 +45,7 @@
@Override
protected void initializeImageRegistry(ImageRegistry reg) {
super.initializeImageRegistry(reg);
+ reg.put(SmooksGraphConstants.IMAGE_EMPTY, getImageDescriptor(SmooksGraphConstants.IMAGE_PATH_BLANK));
reg.put(SmooksGraphConstants.IMAGE_ERROR, getImageDescriptor(SmooksGraphConstants.IMAGE_PATH_ERROR));
reg.put(SmooksGraphConstants.IMAGE_WARNING, getImageDescriptor(SmooksGraphConstants.IMAGE_PATH_WARNING));
}
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/editors/SmooksGraphicalFormPage.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/editors/SmooksGraphicalFormPage.java 2008-10-17 07:27:04 UTC (rev 10909)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/editors/SmooksGraphicalFormPage.java 2008-10-17 09:55:10 UTC (rev 10910)
@@ -95,6 +95,7 @@
import org.eclipse.ui.forms.widgets.ScrolledForm;
import org.eclipse.ui.forms.widgets.Section;
import org.jboss.tools.smooks.analyzer.AnalyzerFactory;
+import org.jboss.tools.smooks.analyzer.DesignTimeAnalyzeResult;
import org.jboss.tools.smooks.analyzer.IMappingAnalyzer;
import org.jboss.tools.smooks.analyzer.ISourceModelAnalyzer;
import org.jboss.tools.smooks.analyzer.ITargetModelAnalyzer;
@@ -114,7 +115,9 @@
import org.jboss.tools.smooks.model.util.SmooksModelConstants;
import org.jboss.tools.smooks.ui.IStructuredDataCreationWizard;
import org.jboss.tools.smooks.ui.IViewerInitor;
+import org.jboss.tools.smooks.ui.SmooksUIActivator;
import org.jboss.tools.smooks.ui.StructuredDataCreationWizardDailog;
+import org.jboss.tools.smooks.ui.ViewerInitorStore;
import org.jboss.tools.smooks.ui.gef.editparts.SmooksEditPartFactory;
import org.jboss.tools.smooks.ui.gef.model.AbstractStructuredDataModel;
import org.jboss.tools.smooks.ui.gef.model.GraphRootModel;
@@ -128,6 +131,7 @@
import org.jboss.tools.smooks.ui.gef.util.GraphicsConstants;
import org.jboss.tools.smooks.ui.modelparser.SmooksConfigurationFileGenerateContext;
import org.jboss.tools.smooks.ui.wizards.TransformDataSelectionWizard;
+import org.jboss.tools.smooks.utils.SmooksGraphConstants;
import org.jboss.tools.smooks.utils.UIUtils;
/**
@@ -164,6 +168,9 @@
private ISelection selection;
protected MappingResourceConfigList mappingResourceConfigList;
protected AdapterFactoryEditingDomain editingDomain;
+ private Label notifyLabel;
+ private boolean canSaveFile = true;
+ private Label imageLabel;
public ISelection getSelection() {
return selection;
@@ -268,6 +275,20 @@
mappingMainComposite.setLayout(gly);
section.setClient(mappingMainComposite);
+ Composite notifyComposite = toolkit
+ .createComposite(mappingMainComposite);
+ GridData ngd = new GridData(GridData.FILL_HORIZONTAL);
+ ngd.horizontalSpan = 3;
+ GridLayout ngl = new GridLayout();
+ ngl.numColumns = 2;
+ notifyComposite.setLayout(ngl);
+ notifyComposite.setLayoutData(ngd);
+ imageLabel = toolkit.createLabel(notifyComposite, "");
+ imageLabel.setImage(SmooksUIActivator.getDefault().getImageRegistry()
+ .get(SmooksGraphConstants.IMAGE_EMPTY));
+ notifyLabel = toolkit.createLabel(notifyComposite, "" );
+ GridData nlgd = new GridData(GridData.FILL_HORIZONTAL);
+ notifyLabel.setLayoutData(nlgd);
GridData sgd = new GridData(GridData.FILL_BOTH);
section.setLayoutData(sgd);
{
@@ -648,6 +669,16 @@
*/
@Override
public void doSave(IProgressMonitor monitor) {
+ if (!canSaveFile) {
+ boolean cleanError = MessageDialog
+ .openQuestion(
+ getSite().getShell(),
+ "Clean all the errors please",
+ "There occurs some errors on the graphical design , please clean all errors .\n" +
+ "Click \"Yes\" to return . If you don't care that , click \"No\" to save file.");
+ if (cleanError)
+ return;
+ }
SmooksFileBuilder builder = this.getSmooksFileBuilder();
builder.setSmooksResource(this.smooksResource);
SmooksConfigurationFileGenerateContext context = this
@@ -756,6 +787,7 @@
public void commandStackChanged(EventObject event) {
commandStackChanged = true;
+ analyzeDesignGraph();
updateSelectionActions();
getManagedForm().dirtyStateChanged();
}
@@ -901,8 +933,10 @@
if (dialog.open() == org.eclipse.jface.dialogs.Dialog.OK) {
sourceDataTypeID = wizard.getSourceDataTypeID();
targetDataTypeID = wizard.getTargetDataTypeID();
- sourceTreeViewerInputModel = wizard.getSourceTreeViewerInputContents();
- targetTreeViewerInputModel = wizard.getTargetTreeViewerInputContents();
+ sourceTreeViewerInputModel = wizard
+ .getSourceTreeViewerInputContents();
+ targetTreeViewerInputModel = wizard
+ .getTargetTreeViewerInputContents();
this.getSmooksConfigurationFileGenerateContext()
.setSourceDataTypeID(sourceDataTypeID);
this.getSmooksConfigurationFileGenerateContext()
@@ -956,9 +990,9 @@
if (input instanceof SmooksFileEditorInput) {
this.sourceTreeViewerInputModel = ((SmooksFileEditorInput) input)
.getSourceTreeViewerInputContents();
-
+
this.targetTreeViewerInputModel = ((SmooksFileEditorInput) input)
- .getTargetTreeViewerInputContents();
+ .getTargetTreeViewerInputContents();
}
// }
@@ -976,9 +1010,13 @@
}
/**
- * It's a very important method <p>
- * If call the method , there will open the data selection wizard to allow user select new data , <p>
+ * It's a very important method
+ * <p>
+ * If call the method , there will open the data selection wizard to allow
+ * user select new data ,
+ * <p>
* when user select the new data , the connections will be removed.
+ *
* @param viewer
*/
protected void showCreationWizard(TreeViewer viewer) {
@@ -1210,10 +1248,63 @@
public void commandStackChanged(EventObject event) {
commandStackChanged = true;
+ analyzeDesignGraph();
updateSelectionActions();
getManagedForm().dirtyStateChanged();
}
+ protected void setErrorMessage(String errorMessage) {
+ imageLabel.setImage(SmooksUIActivator.getDefault().getImageRegistry().get(SmooksGraphConstants.IMAGE_EMPTY));
+ notifyLabel.setText("");
+ canSaveFile = true;
+ if (errorMessage != null) {
+ imageLabel.setImage(SmooksUIActivator.getDefault()
+ .getImageRegistry().get(SmooksGraphConstants.IMAGE_ERROR));
+ notifyLabel.setText(errorMessage);
+ canSaveFile = false;
+ }
+ }
+
+ protected void setWarningMessage(String warningMessage) {
+ imageLabel.setImage(SmooksUIActivator.getDefault().getImageRegistry().get(SmooksGraphConstants.IMAGE_EMPTY));
+ notifyLabel.setText("");
+ if (warningMessage != null) {
+ imageLabel
+ .setImage(SmooksUIActivator.getDefault().getImageRegistry()
+ .get(SmooksGraphConstants.IMAGE_WARNING));
+ notifyLabel.setText(warningMessage);
+ }
+ }
+
+ protected void analyzeDesignGraph() {
+ try {
+ IMappingAnalyzer analyzer = AnalyzerFactory.getInstance()
+ .getMappingAnalyzer(sourceDataTypeID, targetDataTypeID);
+ SmooksConfigurationFileGenerateContext context = this
+ .createContext();
+ this.initSmooksConfigurationFileGenerateContext(context);
+ DesignTimeAnalyzeResult result = analyzer
+ .analyzeGraphModel(context);
+ if (result != null) {
+ String errorMessage = result.getErrorMessage();
+ String warningMessage = result.getWarningMessage();
+
+ if (errorMessage != null) {
+ setErrorMessage(errorMessage);
+ return;
+ }
+
+ if (warningMessage != null) {
+ setWarningMessage(warningMessage);
+ return;
+ }
+ }
+ } catch (CoreException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ }
+
/**
* @return the editingDomain
*/
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/editors/TypeIDSelectionWizard.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/editors/TypeIDSelectionWizard.java 2008-10-17 07:27:04 UTC (rev 10909)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/editors/TypeIDSelectionWizard.java 2008-10-17 09:55:10 UTC (rev 10910)
@@ -58,8 +58,8 @@
if(sid == null || tid == null) return false;
this.sourceDataTypeID = sid;
this.targetDataTypeID = tid;
- setSourceTreeViewerInputContents(page.getSourceTreeViewerInputContents());
- setTargetTreeViewerInputContents(page.getTargetTreeViewerInputContents());
+// setSourceTreeViewerInputContents(page.getSourceTreeViewerInputContents());
+// setTargetTreeViewerInputContents(page.getTargetTreeViewerInputContents());
return true;
}
public Object getSourceTreeViewerInputContents() {
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/editors/TypeIDSelectionWizardPage.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/editors/TypeIDSelectionWizardPage.java 2008-10-17 07:27:04 UTC (rev 10909)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/editors/TypeIDSelectionWizardPage.java 2008-10-17 09:55:10 UTC (rev 10910)
@@ -327,6 +327,8 @@
if (wizard instanceof TypeIDSelectionWizard) {
String s = ((TypeIDSelectionWizard) wizard).getSourceDataTypeID();
String t = ((TypeIDSelectionWizard) wizard).getTargetDataTypeID();
+ this.setSourceID(s);
+ this.setTargetID(t);
if (initViewerCheckState(s, source)) {
source.getTable().setEnabled(false);
}
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/modelparser/SmooksConfigurationFileGenerateContext.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/modelparser/SmooksConfigurationFileGenerateContext.java 2008-10-17 07:27:04 UTC (rev 10909)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/modelparser/SmooksConfigurationFileGenerateContext.java 2008-10-17 09:55:10 UTC (rev 10910)
@@ -68,7 +68,7 @@
/**
* @return the dataMappingRootModel
*/
- public GraphRootModel getDataMappingRootModel() {
+ public GraphRootModel getGraphicalRootModel() {
return dataMappingRootModel;
}
/**
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/utils/SmooksGraphConstants.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/utils/SmooksGraphConstants.java 2008-10-17 07:27:04 UTC (rev 10909)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/utils/SmooksGraphConstants.java 2008-10-17 09:55:10 UTC (rev 10910)
@@ -5,14 +5,18 @@
/**
* @author root
- *
+ *
*/
public class SmooksGraphConstants {
public static final String IMAGE_PATH_ERROR = "icons/full/obj16/error_obj.gif";
-
+
public static final String IMAGE_PATH_WARNING = "icons/full/obj16/warning_obj.gif";
-
+
+ public static final String IMAGE_PATH_BLANK = "icons/full/obj16/blank.gif";
+
public static final String IMAGE_WARNING = IMAGE_PATH_WARNING;
-
+
public static final String IMAGE_ERROR = IMAGE_PATH_ERROR;
+
+ public static final String IMAGE_EMPTY = IMAGE_PATH_BLANK;
}
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.xml/src/org/jboss/tools/smooks/xml2xml/XML2XMLAnalyzer.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.xml/src/org/jboss/tools/smooks/xml2xml/XML2XMLAnalyzer.java 2008-10-17 07:27:04 UTC (rev 10909)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.xml/src/org/jboss/tools/smooks/xml2xml/XML2XMLAnalyzer.java 2008-10-17 09:55:10 UTC (rev 10910)
@@ -6,6 +6,7 @@
import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.swt.widgets.Shell;
import org.jboss.tools.smooks.analyzer.AbstractAnalyzer;
+import org.jboss.tools.smooks.analyzer.DesignTimeAnalyzeResult;
import org.jboss.tools.smooks.analyzer.MappingResourceConfigList;
import org.jboss.tools.smooks.analyzer.SmooksAnalyzerException;
import org.jboss.tools.smooks.model.SmooksResourceListType;
@@ -45,4 +46,10 @@
return null;
}
+ public DesignTimeAnalyzeResult analyzeGraphModel(
+ SmooksConfigurationFileGenerateContext context) {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
}
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.xml2java/src/org/jboss/tools/smooks/xml2java/analyzer/XML2JavaAnalyzer.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.xml2java/src/org/jboss/tools/smooks/xml2java/analyzer/XML2JavaAnalyzer.java 2008-10-17 07:27:04 UTC (rev 10909)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.xml2java/src/org/jboss/tools/smooks/xml2java/analyzer/XML2JavaAnalyzer.java 2008-10-17 09:55:10 UTC (rev 10910)
@@ -18,6 +18,7 @@
import org.eclipse.emf.ecore.xml.type.AnyType;
import org.jboss.tools.smooks.analyzer.AbstractAnalyzer;
+import org.jboss.tools.smooks.analyzer.DesignTimeAnalyzeResult;
import org.jboss.tools.smooks.analyzer.MappingModel;
import org.jboss.tools.smooks.analyzer.MappingResourceConfigList;
import org.jboss.tools.smooks.analyzer.SmooksAnalyzerException;
@@ -58,7 +59,7 @@
throws SmooksAnalyzerException {
SmooksResourceListType listType = context.getSmooksResourceListModel();
- GraphRootModel rootModel = context.getDataMappingRootModel();
+ GraphRootModel rootModel = context.getGraphicalRootModel();
List children = rootModel.getChildren();
for (Iterator iterator = children.iterator(); iterator.hasNext();) {
TreeItemRelationModel dataModel = (TreeItemRelationModel) iterator
@@ -144,7 +145,7 @@
boolean isComplex = true;
JavaBeanModel child = (JavaBeanModel) iterator.next();
AbstractStructuredDataModel graphModel = UIUtils.findGraphModel(
- context.getDataMappingRootModel(), child);
+ context.getGraphicalRootModel(), child);
LineConnectionModel connection = UIUtils
.getFirstTargetModelViaConnection(graphModel);
if (connection == null)
@@ -383,4 +384,10 @@
return null;
}
+ public DesignTimeAnalyzeResult analyzeGraphModel(
+ SmooksConfigurationFileGenerateContext context) {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
}
17 years, 2 months
JBoss Tools SVN: r10909 - in trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test: src/org/jboss/tools/jsf/vpe/richfaces/test and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: dmaliarevich
Date: 2008-10-17 03:27:04 -0400 (Fri, 17 Oct 2008)
New Revision: 10909
Added:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components/dragSupport.xhtml
trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components/dropSupport.xhtml
Modified:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/src/org/jboss/tools/jsf/vpe/richfaces/test/RichFacesComponentContentTest.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-2810,
junit test for rich:dragSupport and rich:dropSupport was added.
Added: trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components/dragSupport.xhtml
===================================================================
(Binary files differ)
Property changes on: trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components/dragSupport.xhtml
___________________________________________________________________
Name: svn:mime-type
+ application/xhtml+xml
Added: trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components/dropSupport.xhtml
===================================================================
(Binary files differ)
Property changes on: trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components/dropSupport.xhtml
___________________________________________________________________
Name: svn:mime-type
+ application/xhtml+xml
Modified: trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/src/org/jboss/tools/jsf/vpe/richfaces/test/RichFacesComponentContentTest.java
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/src/org/jboss/tools/jsf/vpe/richfaces/test/RichFacesComponentContentTest.java 2008-10-17 06:21:15 UTC (rev 10908)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/src/org/jboss/tools/jsf/vpe/richfaces/test/RichFacesComponentContentTest.java 2008-10-17 07:27:04 UTC (rev 10909)
@@ -116,11 +116,11 @@
}
public void testDragSupport() throws Throwable {
- assertTrue("it is necessary to add a body of the test ", false);//$NON-NLS-1$
+ performInvisibleTagTest("components/dragSupport.xhtml", "dragSupport"); //$NON-NLS-1$ //$NON-NLS-2$
}
public void testDropSupport() throws Throwable {
- assertTrue("it is necessary to add a body of the test ", false);//$NON-NLS-1$
+ performInvisibleTagTest("components/dropSupport.xhtml", "dropSupport"); //$NON-NLS-1$ //$NON-NLS-2$
}
public void testDragListener() throws Throwable {
17 years, 2 months
JBoss Tools SVN: r10908 - in trunk/common: plugins/org.jboss.tools.common.text.ext/src/org/jboss/tools/common/text/ext/util and 2 other directories.
by jbosstools-commits@lists.jboss.org
Author: dgolovin
Date: 2008-10-17 02:21:15 -0400 (Fri, 17 Oct 2008)
New Revision: 10908
Added:
trunk/common/tests/org.jboss.tools.common.text.ext.test/projects/HiperlinksTestProject/WebContent/WEB-INF/tldAttributeNameOpenOnTests.tld
Modified:
trunk/common/plugins/org.jboss.tools.common.text.ext/src/org/jboss/tools/common/text/ext/ExtensionsPlugin.java
trunk/common/plugins/org.jboss.tools.common.text.ext/src/org/jboss/tools/common/text/ext/util/StructuredSelectionHelper.java
trunk/common/tests/org.jboss.tools.common.text.ext.test/src/org/jboss/tools/common/text/ext/test/OpenOnsTest.java
Log:
increase coverage and fix errors in ExtensionPlugin
Modified: trunk/common/plugins/org.jboss.tools.common.text.ext/src/org/jboss/tools/common/text/ext/ExtensionsPlugin.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.text.ext/src/org/jboss/tools/common/text/ext/ExtensionsPlugin.java 2008-10-17 03:01:17 UTC (rev 10907)
+++ trunk/common/plugins/org.jboss.tools.common.text.ext/src/org/jboss/tools/common/text/ext/ExtensionsPlugin.java 2008-10-17 06:21:15 UTC (rev 10908)
@@ -16,6 +16,7 @@
import org.jboss.tools.common.log.BaseUIPlugin;
import org.jboss.tools.common.log.IPluginLog;
import org.jboss.tools.common.text.ext.hyperlink.HyperlinkDetector;
+import org.osgi.framework.BundleContext;
/**
@@ -35,6 +36,7 @@
*/
public ExtensionsPlugin() {
super();
+ plugin = this;
}
/**
Modified: trunk/common/plugins/org.jboss.tools.common.text.ext/src/org/jboss/tools/common/text/ext/util/StructuredSelectionHelper.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.text.ext/src/org/jboss/tools/common/text/ext/util/StructuredSelectionHelper.java 2008-10-17 03:01:17 UTC (rev 10907)
+++ trunk/common/plugins/org.jboss.tools.common.text.ext/src/org/jboss/tools/common/text/ext/util/StructuredSelectionHelper.java 2008-10-17 06:21:15 UTC (rev 10908)
@@ -15,10 +15,10 @@
import org.eclipse.jface.viewers.ISelectionProvider;
import org.eclipse.ui.IEditorPart;
import org.eclipse.ui.IWorkbenchPage;
+import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.texteditor.ITextEditor;
import org.eclipse.wst.sse.core.internal.provisional.IndexedRegion;
import org.eclipse.wst.sse.ui.StructuredTextEditor;
-import org.jboss.tools.common.text.ext.ExtensionsPlugin;
import org.jboss.tools.common.text.ext.IEditorWrapper;
import org.jboss.tools.common.text.ext.IMultiPageEditor;
@@ -37,7 +37,7 @@
public static StructuredTextEditor getStructuredTextEditor (IEditorPart editorPart) {
IEditorPart activeEditorPart = editorPart;
if (activeEditorPart == null) {
- IWorkbenchPage workbenchPage = ExtensionsPlugin.getDefault().getWorkbench().getActiveWorkbenchWindow().getActivePage();
+ IWorkbenchPage workbenchPage = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
activeEditorPart = workbenchPage.getActiveEditor();
}
if (activeEditorPart instanceof IMultiPageEditor) {
Added: trunk/common/tests/org.jboss.tools.common.text.ext.test/projects/HiperlinksTestProject/WebContent/WEB-INF/tldAttributeNameOpenOnTests.tld
===================================================================
--- trunk/common/tests/org.jboss.tools.common.text.ext.test/projects/HiperlinksTestProject/WebContent/WEB-INF/tldAttributeNameOpenOnTests.tld (rev 0)
+++ trunk/common/tests/org.jboss.tools.common.text.ext.test/projects/HiperlinksTestProject/WebContent/WEB-INF/tldAttributeNameOpenOnTests.tld 2008-10-17 06:21:15 UTC (rev 10908)
@@ -0,0 +1,46 @@
+<?xml version="1.0" encoding="ISO-8859-1" ?>
+
+<!DOCTYPE taglib
+ PUBLIC "-//Sun Microsystems, Inc.//DTD JSP Tag Library 1.2//EN"
+ "http://java.sun.com/dtd/web-jsptaglibrary_1_2.dtd">
+
+<taglib>
+ <tlib-version>1.0</tlib-version>
+ <jsp-version>1.2</jsp-version>
+ <short-name>test</short-name>
+ <uri>http://org.jboss.org/tests</uri>
+ <description>
+ Test tld to test attribute name open-on
+ </description>
+
+ <validator>
+ <validator-class>
+ com.sun.faces.taglib.jsf_core.CoreValidator
+ </validator-class>
+ <description>
+ verify hiperlink to the class
+ </description>
+ </validator>
+
+ <listener>
+ <listener-class>com.sun.faces.config.ConfigureListener</listener-class>
+ </listener>
+
+ <tag>
+ <name>actionListener</name>
+ <tag-class>com.sun.faces.taglib.jsf_core.ActionListenerTag</tag-class>
+ <tei-class>com.sun.faces.taglib.FacesTagExtraInfo</tei-class>
+ <body-content>empty</body-content>
+
+ <variable>
+ <name-from-attribute>attr1</name-from-attribute>
+ </variable>
+
+ <attribute>
+ <name>attr1</name>
+ <required>true</required>
+ <rtexprvalue>false</rtexprvalue>
+ </attribute>
+ </tag>
+
+</taglib>
Property changes on: trunk/common/tests/org.jboss.tools.common.text.ext.test/projects/HiperlinksTestProject/WebContent/WEB-INF/tldAttributeNameOpenOnTests.tld
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: trunk/common/tests/org.jboss.tools.common.text.ext.test/src/org/jboss/tools/common/text/ext/test/OpenOnsTest.java
===================================================================
--- trunk/common/tests/org.jboss.tools.common.text.ext.test/src/org/jboss/tools/common/text/ext/test/OpenOnsTest.java 2008-10-17 03:01:17 UTC (rev 10907)
+++ trunk/common/tests/org.jboss.tools.common.text.ext.test/src/org/jboss/tools/common/text/ext/test/OpenOnsTest.java 2008-10-17 06:21:15 UTC (rev 10908)
@@ -509,5 +509,28 @@
String fileName = editor.getEditorInput().getName();
assertTrue("html_basic.tld".equals(fileName));
}
-
+
+ public static final String TLD_ATTRIBUTE_NAME_TEST_FILE = OPENON_TEST_PROJECT + "/WebContent/WEB-INF/tldAttributeNameOpenOnTests.tld";
+
+ public void testTldAttributeNameOpenOn() throws CoreException, BadLocationException {
+ IEditorPart editor = WorkbenchUtils.openEditor(TLD_ATTRIBUTE_NAME_TEST_FILE);
+ assertTrue(editor instanceof DefaultMultipageEditor);
+ DefaultMultipageEditor tldEditor = (DefaultMultipageEditor) editor;
+ tldEditor.selectPageByName("Source");
+ ISourceViewer viewer = tldEditor.getSourceEditor().getTextViewer();
+
+ IRegion reg = new FindReplaceDocumentAdapter(tldEditor.getSourceEditor().getTextViewer().getDocument()).find(0,
+ "attr1", true, true, false, false);
+ IHyperlink[] links = HyperlinkDetector.getInstance().detectHyperlinks(viewer, reg, false);
+ assertNotNull(links);
+ assertTrue(links.length!=0);
+ //assertNotNull(links[0].getHyperlinkText());
+ assertNotNull(links[0].toString());
+ links[0].open();
+ JobUtils.waitForIdle();
+ editor = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor();
+
+ ITextSelection selection = (ITextSelection)viewer.getSelectionProvider().getSelection();
+ assertEquals("<name>", selection.getText());
+ }
}
17 years, 2 months
JBoss Tools SVN: r10907 - trunk/smooks/plugins/org.jboss.tools.smooks.javabean/src/org/jboss/tools/smooks/javabean/ui.
by jbosstools-commits@lists.jboss.org
Author: DartPeng
Date: 2008-10-16 23:01:17 -0400 (Thu, 16 Oct 2008)
New Revision: 10907
Modified:
trunk/smooks/plugins/org.jboss.tools.smooks.javabean/src/org/jboss/tools/smooks/javabean/ui/NewJavaBeanStrucutredDataWizard.java
Log:
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.javabean/src/org/jboss/tools/smooks/javabean/ui/NewJavaBeanStrucutredDataWizard.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.javabean/src/org/jboss/tools/smooks/javabean/ui/NewJavaBeanStrucutredDataWizard.java 2008-10-17 02:43:26 UTC (rev 10906)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.javabean/src/org/jboss/tools/smooks/javabean/ui/NewJavaBeanStrucutredDataWizard.java 2008-10-17 03:01:17 UTC (rev 10907)
@@ -16,6 +16,7 @@
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IResource;
+import org.eclipse.core.runtime.IAdaptable;
import org.eclipse.jdt.core.IJavaProject;
import org.eclipse.jdt.core.JavaCore;
import org.eclipse.jdt.internal.core.JavaProject;
@@ -95,6 +96,14 @@
IProject project = ((IResource)obj).getProject();
this.project = JavaCore.create(project);
}
+
+ if(project == null){
+ if(obj instanceof IAdaptable){
+ IResource relateResource =(IResource) ((IAdaptable)obj).getAdapter(IResource.class);
+ IProject project = relateResource.getProject();
+ this.project = JavaCore.create(project);
+ }
+ }
}
}
}
17 years, 2 months
JBoss Tools SVN: r10906 - trunk/smooks/plugins/org.jboss.tools.smooks.javabean/src/org/jboss/tools/smooks/javabean/analyzer.
by jbosstools-commits@lists.jboss.org
Author: DartPeng
Date: 2008-10-16 22:43:26 -0400 (Thu, 16 Oct 2008)
New Revision: 10906
Modified:
trunk/smooks/plugins/org.jboss.tools.smooks.javabean/src/org/jboss/tools/smooks/javabean/analyzer/JavaBeanAnalyzer.java
Log:
JBIDE-2917
the input source/target object instance can't be known by the Analyzer.I have fixed that.
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.javabean/src/org/jboss/tools/smooks/javabean/analyzer/JavaBeanAnalyzer.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.javabean/src/org/jboss/tools/smooks/javabean/analyzer/JavaBeanAnalyzer.java 2008-10-17 01:51:18 UTC (rev 10905)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.javabean/src/org/jboss/tools/smooks/javabean/analyzer/JavaBeanAnalyzer.java 2008-10-17 02:43:26 UTC (rev 10906)
@@ -456,6 +456,16 @@
public MappingResourceConfigList analyzeMappingSmooksModel(
SmooksResourceListType listType, Object sourceObject,
Object targetObject) {
+ if(sourceObject instanceof List){
+ if(!((List)sourceObject).isEmpty()){
+ sourceObject = (JavaBeanModel) ((List)sourceObject).get(0);
+ }
+ }
+ if(targetObject instanceof List){
+ if(!((List)targetObject).isEmpty()){
+ targetObject = (JavaBeanModel) ((List)targetObject).get(0);
+ }
+ }
if (!(sourceObject instanceof JavaBeanModel)
|| !(targetObject instanceof JavaBeanModel)) {
return MappingResourceConfigList.createEmptyList();
17 years, 2 months
JBoss Tools SVN: r10905 - in trunk/common: plugins/org.jboss.tools.common.text.ext/src/org/jboss/tools/common/text/ext/hyperlink and 4 other directories.
by jbosstools-commits@lists.jboss.org
Author: dgolovin
Date: 2008-10-16 21:51:18 -0400 (Thu, 16 Oct 2008)
New Revision: 10905
Added:
trunk/common/tests/org.jboss.tools.common.text.ext.test/projects/HiperlinksTestProject/WebContent/faceletsHiperlinkTests.xhtml
trunk/common/tests/org.jboss.tools.common.text.ext.test/projects/HiperlinksTestProject/WebContent/jspXmlFormatTests.jsp
trunk/common/tests/org.jboss.tools.common.text.ext.test/projects/HiperlinksTestProject/WebContent/templates/
trunk/common/tests/org.jboss.tools.common.text.ext.test/projects/HiperlinksTestProject/WebContent/templates/common.xhtml
Modified:
trunk/common/plugins/org.jboss.tools.common.text.ext/src/org/jboss/tools/common/text/ext/ExtensionsPlugin.java
trunk/common/plugins/org.jboss.tools.common.text.ext/src/org/jboss/tools/common/text/ext/hyperlink/AbstractHyperlink.java
trunk/common/plugins/org.jboss.tools.common.text.ext/src/org/jboss/tools/common/text/ext/hyperlink/ClassHyperlink.java
trunk/common/plugins/org.jboss.tools.common.text.ext/src/org/jboss/tools/common/text/ext/hyperlink/ClassMethodHyperlink.java
trunk/common/tests/org.jboss.tools.common.text.ext.test/projects/HiperlinksTestProject/.classpath
trunk/common/tests/org.jboss.tools.common.text.ext.test/projects/HiperlinksTestProject/WebContent/beanHyperlinkTests.jsp
trunk/common/tests/org.jboss.tools.common.text.ext.test/projects/HiperlinksTestProject/WebContent/styleHyperlinkTests.jsp
trunk/common/tests/org.jboss.tools.common.text.ext.test/src/org/jboss/tools/common/text/ext/test/OpenOnsTest.java
Log:
tests for common.text.ext
Modified: trunk/common/plugins/org.jboss.tools.common.text.ext/src/org/jboss/tools/common/text/ext/ExtensionsPlugin.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.text.ext/src/org/jboss/tools/common/text/ext/ExtensionsPlugin.java 2008-10-17 00:04:13 UTC (rev 10904)
+++ trunk/common/plugins/org.jboss.tools.common.text.ext/src/org/jboss/tools/common/text/ext/ExtensionsPlugin.java 2008-10-17 01:51:18 UTC (rev 10905)
@@ -10,11 +10,6 @@
******************************************************************************/
package org.jboss.tools.common.text.ext;
-import java.util.MissingResourceException;
-import java.util.ResourceBundle;
-
-import org.eclipse.core.resources.IWorkspace;
-import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.IAdaptable;
import org.eclipse.core.runtime.IPluginDescriptor;
import org.eclipse.jface.text.hyperlink.IHyperlinkDetector;
@@ -32,8 +27,6 @@
public class ExtensionsPlugin extends BaseUIPlugin implements IAdaptable {
//The shared instance.
private static ExtensionsPlugin plugin;
- //Resource bundle.
- private ResourceBundle resourceBundle;
public static final String PLUGIN_ID = "org.jboss.tools.common.text.ext";
@@ -42,62 +35,15 @@
*/
public ExtensionsPlugin() {
super();
- plugin = this;
- try {
- resourceBundle= ResourceBundle.getBundle("org.jboss.tools.common.text.ext.ExtensionsPlugin");
- } catch (MissingResourceException x) {
- resourceBundle = null;
- }
}
/**
- * The constructor.
- */
- public ExtensionsPlugin(IPluginDescriptor descriptor) {
- super();
- plugin = this;
- try {
- resourceBundle= ResourceBundle.getBundle("org.jboss.tools.common.text.ext.ExtensionsPlugin");
- } catch (MissingResourceException x) {
- resourceBundle = null;
- }
- }
-
- /**
* Returns the shared instance.
*/
public static ExtensionsPlugin getDefault() {
return plugin;
}
- /**
- * Returns the workspace instance.
- */
- public static IWorkspace getWorkspace() {
- return ResourcesPlugin.getWorkspace();
- }
-
- /**
- * Returns the string from the plugin's resource bundle,
- * or 'key' if not found.
- */
- public static String getResourceString(String key) {
- ResourceBundle bundle= ExtensionsPlugin.getDefault().getResourceBundle();
- try {
- return bundle.getString(key);
- } catch (MissingResourceException e) {
- return key;
- }
- }
-
- /**
- * Returns the plugin's resource bundle,
- */
- public ResourceBundle getResourceBundle() {
- return resourceBundle;
- }
-
-
public Object getAdapter(Class adapter) {
if (adapter == IHyperlinkDetector.class) {
return HyperlinkDetector.getInstance();
Modified: trunk/common/plugins/org.jboss.tools.common.text.ext/src/org/jboss/tools/common/text/ext/hyperlink/AbstractHyperlink.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.text.ext/src/org/jboss/tools/common/text/ext/hyperlink/AbstractHyperlink.java 2008-10-17 00:04:13 UTC (rev 10904)
+++ trunk/common/plugins/org.jboss.tools.common.text.ext/src/org/jboss/tools/common/text/ext/hyperlink/AbstractHyperlink.java 2008-10-17 01:51:18 UTC (rev 10905)
@@ -14,6 +14,7 @@
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.Path;
import org.eclipse.core.runtime.Platform;
@@ -233,7 +234,7 @@
protected IEditorInput createEditorInput(String fileString) {
String jarName = fileString.substring(0,fileString.indexOf("!"));
- IFile[] fs = ExtensionsPlugin.getDefault().getWorkspace().getRoot().findFilesForLocation(new Path(jarName));
+ IFile[] fs = ResourcesPlugin.getWorkspace().getRoot().findFilesForLocation(new Path(jarName));
if(fs == null || fs.length == 0) return null;
IProject p = fs[0].getProject();
Modified: trunk/common/plugins/org.jboss.tools.common.text.ext/src/org/jboss/tools/common/text/ext/hyperlink/ClassHyperlink.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.text.ext/src/org/jboss/tools/common/text/ext/hyperlink/ClassHyperlink.java 2008-10-17 00:04:13 UTC (rev 10904)
+++ trunk/common/plugins/org.jboss.tools.common.text.ext/src/org/jboss/tools/common/text/ext/hyperlink/ClassHyperlink.java 2008-10-17 01:51:18 UTC (rev 10905)
@@ -17,6 +17,7 @@
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IPath;
import org.eclipse.jdt.core.IJavaElement;
@@ -157,7 +158,7 @@
IStorageEditorInput moeInput = (IStorageEditorInput)editorInput;
IPath p = moeInput.getStorage().getFullPath();
String s0 = p.segment(0);
- project = ExtensionsPlugin.getWorkspace().getRoot().getProject(s0);
+ project = ResourcesPlugin.getWorkspace().getRoot().getProject(s0);
}
} else {
project = documentFile.getProject();
Modified: trunk/common/plugins/org.jboss.tools.common.text.ext/src/org/jboss/tools/common/text/ext/hyperlink/ClassMethodHyperlink.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.text.ext/src/org/jboss/tools/common/text/ext/hyperlink/ClassMethodHyperlink.java 2008-10-17 00:04:13 UTC (rev 10904)
+++ trunk/common/plugins/org.jboss.tools.common.text.ext/src/org/jboss/tools/common/text/ext/hyperlink/ClassMethodHyperlink.java 2008-10-17 01:51:18 UTC (rev 10905)
@@ -16,6 +16,7 @@
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IPath;
import org.eclipse.jdt.core.IJavaElement;
@@ -182,7 +183,7 @@
IStorageEditorInput moeInput = (IStorageEditorInput)editorInput;
IPath p = moeInput.getStorage().getFullPath();
String s0 = p.segment(0);
- project = ExtensionsPlugin.getWorkspace().getRoot().getProject(s0);
+ project = ResourcesPlugin.getWorkspace().getRoot().getProject(s0);
}
} else {
project = documentFile.getProject();
Modified: trunk/common/tests/org.jboss.tools.common.text.ext.test/projects/HiperlinksTestProject/.classpath
===================================================================
--- trunk/common/tests/org.jboss.tools.common.text.ext.test/projects/HiperlinksTestProject/.classpath 2008-10-17 00:04:13 UTC (rev 10904)
+++ trunk/common/tests/org.jboss.tools.common.text.ext.test/projects/HiperlinksTestProject/.classpath 2008-10-17 01:51:18 UTC (rev 10905)
@@ -3,7 +3,7 @@
<classpathentry kind="src" path="JavaSource"/>
<classpathentry kind="con" path="org.eclipse.jst.j2ee.internal.web.container"/>
<classpathentry kind="con" path="org.eclipse.jst.j2ee.internal.module.container"/>
- <classpathentry kind="con" path="org.eclipse.jst.server.core.container/org.eclipse.jst.server.preview.runtimeTarget/J2EE Preview"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/java-1.5.0-sun-1.5.0.15"/>
+ <classpathentry kind="con" path="org.eclipse.jst.server.core.container/org.eclipse.jst.server.tomcat.runtimeTarget/Apache Tomcat v6.0"/>
<classpathentry kind="output" path="WebContent/WEB-INF/classes"/>
</classpath>
Modified: trunk/common/tests/org.jboss.tools.common.text.ext.test/projects/HiperlinksTestProject/WebContent/beanHyperlinkTests.jsp
===================================================================
--- trunk/common/tests/org.jboss.tools.common.text.ext.test/projects/HiperlinksTestProject/WebContent/beanHyperlinkTests.jsp 2008-10-17 00:04:13 UTC (rev 10904)
+++ trunk/common/tests/org.jboss.tools.common.text.ext.test/projects/HiperlinksTestProject/WebContent/beanHyperlinkTests.jsp 2008-10-17 01:51:18 UTC (rev 10905)
@@ -2,4 +2,12 @@
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
<jsp:useBean id="b1" class="org.jboss.tools.test.TestBean1"></jsp:useBean>
<jsp:getProperty property="property1" name="b1"/>
+<jsp:setProperty property="property2" name="b1"/>
+<html>
+ <head>
+ <link rel="" >
+ </head>
+
+<a href="classHyperlinkTests.jsp">test</a>
+
Added: trunk/common/tests/org.jboss.tools.common.text.ext.test/projects/HiperlinksTestProject/WebContent/faceletsHiperlinkTests.xhtml
===================================================================
--- trunk/common/tests/org.jboss.tools.common.text.ext.test/projects/HiperlinksTestProject/WebContent/faceletsHiperlinkTests.xhtml (rev 0)
+++ trunk/common/tests/org.jboss.tools.common.text.ext.test/projects/HiperlinksTestProject/WebContent/faceletsHiperlinkTests.xhtml 2008-10-17 01:51:18 UTC (rev 10905)
@@ -0,0 +1,27 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:ui="http://java.sun.com/jsf/facelets"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:c="http://java.sun.com/jstl/core">
+
+ <f:loadBundle basename="resources" var="msg" />
+
+ <ui:composition template="/templates/common.xhtml">
+
+ <ui:define name="pageTitle">Input User Name</ui:define>
+
+ <ui:define name="pageHeader">Facelets Hello Application</ui:define>
+
+ <ui:define name="body">
+ <h:message showSummary="true" showDetail="false" style="color: red; font-weight: bold;" for="name" />
+ <form jsfc="h:form" id="helloForm">
+ ${msg.prompt}
+ <input label="Name" jsfc="h:inputText" required="true" id="name" value="#{person.name}" />
+ <input type="submit" jsfc="h:commandButton" id="submit"
+ action="greeting" value="Say Hello" />
+ </form>
+
+ </ui:define>
+ </ui:composition>
+</html>
Property changes on: trunk/common/tests/org.jboss.tools.common.text.ext.test/projects/HiperlinksTestProject/WebContent/faceletsHiperlinkTests.xhtml
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/common/tests/org.jboss.tools.common.text.ext.test/projects/HiperlinksTestProject/WebContent/jspXmlFormatTests.jsp
===================================================================
--- trunk/common/tests/org.jboss.tools.common.text.ext.test/projects/HiperlinksTestProject/WebContent/jspXmlFormatTests.jsp (rev 0)
+++ trunk/common/tests/org.jboss.tools.common.text.ext.test/projects/HiperlinksTestProject/WebContent/jspXmlFormatTests.jsp 2008-10-17 01:51:18 UTC (rev 10905)
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="ISO-8859-1" ?>
+<jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" xmlns:f="http://java.sun.com/jsf/core" xmlns:h="http://java.sun.com/jsf/html" version="2.0">
+ <jsp:directive.page language="java"
+ contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1" />
+ <jsp:text>
+ <![CDATA[ <?xml version="1.0" encoding="ISO-8859-1" ?> ]]>
+ </jsp:text>
+ <jsp:text>
+ <![CDATA[ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> ]]>
+ </jsp:text>
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
+ <title>Insert title here</title>
+ </head>
+ <body>
+ <f:view>
+
+ </f:view>
+ </body>
+</html>
+</jsp:root>
\ No newline at end of file
Property changes on: trunk/common/tests/org.jboss.tools.common.text.ext.test/projects/HiperlinksTestProject/WebContent/jspXmlFormatTests.jsp
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: trunk/common/tests/org.jboss.tools.common.text.ext.test/projects/HiperlinksTestProject/WebContent/styleHyperlinkTests.jsp
===================================================================
--- trunk/common/tests/org.jboss.tools.common.text.ext.test/projects/HiperlinksTestProject/WebContent/styleHyperlinkTests.jsp 2008-10-17 00:04:13 UTC (rev 10904)
+++ trunk/common/tests/org.jboss.tools.common.text.ext.test/projects/HiperlinksTestProject/WebContent/styleHyperlinkTests.jsp 2008-10-17 01:51:18 UTC (rev 10905)
@@ -4,7 +4,7 @@
<html>
<head>
<title>Input User Name Page</title>
- <link href="stylesheet/style15.css" rel="stylesheet" type="text/css" />
+ <link href="stylesheet/style15.css" rel="stylesheet" type="text/css" />
<link href="stylesheet/style14.css" rel="stylesheet" type="text/css" />
<link href="stylesheet/style13.css" rel="stylesheet" type="text/css" />
<link href="stylesheet/style12.css" rel="stylesheet" type="text/css" />
Added: trunk/common/tests/org.jboss.tools.common.text.ext.test/projects/HiperlinksTestProject/WebContent/templates/common.xhtml
===================================================================
--- trunk/common/tests/org.jboss.tools.common.text.ext.test/projects/HiperlinksTestProject/WebContent/templates/common.xhtml (rev 0)
+++ trunk/common/tests/org.jboss.tools.common.text.ext.test/projects/HiperlinksTestProject/WebContent/templates/common.xhtml 2008-10-17 01:51:18 UTC (rev 10905)
@@ -0,0 +1,65 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:ui="http://java.sun.com/jsf/facelets"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:f="http://java.sun.com/jsf/core">
+
+ <f:loadBundle basename="resources" var="msg" />
+ <head>
+ <title><ui:insert name="pageTitle">Page Title</ui:insert></title>
+ <style type="text/css">
+ body {
+ font-family: Verdana, Arial, Helvetica, sans-serif;
+ font-size: 14px;
+ }
+ .header {
+ font-family: Verdana, Arial, Helvetica, sans-serif;
+ font-size: 18px;
+ }
+ .bottom {
+ font-family: Verdana, Arial, Helvetica, sans-serif;
+ font-size: 9px;
+ text-align: center;
+ vertical-align: middle;
+ color: #8E969D;
+ }
+ </style>
+ </head>
+
+<body bgcolor="#ffffff">
+<table style="border:1px solid #CAD6E0" align="center" cellpadding="0" cellspacing="0" border="0" width="400">
+<tbody>
+
+ <tr>
+ <td class="header" height="42" align="center" valign="middle" width="100%" bgcolor="#E4EBEB">
+ <ui:insert name="pageHeader">Page Header</ui:insert>
+ </td>
+ </tr>
+ <tr>
+ <td height="1" width="100%" bgcolor="#CAD6E0"></td>
+ </tr>
+
+ <tr>
+ <td width="100%" colspan="2">
+ <table width="100%" style="height:150px" align="left" cellpadding="0" cellspacing="0" border="0">
+ <tbody>
+ <tr>
+ <td align="center" width="100%" valign="middle">
+
+ <ui:insert name="body">Page Body</ui:insert>
+
+ </td>
+ </tr>
+ </tbody>
+ </table>
+ </td>
+ </tr>
+
+ <tr>
+ <td colspan="2" valign="bottom" height="1" width="100%" bgcolor="#CAD6E0"></td>
+ </tr>
+</tbody>
+</table>
+</body>
+
+</html>
\ No newline at end of file
Property changes on: trunk/common/tests/org.jboss.tools.common.text.ext.test/projects/HiperlinksTestProject/WebContent/templates/common.xhtml
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: trunk/common/tests/org.jboss.tools.common.text.ext.test/src/org/jboss/tools/common/text/ext/test/OpenOnsTest.java
===================================================================
--- trunk/common/tests/org.jboss.tools.common.text.ext.test/src/org/jboss/tools/common/text/ext/test/OpenOnsTest.java 2008-10-17 00:04:13 UTC (rev 10904)
+++ trunk/common/tests/org.jboss.tools.common.text.ext.test/src/org/jboss/tools/common/text/ext/test/OpenOnsTest.java 2008-10-17 01:51:18 UTC (rev 10905)
@@ -366,6 +366,27 @@
assertTrue("TestBean1.java".equals(fileName));
}
+ public void testSetBeanPropertyOpenOn() throws CoreException, BadLocationException {
+ IEditorPart editor = WorkbenchUtils.openEditor(USE_BEAN_TEST_FILE);
+ assertTrue(editor instanceof JSPMultiPageEditor);
+ JSPMultiPageEditor jspMultyPageEditor = (JSPMultiPageEditor) editor;
+ ISourceViewer viewer = jspMultyPageEditor.getSourceEditor().getTextViewer();
+
+ IRegion reg = new FindReplaceDocumentAdapter(jspMultyPageEditor.getSourceEditor().getTextViewer().getDocument()).find(0,
+ "property2", true, true, false, false);
+ IHyperlink[] links = HyperlinkDetector.getInstance().detectHyperlinks(viewer, reg, false);
+ assertNotNull(links);
+ assertTrue(links.length!=0);
+ //assertNotNull(links[0].getHyperlinkText());
+ assertNotNull(links[0].toString());
+ links[0].open();
+ JobUtils.waitForIdle();
+
+ editor = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor();
+ String fileName = editor.getEditorInput().getName();
+ assertTrue("TestBean1.java".equals(fileName));
+ }
+
public static final String FORWARD_TEST_FILE = OPENON_TEST_PROJECT + "/WebContent/forwardHiperlinkTests.jsp";
@@ -441,4 +462,52 @@
assertTrue("includeHiperlinkPage1Tests.jsp".equals(fileName));
}
+ public static final String FACELETS_XHTML_TEST_FILE = OPENON_TEST_PROJECT + "/WebContent/faceletsHiperlinkTests.xhtml";
+
+
+ public void testJspXmlElementNameOpenOn() throws CoreException, BadLocationException {
+ IEditorPart editor = WorkbenchUtils.openEditor(FACELETS_XHTML_TEST_FILE);
+ assertTrue(editor instanceof JSPMultiPageEditor);
+ JSPMultiPageEditor jspMultyPageEditor = (JSPMultiPageEditor) editor;
+ ISourceViewer viewer = jspMultyPageEditor.getSourceEditor().getTextViewer();
+
+ IRegion reg = new FindReplaceDocumentAdapter(jspMultyPageEditor.getSourceEditor().getTextViewer().getDocument()).find(0,
+ "message", true, true, false, false);
+ IHyperlink[] links = HyperlinkDetector.getInstance().detectHyperlinks(viewer, reg, false);
+ assertNotNull(links);
+ assertTrue(links.length!=0);
+ //assertNotNull(links[0].getHyperlinkText());
+ assertNotNull(links[0].toString());
+ links[0].open();
+ JobUtils.waitForIdle();
+ editor = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor();
+
+ String fileName = editor.getEditorInput().getName();
+ assertTrue("html_basic.tld".equals(fileName));
+ }
+
+ public static final String JSP_XMLNS_TEST_FILE = OPENON_TEST_PROJECT + "/WebContent/jspXmlFormatTests.jsp";
+
+
+ public void testJspXmlnsNameOpenOn() throws CoreException, BadLocationException {
+ IEditorPart editor = WorkbenchUtils.openEditor(FACELETS_XHTML_TEST_FILE);
+ assertTrue(editor instanceof JSPMultiPageEditor);
+ JSPMultiPageEditor jspMultyPageEditor = (JSPMultiPageEditor) editor;
+ ISourceViewer viewer = jspMultyPageEditor.getSourceEditor().getTextViewer();
+
+ IRegion reg = new FindReplaceDocumentAdapter(jspMultyPageEditor.getSourceEditor().getTextViewer().getDocument()).find(0,
+ "http://java.sun.com/jsf/html", true, true, false, false);
+ IHyperlink[] links = HyperlinkDetector.getInstance().detectHyperlinks(viewer, reg, false);
+ assertNotNull(links);
+ assertTrue(links.length!=0);
+ //assertNotNull(links[0].getHyperlinkText());
+ assertNotNull(links[0].toString());
+ links[0].open();
+ JobUtils.waitForIdle();
+ editor = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor();
+
+ String fileName = editor.getEditorInput().getName();
+ assertTrue("html_basic.tld".equals(fileName));
+ }
+
}
17 years, 2 months
JBoss Tools SVN: r10904 - in trunk/as/plugins: org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/publishers and 14 other directories.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2008-10-16 20:04:13 -0400 (Thu, 16 Oct 2008)
New Revision: 10904
Added:
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/icons/cview16/
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/icons/cview16/server_perspective.gif
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/icons/cview16/servers_view.gif
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/eclipse/
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/eclipse/wst/
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/eclipse/wst/server/
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/eclipse/wst/server/ui/
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/eclipse/wst/server/ui/internal/
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/eclipse/wst/server/ui/internal/view/
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/eclipse/wst/server/ui/internal/view/servers/
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/eclipse/wst/server/ui/internal/view/servers/provisional/
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/eclipse/wst/server/ui/internal/view/servers/provisional/ServerActionProvider.java
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/eclipse/wst/server/ui/internal/view/servers/provisional/ServerContentProvider.java
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/eclipse/wst/server/ui/internal/view/servers/provisional/ServerDecorator.java
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/eclipse/wst/server/ui/internal/view/servers/provisional/ServerLabelProvider.java
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/eclipse/wst/server/ui/internal/view/servers/provisional/ServersView.java
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/eclipse/wst/server/ui/internal/view/servers/provisional/extensions/
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/eclipse/wst/server/ui/internal/view/servers/provisional/extensions/EventLogActionProvider.java
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/eclipse/wst/server/ui/internal/view/servers/provisional/extensions/EventLogContentProvider.java
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/eclipse/wst/server/ui/internal/view/servers/provisional/extensions/EventLogLabelProvider.java
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/eclipse/wst/server/ui/internal/view/servers/provisional/extensions/XPathProvider.java
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/descriptors/XPathCategory.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/descriptors/XPathFileResult.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/publishers/JstPublisher.java
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/META-INF/MANIFEST.MF
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/plugin.xml
Log:
Pushing in newest changes before branch. This should give some beta view for the users to play with.
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/descriptors/XPathCategory.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/descriptors/XPathCategory.java 2008-10-16 18:17:33 UTC (rev 10903)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/descriptors/XPathCategory.java 2008-10-17 00:04:13 UTC (rev 10904)
@@ -22,6 +22,7 @@
package org.jboss.ide.eclipse.as.core.extensions.descriptors;
import java.util.HashMap;
+import java.util.Iterator;
import org.eclipse.wst.server.core.IServer;
import org.jboss.ide.eclipse.as.core.server.internal.ServerAttributeHelper;
@@ -43,7 +44,8 @@
}
public String getName() { return this.name; }
-
+ public IServer getServer() { return this.server; }
+
public boolean queriesLoaded() {
return children != null;
}
@@ -77,6 +79,10 @@
children.remove(query.getName());
}
+ public boolean isLoaded() {
+ return children == null ? false : true;
+ }
+
/*
* Save these queries to its server object
*/
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/descriptors/XPathFileResult.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/descriptors/XPathFileResult.java 2008-10-16 18:17:33 UTC (rev 10903)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/descriptors/XPathFileResult.java 2008-10-17 00:04:13 UTC (rev 10904)
@@ -64,13 +64,17 @@
Iterator<Node> i = nodeList.iterator();
int z = 0;
while(i.hasNext()) {
- childList.add(new XPathResultNode(i.next(), query.getAttribute(), z++));
+ childList.add(new XPathResultNode(i.next(), query.getAttribute(), z++, this));
}
children = childList.toArray(new XPathResultNode[childList.size()]);
}
return children;
}
+ public boolean isLoaded() {
+ return children == null ? false : true;
+ }
+
/* A class representing an actual result node / element in the document */
public class XPathResultNode {
protected Node node;
@@ -79,13 +83,19 @@
protected int index;
protected Object val;
protected boolean dirty;
- public XPathResultNode(Node node, String attribute, int index) {
+ protected XPathFileResult file;
+ public XPathResultNode(Node node, String attribute, int index, XPathFileResult file) {
this.node = node;
this.attribute = attribute;
this.index = index;
this.hasAttribute = attribute == null || attribute.equals("") ? false : true;
+ this.file = file;
}
+ public XPathFileResult getFile() {
+ return file;
+ }
+
public int getIndex() {
return index;
}
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/publishers/JstPublisher.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/publishers/JstPublisher.java 2008-10-16 18:17:33 UTC (rev 10903)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/publishers/JstPublisher.java 2008-10-17 00:04:13 UTC (rev 10904)
@@ -149,6 +149,7 @@
}
};
FileUtil.touch(filter, deployPath.toFile(), true);
+ publishState = IServer.PUBLISH_STATE_NONE;
return null;
}
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.ui/META-INF/MANIFEST.MF
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.ui/META-INF/MANIFEST.MF 2008-10-16 18:17:33 UTC (rev 10903)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.ui/META-INF/MANIFEST.MF 2008-10-17 00:04:13 UTC (rev 10904)
@@ -41,7 +41,8 @@
org.eclipse.core.variables,
org.eclipse.search,
org.apache.ant,
- org.jboss.ide.eclipse.as.core
+ org.jboss.ide.eclipse.as.core,
+ org.eclipse.ui.navigator;bundle-version="3.3.100"
Eclipse-LazyStart: true
Export-Package: org.jboss.ide.eclipse.as.ui,
org.jboss.ide.eclipse.as.ui.dialogs,
Added: trunk/as/plugins/org.jboss.ide.eclipse.as.ui/icons/cview16/server_perspective.gif
===================================================================
(Binary files differ)
Property changes on: trunk/as/plugins/org.jboss.ide.eclipse.as.ui/icons/cview16/server_perspective.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/as/plugins/org.jboss.ide.eclipse.as.ui/icons/cview16/servers_view.gif
===================================================================
(Binary files differ)
Property changes on: trunk/as/plugins/org.jboss.ide.eclipse.as.ui/icons/cview16/servers_view.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/eclipse/wst/server/ui/internal/view/servers/provisional/ServerActionProvider.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/eclipse/wst/server/ui/internal/view/servers/provisional/ServerActionProvider.java (rev 0)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/eclipse/wst/server/ui/internal/view/servers/provisional/ServerActionProvider.java 2008-10-17 00:04:13 UTC (rev 10904)
@@ -0,0 +1,297 @@
+package org.eclipse.wst.server.ui.internal.view.servers.provisional;
+
+import java.util.Iterator;
+
+import org.eclipse.debug.core.ILaunchManager;
+import org.eclipse.jface.action.Action;
+import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.action.IContributionManager;
+import org.eclipse.jface.action.IMenuListener;
+import org.eclipse.jface.action.IMenuManager;
+import org.eclipse.jface.action.MenuManager;
+import org.eclipse.jface.action.Separator;
+import org.eclipse.jface.bindings.TriggerSequence;
+import org.eclipse.jface.viewers.IOpenListener;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.ISelectionProvider;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.viewers.OpenEvent;
+import org.eclipse.jface.viewers.StructuredViewer;
+import org.eclipse.swt.dnd.Clipboard;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.ui.IActionBars;
+import org.eclipse.ui.IWorkbench;
+import org.eclipse.ui.IWorkbenchActionConstants;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.actions.ActionFactory;
+import org.eclipse.ui.keys.IBindingService;
+import org.eclipse.ui.navigator.CommonActionProvider;
+import org.eclipse.ui.navigator.CommonViewer;
+import org.eclipse.ui.navigator.ICommonActionExtensionSite;
+import org.eclipse.ui.navigator.ICommonViewerSite;
+import org.eclipse.ui.navigator.ICommonViewerWorkbenchSite;
+import org.eclipse.wst.server.core.IModule;
+import org.eclipse.wst.server.core.IServer;
+import org.eclipse.wst.server.core.ServerPort;
+import org.eclipse.wst.server.core.model.ServerDelegate;
+import org.eclipse.wst.server.ui.internal.Messages;
+import org.eclipse.wst.server.ui.internal.ServerUIPlugin;
+import org.eclipse.wst.server.ui.internal.Trace;
+import org.eclipse.wst.server.ui.internal.actions.NewServerWizardAction;
+import org.eclipse.wst.server.ui.internal.view.servers.CopyAction;
+import org.eclipse.wst.server.ui.internal.view.servers.DeleteAction;
+import org.eclipse.wst.server.ui.internal.view.servers.ModuleServer;
+import org.eclipse.wst.server.ui.internal.view.servers.ModuleSloshAction;
+import org.eclipse.wst.server.ui.internal.view.servers.MonitorServerPortAction;
+import org.eclipse.wst.server.ui.internal.view.servers.OpenAction;
+import org.eclipse.wst.server.ui.internal.view.servers.PasteAction;
+import org.eclipse.wst.server.ui.internal.view.servers.PropertiesAction;
+import org.eclipse.wst.server.ui.internal.view.servers.PublishAction;
+import org.eclipse.wst.server.ui.internal.view.servers.PublishCleanAction;
+import org.eclipse.wst.server.ui.internal.view.servers.RemoveModuleAction;
+import org.eclipse.wst.server.ui.internal.view.servers.RenameAction;
+import org.eclipse.wst.server.ui.internal.view.servers.RestartModuleAction;
+import org.eclipse.wst.server.ui.internal.view.servers.ShowInConsoleAction;
+import org.eclipse.wst.server.ui.internal.view.servers.ShowInDebugAction;
+import org.eclipse.wst.server.ui.internal.view.servers.StartAction;
+import org.eclipse.wst.server.ui.internal.view.servers.StartModuleAction;
+import org.eclipse.wst.server.ui.internal.view.servers.StopAction;
+import org.eclipse.wst.server.ui.internal.view.servers.StopModuleAction;
+
+public class ServerActionProvider extends CommonActionProvider {
+ private ICommonActionExtensionSite actionSite;
+ private Clipboard clipboard;
+ public ServerActionProvider() {
+ super();
+ }
+
+ public void init(ICommonActionExtensionSite aSite) {
+ super.init(aSite);
+ this.actionSite = aSite;
+ ICommonViewerSite site = aSite.getViewSite();
+ if( site instanceof ICommonViewerWorkbenchSite ) {
+ StructuredViewer v = aSite.getStructuredViewer();
+ if( v instanceof CommonViewer ) {
+ CommonViewer cv = (CommonViewer)v;
+ ICommonViewerWorkbenchSite wsSite = (ICommonViewerWorkbenchSite)site;
+ addListeners(cv);
+ makeServerActions(cv, wsSite.getSelectionProvider());
+ }
+ }
+ }
+
+
+ // actions on a server
+ protected Action[] actions;
+ protected Action actionModifyModules;
+ protected Action openAction, showInConsoleAction, showInDebugAction, propertiesAction, monitorPropertiesAction;
+ protected Action copyAction, pasteAction, deleteAction, renameAction;
+ protected Action noneAction = new Action(Messages.dialogMonitorNone) {
+ // dummy action
+ };
+
+ private void addListeners(CommonViewer tableViewer) {
+ tableViewer.addOpenListener(new IOpenListener() {
+ public void open(OpenEvent event) {
+ try {
+ IStructuredSelection sel = (IStructuredSelection) event.getSelection();
+ Object data = sel.getFirstElement();
+ if (!(data instanceof IServer))
+ return;
+ IServer server = (IServer) data;
+ ServerUIPlugin.editServer(server);
+ } catch (Exception e) {
+ Trace.trace(Trace.SEVERE, "Could not open server", e);
+ }
+ }
+ });
+ }
+
+ private void makeServerActions(CommonViewer tableViewer, ISelectionProvider provider) {
+ clipboard = new Clipboard(tableViewer.getTree().getDisplay());
+ Shell shell = tableViewer.getTree().getShell();
+
+ actions = new Action[6];
+ // create the start actions
+ actions[0] = new StartAction(shell, provider, ILaunchManager.DEBUG_MODE);
+ actions[1] = new StartAction(shell, provider, ILaunchManager.RUN_MODE);
+ actions[2] = new StartAction(shell, provider, ILaunchManager.PROFILE_MODE);
+
+ // create the stop action
+ actions[3] = new StopAction(shell, provider);
+
+ // create the publish actions
+ actions[4] = new PublishAction(shell, provider);
+ actions[5] = new PublishCleanAction(shell, provider);
+
+ // create the open action
+ openAction = new OpenAction(provider);
+
+// // create copy, paste, and delete actions
+ pasteAction = new PasteAction(shell, provider, clipboard);
+ copyAction = new CopyAction(provider, clipboard, pasteAction);
+ deleteAction = new DeleteAction(shell, provider);
+ renameAction = new RenameAction(shell, tableViewer, provider);
+
+ // create the other actions
+ actionModifyModules = new ModuleSloshAction(shell, provider);
+ showInConsoleAction = new ShowInConsoleAction(provider);
+ showInDebugAction = new ShowInDebugAction(provider);
+
+ // create the properties action
+ propertiesAction = new PropertiesAction(shell, provider);
+ monitorPropertiesAction = new PropertiesAction(shell, "org.eclipse.wst.server.ui.properties.monitor", provider);
+ }
+
+ public void fillActionBars(IActionBars actionBars) {
+ actionBars.setGlobalActionHandler("org.eclipse.wst.server.debug", actions[0]);
+ actionBars.setGlobalActionHandler("org.eclipse.wst.server.run", actions[1]);
+ actionBars.setGlobalActionHandler("org.eclipse.wst.server.stop", actions[3]);
+ actionBars.setGlobalActionHandler("org.eclipse.wst.server.publish", actions[4]);
+ actionBars.setGlobalActionHandler("org.eclipse.ui.navigator.Open", openAction);
+ actionBars.setGlobalActionHandler(ActionFactory.PROPERTIES.getId(), propertiesAction);
+ actionBars.updateActionBars();
+ actionBars.setGlobalActionHandler(ActionFactory.COPY.getId(), copyAction);
+ actionBars.setGlobalActionHandler(ActionFactory.PASTE.getId(), pasteAction);
+ actionBars.setGlobalActionHandler(ActionFactory.DELETE.getId(), deleteAction);
+ actionBars.setGlobalActionHandler(ActionFactory.RENAME.getId(), renameAction);
+
+ IContributionManager cm = actionBars.getToolBarManager();
+ cm.removeAll();
+
+ for (int i = 0; i < actions.length - 1; i++)
+ cm.add(actions[i]);
+ }
+
+ private static void fillNewContextMenu(Shell shell, ISelection selection, IMenuManager menu) {
+ IAction newServerAction = new NewServerWizardAction();
+ newServerAction.setText(Messages.actionNewServer);
+ menu.add(newServerAction);
+ }
+
+ public void fillContextMenu(IMenuManager menu) {
+ ICommonViewerSite site = actionSite.getViewSite();
+ IStructuredSelection selection = null;
+ Shell shell = actionSite.getViewSite().getShell();
+ if( site instanceof ICommonViewerWorkbenchSite ) {
+ ICommonViewerWorkbenchSite wsSite = (ICommonViewerWorkbenchSite)site;
+ selection = (IStructuredSelection) wsSite.getSelectionProvider().getSelection();
+ }
+
+ IServer server = null;
+ IModule[] module = null;
+ if (selection != null && !selection.isEmpty()) {
+ Iterator iterator = selection.iterator();
+ Object obj = iterator.next();
+ if (obj instanceof IServer)
+ server = (IServer) obj;
+ if (obj instanceof ModuleServer) {
+ ModuleServer ms = (ModuleServer) obj;
+ server = ms.server;
+ module = ms.module;
+ }
+ if (iterator.hasNext()) {
+ server = null;
+ module = null;
+ }
+ }
+
+ // new action
+ MenuManager newMenu = new MenuManager(Messages.actionNew);
+ fillNewContextMenu(null, selection, newMenu);
+ menu.add(newMenu);
+
+ // open action
+ if (server != null && module == null) {
+ menu.add(openAction);
+
+ String text = Messages.actionShowIn;
+ final IWorkbench workbench = PlatformUI.getWorkbench();
+ final IBindingService bindingService = (IBindingService) workbench
+ .getAdapter(IBindingService.class);
+ final TriggerSequence[] activeBindings = bindingService
+ .getActiveBindingsFor("org.eclipse.ui.navigate.showInQuickMenu");
+ if (activeBindings.length > 0) {
+ text += "\t" + activeBindings[0].format();
+ }
+
+ MenuManager showInMenu = new MenuManager(text);
+ showInMenu.add(showInConsoleAction);
+ showInMenu.add(showInDebugAction);
+ //IActionBars actionBars = getViewSite().getActionBars();
+ //actionBars.setGlobalActionHandler("group.show", showInMenu);
+ menu.add(showInMenu);
+ menu.add(new Separator());
+ } else
+ menu.add(new Separator());
+
+ if (server != null) {
+ if (module == null) {
+ menu.add(copyAction);
+ menu.add(pasteAction);
+ menu.add(deleteAction);
+ menu.add(renameAction);
+ } else if (module.length == 1)
+ menu.add(new RemoveModuleAction(shell, server, module[0]));
+ menu.add(new Separator());
+ }
+
+ if (server != null && module == null) {
+ // server actions
+ for (int i = 0; i < actions.length; i++)
+ menu.add(actions[i]);
+
+ menu.add(new Separator());
+ menu.add(actionModifyModules);
+
+ // monitor
+ if (server.getServerType() != null) {
+ final MenuManager menuManager = new MenuManager(Messages.actionMonitor);
+
+ final IServer server2 = server;
+ final Shell shell2 = shell;
+ menuManager.addMenuListener(new IMenuListener() {
+ public void menuAboutToShow(IMenuManager manager) {
+ menuManager.removeAll();
+ if (server2.getAdapter(ServerDelegate.class) != null) {
+ ServerPort[] ports = server2.getServerPorts(null);
+ if (ports != null) {
+ int size = ports.length;
+ for (int i = 0; i < size; i++) {
+ if (!ports[i].isAdvanced())
+ menuManager.add(new MonitorServerPortAction(shell2, server2, ports[i]));
+ }
+ }
+ }
+
+ if (menuManager.isEmpty())
+ menuManager.add(noneAction);
+
+ menuManager.add(new Separator());
+ menuManager.add(monitorPropertiesAction);
+ }
+ });
+
+ // add an initial menu item so that the menu appears correctly
+ noneAction.setEnabled(false);
+ menuManager.add(noneAction);
+ menu.add(menuManager);
+ }
+ }
+
+ if (server != null && module != null) {
+ menu.add(new Separator());
+ menu.add(new StartModuleAction(server, module));
+ menu.add(new StopModuleAction(server, module));
+ menu.add(new RestartModuleAction(server, module));
+ }
+
+ menu.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS));
+ menu.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS+"-end"));
+
+ if (server != null) {
+ menu.add(new Separator());
+ menu.add(propertiesAction);
+ }
+ }
+}
Added: trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/eclipse/wst/server/ui/internal/view/servers/provisional/ServerContentProvider.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/eclipse/wst/server/ui/internal/view/servers/provisional/ServerContentProvider.java (rev 0)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/eclipse/wst/server/ui/internal/view/servers/provisional/ServerContentProvider.java 2008-10-17 00:04:13 UTC (rev 10904)
@@ -0,0 +1,331 @@
+package org.eclipse.wst.server.ui.internal.view.servers.provisional;
+
+import java.util.ArrayList;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.jobs.Job;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.ITreeContentProvider;
+import org.eclipse.jface.viewers.StructuredViewer;
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.wst.server.core.IModule;
+import org.eclipse.wst.server.core.IPublishListener;
+import org.eclipse.wst.server.core.IServer;
+import org.eclipse.wst.server.core.IServerLifecycleListener;
+import org.eclipse.wst.server.core.IServerListener;
+import org.eclipse.wst.server.core.ServerCore;
+import org.eclipse.wst.server.core.ServerEvent;
+import org.eclipse.wst.server.core.internal.Server;
+import org.eclipse.wst.server.core.internal.UpdateServerJob;
+import org.eclipse.wst.server.core.util.PublishAdapter;
+import org.eclipse.wst.server.ui.internal.Messages;
+import org.eclipse.wst.server.ui.internal.Trace;
+import org.eclipse.wst.server.ui.internal.view.servers.ModuleServer;
+import org.eclipse.wst.server.ui.internal.viewers.BaseContentProvider;
+
+public class ServerContentProvider extends BaseContentProvider implements ITreeContentProvider {
+ public static Object INITIALIZING = new Object();
+ protected IServerLifecycleListener serverResourceListener;
+ protected IPublishListener publishListener;
+ protected IServerListener serverListener;
+
+ // servers that are currently publishing and starting
+ protected static Set<String> publishing = new HashSet<String>(4);
+ protected static Set<String> starting = new HashSet<String>(4);
+ protected boolean animationActive = false;
+ protected boolean stopAnimation = false;
+ protected boolean initialized = false;
+
+
+ private StructuredViewer viewer;
+
+ public ServerContentProvider() {
+ addListeners();
+ }
+
+ public Object[] getElements(Object element) {
+ if( !initialized ) {
+ deferInitialization();
+ return new Object[] {INITIALIZING};
+ }
+
+ List<IServer> list = new ArrayList<IServer>();
+ IServer[] servers = ServerCore.getServers();
+ if (servers != null) {
+ int size = servers.length;
+ for (int i = 0; i < size; i++) {
+ if (!((Server)servers[i]).isPrivate())
+ list.add(servers[i]);
+ }
+ }
+ return list.toArray();
+ }
+
+ public Object[] getChildren(Object element) {
+ if (element instanceof ModuleServer) {
+ ModuleServer ms = (ModuleServer) element;
+ try {
+ IModule[] children = ms.server.getChildModules(ms.module, null);
+ int size = children.length;
+ ModuleServer[] ms2 = new ModuleServer[size];
+ for (int i = 0; i < size; i++) {
+ int size2 = ms.module.length;
+ IModule[] module = new IModule[size2 + 1];
+ System.arraycopy(ms.module, 0, module, 0, size2);
+ module[size2] = children[i];
+ ms2[i] = new ModuleServer(ms.server, module);
+ }
+ return ms2;
+ } catch (Exception e) {
+ return null;
+ }
+ }
+
+ IServer server = (IServer) element;
+ IModule[] modules = server.getModules();
+ int size = modules.length;
+ ModuleServer[] ms = new ModuleServer[size];
+ for (int i = 0; i < size; i++) {
+ ms[i] = new ModuleServer(server, new IModule[] { modules[i] });
+ }
+ return ms;
+ }
+
+ public Object getParent(Object element) {
+ if (element instanceof ModuleServer) {
+ ModuleServer ms = (ModuleServer) element;
+ return ms.server;
+ }
+ return null;
+ }
+
+ public boolean hasChildren(Object element) {
+ if (element instanceof ModuleServer) {
+ // Check if the module server has child modules.
+ ModuleServer curModuleServer = (ModuleServer)element;
+ IServer curServer = curModuleServer.server;
+ IModule[] curModule = curModuleServer.module;
+ if (curServer != null && curModule != null) {
+ IModule[] curChildModule = curServer.getChildModules(curModule, null);
+ if (curChildModule != null && curChildModule.length > 0)
+ return true;
+
+ return false;
+ }
+
+ return false;
+ }
+ if( element instanceof IServer ) {
+ return ((IServer) element).getModules().length > 0;
+ }
+ return false;
+ }
+
+ public void inputChanged(Viewer aViewer, Object oldInput, Object newInput) {
+ viewer = (StructuredViewer) aViewer;
+ }
+
+ public void dispose() {
+ // do nothing
+ }
+
+
+
+ // Listeners and refreshing the viewer
+ protected void addListeners() {
+ serverResourceListener = new IServerLifecycleListener() {
+ public void serverAdded(IServer server) {
+ refreshServer(null);
+ server.addServerListener(serverListener);
+ ((Server) server).addPublishListener(publishListener);
+ }
+ public void serverChanged(IServer server) {
+ refreshServer(server);
+ }
+ public void serverRemoved(IServer server) {
+ refreshServer(null);
+ server.removeServerListener(serverListener);
+ ((Server) server).removePublishListener(publishListener);
+ }
+ };
+ ServerCore.addServerLifecycleListener(serverResourceListener);
+
+ publishListener = new PublishAdapter() {
+ public void publishStarted(IServer server) {
+ handlePublishChange(server, true);
+ }
+
+ public void publishFinished(IServer server, IStatus status) {
+ handlePublishChange(server, false);
+ }
+ };
+
+ serverListener = new IServerListener() {
+ public void serverChanged(ServerEvent event) {
+ if (event == null)
+ return;
+
+ int eventKind = event.getKind();
+ IServer server = event.getServer();
+ if ((eventKind & ServerEvent.SERVER_CHANGE) != 0) {
+ // server change event
+ if ((eventKind & ServerEvent.STATE_CHANGE) != 0) {
+ refreshServer(server, true);
+ int state = event.getState();
+ String id = server.getId();
+ if (state == IServer.STATE_STARTING || state == IServer.STATE_STOPPING) {
+ boolean startThread = false;
+ synchronized (starting) {
+ if (!starting.contains(id)) {
+ if (starting.isEmpty())
+ startThread = true;
+ starting.add(id);
+ }
+ }
+ if (startThread)
+ startThread();
+ } else {
+ boolean stopThread = false;
+ synchronized (starting) {
+ if (starting.contains(id)) {
+ starting.remove(id);
+ if (starting.isEmpty())
+ stopThread = true;
+ }
+ }
+ if (stopThread)
+ stopThread();
+ }
+ } else
+ refreshServer(server);
+ } else if ((eventKind & ServerEvent.MODULE_CHANGE) != 0) {
+ // module change event
+ if ((eventKind & ServerEvent.STATE_CHANGE) != 0 || (eventKind & ServerEvent.PUBLISH_STATE_CHANGE) != 0) {
+ refreshServer(server);
+ }
+ }
+ }
+ };
+
+ // add listeners to servers
+ IServer[] servers = ServerCore.getServers();
+ if (servers != null) {
+ int size = servers.length;
+ for (int i = 0; i < size; i++) {
+ servers[i].addServerListener(serverListener);
+ ((Server) servers[i]).addPublishListener(publishListener);
+ }
+ }
+ }
+
+ protected void deferInitialization() {
+ Job job = new Job(Messages.jobInitializingServersView) {
+ public IStatus run(IProgressMonitor monitor) {
+ IServer[] servers = ServerCore.getServers();
+ int size = servers.length;
+ for (int i = 0; i < size; i++) {
+ ((Server)servers[i]).getAllModules().iterator();
+ }
+
+ for (int i = 0; i < size; i++) {
+ IServer server = servers[i];
+ if (server.getServerType() != null && server.getServerState() == IServer.STATE_UNKNOWN) {
+ UpdateServerJob job2 = new UpdateServerJob(server);
+ job2.schedule();
+ }
+ }
+ initialized = true;
+ refreshServer(null);
+ return Status.OK_STATUS;
+ }
+ };
+
+ job.setSystem(true);
+ job.setPriority(Job.SHORT);
+ job.schedule();
+ }
+
+ protected void refreshServer(final IServer server) {
+ refreshServer(server, false);
+ }
+ protected void refreshServer(final IServer server, final boolean resetSelection) {
+ Display.getDefault().asyncExec(new Runnable() {
+ public void run() {
+ try {
+ if( viewer != null && !viewer.getControl().isDisposed()) {
+ viewer.refresh(server);
+ if( resetSelection ) {
+ ISelection sel = viewer.getSelection();
+ viewer.setSelection(sel);
+ }
+ ServerDecorator.getDefault().redecorate(server);
+ }
+ } catch (Exception e) {
+ // ignore
+ }
+ }
+ });
+ }
+
+ protected void handlePublishChange(IServer server, boolean isPublishing) {
+ String serverId = server.getId();
+ if (isPublishing)
+ publishing.add(serverId);
+ else
+ publishing.remove(serverId);
+
+ refreshServer(server);
+ }
+
+
+ protected void startThread() {
+ if (animationActive)
+ return;
+
+ stopAnimation = false;
+
+ final Display display = viewer == null ? Display.getDefault() : viewer.getControl().getDisplay();
+ final int SLEEP = 200;
+ final Runnable[] animator = new Runnable[1];
+ animator[0] = new Runnable() {
+ public void run() {
+ if (!stopAnimation) {
+ try {
+ int size = 0;
+ String[] servers;
+ synchronized (starting) {
+ size = starting.size();
+ servers = new String[size];
+ starting.toArray(servers);
+ }
+
+ for (int i = 0; i < size; i++) {
+ IServer server = ServerCore.findServer(servers[i]);
+ if (server != null ) {
+ ServerDecorator.animate();
+ refreshServer(server);
+ }
+ }
+ } catch (Exception e) {
+ Trace.trace(Trace.FINEST, "Error in Servers view animation", e);
+ }
+ display.timerExec(SLEEP, animator[0]);
+ }
+ }
+ };
+ Display.getDefault().asyncExec(new Runnable() {
+ public void run() {
+ display.timerExec(SLEEP, animator[0]);
+ }
+ });
+ }
+
+ protected void stopThread() {
+ stopAnimation = true;
+ }}
Added: trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/eclipse/wst/server/ui/internal/view/servers/provisional/ServerDecorator.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/eclipse/wst/server/ui/internal/view/servers/provisional/ServerDecorator.java (rev 0)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/eclipse/wst/server/ui/internal/view/servers/provisional/ServerDecorator.java 2008-10-17 00:04:13 UTC (rev 10904)
@@ -0,0 +1,196 @@
+package org.eclipse.wst.server.ui.internal.view.servers.provisional;
+
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.jface.viewers.IDecoration;
+import org.eclipse.jface.viewers.ILabelProvider;
+import org.eclipse.jface.viewers.ILightweightLabelDecorator;
+import org.eclipse.jface.viewers.LabelProvider;
+import org.eclipse.jface.viewers.LabelProviderChangedEvent;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.ui.ISharedImages;
+import org.eclipse.wst.server.core.IServer;
+import org.eclipse.wst.server.core.IServerType;
+import org.eclipse.wst.server.core.internal.Server;
+import org.eclipse.wst.server.ui.ServerUICore;
+import org.eclipse.wst.server.ui.internal.ImageResource;
+import org.eclipse.wst.server.ui.internal.Messages;
+import org.eclipse.wst.server.ui.internal.ServerUIPlugin;
+import org.eclipse.wst.server.ui.internal.provisional.UIDecoratorManager;
+import org.eclipse.wst.server.ui.internal.view.servers.ModuleServer;
+
+public class ServerDecorator extends LabelProvider implements ILightweightLabelDecorator {
+
+ public static final String[] syncState = new String[] {
+ Messages.viewSyncOkay,
+ Messages.viewSyncRestart,
+ Messages.viewSyncPublish,
+ Messages.viewSyncRestartPublish,
+ Messages.viewSyncPublishing};
+
+ public static final String[] syncStateUnmanaged = new String[] {
+ Messages.viewSyncOkay2,
+ Messages.viewSyncRestart2,
+ Messages.viewSyncPublish2,
+ Messages.viewSyncRestartPublish2,
+ Messages.viewSyncPublishing2};
+
+ public static final String[] modulePublishState = new String[] {
+ "",
+ Messages.viewSyncOkay,
+ Messages.viewSyncPublish,
+ Messages.viewSyncPublish};
+
+ private static ServerDecorator instance;
+ public static ServerDecorator getDefault() {
+ return instance;
+ }
+
+ private static int count = 0;
+ public static void animate() {
+ count = (count + 1)%3;
+ }
+ public static int getCount() {
+ return count;
+ }
+
+ public ServerDecorator() {
+ instance = this;
+ }
+
+ public void decorate(Object element, IDecoration decoration) {
+ if( element instanceof IServer ) {
+ String state = getServerStateLabel((IServer)element);
+ String status = getServerStatusLabel((IServer)element);
+ decoration.addSuffix(combine(state, status));
+ } else if( element instanceof ModuleServer ) {
+ String state = getModuleStateText((ModuleServer)element);
+ String status = getModuleStatusText((ModuleServer)element);
+ decoration.addSuffix(combine(state, status));
+ }
+ }
+
+ protected String combine(String state, String status) {
+ if(isEmpty(state) && isEmpty(status))
+ return "";
+ if( isEmpty(state))
+ return " [" + status + "]";
+ if( isEmpty(status))
+ return " [" + state + "]";
+ return " [" + state + ", " + status + "]";
+ }
+
+ protected boolean isEmpty(String s) {
+ return (s == null || "".equals(s));
+ }
+
+ public void redecorate(IServer server) {
+ fireLabelProviderChanged(new LabelProviderChangedEvent(this));
+ }
+
+
+
+ /*
+ * Utility methods
+ */
+ public static Image getServerImage(IServer server) {
+ return server == null ? null :
+ server.getServerType() == null ? null :
+ ImageResource.getImage(server.getServerType().getId());
+ }
+
+ public static String getServerStateLabel(IServer server) {
+ return server == null ? null :
+ server.getServerType() == null ? null :
+ getStateLabel(server.getServerType(), server.getServerState(), server.getMode());
+ }
+
+ public static String getStateLabel(IServerType serverType, int state, String mode) {
+ return serverType == null ? null :
+ UIDecoratorManager.getUIDecorator(serverType).getStateLabel(state, mode, count);
+ }
+
+ public static String getServerStatusLabel(IServer server) {
+ IStatus status = ((Server) server).getServerStatus();
+ if (status != null)
+ return status.getMessage();
+
+ if (server.getServerType() == null)
+ return "";
+
+ if (server.getServerState() == IServer.STATE_UNKNOWN)
+ return "";
+
+ String serverId = server.getId();
+ if (ServerContentProvider.publishing.contains(serverId))
+ return ServerDecorator.syncState[4];
+
+ // republish
+ int i = 0;
+ if (server.shouldPublish()) {
+ if (((Server)server).isPublishUnknown())
+ return "";
+ i += 2;
+ }
+
+ if (server.shouldRestart())
+ i = 1;
+
+ return syncState[i];
+ }
+
+ public static Image getServerStateImage(IServer server) {
+ return server == null ? null :
+ getStateImage(server.getServerType(), server.getServerState(), server.getMode());
+ }
+
+ public static Image getStateImage(IServerType serverType, int state, String mode) {
+ return serverType == null ? null :
+ UIDecoratorManager.getUIDecorator(serverType).getStateImage(state, mode, getCount());
+ }
+
+ public static String getModuleText(ModuleServer ms ) {
+ if (ms == null || ms.module == null)
+ return "";
+ int size = ms.module.length;
+ return ms.module[size - 1].getName();
+ }
+
+ public static Image getModuleImage(ModuleServer ms) {
+ if( ms != null ) {
+ ILabelProvider labelProvider = ServerUICore.getLabelProvider();
+ Image image = labelProvider.getImage(ms.module[ms.module.length - 1]);
+ labelProvider.dispose();
+ return image;
+ }
+ return null;
+ }
+
+ public static String getModuleStateText(ModuleServer ms) {
+ return "";
+ }
+
+ public static String getModuleStatusText(ModuleServer ms) {
+ if( ms != null && ms.server != null && ms.module != null ) {
+ IStatus status = ((Server) ms.server).getModuleStatus(ms.module);
+ if (status != null)
+ return status.getMessage();
+
+ return modulePublishState[ms.server.getModulePublishState(ms.module)];
+ }
+ return "";
+ }
+
+ public static Image getModuleStatusImage(ModuleServer ms) {
+ IStatus status = ((Server) ms.server).getModuleStatus(ms.module);
+ if (status != null) {
+ ISharedImages sharedImages = ServerUIPlugin.getInstance().getWorkbench().getSharedImages();
+ if (status.getSeverity() == IStatus.ERROR)
+ return sharedImages.getImage(ISharedImages.IMG_OBJS_ERROR_TSK);
+ else if (status.getSeverity() == IStatus.WARNING)
+ return sharedImages.getImage(ISharedImages.IMG_OBJS_WARN_TSK);
+ else if (status.getSeverity() == IStatus.INFO)
+ return sharedImages.getImage(ISharedImages.IMG_OBJS_INFO_TSK);
+ }
+ return null;
+ }
+}
Added: trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/eclipse/wst/server/ui/internal/view/servers/provisional/ServerLabelProvider.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/eclipse/wst/server/ui/internal/view/servers/provisional/ServerLabelProvider.java (rev 0)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/eclipse/wst/server/ui/internal/view/servers/provisional/ServerLabelProvider.java 2008-10-17 00:04:13 UTC (rev 10904)
@@ -0,0 +1,78 @@
+/*******************************************************************************
+ * Copyright (c) 2003, 2007 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - Initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.server.ui.internal.view.servers.provisional;
+
+import org.eclipse.jface.viewers.ILabelProvider;
+import org.eclipse.jface.viewers.LabelProvider;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.wst.server.core.IServer;
+import org.eclipse.wst.server.ui.ServerUICore;
+import org.eclipse.wst.server.ui.internal.ImageResource;
+import org.eclipse.wst.server.ui.internal.Messages;
+import org.eclipse.wst.server.ui.internal.view.servers.ModuleServer;
+/**
+ * Server table label provider.
+ */
+public class ServerLabelProvider extends LabelProvider {
+
+ /**
+ * ServerTableLabelProvider constructor comment.
+ */
+ public ServerLabelProvider() {
+ super();
+ }
+
+ public String getText(Object element) {
+ if (element instanceof ModuleServer) {
+ ModuleServer ms = (ModuleServer) element;
+ if (ms.module == null)
+ return "";
+ int size = ms.module.length;
+ String name = ms.module[size - 1].getName();
+ return name;
+ }
+
+ if( element instanceof IServer ) {
+ IServer server = (IServer) element;
+ return notNull(server.getName());
+ }
+
+ if( element == ServerContentProvider.INITIALIZING)
+ return Messages.viewInitializing;
+
+ return "-";
+ }
+ public Image getImage(Object element) {
+ Image image = null;
+ if (element instanceof ModuleServer) {
+ ModuleServer ms = (ModuleServer) element;
+ ILabelProvider labelProvider = ServerUICore.getLabelProvider();
+ image = labelProvider.getImage(ms.module[ms.module.length - 1]);
+ labelProvider.dispose();
+ } else if( element instanceof IServer ) {
+ IServer server = (IServer) element;
+ if (server.getServerType() != null) {
+ image = ImageResource.getImage(server.getServerType().getId());
+ }
+ }
+ return image;
+ }
+
+ protected String notNull(String s) {
+ if (s == null)
+ return "";
+ return s;
+ }
+
+ public boolean isLabelProperty(Object element, String property) {
+ return false;
+ }
+}
\ No newline at end of file
Added: trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/eclipse/wst/server/ui/internal/view/servers/provisional/ServersView.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/eclipse/wst/server/ui/internal/view/servers/provisional/ServersView.java (rev 0)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/eclipse/wst/server/ui/internal/view/servers/provisional/ServersView.java 2008-10-17 00:04:13 UTC (rev 10904)
@@ -0,0 +1,24 @@
+/*******************************************************************************
+ * Copyright (c) 2003, 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - Initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.server.ui.internal.view.servers.provisional;
+
+import org.eclipse.ui.navigator.CommonNavigator;
+/**
+ * A view of servers, their modules, and status.
+ */
+public class ServersView extends CommonNavigator {
+ /**
+ * ServersView constructor comment.
+ */
+ public ServersView() {
+ super();
+ }
+}
\ No newline at end of file
Added: trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/eclipse/wst/server/ui/internal/view/servers/provisional/extensions/EventLogActionProvider.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/eclipse/wst/server/ui/internal/view/servers/provisional/extensions/EventLogActionProvider.java (rev 0)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/eclipse/wst/server/ui/internal/view/servers/provisional/extensions/EventLogActionProvider.java 2008-10-17 00:04:13 UTC (rev 10904)
@@ -0,0 +1,72 @@
+package org.eclipse.wst.server.ui.internal.view.servers.provisional.extensions;
+
+import org.eclipse.jface.action.Action;
+import org.eclipse.jface.action.IMenuManager;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.ui.navigator.CommonActionProvider;
+import org.eclipse.ui.navigator.ICommonActionExtensionSite;
+import org.eclipse.ui.navigator.ICommonViewerSite;
+import org.eclipse.ui.navigator.ICommonViewerWorkbenchSite;
+import org.jboss.ide.eclipse.as.core.extensions.events.EventLogModel;
+import org.jboss.ide.eclipse.as.core.extensions.events.EventLogModel.EventLogTreeItem;
+import org.jboss.ide.eclipse.as.core.extensions.events.EventLogModel.ServerEventModel;
+import org.jboss.ide.eclipse.as.ui.dialogs.ShowStackTraceDialog;
+
+public class EventLogActionProvider extends CommonActionProvider {
+ private Action clearLogAction;
+ private Action showStackTraceAction;
+ private ICommonActionExtensionSite actionSite;
+ public EventLogActionProvider() {
+ super();
+ }
+
+ public void init(ICommonActionExtensionSite aSite) {
+ super.init(aSite);
+ this.actionSite = aSite;
+ createActions();
+ }
+ public void fillContextMenu(IMenuManager menu) {
+ ICommonViewerSite site = actionSite.getViewSite();
+ IStructuredSelection selection = null;
+ if( site instanceof ICommonViewerWorkbenchSite ) {
+ ICommonViewerWorkbenchSite wsSite = (ICommonViewerWorkbenchSite)site;
+ selection = (IStructuredSelection) wsSite.getSelectionProvider().getSelection();
+ Object first = selection.getFirstElement();
+ if( first != null && first instanceof ServerEventModel) {
+ menu.add(clearLogAction);
+ }
+ if( first != null && first instanceof EventLogTreeItem &&
+ (((EventLogTreeItem)first).getEventClass().equals(EventLogModel.EVENT_TYPE_EXCEPTION) ||
+ ((EventLogTreeItem)first).getSpecificType().equals(EventLogModel.EVENT_TYPE_EXCEPTION))) {
+ menu.add(showStackTraceAction);
+ }
+ }
+ }
+
+
+ protected void createActions() {
+ clearLogAction = new Action() {
+ public void run() {
+ IStructuredSelection selection = (IStructuredSelection)actionSite.getStructuredViewer().getSelection();
+ if(selection.getFirstElement() != null && selection.getFirstElement() instanceof ServerEventModel) {
+ ((ServerEventModel)selection.getFirstElement()).clearEvents();
+ actionSite.getStructuredViewer().refresh(((ServerEventModel)selection.getFirstElement()));
+ }
+ }
+ };
+ clearLogAction.setText("Clear Event Log");
+
+ showStackTraceAction = new Action() {
+ public void run() {
+ IStructuredSelection selection = (IStructuredSelection)actionSite.getStructuredViewer().getSelection();
+ if( selection.getFirstElement() != null && selection.getFirstElement() instanceof EventLogTreeItem ) {
+ EventLogTreeItem item = (EventLogTreeItem)selection.getFirstElement();
+ ShowStackTraceDialog dialog = new ShowStackTraceDialog(new Shell(), item);
+ dialog.open();
+ }
+ }
+ };
+ showStackTraceAction.setText("See Exception Details");
+ }
+}
Added: trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/eclipse/wst/server/ui/internal/view/servers/provisional/extensions/EventLogContentProvider.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/eclipse/wst/server/ui/internal/view/servers/provisional/extensions/EventLogContentProvider.java (rev 0)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/eclipse/wst/server/ui/internal/view/servers/provisional/extensions/EventLogContentProvider.java 2008-10-17 00:04:13 UTC (rev 10904)
@@ -0,0 +1,165 @@
+package org.eclipse.wst.server.ui.internal.view.servers.provisional.extensions;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.List;
+
+import org.eclipse.core.runtime.Preferences;
+import org.eclipse.jface.viewers.ITreeContentProvider;
+import org.eclipse.jface.viewers.StructuredViewer;
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.wst.server.core.IServer;
+import org.jboss.ide.eclipse.as.core.extensions.events.EventLogModel;
+import org.jboss.ide.eclipse.as.core.extensions.events.EventLogModel.EventLogRoot;
+import org.jboss.ide.eclipse.as.core.extensions.events.EventLogModel.EventLogTreeItem;
+import org.jboss.ide.eclipse.as.core.extensions.events.EventLogModel.IEventLogListener;
+import org.jboss.ide.eclipse.as.core.extensions.events.EventLogModel.ServerEventModel;
+import org.jboss.ide.eclipse.as.core.util.SimpleTreeItem;
+import org.jboss.ide.eclipse.as.ui.JBossServerUIPlugin;
+
+public class EventLogContentProvider implements ITreeContentProvider {
+ public static final String SHOW_TIMESTAMP = "org.jboss.ide.eclipse.as.ui.views.server.providers.EventLogViewProvider.showTimestamp";
+ public static final String GROUP_BY_CATEGORY = "org.jboss.ide.eclipse.as.ui.views.server.providers.EventLogViewProvider.groupByCategory";
+ public static final String EVENT_ON_TOP = "org.jboss.ide.eclipse.as.ui.views.server.providers.EventLogViewProvider.eventOnTop";
+ public static final int NEWEST_ON_TOP = 1;
+ public static final int OLDEST_ON_TOP = 2;
+ public static final int _TRUE_ = 1;
+ public static final int _FALSE_ = 2;
+
+ private Viewer viewer;
+
+ public EventLogContentProvider() {
+ EventLogModel.enableLogging();
+ EventLogModel.getDefault().addListener(new IEventLogListener() {
+ public void eventModelChanged(String serverId,
+ EventLogTreeItem changed) {
+ if( viewer instanceof StructuredViewer ) {
+ final Object o = changed.getEventRoot();
+ if( o instanceof EventLogRoot) {
+ Display.getDefault().asyncExec(new Runnable() {
+ public void run() {
+ ((StructuredViewer)viewer).refresh(((EventLogRoot)o).getModel());
+ }
+ });
+ }
+ }
+ }
+ });
+ }
+
+ public Object[] getChildren(Object parentElement) {
+ if( parentElement instanceof IServer && parentElement != null ) {
+ return new Object[] { EventLogModel.getModel((IServer)parentElement)};
+ }
+ if( parentElement instanceof ServerEventModel) {
+ ServerEventModel s = ((ServerEventModel)parentElement);
+ boolean categorize = getCategorize();
+ if( categorize )
+ return getRootCategories(s);
+ Object[] ret = s.getRoot().getChildren();
+ if( getSortOrder()) {
+ List<Object> l = Arrays.asList(ret);
+ Collections.reverse(l);
+ return l.toArray();
+ }
+ return ret;
+ }
+
+ if( parentElement instanceof MajorEventType ) {
+ // get children only of this type
+ String serverId = ((MajorEventType)parentElement).getServer();
+ SimpleTreeItem[] children = EventLogModel.getModel(serverId).getRoot().getChildren();
+ ArrayList<SimpleTreeItem> items = new ArrayList<SimpleTreeItem>();
+ for( int i = 0; i < children.length; i++ ) {
+ if( children[i] instanceof EventLogTreeItem ) {
+ String type = ((EventLogTreeItem)children[i]).getEventClass();
+ if( type != null && type.equals(((MajorEventType)parentElement).getId()))
+ items.add(children[i]);
+ }
+ }
+
+ if( getSortOrder() ) Collections.reverse(items);
+
+ return items.toArray(new Object[items.size()]);
+ }
+
+ // just return the object's kids
+ if( parentElement instanceof EventLogTreeItem ) {
+ return ((EventLogTreeItem)parentElement).getChildren();
+ }
+ return new Object[0];
+ }
+
+ public static class MajorEventType {
+ private String id;
+ private String serverId;
+ public MajorEventType(String serverId, String id) {
+ this.id = id;
+ this.serverId = serverId;
+ }
+ public String getId() {
+ return id;
+ }
+ public String getServer() { return serverId; }
+ public String toString() { return id; }
+ public boolean equals(Object o) {
+ return o instanceof MajorEventType &&
+ ((MajorEventType)o).getId().equals(id) &&
+ ((MajorEventType)o).getServer().equals(serverId);
+ }
+ }
+
+ protected Object[] getRootCategories(ServerEventModel model) {
+ EventLogRoot root = model.getRoot();
+ ArrayList<String> list = new ArrayList<String>();
+ ArrayList<MajorEventType> majorTypes = new ArrayList<MajorEventType>();
+ SimpleTreeItem[] children = root.getChildren();
+ for( int i = 0; i < children.length; i++ ) {
+ if( children[i] instanceof EventLogTreeItem ) {
+ String type = ((EventLogTreeItem)children[i]).getEventClass();
+ if( !list.contains(type)) {
+ list.add(type);
+ majorTypes.add(new MajorEventType(model.getId(), type));
+ }
+ }
+ }
+ return majorTypes.toArray(new MajorEventType[majorTypes.size()]);
+ }
+
+
+ public Object getParent(Object element) {
+ return null;
+ }
+
+ public boolean hasChildren(Object element) {
+ return getChildren(element).length > 0 ? true : false;
+ }
+
+ public Object[] getElements(Object inputElement) {
+ return null;
+ }
+
+ public void dispose() {
+ EventLogModel.disableLogging();
+ }
+
+ public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
+ this.viewer = viewer;
+ }
+
+ protected boolean getSortOrder() {
+ Preferences store = JBossServerUIPlugin.getDefault().getPluginPreferences();
+ int showTimestamp = store.getInt(EVENT_ON_TOP);
+ if( showTimestamp == OLDEST_ON_TOP) return false;
+ return true;
+ }
+ protected boolean getCategorize() {
+ Preferences store = JBossServerUIPlugin.getDefault().getPluginPreferences();
+ int showTimestamp = store.getInt(GROUP_BY_CATEGORY);
+ if( showTimestamp == _TRUE_ ) return true;
+ if( showTimestamp == _FALSE_) return false;
+ return false; // default
+ }
+}
\ No newline at end of file
Added: trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/eclipse/wst/server/ui/internal/view/servers/provisional/extensions/EventLogLabelProvider.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/eclipse/wst/server/ui/internal/view/servers/provisional/extensions/EventLogLabelProvider.java (rev 0)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/eclipse/wst/server/ui/internal/view/servers/provisional/extensions/EventLogLabelProvider.java 2008-10-17 00:04:13 UTC (rev 10904)
@@ -0,0 +1,147 @@
+package org.eclipse.wst.server.ui.internal.view.servers.provisional.extensions;
+
+import java.util.Date;
+import java.util.HashMap;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IConfigurationElement;
+import org.eclipse.core.runtime.IExtensionRegistry;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.core.runtime.Preferences;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.jface.viewers.LabelProvider;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.wst.server.ui.internal.view.servers.provisional.extensions.EventLogContentProvider.MajorEventType;
+import org.jboss.ide.eclipse.as.core.extensions.events.EventLogModel.EventLogTreeItem;
+import org.jboss.ide.eclipse.as.core.extensions.events.EventLogModel.ServerEventModel;
+import org.jboss.ide.eclipse.as.ui.JBossServerUIPlugin;
+import org.jboss.ide.eclipse.as.ui.views.server.extensions.IEventLogLabelProvider;
+import org.jboss.ide.eclipse.as.ui.views.server.extensions.ServerViewProvider;
+
+public class EventLogLabelProvider extends LabelProvider {
+
+ public static final String SHOW_TIMESTAMP = "org.jboss.ide.eclipse.as.ui.views.server.providers.EventLogViewProvider.showTimestamp";
+ public static final int _TRUE_ = 1;
+ public static final int _FALSE_ = 2;
+ private static HashMap<String, String> majorTypeToName = new HashMap<String, String>();
+
+ static {
+ IExtensionRegistry registry = Platform.getExtensionRegistry();
+ IConfigurationElement[] cf = registry.getConfigurationElementsFor(JBossServerUIPlugin.PLUGIN_ID, "EventLogMajorType");
+ for( int i = 0; i < cf.length; i++ ) {
+ String type = cf[i].getAttribute("typeId");
+ String name = cf[i].getAttribute("name");
+ majorTypeToName.put(type, name);
+ }
+ }
+
+ private Image rootImage;
+ public EventLogLabelProvider() {
+ super();
+ ImageDescriptor des = ImageDescriptor.createFromURL(JBossServerUIPlugin.getDefault().getBundle().getEntry("icons/info_obj.gif"));
+ rootImage = des.createImage();
+ }
+ public void dispose() {
+ super.dispose();
+ rootImage.dispose();
+ }
+
+ private IEventLogLabelProvider[] labelProviderDelegates = null;
+ public Image getImage(Object element) {
+ if( labelProviderDelegates == null )
+ loadLabelProviderDelegates();
+
+ if( element instanceof ServerEventModel ) {
+ return rootImage;
+ }
+
+ if( !(element instanceof EventLogTreeItem))
+ return null;
+
+ EventLogTreeItem item = (EventLogTreeItem)element;
+ for( int i = 0; i < labelProviderDelegates.length; i++ ) {
+ if( labelProviderDelegates[i] != null
+ && labelProviderDelegates[i].supports(item.getSpecificType())) {
+ Image image = labelProviderDelegates[i].getImage((EventLogTreeItem)element);
+ if( image != null ) return image;
+ }
+ }
+
+ return null;
+ }
+
+ public String getText(Object element) {
+ if( element == null ) return "ERROR: Unknown String type";
+
+ if( element instanceof ServerEventModel ) {
+ return "Event Log";
+ }
+
+
+ String suffix = getShowTimestamp() ? createTimestamp(element) : "";
+ if( labelProviderDelegates == null )
+ loadLabelProviderDelegates();
+
+ if( element instanceof ServerViewProvider ) {
+ return ((ServerViewProvider)element).getName();
+ }
+
+ if( !(element instanceof EventLogTreeItem)) {
+ if( element instanceof MajorEventType ) {
+ String val = majorTypeToName.get(((MajorEventType)element).getId());
+ if( val != null ) return val;
+ }
+ return element.toString();
+ }
+ EventLogTreeItem item = (EventLogTreeItem)element;
+
+ for( int i = 0; i < labelProviderDelegates.length; i++ ) {
+ if( labelProviderDelegates[i] != null
+ && labelProviderDelegates[i].supports(item.getSpecificType())) {
+ String text = labelProviderDelegates[i].getText((EventLogTreeItem)element);
+ if( text != null ) return text + suffix;
+ }
+ }
+
+ return element == null ? "" : element.toString() + suffix;
+ }
+
+ public void loadLabelProviderDelegates() {
+ IExtensionRegistry registry = Platform.getExtensionRegistry();
+ IConfigurationElement[] elements = registry.getConfigurationElementsFor(JBossServerUIPlugin.PLUGIN_ID, "EventLogLabelProvider");
+ labelProviderDelegates = new IEventLogLabelProvider[elements.length];
+ for( int i = 0; i < elements.length; i++ ) {
+ try {
+ labelProviderDelegates[i] = (IEventLogLabelProvider)elements[i].createExecutableExtension("class");
+ } catch( CoreException ce ) {
+ JBossServerUIPlugin.log("Error loading Event Log Label Provider Delegate", ce);
+ }
+ }
+ }
+ protected boolean getShowTimestamp() {
+ Preferences store = JBossServerUIPlugin.getDefault().getPluginPreferences();
+ int showTimestamp = store.getInt(SHOW_TIMESTAMP);
+ if( showTimestamp == _TRUE_ ) return true;
+ if( showTimestamp == _FALSE_) return false;
+ return false; // default
+ }
+
+ protected String createTimestamp(Object element) {
+ if( element instanceof EventLogTreeItem ) {
+ Long v = (Long) ((EventLogTreeItem)element).getProperty(EventLogTreeItem.DATE);
+ if( v == null ) return "";
+
+ double date = v.doubleValue();
+ double now = new Date().getTime();
+ int seconds = (int) (( now - date) / 1000);
+ int minutes = seconds / 60;
+ int hours = minutes / 60;
+ minutes -= (hours * 60);
+ String minString = minutes + "m ago";
+ if( hours == 0 )
+ return " (" + minString + ")";
+ return " (" + hours + "h " + minString + ")";
+ }
+ return "";
+ }
+}
\ No newline at end of file
Added: trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/eclipse/wst/server/ui/internal/view/servers/provisional/extensions/XPathProvider.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/eclipse/wst/server/ui/internal/view/servers/provisional/extensions/XPathProvider.java (rev 0)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/eclipse/wst/server/ui/internal/view/servers/provisional/extensions/XPathProvider.java 2008-10-17 00:04:13 UTC (rev 10904)
@@ -0,0 +1,457 @@
+package org.eclipse.wst.server.ui.internal.view.servers.provisional.extensions;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+
+import org.eclipse.core.filesystem.EFS;
+import org.eclipse.core.filesystem.IFileStore;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.jobs.Job;
+import org.eclipse.jface.action.Action;
+import org.eclipse.jface.action.IMenuManager;
+import org.eclipse.jface.action.Separator;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.jface.viewers.IDecoration;
+import org.eclipse.jface.viewers.ILightweightLabelDecorator;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.viewers.ITreeContentProvider;
+import org.eclipse.jface.viewers.LabelProvider;
+import org.eclipse.jface.viewers.StructuredViewer;
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.jface.window.Window;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.MessageBox;
+import org.eclipse.ui.ISharedImages;
+import org.eclipse.ui.IWorkbench;
+import org.eclipse.ui.IWorkbenchPage;
+import org.eclipse.ui.IWorkbenchWindow;
+import org.eclipse.ui.PartInitException;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.ide.IDE;
+import org.eclipse.ui.navigator.CommonActionProvider;
+import org.eclipse.ui.navigator.ICommonActionExtensionSite;
+import org.eclipse.ui.navigator.ICommonViewerSite;
+import org.eclipse.ui.navigator.ICommonViewerWorkbenchSite;
+import org.eclipse.wst.server.core.IServer;
+import org.eclipse.wst.server.ui.internal.view.servers.provisional.extensions.XPathProvider.XPathTreeContentProvider.ServerWrapper;
+import org.jboss.ide.eclipse.as.core.extensions.descriptors.XPathCategory;
+import org.jboss.ide.eclipse.as.core.extensions.descriptors.XPathFileResult;
+import org.jboss.ide.eclipse.as.core.extensions.descriptors.XPathModel;
+import org.jboss.ide.eclipse.as.core.extensions.descriptors.XPathQuery;
+import org.jboss.ide.eclipse.as.core.extensions.descriptors.XPathFileResult.XPathResultNode;
+import org.jboss.ide.eclipse.as.ui.JBossServerUIPlugin;
+import org.jboss.ide.eclipse.as.ui.Messages;
+import org.jboss.ide.eclipse.as.ui.dialogs.XPathDialogs;
+import org.jboss.ide.eclipse.as.ui.dialogs.XPathDialogs.XPathCategoryDialog;
+import org.jboss.ide.eclipse.as.ui.dialogs.XPathDialogs.XPathDialog;
+
+public class XPathProvider {
+ public static class XPathTreeContentProvider implements
+ ITreeContentProvider {
+
+ public static class DelayProxy {}
+ public static final DelayProxy LOADING = new DelayProxy();
+
+ private Viewer viewer;
+ private ArrayList<XPathCategory> loading = new ArrayList<XPathCategory>();
+
+ public class ServerWrapper {
+ public IServer server;
+
+ public ServerWrapper(IServer server) {
+ this.server = server;
+ }
+ public int hashCode() {
+ return server.getId().hashCode();
+ }
+ public boolean equals(Object other) {
+ return other instanceof ServerWrapper &&
+ ((ServerWrapper)other).server.getId().equals(server.getId());
+ }
+ }
+
+ public Object[] getChildren(Object parentElement) {
+ if (parentElement == null)
+ return new Object[] {};
+ if (parentElement instanceof IServer) {
+ return new Object[] { new ServerWrapper((IServer) parentElement) };
+ }
+
+ if (parentElement instanceof ServerWrapper) {
+ return XPathModel.getDefault().getCategories(
+ ((ServerWrapper) parentElement).server);
+ }
+
+ if( parentElement instanceof XPathCategory) {
+ if( ((XPathCategory)parentElement).isLoaded())
+ return ((XPathCategory)parentElement).getQueries();
+
+ if( !loading.contains((XPathCategory)parentElement))
+ launchLoad((XPathCategory)parentElement);
+
+ return new Object[] { LOADING };
+ }
+
+ // we're the named element (JNDI)
+ if( parentElement instanceof XPathQuery) {
+ if( XPathProvider.getResultNodes((XPathQuery)parentElement).length == 1 ) {
+ return new Object[0];
+ } else {
+ return ((XPathQuery)parentElement).getResults();
+ }
+ }
+
+ // we're a file node (blah.xml)
+ if( parentElement instanceof XPathFileResult ) {
+ if( ((XPathFileResult)parentElement).getChildren().length == 1 )
+ return new Object[0];
+ return ((XPathFileResult)parentElement).getChildren();
+ }
+
+ if( parentElement instanceof XPathResultNode ) {
+ return new Object[0];
+ }
+
+
+ return new Object[0];
+ }
+
+
+ protected void launchLoad(final XPathCategory cat) {
+ new Job("Loading XPaths") {
+ protected IStatus run(IProgressMonitor monitor) {
+ loading.add(cat);
+ XPathQuery[] queries = cat.getQueries();
+ XPathFileResult[] results;
+ for( int i = 0; i < queries.length; i++ ) {
+ results = queries[i].getResults();
+ for( int j = 0; j < results.length; j++ ) {
+ results[j].getChildren();
+ }
+ }
+ Display.getDefault().asyncExec(new Runnable() {
+ public void run() {
+ loading.remove(cat);
+ ((StructuredViewer)viewer).refresh(cat.getServer());
+ }
+ });
+ return Status.OK_STATUS;
+ }
+ }.schedule(200);
+ }
+
+ public Object getParent(Object element) {
+ return null;
+ }
+
+ public boolean hasChildren(Object element) {
+ return getChildren(element).length > 0 ? true : false;
+ }
+
+ public Object[] getElements(Object inputElement) {
+ return new Object[0];
+ }
+
+ public void dispose() {
+ }
+
+ public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
+ this.viewer = viewer;
+ }
+ }
+
+ public static class XPathTreeLabelProvider extends LabelProvider {
+ private Image rootImage;
+ public XPathTreeLabelProvider() {
+ super();
+ ImageDescriptor des = ImageDescriptor.createFromURL(JBossServerUIPlugin.getDefault().getBundle().getEntry("icons/XMLFile.gif"));
+ rootImage = des.createImage();
+ }
+
+ public Image getImage(Object element) {
+ if( element instanceof ServerWrapper )
+ return rootImage;
+
+ if (element instanceof XPathCategory)
+ return PlatformUI.getWorkbench().getSharedImages().getImage(
+ ISharedImages.IMG_OBJ_FOLDER);
+
+ return null;
+ }
+
+ public String getText(Object element) {
+ if( element instanceof ServerWrapper )
+ return "XML Configuration";
+ if( element == XPathTreeContentProvider.LOADING )
+ return "Loading...";
+
+ if (element instanceof XPathCategory)
+ return ((XPathCategory) element).getName();
+
+ if( element instanceof XPathQuery )
+ return ((XPathQuery)element).getName();
+
+ if( element instanceof XPathFileResult )
+ return ((XPathFileResult)element).getFileLocation();
+
+ return "";
+ }
+
+ public XPathResultNode[] getResultNodes(XPathQuery query) {
+ ArrayList<XPathResultNode> l = new ArrayList<XPathResultNode>();
+ XPathFileResult[] files = query.getResults();
+ for( int i = 0; i < files.length; i++ ) {
+ l.addAll(Arrays.asList(files[i].getChildren()));
+ }
+ return l.toArray(new XPathResultNode[l.size()]);
+ }
+ }
+
+ public static class XMLActionProvider extends CommonActionProvider {
+
+ private ICommonActionExtensionSite actionSite;
+ public Action newXPathCategoryAction, deleteXPathCategoryAction,
+ newXPathAction, editXPathAction, deleteXPathAction,
+ editFileAction;
+ private Object selectedNode;
+
+ public void init(ICommonActionExtensionSite aSite) {
+ super.init(aSite);
+ this.actionSite = aSite;
+ createActions();
+ }
+
+ public void createActions() {
+ newXPathCategoryAction = new Action() {
+ public void run() {
+ XPathCategoryDialog d = new XPathCategoryDialog(Display
+ .getCurrent().getActiveShell(), getServer());
+ if (d.open() == Window.OK) {
+ XPathModel.getDefault()
+ .addCategory(getServer(), d.getText());
+ XPathModel.getDefault().save(getServer());
+ refreshViewer();
+ }
+ }
+ };
+ newXPathCategoryAction.setText("New Category");
+
+ deleteXPathCategoryAction = new Action() {
+ public void run() {
+ int style = SWT.APPLICATION_MODAL | SWT.YES | SWT.NO;
+ MessageBox messageBox = new MessageBox(Display.getCurrent()
+ .getActiveShell(), style);
+ messageBox.setText(Messages.DescriptorXPathRemoveCategory
+ + "?");
+ messageBox
+ .setMessage(Messages.DescriptorXPathRemoveCategoryDesc);
+ if (messageBox.open() == SWT.YES) {
+ XPathModel.getDefault().removeCategory(getServer(),
+ ((XPathCategory)selectedNode).getName());
+ XPathModel.getDefault().save(getServer());
+ refreshViewer();
+ }
+ }
+ };
+ deleteXPathCategoryAction
+ .setText(Messages.DescriptorXPathRemoveCategory);
+
+ newXPathAction = new Action() {
+ public void run() {
+ XPathCategory category = (XPathCategory)selectedNode;
+ if (category != null) {
+ String categoryName = category.getName();
+ XPathDialog d = new XPathDialog(Display.getCurrent()
+ .getActiveShell(), getServer(), categoryName);
+ if (d.open() == Window.OK) {
+ XPathCategory[] categoryList = XPathModel
+ .getDefault().getCategories(getServer());
+ XPathCategory categoryItem = null;
+ for (int i = 0; i < categoryList.length; i++) {
+ if (categoryList[i].getName().equals(
+ category.getName()))
+ categoryItem = categoryList[i];
+ }
+ if (categoryItem != null) {
+ XPathQuery query = new XPathQuery(d.getName(),
+ XPathDialogs.getConfigFolder(getServer()),
+ null, d.getXpath(), d.getAttribute());
+ categoryItem.addQuery(query);
+ XPathModel.getDefault().save(getServer());
+ refreshViewer();
+ }
+ }
+ }
+ }
+ };
+ newXPathAction.setText(Messages.DescriptorXPathNewXPath);
+
+ editXPathAction = new Action() {
+ public void run() {
+ Object o = selectedNode;
+ if (o != null && o instanceof XPathQuery) {
+ XPathQuery original = (XPathQuery) o;
+ XPathCategory category = original.getCategory();
+
+ XPathDialog d = new XPathDialog(Display.getCurrent()
+ .getActiveShell(), getServer(), category.getName(),
+ original.getName());
+ d.setAttribute(original.getAttribute());
+ d.setXpath(original.getXpathPattern());
+
+ if (d.open() == Window.OK) {
+ original.setAttribute(d.getAttribute());
+ original.setXpathPattern(d.getXpath());
+ original.setName(d.getName());
+ category.save();
+ refreshViewer();
+ }
+ }
+ }
+ };
+ editXPathAction.setText(Messages.DescriptorXPathEditXPath);
+
+ deleteXPathAction = new Action() {
+ public void run() {
+ Object o = selectedNode;
+ if (o instanceof XPathQuery) {
+ XPathCategory cat = ((XPathQuery) o).getCategory();
+ cat.removeQuery((XPathQuery) o);
+ cat.save();
+ refreshViewer();
+ }
+ }
+ };
+ deleteXPathAction.setText(Messages.DescriptorXPathDeleteXPath);
+
+ editFileAction = new Action() {
+ public void run() {
+ try {
+ Object o = selectedNode;
+ Path p = null;
+ if (o instanceof XPathQuery
+ && ((XPathQuery) o).getResults().length == 1) {
+ o = (XPathFileResult) ((XPathQuery) o).getResults()[0];
+ }
+ if (o instanceof XPathFileResult) {
+ p = new Path(((XPathFileResult) o)
+ .getFileLocation());
+ } else if (o instanceof XPathResultNode) {
+ p = new Path(((XPathResultNode) o)
+ .getFileLocation());
+ }
+ if (p != null) {
+
+ IFileStore fileStore = EFS.getLocalFileSystem()
+ .getStore(p.removeLastSegments(1));
+ fileStore = fileStore.getChild(p.lastSegment());
+ IWorkbench wb = PlatformUI.getWorkbench();
+ IWorkbenchWindow win = wb
+ .getActiveWorkbenchWindow();
+ IWorkbenchPage page = win.getActivePage();
+
+ if (!fileStore.fetchInfo().isDirectory()
+ && fileStore.fetchInfo().exists()) {
+ try {
+ IDE.openEditorOnFileStore(page, fileStore);
+ } catch (PartInitException e) {
+ }
+ }
+ }
+ } catch (Exception exc) {
+ JBossServerUIPlugin.log(
+ "Error running edit file action", exc);
+ }
+ }
+ };
+ editFileAction.setText("Edit File");
+ }
+
+ public void fillContextMenu(IMenuManager menu) {
+ ICommonViewerSite site = actionSite.getViewSite();
+ IStructuredSelection selection = null;
+ if (site instanceof ICommonViewerWorkbenchSite) {
+ ICommonViewerWorkbenchSite wsSite = (ICommonViewerWorkbenchSite) site;
+ selection = (IStructuredSelection) wsSite
+ .getSelectionProvider().getSelection();
+ Object first = selection.getFirstElement();
+ if( first == null )
+ return;
+
+ if (first instanceof ServerWrapper) {
+ menu.add(newXPathCategoryAction);
+ menu.add(new Separator());
+ return;
+ }
+
+ if (first instanceof XPathCategory) {
+
+ menu.add(newXPathAction);
+ menu.add(deleteXPathCategoryAction);
+ menu.add(new Separator());
+ return;
+ }
+
+ if( first instanceof XPathQuery) {
+ selectedNode = first;
+ menu.add(newXPathAction);
+ menu.add(editXPathAction);
+ menu.add(deleteXPathAction);
+ }
+ if( (first instanceof XPathResultNode || first instanceof XPathFileResult ) ||
+ (first instanceof XPathQuery && ((XPathQuery)first).getResults().length == 1)) {
+ menu.add(editFileAction);
+ }
+ }
+ }
+
+ protected void refreshViewer() {
+ actionSite.getStructuredViewer().refresh();
+ }
+
+ protected IServer getServer() {
+ Object o = selectedNode;
+ if( o instanceof ServerWrapper) return ((ServerWrapper)o).server;
+ if( o instanceof XPathCategory) return ((XPathCategory)o).getServer();
+ if( o instanceof XPathQuery) return ((XPathQuery)o).getCategory().getServer();
+ if( o instanceof XPathFileResult) return ((XPathFileResult)o).getQuery().getCategory().getServer();
+ if( o instanceof XPathResultNode) return ((XPathResultNode)o).getFile().getQuery().getCategory().getServer();
+ return null;
+ }
+ }
+
+
+ public static class XMLDecorator extends LabelProvider implements ILightweightLabelDecorator {
+ public void decorate(Object element, IDecoration decoration) {
+ if( element instanceof XPathQuery) {
+ XPathResultNode[] nodes = getResultNodes((XPathQuery)element);
+ if(nodes.length == 1 ) {
+ decoration.addSuffix(" " + nodes[0].getText());
+ }
+ return;
+ }
+
+ // we're a file node (blah.xml)
+ if( element instanceof XPathFileResult ) {
+ XPathResultNode[] nodes = ((XPathFileResult)element).getChildren();
+ if( nodes.length == 1 )
+ decoration.addSuffix(" " + nodes[0].getText());
+ }
+ }
+ }
+
+ public static XPathResultNode[] getResultNodes(XPathQuery query) {
+ ArrayList<XPathResultNode> l = new ArrayList<XPathResultNode>();
+ XPathFileResult[] files = query.getResults();
+ for( int i = 0; i < files.length; i++ ) {
+ l.addAll(Arrays.asList(files[i].getChildren()));
+ }
+ return l.toArray(new XPathResultNode[l.size()]);
+ }
+
+}
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.ui/plugin.xml
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.ui/plugin.xml 2008-10-16 18:17:33 UTC (rev 10903)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.ui/plugin.xml 2008-10-17 00:04:13 UTC (rev 10904)
@@ -209,7 +209,7 @@
typeId="org.jboss.ide.eclipse.as.core.runtime.server.polling.MajorType"/>
<MajorType
name="Publish Events"
- typeId="org.jboss.ide.eclipse.as.core.publishers.MajorType"/>
+ typeId="org.jboss.ide.eclipse.as.core.publishers.Events.MajorType"/>
</extension>
<extension
point="org.eclipse.wst.server.ui.editorPageSections">
@@ -324,4 +324,199 @@
</extension>
+
+<!-- Provisional stuff to be contributed to Webtools -->
+
+ <extension point="org.eclipse.ui.views">
+ <view
+ id="org.eclipse.wst.server.ui.ServersViewProvisional"
+ name="JBoss Servers View 2 (beta)"
+ category="org.eclipse.wst.server.ui"
+ class="org.eclipse.wst.server.ui.internal.view.servers.provisional.ServersView"
+ icon="icons/jboss.gif"/>
+ </extension>
+
+ <extension point="org.eclipse.ui.decorators">
+ <decorator
+ class="org.eclipse.wst.server.ui.internal.view.servers.provisional.ServerDecorator"
+ icon="icons/obj16/server.gif"
+ id="org.eclipse.wst.server.ui.navigatorDecorator"
+ label="Server State Decorator"
+ lightweight="true"
+ location="BOTTOM_RIGHT">
+ <enablement>
+ <or>
+ <objectClass
+ name="org.eclipse.wst.server.core.IServer">
+ </objectClass>
+ <objectClass
+ name="org.eclipse.wst.server.ui.internal.view.servers.ModuleServer">
+ </objectClass>
+ </or>
+ </enablement>
+ </decorator>
+ </extension>
+
+ <extension
+ point="org.eclipse.ui.navigator.navigatorContent">
+ <navigatorContent
+ activeByDefault="true"
+ contentProvider="org.eclipse.wst.server.ui.internal.view.servers.provisional.ServerContentProvider"
+ icon="icons/cview16/servers_view.gif"
+ id="org.eclipse.wst.server.ui.ServersView.content.root"
+ labelProvider="org.eclipse.wst.server.ui.internal.view.servers.provisional.ServerLabelProvider"
+ name="Servers View Default Content"
+ priority="highest">
+ <triggerPoints>
+ <instanceof
+ value="org.eclipse.wst.server.core.internal.ServerPlugin">
+ </instanceof>
+ </triggerPoints>
+ <possibleChildren>
+ <or>
+ <instanceof
+ value="org.eclipse.wst.server.core.IServer">
+ </instanceof>
+ <instanceof
+ value="org.eclipse.wst.server.ui.internal.view.servers.ModuleServer">
+ </instanceof>
+ </or></possibleChildren>
+ <actionProvider
+ class="org.eclipse.wst.server.ui.internal.view.servers.provisional.ServerActionProvider"
+ id="org.eclipse.wst.server.ui.internal.view.servers.provisional.ServerActionProvider"
+ priority="highest">
+ </actionProvider>
+ </navigatorContent>
+ </extension>
+ <extension
+ point="org.eclipse.ui.navigator.viewer">
+ <viewerContentBinding
+ viewerId="org.eclipse.wst.server.ui.ServersViewProvisional">
+ <includes>
+ <contentExtension
+ isRoot="true"
+ pattern="org.eclipse.wst.server.ui.ServersView.content.root">
+ </contentExtension>
+ </includes>
+ </viewerContentBinding>
+ </extension>
+
+
+
+ <!-- Extensions to new Server View -->
+
+ <extension
+ point="org.eclipse.ui.navigator.navigatorContent">
+ <navigatorContent
+ id="org.jboss.ide.eclipse.as.ui.extensions.eventLog"
+ activeByDefault="true"
+ icon="icons/info_obj.gif"
+ contentProvider="org.eclipse.wst.server.ui.internal.view.servers.provisional.extensions.EventLogContentProvider"
+ labelProvider="org.eclipse.wst.server.ui.internal.view.servers.provisional.extensions.EventLogLabelProvider"
+ name="JBoss Server Event Log"
+ priority="normal">
+ <triggerPoints>
+ <instanceof
+ value="org.eclipse.wst.server.core.IServer">
+ </instanceof>
+ </triggerPoints>
+ <possibleChildren>
+ <or>
+ <instanceof
+ value="org.jboss.ide.eclipse.as.core.extensions.events.EventLogModel$EventLogTreeItem">
+ </instanceof>
+ <instanceof
+ value="org.jboss.ide.eclipse.as.core.extensions.events.EventLogModel$ServerEventModel">
+ </instanceof>
+ </or></possibleChildren>
+ <actionProvider
+ class="org.eclipse.wst.server.ui.internal.view.servers.provisional.extensions.EventLogActionProvider"
+ id="org.jboss.ide.eclipse.as.ui.extensions.eventLog.actions"
+ priority="highest">
+ </actionProvider>
+ </navigatorContent>
+ <navigatorContent
+ activeByDefault="true"
+ contentProvider="org.eclipse.wst.server.ui.internal.view.servers.provisional.extensions.XPathProvider$XPathTreeContentProvider"
+ icon="icons/XMLFile.gif"
+ id="org.jboss.ide.eclipse.as.ui.extensions.xml"
+ labelProvider="org.eclipse.wst.server.ui.internal.view.servers.provisional.extensions.XPathProvider$XPathTreeLabelProvider"
+ name="XML Configuration"
+ priority="normal">
+ <triggerPoints>
+ <instanceof
+ value="org.eclipse.wst.server.core.IServer">
+ </instanceof>
+ </triggerPoints>
+ <possibleChildren>
+ <or>
+ <instanceof
+ value="org.eclipse.wst.server.ui.internal.view.servers.provisional.extensions.XPathProvider$XPathTreeContentProvider$ServerWrapper">
+ </instanceof>
+ <instanceof
+ value="org.eclipse.wst.server.ui.internal.view.servers.provisional.extensions.XPathProvider$XPathTreeContentProvider$DelayProxy">
+ </instanceof>
+ <instanceof
+ value="org.jboss.ide.eclipse.as.core.extensions.descriptors.XPathCategory">
+ </instanceof>
+ <instanceof
+ value="org.jboss.ide.eclipse.as.core.extensions.descriptors.XPathQuery">
+ </instanceof>
+ <instanceof
+ value="org.jboss.ide.eclipse.as.core.extensions.descriptors.XPathFileResult">
+ </instanceof>
+ <instanceof
+ value="org.jboss.ide.eclipse.as.core.extensions.descriptors.XPathFileResult$XPathResultNode">
+ </instanceof></or>
+ </possibleChildren>
+ <actionProvider
+ class="org.eclipse.wst.server.ui.internal.view.servers.provisional.extensions.XPathProvider$XMLActionProvider"
+ id="org.jboss.ide.eclipse.as.ui.extensions.eventLog.actions"
+ priority="highest">
+ </actionProvider>
+ </navigatorContent>
+ </extension>
+ <extension
+ point="org.eclipse.ui.navigator.viewer">
+ <viewerContentBinding
+ viewerId="org.eclipse.wst.server.ui.ServersViewProvisional">
+ <includes>
+ <contentExtension
+ isRoot="false"
+ pattern="org.jboss.ide.eclipse.as.ui.extensions.eventLog">
+ </contentExtension>
+ <contentExtension
+ isRoot="false"
+ pattern="org.jboss.ide.eclipse.as.ui.extensions.xml">
+ </contentExtension>
+ </includes>
+ </viewerContentBinding>
+ </extension>
+
+
+
+ <!-- Decorator for xpaths / xml-->
+ <extension point="org.eclipse.ui.decorators">
+ <decorator
+ class="org.eclipse.wst.server.ui.internal.view.servers.provisional.extensions.XPathProvider$XMLDecorator"
+ id="org.jboss.ide.eclipse.as.ui.extensions.xml.decorator"
+ label="JBoss Server XML Configuration Decorator"
+ lightweight="true"
+ location="BOTTOM_RIGHT">
+ <enablement>
+ <or>
+ <objectClass name="org.jboss.ide.eclipse.as.core.extensions.descriptors.XPathQuery"/>
+ <objectClass
+ name="org.jboss.ide.eclipse.as.core.extensions.descriptors.XPathFileResult">
+ </objectClass>
+ <objectClass
+ name="org.jboss.ide.eclipse.as.core.extensions.descriptors.XPathFileResult$XPathResultNode">
+ </objectClass>
+ </or>
+ </enablement>
+ </decorator>
+ </extension>
+
+
+
</plugin>
17 years, 2 months
JBoss Tools SVN: r10903 - trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/policy.
by jbosstools-commits@lists.jboss.org
Author: koen.aers(a)jboss.com
Date: 2008-10-16 14:17:33 -0400 (Thu, 16 Oct 2008)
New Revision: 10903
Modified:
trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/policy/ConnectionEditPolicy.java
Log:
cleanup
Modified: trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/policy/ConnectionEditPolicy.java
===================================================================
--- trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/policy/ConnectionEditPolicy.java 2008-10-16 18:16:26 UTC (rev 10902)
+++ trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/policy/ConnectionEditPolicy.java 2008-10-16 18:17:33 UTC (rev 10903)
@@ -38,8 +38,6 @@
*/
public class ConnectionEditPolicy extends org.eclipse.gef.editpolicies.ConnectionEditPolicy {
-// private ConnectionFactory elementConnectionFactory;
-
private CreationFactory elementConnectionFactory;
public void setElementConnectionFactory(CreationFactory elementConnectionFactory) {
17 years, 2 months
JBoss Tools SVN: r10902 - in trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common: registry and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: koen.aers(a)jboss.com
Date: 2008-10-16 14:16:26 -0400 (Thu, 16 Oct 2008)
New Revision: 10902
Modified:
trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/editpart/ConnectionEditPart.java
trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/registry/ElementRegistry.java
Log:
creation factory based on the element
Modified: trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/editpart/ConnectionEditPart.java
===================================================================
--- trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/editpart/ConnectionEditPart.java 2008-10-16 18:06:45 UTC (rev 10901)
+++ trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/editpart/ConnectionEditPart.java 2008-10-16 18:16:26 UTC (rev 10902)
@@ -30,9 +30,9 @@
import org.eclipse.gef.editparts.AbstractConnectionEditPart;
import org.eclipse.gef.editpolicies.ConnectionEndpointEditPolicy;
import org.eclipse.gef.requests.CreationFactory;
-import org.eclipse.gef.requests.SimpleFactory;
import org.jboss.tools.flow.common.policy.ConnectionBendpointEditPolicy;
import org.jboss.tools.flow.common.policy.ConnectionEditPolicy;
+import org.jboss.tools.flow.common.registry.ElementRegistry;
import org.jboss.tools.flow.common.wrapper.ConnectionWrapper;
import org.jboss.tools.flow.common.wrapper.DefaultConnectionWrapper;
import org.jboss.tools.flow.common.wrapper.ModelEvent;
@@ -58,7 +58,7 @@
}
protected CreationFactory getElementConnectionFactory() {
- return new SimpleFactory(getElementConnectionType());
+ return ElementRegistry.getCreationFactory(getElementConnection().getElement());
}
Modified: trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/registry/ElementRegistry.java
===================================================================
--- trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/registry/ElementRegistry.java 2008-10-16 18:06:45 UTC (rev 10901)
+++ trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/registry/ElementRegistry.java 2008-10-16 18:16:26 UTC (rev 10902)
@@ -339,5 +339,15 @@
}
};
}
+
+ public static CreationFactory getCreationFactory(Element element) {
+ String id = null;
+ IConfigurationElement configurationElement =
+ (IConfigurationElement)element.getMetaData("configurationElement");
+ if (configurationElement != null) {
+ id = configurationElement.getAttribute("id");
+ }
+ return id == null ? null : getCreationFactory(id);
+ }
}
17 years, 2 months
JBoss Tools SVN: r10901 - in trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4: src/org/jboss/tools/flow/jpdl4/editor and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: koen.aers(a)jboss.com
Date: 2008-10-16 14:06:45 -0400 (Thu, 16 Oct 2008)
New Revision: 10901
Modified:
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/plugin.xml
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/editor/JpdlSerializer.java
Log:
basic jpdl serialization
Modified: trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/plugin.xml
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/plugin.xml 2008-10-16 18:06:11 UTC (rev 10900)
+++ trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/plugin.xml 2008-10-16 18:06:45 UTC (rev 10901)
@@ -32,7 +32,7 @@
acceptsElementStrategy="org.jboss.tools.flow.jpdl4.strategy.ProcessAcceptsElementStrategy"></flow>
</element>
<element
- class="org.jboss.tools.flow.common.model.DefaultContainer"
+ class="org.jboss.tools.flow.jpdl4.model.SuperState"
figure="icons/super.gif"
id="org.jboss.tools.flow.jpdl4.superState"
language="org.jboss.tools.flow.jpdl4"
Modified: trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/editor/JpdlSerializer.java
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/editor/JpdlSerializer.java 2008-10-16 18:06:11 UTC (rev 10900)
+++ trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/editor/JpdlSerializer.java 2008-10-16 18:06:45 UTC (rev 10901)
@@ -38,18 +38,21 @@
private static void appendOpening(StringBuffer buffer, Wrapper wrapper, int level) {
Element element = (Element)wrapper.getElement();
- buffer.append("\n");
- appendPadding(buffer, level);
if (element instanceof Transition) {
+ buffer.append("\n");
+ appendPadding(buffer, level);
buffer.append("<transition");
Transition transition = (Transition)element;
if (transition.getTo() != null) {
+ buffer.append(" ");
String value = transition.getTo().getName();
value = value == null ? "" : value;
buffer.append("to=\"" + value + "\"");
}
buffer.append(">");
} else if (element instanceof EndState) {
+ buffer.append("\n\n");
+ appendPadding(buffer, level);
buffer.append("<end-state");
EndState endState = (EndState)element;
if (endState.getName() != null) {
@@ -59,6 +62,8 @@
}
buffer.append(">");
} else if (element instanceof StartState) {
+ buffer.append("\n\n");
+ appendPadding(buffer, level);
buffer.append("<start-state");
StartState startState = (StartState)element;
if (startState.getName() != null) {
@@ -68,6 +73,8 @@
}
buffer.append(">");
} else if (element instanceof SuperState) {
+ buffer.append("\n\n");
+ appendPadding(buffer, level);
buffer.append("<super-state");
SuperState superState = (SuperState)element;
if (superState.getName() != null) {
@@ -77,6 +84,8 @@
}
buffer.append(">");
} else if (element instanceof State) {
+ buffer.append("\n\n");
+ appendPadding(buffer, level);
buffer.append("<state");
State state = (State)element;
if (state.getName() != null) {
@@ -112,19 +121,29 @@
private static void appendClosing(StringBuffer buffer, Wrapper wrapper, int level) {
Element element = (Element)wrapper.getElement();
- buffer.append("\n");
- appendPadding(buffer, level);
if (element instanceof Transition) {
+ buffer.append("\n");
+ appendPadding(buffer, level);
buffer.append("</transition>");
} else if (element instanceof EndState) {
+ buffer.append("\n");
+ appendPadding(buffer, level);
buffer.append("</end-state>");
} else if (element instanceof StartState) {
+ buffer.append("\n");
+ appendPadding(buffer, level);
buffer.append("</start-state>");
} else if (element instanceof SuperState) {
+ buffer.append("\n\n");
+ appendPadding(buffer, level);
buffer.append("</super-state>");
} else if (element instanceof State) {
+ buffer.append("\n");
+ appendPadding(buffer, level);
buffer.append("</state>");
} else if (element instanceof Process) {
+ buffer.append("\n\n");
+ appendPadding(buffer, level);
buffer.append("</process>");
}
}
@@ -134,14 +153,14 @@
ContainerWrapper containerWrapper = (ContainerWrapper)wrapper;
List<NodeWrapper> children = containerWrapper.getElements();
for (NodeWrapper nodeWrapper : children) {
- appendToBuffer(buffer, nodeWrapper, ++level);
+ appendToBuffer(buffer, nodeWrapper, level+1);
}
}
if (wrapper instanceof NodeWrapper) {
NodeWrapper nodeWrapper = (NodeWrapper)wrapper;
List<ConnectionWrapper> children = nodeWrapper.getOutgoingConnections();
for (ConnectionWrapper connectionWrapper : children) {
- appendToBuffer(buffer, connectionWrapper, ++level);
+ appendToBuffer(buffer, connectionWrapper, level+1);
}
}
}
17 years, 2 months
JBoss Tools SVN: r10900 - trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/common/properties.
by jbosstools-commits@lists.jboss.org
Author: koen.aers(a)jboss.com
Date: 2008-10-16 14:06:11 -0400 (Thu, 16 Oct 2008)
New Revision: 10900
Added:
trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/common/properties/DefaultContainerPropertySource.java
trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/common/properties/DefaultNodePropertySource.java
Log:
container wrapper is properties provider
Added: trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/common/properties/DefaultContainerPropertySource.java
===================================================================
--- trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/common/properties/DefaultContainerPropertySource.java (rev 0)
+++ trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/common/properties/DefaultContainerPropertySource.java 2008-10-16 18:06:11 UTC (rev 10900)
@@ -0,0 +1,50 @@
+package org.jboss.tools.common.properties;
+
+import org.eclipse.ui.views.properties.IPropertyDescriptor;
+import org.eclipse.ui.views.properties.IPropertySource;
+import org.eclipse.ui.views.properties.TextPropertyDescriptor;
+import org.jboss.tools.flow.common.wrapper.DefaultContainerWrapper;
+
+public class DefaultContainerPropertySource implements IPropertySource {
+
+ private static final String NAME = "org.jboss.tools.flow.common.model.DefaultContainer.name";
+
+ private DefaultContainerWrapper wrapper = null;
+ private IPropertyDescriptor[] propertyDescriptors;
+
+ public DefaultContainerPropertySource(DefaultContainerWrapper wrapper) {
+ this.wrapper = wrapper;
+ }
+ public Object getEditableValue() {
+ return null;
+ }
+ public IPropertyDescriptor[] getPropertyDescriptors() {
+ if (propertyDescriptors == null) {
+ propertyDescriptors = new IPropertyDescriptor[] {
+ new TextPropertyDescriptor(NAME, "Name") {}
+ };
+ }
+ return propertyDescriptors;
+ }
+ public Object getPropertyValue(Object id) {
+ if (NAME.equals(id)) {
+ return wrapper.getName();
+ }
+ return null;
+ }
+ public boolean isPropertySet(Object id) {
+ if (NAME.equals(id)) {
+ return wrapper.getName() != null;
+ }
+ return false;
+ }
+ public void resetPropertyValue(Object id) {
+ }
+ public void setPropertyValue(Object id, Object value) {
+ if (NAME.equals(id)) {
+ if (value instanceof String) {
+ wrapper.setName((String)value);
+ }
+ }
+ }
+}
Added: trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/common/properties/DefaultNodePropertySource.java
===================================================================
--- trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/common/properties/DefaultNodePropertySource.java (rev 0)
+++ trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/common/properties/DefaultNodePropertySource.java 2008-10-16 18:06:11 UTC (rev 10900)
@@ -0,0 +1,50 @@
+package org.jboss.tools.common.properties;
+
+import org.eclipse.ui.views.properties.IPropertyDescriptor;
+import org.eclipse.ui.views.properties.IPropertySource;
+import org.eclipse.ui.views.properties.TextPropertyDescriptor;
+import org.jboss.tools.flow.common.wrapper.DefaultNodeWrapper;
+
+public class DefaultNodePropertySource implements IPropertySource {
+
+ private static final String NAME = "org.jboss.tools.flow.common.model.DefaultNode.name";
+
+ private DefaultNodeWrapper wrapper = null;
+ private IPropertyDescriptor[] propertyDescriptors;
+
+ public DefaultNodePropertySource(DefaultNodeWrapper wrapper) {
+ this.wrapper = wrapper;
+ }
+ public Object getEditableValue() {
+ return null;
+ }
+ public IPropertyDescriptor[] getPropertyDescriptors() {
+ if (propertyDescriptors == null) {
+ propertyDescriptors = new IPropertyDescriptor[] {
+ new TextPropertyDescriptor(NAME, "Name") {}
+ };
+ }
+ return propertyDescriptors;
+ }
+ public Object getPropertyValue(Object id) {
+ if (NAME.equals(id)) {
+ return wrapper.getName();
+ }
+ return null;
+ }
+ public boolean isPropertySet(Object id) {
+ if (NAME.equals(id)) {
+ return wrapper.getName() != null;
+ }
+ return false;
+ }
+ public void resetPropertyValue(Object id) {
+ }
+ public void setPropertyValue(Object id, Object value) {
+ if (NAME.equals(id)) {
+ if (value instanceof String) {
+ wrapper.setName((String)value);
+ }
+ }
+ }
+}
17 years, 2 months
JBoss Tools SVN: r10899 - trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/wrapper.
by jbosstools-commits@lists.jboss.org
Author: koen.aers(a)jboss.com
Date: 2008-10-16 14:05:49 -0400 (Thu, 16 Oct 2008)
New Revision: 10899
Modified:
trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/wrapper/AbstractFlowWrapper.java
trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/wrapper/DefaultContainerWrapper.java
trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/wrapper/DefaultNodeWrapper.java
Log:
container wrapper is properties provider
Modified: trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/wrapper/AbstractFlowWrapper.java
===================================================================
--- trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/wrapper/AbstractFlowWrapper.java 2008-10-16 17:20:52 UTC (rev 10898)
+++ trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/wrapper/AbstractFlowWrapper.java 2008-10-16 18:05:49 UTC (rev 10899)
@@ -29,7 +29,8 @@
*/
public abstract class AbstractFlowWrapper extends AbstractWrapper implements FlowWrapper {
- private Map<String, NodeWrapper> elements = new HashMap<String, NodeWrapper>();
+ private Map<String, NodeWrapper> elementMap = new HashMap<String, NodeWrapper>();
+ private List<NodeWrapper> elementList = new ArrayList<NodeWrapper>();
private transient List<ModelListener> listeners = new ArrayList<ModelListener>();
public abstract Integer getRouterLayout();
@@ -44,11 +45,11 @@
public List<NodeWrapper> getElements() {
return Collections.unmodifiableList(
- new ArrayList<NodeWrapper>(elements.values()));
+ new ArrayList<NodeWrapper>(elementList));
}
public NodeWrapper getElement(String id) {
- return (NodeWrapper) elements.get(id);
+ return (NodeWrapper) elementMap.get(id);
}
public void addElement(NodeWrapper element) {
@@ -59,7 +60,8 @@
}
public void localAddElement(NodeWrapper element) {
- elements.put(element.getId(), element);
+ elementMap.put(element.getId(), element);
+ elementList.add(element);
}
public boolean acceptsElement(NodeWrapper element) {
@@ -68,10 +70,15 @@
protected abstract void internalAddElement(NodeWrapper element);
+ public void localRemoveElement(NodeWrapper element) {
+ elementMap.remove(element.getId());
+ elementList.remove(element);
+ }
+
public void removeElement(NodeWrapper element) {
- elements.remove(element.getId());
+ localRemoveElement(element);
+ internalRemoveElement(element);
notifyListeners(CHANGE_ELEMENTS);
- internalRemoveElement(element);
}
protected abstract void internalRemoveElement(NodeWrapper element);
Modified: trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/wrapper/DefaultContainerWrapper.java
===================================================================
--- trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/wrapper/DefaultContainerWrapper.java 2008-10-16 17:20:52 UTC (rev 10898)
+++ trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/wrapper/DefaultContainerWrapper.java 2008-10-16 18:05:49 UTC (rev 10899)
@@ -3,6 +3,8 @@
import java.util.List;
import org.eclipse.draw2d.geometry.Rectangle;
+import org.eclipse.ui.views.properties.IPropertySource;
+import org.jboss.tools.common.properties.DefaultContainerPropertySource;
import org.jboss.tools.flow.common.model.Connection;
import org.jboss.tools.flow.common.model.Container;
import org.jboss.tools.flow.common.model.Flow;
@@ -16,7 +18,12 @@
private AcceptsElementStrategy acceptsElementStrategy;
private AcceptsIncomingConnectionStrategy incomingConnectionStrategy;
private AcceptsOutgoingConnectionStrategy outgoingConnectionStrategy;
+ private DefaultContainerPropertySource propertySource;
+ protected void internalSetName(String name) {
+ getNode().setName(name);
+ }
+
protected void internalAddElement(NodeWrapper element) {
Node node = (Node)element.getElement();
List<Node> nodes = ((Flow)getFlowWrapper().getElement()).getNodes();
@@ -117,4 +124,19 @@
}
}
+ @SuppressWarnings("unchecked")
+ public Object getAdapter(Class adapter) {
+ if (adapter == IPropertySource.class) {
+ return getPropertySource();
+ }
+ return super.getAdapter(adapter);
+ }
+
+ private IPropertySource getPropertySource() {
+ if (propertySource == null) {
+ propertySource = new DefaultContainerPropertySource(this);
+ }
+ return propertySource;
+ }
+
}
Modified: trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/wrapper/DefaultNodeWrapper.java
===================================================================
--- trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/wrapper/DefaultNodeWrapper.java 2008-10-16 17:20:52 UTC (rev 10898)
+++ trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/wrapper/DefaultNodeWrapper.java 2008-10-16 18:05:49 UTC (rev 10899)
@@ -1,6 +1,8 @@
package org.jboss.tools.flow.common.wrapper;
import org.eclipse.draw2d.geometry.Rectangle;
+import org.eclipse.ui.views.properties.IPropertySource;
+import org.jboss.tools.common.properties.DefaultNodePropertySource;
import org.jboss.tools.flow.common.model.Connection;
import org.jboss.tools.flow.common.model.Node;
import org.jboss.tools.flow.common.strategy.AcceptsIncomingConnectionStrategy;
@@ -10,6 +12,7 @@
private AcceptsIncomingConnectionStrategy incomingConnectionStrategy;
private AcceptsOutgoingConnectionStrategy outgoingConnectionStrategy;
+ private DefaultNodePropertySource propertySource;
public void setNode(Node node) {
setElement(node);
@@ -104,4 +107,19 @@
((DefaultConnectionWrapper) connection).getConnection());
}
+ @SuppressWarnings("unchecked")
+ public Object getAdapter(Class adapter) {
+ if (adapter == IPropertySource.class) {
+ return getPropertySource();
+ }
+ return super.getAdapter(adapter);
+ }
+
+ private IPropertySource getPropertySource() {
+ if (propertySource == null) {
+ propertySource = new DefaultNodePropertySource(this);
+ }
+ return propertySource;
+ }
+
}
17 years, 2 months
JBoss Tools SVN: r10898 - in trunk/seam/plugins/org.jboss.tools.seam.core: src/org/jboss/tools/seam/internal/core/project/facet and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: akazakov
Date: 2008-10-16 13:20:52 -0400 (Thu, 16 Oct 2008)
New Revision: 10898
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/plugin.xml
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/Seam2FacetInstallDelegate.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamFacetAbstractInstallDelegate.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamFacetInstallDelegate.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-2731
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/plugin.xml
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/plugin.xml 2008-10-16 17:02:09 UTC (rev 10897)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/plugin.xml 2008-10-16 17:20:52 UTC (rev 10898)
@@ -51,6 +51,10 @@
<constraint>
<or>
<requires
+ facet="jst.ear"
+ version="[5.0">
+ </requires>
+ <requires
facet="jst.ejb"
version="[3.0">
</requires>
@@ -77,6 +81,10 @@
<constraint>
<or>
<requires
+ facet="jst.ear"
+ version="[5.0">
+ </requires>
+ <requires
facet="jst.ejb"
version="[3.0">
</requires>
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/Seam2FacetInstallDelegate.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/Seam2FacetInstallDelegate.java 2008-10-16 17:02:09 UTC (rev 10897)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/Seam2FacetInstallDelegate.java 2008-10-16 17:20:52 UTC (rev 10898)
@@ -80,16 +80,6 @@
/*
* (non-Javadoc)
- * @see org.jboss.tools.seam.internal.core.project.facet.SeamFacetAbstractInstallDelegate#doExecuteForEar(org.eclipse.core.resources.IProject, org.eclipse.wst.common.project.facet.core.IProjectFacetVersion, org.eclipse.wst.common.frameworks.datamodel.IDataModel, org.eclipse.core.runtime.IProgressMonitor)
- */
- @Override
- protected void doExecuteForEar(final IProject project, IProjectFacetVersion fv,
- IDataModel model, IProgressMonitor monitor) throws CoreException {
- // TODO
- }
-
- /*
- * (non-Javadoc)
* @see org.jboss.tools.seam.internal.core.project.facet.SeamFacetAbstractInstallDelegate#doExecuteForEjb(org.eclipse.core.resources.IProject, org.eclipse.wst.common.project.facet.core.IProjectFacetVersion, org.eclipse.wst.common.frameworks.datamodel.IDataModel, org.eclipse.core.runtime.IProgressMonitor)
*/
@Override
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamFacetAbstractInstallDelegate.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamFacetAbstractInstallDelegate.java 2008-10-16 17:02:09 UTC (rev 10897)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamFacetAbstractInstallDelegate.java 2008-10-16 17:20:52 UTC (rev 10898)
@@ -444,9 +444,63 @@
* @param monitor
* @throws CoreException
*/
- protected abstract void doExecuteForEar(IProject project, IProjectFacetVersion fv,
- IDataModel model, IProgressMonitor monitor) throws CoreException;
+ protected void doExecuteForEar(IProject project, IProjectFacetVersion fv,
+ IDataModel model, IProgressMonitor monitor) throws CoreException {
+/*
+ if(seamHomePath==null) {
+ return;
+ }
+ model.setProperty(ISeamFacetDataModelProperties.SEAM_EAR_PROJECT, project.getName());
+ IVirtualComponent component = ComponentCore.createComponent(project);
+ IVirtualFolder rootVirtFolder = component.getRootFolder().getFolder(new Path("/")); //$NON-NLS-1$
+ IContainer earContentsContainer = rootVirtFolder.getUnderlyingFolder();
+ File earContentsFolder = earContentsFolder.getAbsoluteFile();
+ File earProjectFolder = project.getLocation().toFile();
+
+ File ejbTemplateDir;
+ AntCopyUtils.FileSet excludeCvsSvn;
+
+ try {
+ ejbTemplateDir = new File(SeamFacetInstallDataModelProvider.getTemplatesFolder(), "ejb");
+ } catch (IOException e) {
+ SeamCorePlugin.getPluginLog().logError(e);
+ }
+ excludeCvsSvn = new AntCopyUtils.FileSet(SeamFacetAbstractInstallDelegate.CVS_SVN).dir(ejbTemplateDir);
+
+ FilterSet earFilterSet = new FilterSet();
+ earFilterSet.addFilter("projectName", project.getName() + ".ear"); //$NON-NLS-1$ //$NON-NLS-2$
+
+ AntCopyUtils.copyFileToFolder(
+ new File(seamGenResFolder, "META-INF/jboss-app.xml"), //$NON-NLS-1$
+ new File(earContentsFolder, "META-INF"), //$NON-NLS-1$
+ new FilterSetCollection(earFilterSet), false);
+
+ // Copy configuration files from template
+ try {
+ AntCopyUtils.copyFilesAndFolders(
+ new File(SeamFacetInstallDataModelProvider.getTemplatesFolder(), "ear"), //$NON-NLS-1$
+ earProjectFolder, new AntCopyUtils.FileSetFileFilter(excludeCvsSvn),
+ new FilterSetCollection(ejbFilterSet), true);
+ } catch (IOException e) {
+ SeamCorePlugin.getPluginLog().logError(e);
+ }
+
+ // Fill ear contents
+ AntCopyUtils.copyFiles(seamHomeFolder, earContentsFolder, new AntCopyUtils.FileSetFileFilter(new AntCopyUtils.FileSet(getJbossEarContent()).dir(seamHomeFolder)));
+ AntCopyUtils.copyFiles(seamLibFolder, earContentsFolder, new AntCopyUtils.FileSetFileFilter(new AntCopyUtils.FileSet(getJbossEarContent()).dir(seamLibFolder)));
+ AntCopyUtils.copyFiles(droolsLibFolder, earContentsFolder, new AntCopyUtils.FileSetFileFilter(new AntCopyUtils.FileSet(getJbossEarContent()).dir(droolsLibFolder)));
+ AntCopyUtils.copyFiles(seamLibFolder, earContentsFolder, new AntCopyUtils.FileSetFileFilter(new AntCopyUtils.FileSet(getJbossEarContent()).dir(seamLibFolder)));
+ AntCopyUtils.copyFiles(seamGenResFolder, earContentsFolder, new AntCopyUtils.FileSetFileFilter(new AntCopyUtils.FileSet(getJbossEarContent()).dir(seamGenResFolder)));
+
+ File resources = new File(earProjectFolder, "resources");
+ AntCopyUtils.copyFileToFile(
+ dataSourceDsFile,
+ new File(resources, seamWebProject.getName() + "-ds.xml"), //$NON-NLS-1$ //$NON-NLS-2$
+ viewFilterSetCollection, true);
+*/
+ }
+
protected IResource getSrcFolder(IProject project) throws JavaModelException {
IJavaProject javaProject = EclipseResourceUtil.getJavaProject(project);
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamFacetInstallDelegate.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamFacetInstallDelegate.java 2008-10-16 17:02:09 UTC (rev 10897)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamFacetInstallDelegate.java 2008-10-16 17:20:52 UTC (rev 10898)
@@ -105,16 +105,6 @@
/*
* (non-Javadoc)
- * @see org.jboss.tools.seam.internal.core.project.facet.SeamFacetAbstractInstallDelegate#doExecuteForEar(org.eclipse.core.resources.IProject, org.eclipse.wst.common.project.facet.core.IProjectFacetVersion, org.eclipse.wst.common.frameworks.datamodel.IDataModel, org.eclipse.core.runtime.IProgressMonitor)
- */
- @Override
- protected void doExecuteForEar(final IProject project, IProjectFacetVersion fv,
- IDataModel model, IProgressMonitor monitor) throws CoreException {
- // TODO
- }
-
- /*
- * (non-Javadoc)
* @see org.jboss.tools.seam.internal.core.project.facet.SeamFacetAbstractInstallDelegate#copyFilesToWarProject(org.eclipse.core.resources.IProject, org.eclipse.wst.common.project.facet.core.IProjectFacetVersion, org.eclipse.wst.common.frameworks.datamodel.IDataModel, org.eclipse.core.runtime.IProgressMonitor)
*/
@Override
17 years, 2 months
JBoss Tools SVN: r10897 - trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/jspeditor.
by jbosstools-commits@lists.jboss.org
Author: mareshkau
Date: 2008-10-16 13:02:09 -0400 (Thu, 16 Oct 2008)
New Revision: 10897
Modified:
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/jspeditor/JSPMultiPageEditor.java
Log:
JBIDE-2674, reporting about org.jboss.tools.vpe not founded error was added to JSPMultiPageEditor.java
Modified: trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/jspeditor/JSPMultiPageEditor.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/jspeditor/JSPMultiPageEditor.java 2008-10-16 16:58:29 UTC (rev 10896)
+++ trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/jspeditor/JSPMultiPageEditor.java 2008-10-16 17:02:09 UTC (rev 10897)
@@ -144,6 +144,9 @@
Class cls = b
.loadClass("org.jboss.tools.vpe.editor.VpeEditorPartFactory"); //$NON-NLS-1$
visualEditorFactory = (IVisualEditorFactory) cls.newInstance();
+ } else {
+ JspEditorPlugin.getPluginLog().logError("Plugin org.jboss.tools.vpe not available," + //$NON-NLS-1$
+ " visual page editor will be not available"); //$NON-NLS-1$
}
} catch (Exception e) {
JspEditorPlugin.getPluginLog().logError("Error in loading visual editor factory", e); //$NON-NLS-1$
17 years, 2 months
JBoss Tools SVN: r10896 - trunk/birt/docs/en/modules.
by jbosstools-commits@lists.jboss.org
Author: abogachuk
Date: 2008-10-16 12:58:29 -0400 (Thu, 16 Oct 2008)
New Revision: 10896
Modified:
trunk/birt/docs/en/modules/birt_designer.xml
Log:
Modified: trunk/birt/docs/en/modules/birt_designer.xml
===================================================================
--- trunk/birt/docs/en/modules/birt_designer.xml 2008-10-16 16:52:15 UTC (rev 10895)
+++ trunk/birt/docs/en/modules/birt_designer.xml 2008-10-16 16:58:29 UTC (rev 10896)
@@ -12,7 +12,7 @@
<title>BIRT Report Designer</title>
- <para>BIRT Designer is an intuitive and quite easy Eclipse-based set of plugins to make reports. In this chapter we will describe its interface and all its features to you.</para>
+ <para>BIRT Designer is an intuitive and quite easy Eclipse-based set of plugins to make reports. In this chapter we will describe its interface and its features to you.</para>
<section id="birt_designer_UI" xreflabel="birt_designer_UI">
<title>BIRT User Interface</title>
@@ -52,10 +52,10 @@
<title>BIRT Report Designer Features</title>
<para>Here are the main BIRT Report Designer features:</para>
<itemizedlist><listitem><para><emphasis role="bold">Palette</emphasis> - contains tables, labels, and charts. It is used in conjunction with the Layout View to design reports.</para></listitem>
- <listitem><para><emphasis role="bold">Data Explorer</emphasis> - Organizes your data sources (connections) and data sets (queries). The data set editor allows you to test your data set to ensure the report receives the correct data. Within this view multi dimensional cubes can be created using existing data sets. Cubes are currently used when building dynamic cross tables. This view also is used to design report parameters.</para></listitem>
- <listitem><para><emphasis role="bold">Resource Explorer</emphasis> - BIRT allows the reuse of report objects, such as tables, data sources and styles. Objects created for reuse are stored in a library file. To browse the contents of report libraries BIRT supplies a Resource Explorer view. This view list all libraries within the resource folder, in addition other shared content such as images and JavaScript files.</para></listitem>
- <listitem><para><emphasis role="bold">Property Editor</emphasis> - Presents the most commonly used properties in a convenient format that makes editing quick and easy. BIRT also integrates with the standard Eclipse property view to provide a detailed listing of all properties for an item.</para></listitem>
- <listitem><para><emphasis role="bold">Layout View</emphasis> - WYSIWYG editor that provides drag and drop creation of the presentation portion of your report.</para></listitem>
+ <listitem><para><emphasis role="bold">Data Explorer</emphasis> - Organizes your data sources and data sets. The Data Sets editor enables testing your data set to check whether the report receives the correct data. You can also create cubes using your data sets (when building any dynamic cross tables) and design necessary report parameters.</para></listitem>
+ <listitem><para><emphasis role="bold">Resource Explorer</emphasis> - BIRT allows the reuse of report objects, such as tables, data sources and styles. Objects created for reuse are stored in a library file. To browse the contents of report libraries BIRT supplies the Resource Explorer view. This view lists all libraries within the resource folder, in addition to other shared content such as images and JavaScript files.</para></listitem>
+ <listitem><para><emphasis role="bold">Property Editor</emphasis> - Shows the most commonly used properties. BIRT also integrates with the standard Eclipse property view to display a detailed listing of all properties for an item.</para></listitem>
+ <listitem><para><emphasis role="bold">Layout View</emphasis> - WYSIWYG editor. You can select any element from the Palette, drag and drop it to the report and then edit the way you like.</para></listitem>
<listitem><para><emphasis role="bold">Script Editor</emphasis> - Scripting adds business logic to reports during data access, during report generation, or during viewing. The code editor provides standard Eclipse features for editing your scripts: syntax coloring, auto-complete and more. An interesting new feature, for BIRT 2.3 is the ability to debug scripts while the report is running.</para></listitem>
<listitem><para><emphasis role="bold">Report Preview</emphasis> - You can test your report at any time with real data. The preview is a window directly within Eclipse.</para></listitem>
<listitem><para><emphasis role="bold">Chart Builder</emphasis> - Adding Charts to BIRT designs is expedited with the Chart Builder. Chart creation is separated into three phases: Select Chart Type, Select Data, and Format Chart.</para></listitem>
17 years, 2 months
JBoss Tools SVN: r10895 - in trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp: outline and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: mareshkau
Date: 2008-10-16 12:52:15 -0400 (Thu, 16 Oct 2008)
New Revision: 10895
Modified:
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/jspeditor/JSPMultiPageEditor.java
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/JSPContentOutlineConfiguration.java
Log:
JBIDE-2674, checks for null was added in case when visual editor plugin are not installed in system, editor will be work only in source mode.
Modified: trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/jspeditor/JSPMultiPageEditor.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/jspeditor/JSPMultiPageEditor.java 2008-10-16 16:12:40 UTC (rev 10894)
+++ trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/jspeditor/JSPMultiPageEditor.java 2008-10-16 16:52:15 UTC (rev 10895)
@@ -88,7 +88,7 @@
IReusableEditor, ITextEditorExtension, ITextEditorExtension2,
ITextEditorExtension3, INavigationLocationProvider, IMultiPageEditor {
- public static final String EDITOR_ID = "org.jboss.tools.jst.jsp.jspeditor.JSPTextEditor";
+ public static final String EDITOR_ID = "org.jboss.tools.jst.jsp.jspeditor.JSPTextEditor"; //$NON-NLS-1$
private static final String VISUALSOURCE_TAB_LABEL = "JSPMultiPageEditor.TabLabel.VisualSource"; //$NON-NLS-1$
@@ -108,8 +108,6 @@
private int visualSourceIndex;
- private int visualIndex;
-
private JSPTextEditor sourceEditor;
private int sourceIndex;
@@ -141,9 +139,12 @@
static {
try {
Bundle b = Platform.getBundle("org.jboss.tools.vpe"); //$NON-NLS-1$
- Class cls = b
- .loadClass("org.jboss.tools.vpe.editor.VpeEditorPartFactory"); //$NON-NLS-1$
- visualEditorFactory = (IVisualEditorFactory) cls.newInstance();
+ //FIX for JBIDE-2248
+ if(b!=null) {
+ Class cls = b
+ .loadClass("org.jboss.tools.vpe.editor.VpeEditorPartFactory"); //$NON-NLS-1$
+ visualEditorFactory = (IVisualEditorFactory) cls.newInstance();
+ }
} catch (Exception e) {
JspEditorPlugin.getPluginLog().logError("Error in loading visual editor factory", e); //$NON-NLS-1$
}
@@ -219,22 +220,22 @@
protected void pageChange(int newPageIndex) {
selectedPageIndex = newPageIndex;
-
- if (newPageIndex == visualSourceIndex) {
- if (visualEditor.getVisualEditor() == null) {
- visualEditor.createVisualEditor();
- }
- visualEditor.setVisualMode(IVisualEditor.VISUALSOURCE_MODE);
-
- }else if (newPageIndex == sourceIndex)
- visualEditor.setVisualMode(IVisualEditor.SOURCE_MODE);
- else if (newPageIndex == previewIndex) {
- if (visualEditor.getPreviewWebBrowser() == null) {
- visualEditor.createPreviewBrowser();
- }
- visualEditor.setVisualMode(IVisualEditor.PREVIEW_MODE);
- }
+ if(visualEditor!=null) {
+ if (newPageIndex == visualSourceIndex) {
+ if (visualEditor.getVisualEditor() == null) {
+ visualEditor.createVisualEditor();
+ }
+ visualEditor.setVisualMode(IVisualEditor.VISUALSOURCE_MODE);
+ }else if (newPageIndex == sourceIndex)
+ visualEditor.setVisualMode(IVisualEditor.SOURCE_MODE);
+ else if (newPageIndex == previewIndex) {
+ if (visualEditor.getPreviewWebBrowser() == null) {
+ visualEditor.createPreviewBrowser();
+ }
+ visualEditor.setVisualMode(IVisualEditor.PREVIEW_MODE);
+ }
+ }
superPageChange(newPageIndex);
}
@@ -252,7 +253,9 @@
((AbstractTextEditor) sourceEditor)
.setInput(getEditorInput());
}
- visualEditor.setInput(getEditorInput());
+ if(visualEditor!=null) {
+ visualEditor.setInput(getEditorInput());
+ }
updateTitle();
}
updateFile();
@@ -450,14 +453,17 @@
private void createPagesForVPE() {
sourceEditor = new JSPTextEditor(this);
- visualEditor = visualEditorFactory.createVisualEditor(this,
- sourceEditor, false);
-
+ if(visualEditorFactory!=null) {
+ visualEditor = visualEditorFactory.createVisualEditor(this,
+ sourceEditor, false);
+ }
try {
- visualSourceIndex = addPage(visualEditor, getEditorInput());
- setPageText(visualSourceIndex, JSPEditorMessages
- .getString(VISUALSOURCE_TAB_LABEL));
- setPartName(visualEditor.getTitle());
+ if(visualEditor!=null) {
+ visualSourceIndex = addPage(visualEditor, getEditorInput());
+ setPageText(visualSourceIndex, JSPEditorMessages
+ .getString(VISUALSOURCE_TAB_LABEL));
+ setPartName(visualEditor.getTitle());
+ }
} catch (PartInitException e) {
JspEditorPlugin.getPluginLog().logError(e);
}
@@ -471,20 +477,29 @@
}*/
try {
- sourceIndex = addPage(visualEditor, getEditorInput());
- setPageText(sourceIndex, JSPEditorMessages
- .getString(SOURCE_TAB_LABEL));
- setPartName(visualEditor.getTitle());
+ if(visualEditor!=null) {
+ sourceIndex = addPage(visualEditor, getEditorInput());
+ setPageText(sourceIndex, JSPEditorMessages
+ .getString(SOURCE_TAB_LABEL));
+ setPartName(visualEditor.getTitle());
+ } else {
+ sourceIndex = addPage(sourceEditor, getEditorInput());
+ setPageText(sourceIndex, JSPEditorMessages
+ .getString(SOURCE_TAB_LABEL));
+ setPartName(sourceEditor.getTitle());
+ }
} catch (PartInitException e) {
JspEditorPlugin.getPluginLog().logError(e);
}
// Add tab contain default web-browser
try {
- previewIndex = addPage(visualEditor, getEditorInput());
- setPageText(previewIndex, JSPEditorMessages
- .getString(PREVIEW_TAB_LABEL));
- setPartName(visualEditor.getTitle());
+ if(visualEditor!=null) {
+ previewIndex = addPage(visualEditor, getEditorInput());
+ setPageText(previewIndex, JSPEditorMessages
+ .getString(PREVIEW_TAB_LABEL));
+ setPartName(visualEditor.getTitle());
+ }
} catch (PartInitException e) {
JspEditorPlugin.getPluginLog().logError(e);
}
@@ -566,7 +581,9 @@
((MultiPageEditorActionBarContributor) contributor)
.setActivePage(null);
}
- visualEditor.dispose();
+ if(visualEditor!=null) {
+ visualEditor.dispose();
+ }
site.dispose();
outlinePage = null;
XModelObject o = getModelObject();
Modified: trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/JSPContentOutlineConfiguration.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/JSPContentOutlineConfiguration.java 2008-10-16 16:12:40 UTC (rev 10894)
+++ trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/JSPContentOutlineConfiguration.java 2008-10-16 16:52:15 UTC (rev 10895)
@@ -62,9 +62,10 @@
static {
try {
Bundle b = Platform.getBundle("org.jboss.tools.vpe");
- Class cls = b.loadClass("org.jboss.tools.vpe.editor.dnd.context.ViewerDropAdapterFactory");
- dropAdapterFactory = (IViewerDropAdapterFactory)cls.newInstance();
-
+ if(b!=null) {
+ Class cls = b.loadClass("org.jboss.tools.vpe.editor.dnd.context.ViewerDropAdapterFactory");
+ dropAdapterFactory = (IViewerDropAdapterFactory)cls.newInstance();
+ }
} catch (Exception e) {
JspEditorPlugin.getPluginLog().logError(e);
}
@@ -86,12 +87,13 @@
FileTransfer.getInstance(),
TextTransfer.getInstance()
};
+ if(dropAdapterFactory!=null) {
fTransferDropTargetListeners = new TransferDropTargetListener[transfers.length];
for (int i = 0; i < transfers.length; i++) {
final Transfer transfer = transfers[i];
DropContext dropContext = new DropContext();
- final ViewerDropAdapter dropAdapter = dropAdapterFactory.createDropAdapter(transfer, treeViewer, editor, transfer, dropContext);
- fTransferDropTargetListeners[i] = new TransferDropTargetListener() {
+ final ViewerDropAdapter dropAdapter = dropAdapterFactory.createDropAdapter(transfer, treeViewer, editor, transfer, dropContext);
+ fTransferDropTargetListeners[i] = new TransferDropTargetListener() {
public void dragEnter(DropTargetEvent event) {
dropAdapter.dragEnter(event);
}
@@ -124,6 +126,9 @@
return getTransfer().isSupportedType(event.currentDataType);
}
};
+ }
+ } else {
+ fTransferDropTargetListeners = new TransferDropTargetListener[0];
}
}
return fTransferDropTargetListeners;
17 years, 2 months
JBoss Tools SVN: r10894 - in trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core: refactoring and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: akazakov
Date: 2008-10-16 12:12:40 -0400 (Thu, 16 Oct 2008)
New Revision: 10894
Added:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/refactoring/RenameComponentRefactoringContribution.java
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/Seam2FacetInstallDelegate.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamFacetAbstractInstallDelegate.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-2731 2.3. is done
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/Seam2FacetInstallDelegate.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/Seam2FacetInstallDelegate.java 2008-10-16 15:56:06 UTC (rev 10893)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/Seam2FacetInstallDelegate.java 2008-10-16 16:12:40 UTC (rev 10894)
@@ -104,7 +104,7 @@
super.doExecuteForEjb(project, fv, model, monitor);
IResource src = getSrcFolder(project);
- if(src!=null) {
+ if(src!=null && seamHomeFolder!=null) {
File srcFile = src.getLocation().toFile();
AntCopyUtils.copyFileToFolder(new File(seamGenResFolder, "security.drl"), srcFile, false); //$NON-NLS-1$
}
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamFacetAbstractInstallDelegate.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamFacetAbstractInstallDelegate.java 2008-10-16 15:56:06 UTC (rev 10893)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamFacetAbstractInstallDelegate.java 2008-10-16 16:12:40 UTC (rev 10894)
@@ -40,7 +40,9 @@
import org.eclipse.datatools.connectivity.ProfileManager;
import org.eclipse.jdt.core.IJavaProject;
import org.eclipse.jdt.core.IPackageFragmentRoot;
+import org.eclipse.jdt.core.JavaConventions;
import org.eclipse.jdt.core.JavaModelException;
+import org.eclipse.jdt.internal.compiler.impl.CompilerOptions;
import org.eclipse.jface.dialogs.ErrorDialog;
import org.eclipse.jst.common.project.facet.core.ClasspathHelper;
import org.eclipse.jst.j2ee.model.IModelProvider;
@@ -167,6 +169,7 @@
stopListening();
}
if(errorOccurs) {
+ errorOccurs = false;
Display.getDefault().syncExec(
new Runnable() {
public void run() {
@@ -306,24 +309,6 @@
srcFolder = isWarConfiguration(model) ? new File(srcRootFolder.getUnderlyingFolder().getLocation().toFile(), "model") : srcRootFolder.getUnderlyingFolder().getLocation().toFile(); //$NON-NLS-1$
Object runtimeName = model.getProperty(ISeamFacetDataModelProperties.SEAM_RUNTIME_NAME);
if(runtimeName!=null) {
- final SeamRuntime selectedRuntime = SeamRuntimeManager.getInstance().findRuntimeByName(runtimeName.toString());
-
- seamHomePath = selectedRuntime.getHomeDir();
-
- seamHomeFolder = new File(seamHomePath);
- seamLibFolder = new File(seamHomePath, SEAM_LIB_RELATED_PATH);
- seamGenResFolder = new File(seamHomePath, "seam-gen/resources"); //$NON-NLS-1$
-
- seamGenHomeFolder = new File(seamHomePath, "seam-gen"); //$NON-NLS-1$
- seamGenViewSource = new File(seamGenHomeFolder, "view"); //$NON-NLS-1$
- dataSourceDsFile = new File(seamGenResFolder, "datasource-ds.xml"); //$NON-NLS-1$
- componentsFile = new File(seamGenResFolder, "WEB-INF/components" + (isWarConfiguration(model) ? "-war" : "") + ".xml"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
-
- hibernateConsoleLaunchFile = new File(seamGenHomeFolder, "hibernatetools/hibernate-console.launch"); //$NON-NLS-1$
- hibernateConsolePropsFile = new File(seamGenHomeFolder, "hibernatetools/hibernate-console.properties"); //$NON-NLS-1$
- //final File hibernateConsolePref = new File(seamGenHomeFolder, "hibernatetools/.settings/org.hibernate.eclipse.console.prefs"); //$NON-NLS-1$
- persistenceFile = new File(seamGenResFolder, "META-INF/persistence-" + (isWarConfiguration(model) ? DEV_WAR_PROFILE : DEV_EAR_PROFILE) + ".xml"); //$NON-NLS-1$ //$NON-NLS-2$
-
copyFilesToWarProject(project, fv, model, monitor);
} else {
// If seam runtime is null then just modify web.xml and add seam nature.
@@ -490,9 +475,7 @@
*/
protected void doExecuteForEjb(final IProject project, IProjectFacetVersion fv,
IDataModel model, IProgressMonitor monitor) throws CoreException {
-
- IResource src = getSrcFolder(project);
- if(src==null) {
+ if(seamHomePath == null) {
return;
}
@@ -501,46 +484,49 @@
FilterSet jdbcFilterSet = SeamFacetFilterSetFactory.createJdbcFilterSet(model);
FilterSet projectFilterSet = SeamFacetFilterSetFactory.createProjectFilterSet(model);
- if(ejbViewFilterSetCollection==null) {
- ejbViewFilterSetCollection = new FilterSetCollection();
- ejbViewFilterSetCollection.addFilterSet(jdbcFilterSet);
- ejbViewFilterSetCollection.addFilterSet(projectFilterSet);
- }
-
FilterSetCollection hibernateDialectFilterSet = new FilterSetCollection();
hibernateDialectFilterSet.addFilterSet(jdbcFilterSet);
hibernateDialectFilterSet.addFilterSet(projectFilterSet);
hibernateDialectFilterSet.addFilterSet(SeamFacetFilterSetFactory.createHibernateDialectFilterSet(model));
- File srcFile = src.getLocation().toFile();
- // Copy sources to EJB project in case of EAR configuration
- AntCopyUtils.copyFileToFile(
- new File(seamGenHomeFolder, "src/Authenticator.java"), //$NON-NLS-1$
- new File(srcFile, model.getProperty(ISeamFacetDataModelProperties.SESSION_BEAN_PACKAGE_NAME).toString().replace('.', '/') + "/" + "Authenticator.java"), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- new FilterSetCollection(filtersFilterSet), false);
+ IResource src = getSrcFolder(project);
+ if(src!=null) {
+ if(ejbViewFilterSetCollection==null) {
+ ejbViewFilterSetCollection = new FilterSetCollection();
+ ejbViewFilterSetCollection.addFilterSet(jdbcFilterSet);
+ ejbViewFilterSetCollection.addFilterSet(projectFilterSet);
+ }
- File persistentXml = new File(srcFile, "META-INF/persistence.xml"); //$NON-NLS-1$
- if(!persistentXml.exists()) {
- AntCopyUtils.copyFileToFile(persistenceFile, new File(srcFile, "META-INF/persistence.xml"), //$NON-NLS-1$
- ejbViewFilterSetCollection, false);
- } else {
- // TODO modify persistence.xml
- }
+ File srcFile = src.getLocation().toFile();
+ // Copy sources to EJB project in case of EAR configuration
+ AntCopyUtils.copyFileToFile(
+ new File(seamGenHomeFolder, "src/Authenticator.java"), //$NON-NLS-1$
+ new File(srcFile, model.getProperty(ISeamFacetDataModelProperties.SESSION_BEAN_PACKAGE_NAME).toString().replace('.', '/') + "/" + "Authenticator.java"), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ new FilterSetCollection(filtersFilterSet), false);
- File componentProperties = new File(srcFile, "components.properties"); //$NON-NLS-1$
- if(!componentProperties.exists()) {
- SeamFacetAbstractInstallDelegate.createComponentsProperties(srcFile, project.getName(), false);
- }
+ File persistentXml = new File(srcFile, "META-INF/persistence.xml"); //$NON-NLS-1$
+ if(!persistentXml.exists()) {
+ AntCopyUtils.copyFileToFile(persistenceFile, new File(srcFile, "META-INF/persistence.xml"), //$NON-NLS-1$
+ ejbViewFilterSetCollection, false);
+ } else {
+ // TODO modify persistence.xml
+ }
- AntCopyUtils.FileSet ejbSrcResourcesSet = new AntCopyUtils.FileSet(JBOOS_EJB_WEB_INF_CLASSES_SET).dir(seamGenResFolder);
- AntCopyUtils.copyFilesAndFolders(seamGenResFolder, srcFile, new AntCopyUtils.FileSetFileFilter(ejbSrcResourcesSet), ejbViewFilterSetCollection, false);
+ File componentProperties = new File(srcFile, "components.properties"); //$NON-NLS-1$
+ if(!componentProperties.exists()) {
+ SeamFacetAbstractInstallDelegate.createComponentsProperties(srcFile, project.getName(), false);
+ }
- File ejbJarXml = new File(srcFile, "META-INF/ejb-jar.xml");
- if(!ejbJarXml.exists()) {
- AntCopyUtils.copyFileToFolder(new File(seamGenResFolder, "META-INF/ejb-jar.xml"), //$NON-NLS-1$
- new File(srcFile, "META-INF"), ejbViewFilterSetCollection, false); //$NON-NLS-1$
- } else {
- // TODO modify ejb-jar.xml
+ AntCopyUtils.FileSet ejbSrcResourcesSet = new AntCopyUtils.FileSet(JBOOS_EJB_WEB_INF_CLASSES_SET).dir(seamGenResFolder);
+ AntCopyUtils.copyFilesAndFolders(seamGenResFolder, srcFile, new AntCopyUtils.FileSetFileFilter(ejbSrcResourcesSet), ejbViewFilterSetCollection, false);
+
+ File ejbJarXml = new File(srcFile, "META-INF/ejb-jar.xml");
+ if(!ejbJarXml.exists()) {
+ AntCopyUtils.copyFileToFolder(new File(seamGenResFolder, "META-INF/ejb-jar.xml"), //$NON-NLS-1$
+ new File(srcFile, "META-INF"), ejbViewFilterSetCollection, false); //$NON-NLS-1$
+ } else {
+ // TODO modify ejb-jar.xml
+ }
}
FilterSet ejbFilterSet = new FilterSet();
ejbFilterSet.addFilter("projectName", ejbProjectFolder.getName()); //$NON-NLS-1$
@@ -553,6 +539,14 @@
ejbProjectFolder, hibernateDialectFilterSet, false);
}
+ enum ProjectType {
+ EAR,
+ EJB,
+ WAR
+ }
+
+ protected ProjectType projectType;
+
/**
*
* @param project
@@ -563,6 +557,7 @@
*/
public void doExecute(final IProject project, IProjectFacetVersion fv,
Object config, IProgressMonitor monitor) throws CoreException {
+ ejbViewFilterSetCollection = null;
final IDataModel model = (IDataModel)config;
IFacetedProject facetedProject = ProjectFacetsManager.create(project);
IProjectFacetVersion ejbVersion = facetedProject.getProjectFacetVersion(IJ2EEFacetConstants.EJB_FACET);
@@ -582,11 +577,37 @@
model.setProperty(ISeamFacetDataModelProperties.HIBERNATE_HBM2DDL_AUTO, "create-drop"); //$NON-NLS-1$
}
+ Object runtimeName = model.getProperty(ISeamFacetDataModelProperties.SEAM_RUNTIME_NAME);
+ if(runtimeName!=null) {
+ final SeamRuntime selectedRuntime = SeamRuntimeManager.getInstance().findRuntimeByName(runtimeName.toString());
+
+ seamHomePath = selectedRuntime.getHomeDir();
+
+ seamHomeFolder = new File(seamHomePath);
+ seamLibFolder = new File(seamHomePath, SEAM_LIB_RELATED_PATH);
+ seamGenResFolder = new File(seamHomePath, "seam-gen/resources"); //$NON-NLS-1$
+
+ seamGenHomeFolder = new File(seamHomePath, "seam-gen"); //$NON-NLS-1$
+ seamGenViewSource = new File(seamGenHomeFolder, "view"); //$NON-NLS-1$
+ dataSourceDsFile = new File(seamGenResFolder, "datasource-ds.xml"); //$NON-NLS-1$
+ componentsFile = new File(seamGenResFolder, "WEB-INF/components" + (isWarConfiguration(model) ? "-war" : "") + ".xml"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
+
+ hibernateConsoleLaunchFile = new File(seamGenHomeFolder, "hibernatetools/hibernate-console.launch"); //$NON-NLS-1$
+ hibernateConsolePropsFile = new File(seamGenHomeFolder, "hibernatetools/hibernate-console.properties"); //$NON-NLS-1$
+ //final File hibernateConsolePref = new File(seamGenHomeFolder, "hibernatetools/.settings/org.hibernate.eclipse.console.prefs"); //$NON-NLS-1$
+ persistenceFile = new File(seamGenResFolder, "META-INF/persistence-" + (isWarConfiguration(model) ? DEV_WAR_PROFILE : DEV_EAR_PROFILE) + ".xml"); //$NON-NLS-1$ //$NON-NLS-2$
+ } else {
+ seamHomePath = null;
+ }
+
if(ejbVersion!=null) {
+ projectType = ProjectType.EJB;
doExecuteForEjb(project, fv, model, monitor);
} else if(webVersion!=null) {
+ projectType = ProjectType.WAR;
doExecuteForWar(project, fv, model, monitor);
} else if(earVersion!=null) {
+ projectType = ProjectType.EAR;
doExecuteForEar(project, fv, model, monitor);
}
@@ -600,14 +621,19 @@
if(model.getProperty(ISeamFacetDataModelProperties.JBOSS_AS_DEPLOY_AS)==null) {
model.setProperty(ISeamFacetDataModelProperties.JBOSS_AS_DEPLOY_AS, warProject?ISeamFacetDataModelProperties.DEPLOY_AS_WAR:ISeamFacetDataModelProperties.DEPLOY_AS_EAR);
}
+ Object projectNamePackage = model.getProperty(IFacetDataModelProperties.FACET_PROJECT_NAME);
+ IStatus status = JavaConventions.validatePackageName(projectNamePackage.toString(), CompilerOptions.VERSION_1_5, CompilerOptions.VERSION_1_5);
+ if(!status.isOK()) {
+ projectNamePackage = "project";
+ }
if(model.getProperty(ISeamFacetDataModelProperties.SESSION_BEAN_PACKAGE_NAME)==null) {
- model.setProperty(ISeamFacetDataModelProperties.SESSION_BEAN_PACKAGE_NAME, "org.domain." + model.getProperty(IFacetDataModelProperties.FACET_PROJECT_NAME) + ".session"); //$NON-NLS-1$
+ model.setProperty(ISeamFacetDataModelProperties.SESSION_BEAN_PACKAGE_NAME, "org.domain." + projectNamePackage + ".session"); //$NON-NLS-1$
}
if(model.getProperty(ISeamFacetDataModelProperties.ENTITY_BEAN_PACKAGE_NAME)==null) {
- model.setProperty(ISeamFacetDataModelProperties.ENTITY_BEAN_PACKAGE_NAME, "org.domain." + model.getProperty(IFacetDataModelProperties.FACET_PROJECT_NAME) + ".entity"); //$NON-NLS-1$
+ model.setProperty(ISeamFacetDataModelProperties.ENTITY_BEAN_PACKAGE_NAME, "org.domain." + projectNamePackage + ".entity"); //$NON-NLS-1$
}
if(model.getProperty(ISeamFacetDataModelProperties.TEST_CASES_PACKAGE_NAME)==null) {
- model.setProperty(ISeamFacetDataModelProperties.TEST_CASES_PACKAGE_NAME, "org.domain." + model.getProperty(IFacetDataModelProperties.FACET_PROJECT_NAME) + ".test"); //$NON-NLS-1$
+ model.setProperty(ISeamFacetDataModelProperties.TEST_CASES_PACKAGE_NAME, "org.domain." + projectNamePackage + ".test"); //$NON-NLS-1$
}
if(model.getProperty(ISeamFacetDataModelProperties.SEAM_RUNTIME_NAME)==null) {
String runtimeName = SeamFacetInstallDataModelProvider.getSeamRuntimeDefaultValue(model);
@@ -669,6 +695,9 @@
*/
protected void createSeamProjectPreferenes(final IProject project,
final IDataModel model) {
+ if(projectType == ProjectType.EAR) {
+ return;
+ }
IScopeContext projectScope = new ProjectScope(project);
IEclipsePreferences prefs = projectScope.getNode(SeamCorePlugin.PLUGIN_ID);
@@ -690,10 +719,23 @@
IVirtualFolder rootFolder = component.getRootFolder();
IContainer webRootFolder = rootFolder.getFolder(new Path("/")).getUnderlyingFolder(); //$NON-NLS-1$
String webRootFolderPath = webRootFolder.getFullPath().toString();
- prefs.put(WEB_CONTENTS_FOLDER, webRootFolderPath);
+ IPath srcRootFolder = null;
+ if(projectType == ProjectType.WAR) {
+ srcRootFolder = rootFolder.getFolder(new Path("/WEB-INF/classes")).getUnderlyingFolder().getParent().getFullPath(); //$NON-NLS-1$
+ } else if(projectType == ProjectType.EJB) {
+ try {
+ srcRootFolder = getSrcFolder(project).getFullPath();
+ } catch (JavaModelException e) {
+ SeamCorePlugin.getPluginLog().logError(e);
+ srcRootFolder = new Path("");
+ }
+ }
+ if(projectType == ProjectType.WAR) {
+ prefs.put(WEB_CONTENTS_FOLDER, webRootFolderPath);
+ } else {
+ prefs.put(WEB_CONTENTS_FOLDER, srcRootFolder.toString());
+ }
- IPath srcRootFolder = rootFolder.getFolder(new Path("/WEB-INF/classes")).getUnderlyingFolder().getParent().getFullPath(); //$NON-NLS-1$
-
if(!isWarConfiguration(model)) {
prefs.put(SEAM_EJB_PROJECT, project.getName());
prefs.put(SEAM_EAR_PROJECT, project.getName());
Added: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/refactoring/RenameComponentRefactoringContribution.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/refactoring/RenameComponentRefactoringContribution.java (rev 0)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/refactoring/RenameComponentRefactoringContribution.java 2008-10-16 16:12:40 UTC (rev 10894)
@@ -0,0 +1,35 @@
+ /*******************************************************************************
+ * Copyright (c) 2008 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.seam.internal.core.refactoring;
+
+import java.util.Map;
+
+import org.eclipse.ltk.core.refactoring.RefactoringContribution;
+import org.eclipse.ltk.core.refactoring.RefactoringDescriptor;
+
+/**
+ * @author Alexey Kazakov
+ */
+public class RenameComponentRefactoringContribution extends RefactoringContribution {
+
+ @Override
+ public RefactoringDescriptor createDescriptor(String id, String project, String description, String comment, Map arguments, int flags) {
+// return new IntroduceIndirectionDescriptor(project, description, comment, arguments);
+ return super.createDescriptor();
+ }
+
+ @Override
+ public Map retrieveArgumentMap(RefactoringDescriptor descriptor) {
+// if (descriptor instanceof IntroduceIndirectionDescriptor)
+// return ((IntroduceIndirectionDescriptor) descriptor).getArguments();
+ return super.retrieveArgumentMap(descriptor);
+ }
+}
\ No newline at end of file
Property changes on: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/refactoring/RenameComponentRefactoringContribution.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
17 years, 2 months
JBoss Tools SVN: r10893 - in trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test: src/org/jboss/tools/jsf/vpe/richfaces/test and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: dmaliarevich
Date: 2008-10-16 11:56:06 -0400 (Thu, 16 Oct 2008)
New Revision: 10893
Added:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components/dragIndicator.xhtml
Modified:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/src/org/jboss/tools/jsf/vpe/richfaces/test/RichFacesComponentContentTest.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-2810,
junit test for rich:dragIndicator was added.
Added: trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components/dragIndicator.xhtml
===================================================================
(Binary files differ)
Property changes on: trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components/dragIndicator.xhtml
___________________________________________________________________
Name: svn:mime-type
+ application/xhtml+xml
Modified: trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/src/org/jboss/tools/jsf/vpe/richfaces/test/RichFacesComponentContentTest.java
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/src/org/jboss/tools/jsf/vpe/richfaces/test/RichFacesComponentContentTest.java 2008-10-16 15:41:27 UTC (rev 10892)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/src/org/jboss/tools/jsf/vpe/richfaces/test/RichFacesComponentContentTest.java 2008-10-16 15:56:06 UTC (rev 10893)
@@ -112,7 +112,7 @@
}
public void testDragIndicator() throws Throwable {
- assertTrue("it is necessary to add a body of the test ", false);//$NON-NLS-1$
+ performInvisibleTagTest("components/dragIndicator.xhtml", "dragIndicator"); //$NON-NLS-1$ //$NON-NLS-2$
}
public void testDragSupport() throws Throwable {
17 years, 2 months
JBoss Tools SVN: r10892 - trunk/birt/docs/en/modules.
by jbosstools-commits@lists.jboss.org
Author: abogachuk
Date: 2008-10-16 11:41:27 -0400 (Thu, 16 Oct 2008)
New Revision: 10892
Modified:
trunk/birt/docs/en/modules/birt_designer.xml
Log:
https://jira.jboss.org/jira/browse/JBDS-388 - BIRT UI, Designer features described
Modified: trunk/birt/docs/en/modules/birt_designer.xml
===================================================================
--- trunk/birt/docs/en/modules/birt_designer.xml 2008-10-16 15:10:40 UTC (rev 10891)
+++ trunk/birt/docs/en/modules/birt_designer.xml 2008-10-16 15:41:27 UTC (rev 10892)
@@ -12,7 +12,7 @@
<title>BIRT Report Designer</title>
- <para>BIRT Designer is an intuitive and quite easy Eclipse-based set of plugins to make reports. We will describe all its features to you.</para>
+ <para>BIRT Designer is an intuitive and quite easy Eclipse-based set of plugins to make reports. In this chapter we will describe its interface and all its features to you.</para>
<section id="birt_designer_UI" xreflabel="birt_designer_UI">
<title>BIRT User Interface</title>
17 years, 2 months
JBoss Tools SVN: r10891 - in trunk: birt/docs/en and 13 other directories.
by jbosstools-commits@lists.jboss.org
Author: smukhina
Date: 2008-10-16 11:10:40 -0400 (Thu, 16 Oct 2008)
New Revision: 10891
Modified:
trunk/as/docs/reference/en/master.xml
trunk/birt/docs/en/master.xml
trunk/documentation/guides/GettingStartedGuide/en/modules/getting_started.xml
trunk/esb/docs/esb_ref_guide/en/master.xml
trunk/hibernatetools/docs/reference/en/master.xml
trunk/jbpm/docs/reference/en/master.xml
trunk/jsf/docs/jsf_tools_ref_guide/en/master.xml
trunk/jsf/docs/jsf_tools_tutorial/en/master.xml
trunk/jsf/docs/userguide/en/modules/palette.xml
trunk/portlet/docs/reference/en/master.xml
trunk/portlet/docs/reference/en/modules/installation.xml
trunk/seam/docs/reference/en/master.xml
trunk/struts/docs/struts_tools_ref_guide/en/master.xml
trunk/struts/docs/struts_tools_tutorial/en/master.xml
trunk/ws/docs/reference/en/master.xml
Log:
https://jira.jboss.org/jira/browse/JBDS-292
versions are updated for beta1
Modified: trunk/as/docs/reference/en/master.xml
===================================================================
--- trunk/as/docs/reference/en/master.xml 2008-10-16 15:04:53 UTC (rev 10890)
+++ trunk/as/docs/reference/en/master.xml 2008-10-16 15:10:40 UTC (rev 10891)
@@ -41,7 +41,7 @@
<holder>JBoss, a division of Red Hat Inc.</holder>
</copyright>
<releaseinfo>
- Version: 3.0.0.alpha
+ Version: 3.0.0.beta1
</releaseinfo>
<abstract>
<title/>
Modified: trunk/birt/docs/en/master.xml
===================================================================
--- trunk/birt/docs/en/master.xml 2008-10-16 15:04:53 UTC (rev 10890)
+++ trunk/birt/docs/en/master.xml 2008-10-16 15:10:40 UTC (rev 10891)
@@ -23,7 +23,7 @@
<holder>JBoss, a division of Red Hat Inc.</holder>
</copyright>
<releaseinfo>
- Version: 1.0.0.alpha
+ Version: 3.0.0.beta1
</releaseinfo>
</bookinfo>
Modified: trunk/documentation/guides/GettingStartedGuide/en/modules/getting_started.xml
===================================================================
--- trunk/documentation/guides/GettingStartedGuide/en/modules/getting_started.xml 2008-10-16 15:04:53 UTC (rev 10890)
+++ trunk/documentation/guides/GettingStartedGuide/en/modules/getting_started.xml 2008-10-16 15:10:40 UTC (rev 10891)
@@ -386,7 +386,7 @@
<para>Get Eclipse and Web Tools</para>
</listitem>
</itemizedlist>
- <para>The currant version of JBoss Tools (3.0.0Alpha1) targets at Eclipse 3.4/Ganymede and WTP
+ <para>The currant version of JBoss Tools (3.0.0.beta1) targets at Eclipse 3.4/Ganymede and WTP
3.0.</para>
<tip>
Modified: trunk/esb/docs/esb_ref_guide/en/master.xml
===================================================================
--- trunk/esb/docs/esb_ref_guide/en/master.xml 2008-10-16 15:04:53 UTC (rev 10890)
+++ trunk/esb/docs/esb_ref_guide/en/master.xml 2008-10-16 15:10:40 UTC (rev 10891)
@@ -34,7 +34,7 @@
<holder>JBoss, a division of Red Hat Inc.</holder>
</copyright>
<releaseinfo>
- Version: 3.0.0.alpha
+ Version: 3.0.0.beta1
</releaseinfo>
<abstract>
Modified: trunk/hibernatetools/docs/reference/en/master.xml
===================================================================
--- trunk/hibernatetools/docs/reference/en/master.xml 2008-10-16 15:04:53 UTC (rev 10890)
+++ trunk/hibernatetools/docs/reference/en/master.xml 2008-10-16 15:10:40 UTC (rev 10891)
@@ -40,7 +40,7 @@
</copyright>
<releaseinfo>
- Version: 3.0.0.alpha
+ Version: 3.0.0.beta1
</releaseinfo>
Modified: trunk/jbpm/docs/reference/en/master.xml
===================================================================
--- trunk/jbpm/docs/reference/en/master.xml 2008-10-16 15:04:53 UTC (rev 10890)
+++ trunk/jbpm/docs/reference/en/master.xml 2008-10-16 15:10:40 UTC (rev 10891)
@@ -59,7 +59,7 @@
<year>2008</year>
<holder>JBoss, a division of Red Hat Inc.</holder>
</copyright>
- <releaseinfo> Version: 3.0.0.alpha </releaseinfo>
+ <releaseinfo> Version: 3.0.0.beta1</releaseinfo>
<abstract>
<title/>
Modified: trunk/jsf/docs/jsf_tools_ref_guide/en/master.xml
===================================================================
--- trunk/jsf/docs/jsf_tools_ref_guide/en/master.xml 2008-10-16 15:04:53 UTC (rev 10890)
+++ trunk/jsf/docs/jsf_tools_ref_guide/en/master.xml 2008-10-16 15:10:40 UTC (rev 10891)
@@ -41,7 +41,7 @@
<holder>JBoss, a division of Red Hat Inc.</holder>
</copyright>
<releaseinfo>
- Version: 3.0.0.alpha
+ Version: 3.0.0.beta1
</releaseinfo>
<abstract>
Modified: trunk/jsf/docs/jsf_tools_tutorial/en/master.xml
===================================================================
--- trunk/jsf/docs/jsf_tools_tutorial/en/master.xml 2008-10-16 15:04:53 UTC (rev 10890)
+++ trunk/jsf/docs/jsf_tools_tutorial/en/master.xml 2008-10-16 15:10:40 UTC (rev 10891)
@@ -42,7 +42,7 @@
</copyright>
<releaseinfo>
- Version: 3.0.0.alpha
+ Version: 3.0.0.beta1
</releaseinfo>
Modified: trunk/jsf/docs/userguide/en/modules/palette.xml
===================================================================
--- trunk/jsf/docs/userguide/en/modules/palette.xml 2008-10-16 15:04:53 UTC (rev 10890)
+++ trunk/jsf/docs/userguide/en/modules/palette.xml 2008-10-16 15:10:40 UTC (rev 10891)
@@ -586,7 +586,7 @@
<para>Currant version of <property>JBoss Developer Studio</property> (i. e. 1.1.0GA)
includes <ulink url="http://www.jboss.org/jbossrichfaces/downloads/">RichFaces
- 3.1.3</ulink>. The JBoss Tools 3.0Alpha comes with <ulink
+ 3.2.2</ulink>. The JBoss Tools 3.0.0.beta1 comes with <ulink
url="http://www.jboss.org/jbossrichfaces/downloads/">RichFaces 3.1.3</ulink> and
partly support 3.2 version of the component framework. If you need to use the latest
version of the component framework you should import it into the Palette like any
Modified: trunk/portlet/docs/reference/en/master.xml
===================================================================
--- trunk/portlet/docs/reference/en/master.xml 2008-10-16 15:04:53 UTC (rev 10890)
+++ trunk/portlet/docs/reference/en/master.xml 2008-10-16 15:10:40 UTC (rev 10891)
@@ -36,7 +36,7 @@
<holder>JBoss, a division of Red Hat Inc.</holder>
</copyright>
<releaseinfo>
- Version: 3.0.0.alpha
+ Version: 3.0.0.beta1
</releaseinfo>
</bookinfo>
Modified: trunk/portlet/docs/reference/en/modules/installation.xml
===================================================================
--- trunk/portlet/docs/reference/en/modules/installation.xml 2008-10-16 15:04:53 UTC (rev 10890)
+++ trunk/portlet/docs/reference/en/modules/installation.xml 2008-10-16 15:10:40 UTC (rev 10891)
@@ -8,7 +8,7 @@
<itemizedlist>
<listitem>
- <para>First, you need to have Eclipse Ganymede with JBoss Tools 3.0.0.Alpha1 installed.</para>
+ <para>First, you need to have Eclipse Ganymede with JBoss Tools 3.0.0.Alpha1 and higher installed.</para>
<tip>
<title>Tip:</title>
Modified: trunk/seam/docs/reference/en/master.xml
===================================================================
--- trunk/seam/docs/reference/en/master.xml 2008-10-16 15:04:53 UTC (rev 10890)
+++ trunk/seam/docs/reference/en/master.xml 2008-10-16 15:10:40 UTC (rev 10891)
@@ -46,7 +46,7 @@
<holder>JBoss, a division of Red Hat Inc.</holder>
</copyright>
<releaseinfo>
- Version: 3.0.0.alpha
+ Version: 3.0.0.beta1
</releaseinfo>
<abstract>
Modified: trunk/struts/docs/struts_tools_ref_guide/en/master.xml
===================================================================
--- trunk/struts/docs/struts_tools_ref_guide/en/master.xml 2008-10-16 15:04:53 UTC (rev 10890)
+++ trunk/struts/docs/struts_tools_ref_guide/en/master.xml 2008-10-16 15:10:40 UTC (rev 10891)
@@ -42,7 +42,7 @@
<holder>JBoss, a division of Red Hat Inc.</holder>
</copyright>
<releaseinfo>
- Version: 3.0.0.alpha
+ Version: 3.0.0.beta1
</releaseinfo>
<abstract>
Modified: trunk/struts/docs/struts_tools_tutorial/en/master.xml
===================================================================
--- trunk/struts/docs/struts_tools_tutorial/en/master.xml 2008-10-16 15:04:53 UTC (rev 10890)
+++ trunk/struts/docs/struts_tools_tutorial/en/master.xml 2008-10-16 15:10:40 UTC (rev 10891)
@@ -41,7 +41,7 @@
</copyright>
<releaseinfo>
- Version: 3.0.0.alpha
+ Version: 3.0.0.beta1
</releaseinfo>
<abstract>
<title/>
Modified: trunk/ws/docs/reference/en/master.xml
===================================================================
--- trunk/ws/docs/reference/en/master.xml 2008-10-16 15:04:53 UTC (rev 10890)
+++ trunk/ws/docs/reference/en/master.xml 2008-10-16 15:10:40 UTC (rev 10891)
@@ -21,7 +21,7 @@
<holder>JBoss, a division of Red Hat Inc.</holder>
</copyright>
<releaseinfo>
- Version: 3.0.GA
+ Version: 3.0.0.beta1
</releaseinfo>
<abstract>
<title/>
17 years, 2 months
JBoss Tools SVN: r10890 - in trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test: src/org/jboss/tools/jsf/vpe/richfaces/test and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: dmaliarevich
Date: 2008-10-16 11:04:53 -0400 (Thu, 16 Oct 2008)
New Revision: 10890
Added:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components/dataOrderedList.xhtml.xml
trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components/dndParam.xhtml
Modified:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/src/org/jboss/tools/jsf/vpe/richfaces/test/RichFacesComponentContentTest.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-2810,
junit test for rich:dndParam was added.
Added: trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components/dataOrderedList.xhtml.xml
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components/dataOrderedList.xhtml.xml (rev 0)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components/dataOrderedList.xhtml.xml 2008-10-16 15:04:53 UTC (rev 10890)
@@ -0,0 +1,5 @@
+<tests>
+ <test id="dataOrderedList">
+
+ </test>
+</tests>
\ No newline at end of file
Property changes on: trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components/dataOrderedList.xhtml.xml
___________________________________________________________________
Name: svn:mime-type
+ text/xml
Name: svn:eol-style
+ native
Added: trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components/dndParam.xhtml
===================================================================
(Binary files differ)
Property changes on: trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components/dndParam.xhtml
___________________________________________________________________
Name: svn:mime-type
+ application/xhtml+xml
Modified: trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/src/org/jboss/tools/jsf/vpe/richfaces/test/RichFacesComponentContentTest.java
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/src/org/jboss/tools/jsf/vpe/richfaces/test/RichFacesComponentContentTest.java 2008-10-16 14:34:05 UTC (rev 10889)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/src/org/jboss/tools/jsf/vpe/richfaces/test/RichFacesComponentContentTest.java 2008-10-16 15:04:53 UTC (rev 10890)
@@ -98,7 +98,7 @@
assertTrue("it is necessary to add a body of the test ", false);//$NON-NLS-1$
}
- public void _testDataTable() throws Throwable {
+ public void testDataTable() throws Throwable {
performContentTest("components/dataTable.xhtml");//$NON-NLS-1$
}
@@ -108,7 +108,7 @@
}
public void testDndParam() throws Throwable {
- assertTrue("it is necessary to add a body of the test ", false);//$NON-NLS-1$
+ performInvisibleTagTest("components/dndParam.xhtml", "dndParam"); //$NON-NLS-1$ //$NON-NLS-2$
}
public void testDragIndicator() throws Throwable {
17 years, 2 months
JBoss Tools SVN: r10889 - trunk/common/plugins/org.jboss.tools.common.text.xml/src/org/jboss/tools/common/text/xml/contentassist.
by jbosstools-commits@lists.jboss.org
Author: vrubezhny
Date: 2008-10-16 10:34:05 -0400 (Thu, 16 Oct 2008)
New Revision: 10889
Modified:
trunk/common/plugins/org.jboss.tools.common.text.xml/src/org/jboss/tools/common/text/xml/contentassist/SortingCompoundContentAssistProcessor.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-2118 Cleanup/unify the EL code completion used in JSF, Java, Seam completions
Modified: trunk/common/plugins/org.jboss.tools.common.text.xml/src/org/jboss/tools/common/text/xml/contentassist/SortingCompoundContentAssistProcessor.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.text.xml/src/org/jboss/tools/common/text/xml/contentassist/SortingCompoundContentAssistProcessor.java 2008-10-16 14:16:06 UTC (rev 10888)
+++ trunk/common/plugins/org.jboss.tools.common.text.xml/src/org/jboss/tools/common/text/xml/contentassist/SortingCompoundContentAssistProcessor.java 2008-10-16 14:34:05 UTC (rev 10889)
@@ -16,6 +16,7 @@
import java.util.Collection;
import java.util.Comparator;
import java.util.HashMap;
+import java.util.HashSet;
import java.util.Iterator;
import java.util.LinkedHashSet;
import java.util.LinkedList;
@@ -207,10 +208,33 @@
ICompletionProposal[] resultArray = ret.toArray(new ICompletionProposal[ret.size()]);
Object[] sorted = createSorter().sort(resultArray);
System.arraycopy(sorted, 0, resultArray, 0, sorted.length);
+ resultArray = makeUnique(resultArray);
return resultArray;
}
+ /**
+ * Removes duplicates of completion strings
+ *
+ * @param suggestions a list of suggestions ({@link String}).
+ * @return a list of unique completion suggestions.
+ */
+ public ICompletionProposal[] makeUnique(ICompletionProposal[] proposals) {
+ HashSet<String> present = new HashSet<String>();
+ ArrayList<ICompletionProposal> unique= new ArrayList<ICompletionProposal>();
+
+ for (int i = 0; proposals != null && i < proposals.length; i++) {
+
+ if (!present.contains(proposals[i].getDisplayString())) {
+ present.add(proposals[i].getDisplayString());
+ unique.add(proposals[i]);
+ }
+ }
+
+ present.clear();
+ return unique.toArray(new ICompletionProposal[unique.size()]);
+ }
+
protected Sorter createSorter() {
return new Sorter() {
public boolean compare(Object proposal1, Object proposal2) {
@@ -233,7 +257,7 @@
return str2.compareTo(str1) > 0;
}
- return (pr1 < pr2);
+ return (pr2 > pr1);
}
};
}
17 years, 2 months
JBoss Tools SVN: r10888 - in trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4: model and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: koen.aers(a)jboss.com
Date: 2008-10-16 10:16:06 -0400 (Thu, 16 Oct 2008)
New Revision: 10888
Modified:
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/editor/JpdlEditor.java
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/model/Process.java
Log:
flow properties in properties view
Modified: trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/editor/JpdlEditor.java
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/editor/JpdlEditor.java 2008-10-16 14:14:51 UTC (rev 10887)
+++ trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/editor/JpdlEditor.java 2008-10-16 14:16:06 UTC (rev 10888)
@@ -35,4 +35,5 @@
protected void createModel(InputStream is) {
setModel(createModel());
}
+
}
Modified: trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/model/Process.java
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/model/Process.java 2008-10-16 14:14:51 UTC (rev 10887)
+++ trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/model/Process.java 2008-10-16 14:16:06 UTC (rev 10888)
@@ -9,11 +9,6 @@
private Node initial = null;
- public Process() {
- super();
- setMetaData("xml", "process-definition");
- }
-
public StartState getStartState() {
for (Iterator<Node> iterator = getNodes().iterator(); iterator.hasNext(); ) {
Node node = iterator.next();
@@ -31,5 +26,5 @@
public void setInitial(Node node) {
initial = node;
}
-
+
}
17 years, 2 months
JBoss Tools SVN: r10887 - in trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools: common and 3 other directories.
by jbosstools-commits@lists.jboss.org
Author: koen.aers(a)jboss.com
Date: 2008-10-16 10:14:51 -0400 (Thu, 16 Oct 2008)
New Revision: 10887
Added:
trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/common/
trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/common/properties/
trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/common/properties/DefaultFlowPropertySource.java
Modified:
trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/registry/ElementRegistry.java
trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/wrapper/AbstractConnectionWrapper.java
trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/wrapper/AbstractWrapper.java
trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/wrapper/DefaultFlowWrapper.java
trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/wrapper/DefaultNodeWrapper.java
trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/wrapper/Wrapper.java
Log:
flow properties in properties view
Added: trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/common/properties/DefaultFlowPropertySource.java
===================================================================
--- trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/common/properties/DefaultFlowPropertySource.java (rev 0)
+++ trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/common/properties/DefaultFlowPropertySource.java 2008-10-16 14:14:51 UTC (rev 10887)
@@ -0,0 +1,50 @@
+package org.jboss.tools.common.properties;
+
+import org.eclipse.ui.views.properties.IPropertyDescriptor;
+import org.eclipse.ui.views.properties.IPropertySource;
+import org.eclipse.ui.views.properties.TextPropertyDescriptor;
+import org.jboss.tools.flow.common.wrapper.DefaultFlowWrapper;
+
+public class DefaultFlowPropertySource implements IPropertySource {
+
+ private static final String NAME = "org.jboss.tools.flow.common.model.DefaultFlow.name";
+
+ private DefaultFlowWrapper wrapper = null;
+ private IPropertyDescriptor[] propertyDescriptors;
+
+ public DefaultFlowPropertySource(DefaultFlowWrapper wrapper) {
+ this.wrapper = wrapper;
+ }
+ public Object getEditableValue() {
+ return null;
+ }
+ public IPropertyDescriptor[] getPropertyDescriptors() {
+ if (propertyDescriptors == null) {
+ propertyDescriptors = new IPropertyDescriptor[] {
+ new TextPropertyDescriptor(NAME, "Name") {}
+ };
+ }
+ return propertyDescriptors;
+ }
+ public Object getPropertyValue(Object id) {
+ if (NAME.equals(id)) {
+ return wrapper.getName();
+ }
+ return null;
+ }
+ public boolean isPropertySet(Object id) {
+ if (NAME.equals(id)) {
+ return wrapper.getName() != null;
+ }
+ return false;
+ }
+ public void resetPropertyValue(Object id) {
+ }
+ public void setPropertyValue(Object id, Object value) {
+ if (NAME.equals(id)) {
+ if (value instanceof String) {
+ wrapper.setName((String)value);
+ }
+ }
+ }
+}
Modified: trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/registry/ElementRegistry.java
===================================================================
--- trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/registry/ElementRegistry.java 2008-10-16 14:02:38 UTC (rev 10886)
+++ trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/registry/ElementRegistry.java 2008-10-16 14:14:51 UTC (rev 10887)
@@ -83,7 +83,7 @@
}
((Element)element).setMetaData("configurationElement", configurationElement);
Wrapper result = new DefaultConnectionWrapper();
- result.setElement(element);
+ result.setElement((Element)element);
return result;
}
@@ -97,7 +97,7 @@
}
((Node)element).setMetaData("configurationElement", configurationElement);
DefaultNodeWrapper result = new DefaultNodeWrapper();
- result.setElement(element);
+ result.setElement((Element)element);
AcceptsIncomingConnectionStrategy acceptsIncomingConnectionStrategy = createAcceptsIncomingConnectionStrategy(configurationElement);
if (acceptsIncomingConnectionStrategy != null) {
acceptsIncomingConnectionStrategy.setNode((Node)element);
@@ -122,7 +122,7 @@
}
((Element) element).setMetaData("configurationElement", configurationElement);
DefaultContainerWrapper result = new DefaultContainerWrapper();
- result.setElement(element);
+ result.setElement((Element)element);
AcceptsElementStrategy acceptsElementStrategy = createAcceptsElementStrategy(configurationElement);
if (acceptsElementStrategy != null) {
acceptsElementStrategy.setContainer((Container)element);
@@ -184,7 +184,7 @@
}
((Element) element).setMetaData("configurationElement", configurationElement);
DefaultFlowWrapper result = new DefaultFlowWrapper();
- result.setElement(element);
+ result.setElement((Element)element);
AcceptsElementStrategy acceptsElementStrategy = createAcceptsElementStrategy(configurationElement);
if (acceptsElementStrategy != null) {
acceptsElementStrategy.setContainer((Container)result.getElement());
Modified: trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/wrapper/AbstractConnectionWrapper.java
===================================================================
--- trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/wrapper/AbstractConnectionWrapper.java 2008-10-16 14:02:38 UTC (rev 10886)
+++ trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/wrapper/AbstractConnectionWrapper.java 2008-10-16 14:14:51 UTC (rev 10887)
@@ -20,6 +20,7 @@
import java.util.List;
import org.eclipse.draw2d.geometry.Point;
+import org.jboss.tools.flow.common.model.Element;
/**
* A connection between two model elements.
@@ -30,17 +31,17 @@
private static final long serialVersionUID = 1L;
- private Object element;
+ private Element element;
private NodeWrapper source;
private NodeWrapper target;
private transient List<Point> bendpoints = new ArrayList<Point>();
private transient List<ModelListener> listeners = new ArrayList<ModelListener>();
- public void setElement(Object element) {
+ public void setElement(Element element) {
this.element = element;
}
- public Object getElement() {
+ public Element getElement() {
return element;
}
Modified: trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/wrapper/AbstractWrapper.java
===================================================================
--- trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/wrapper/AbstractWrapper.java 2008-10-16 14:02:38 UTC (rev 10886)
+++ trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/wrapper/AbstractWrapper.java 2008-10-16 14:14:51 UTC (rev 10887)
@@ -1,15 +1,25 @@
package org.jboss.tools.flow.common.wrapper;
+import org.jboss.tools.flow.common.model.Element;
+
public abstract class AbstractWrapper implements Wrapper {
- private Object element;
+ private Element element;
- public void setElement(Object element) {
+ public void setElement(Element element) {
this.element = element;
}
- public Object getElement() {
+ public Element getElement() {
return element;
}
+
+ @SuppressWarnings("unchecked")
+ public Object getAdapter(Class adapter) {
+ if (adapter == Element.class) {
+ return element;
+ }
+ return null;
+ }
}
Modified: trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/wrapper/DefaultFlowWrapper.java
===================================================================
--- trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/wrapper/DefaultFlowWrapper.java 2008-10-16 14:02:38 UTC (rev 10886)
+++ trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/wrapper/DefaultFlowWrapper.java 2008-10-16 14:14:51 UTC (rev 10887)
@@ -1,5 +1,8 @@
package org.jboss.tools.flow.common.wrapper;
+import org.eclipse.ui.views.properties.IPropertySource;
+import org.jboss.tools.common.properties.DefaultFlowPropertySource;
+import org.jboss.tools.flow.common.model.DefaultFlow;
import org.jboss.tools.flow.common.model.Flow;
import org.jboss.tools.flow.common.model.Node;
import org.jboss.tools.flow.common.strategy.AcceptsElementStrategy;
@@ -7,6 +10,15 @@
public class DefaultFlowWrapper extends AbstractFlowWrapper {
private AcceptsElementStrategy acceptsElementStrategy;
+ private DefaultFlowPropertySource propertySource;
+
+ public String getName() {
+ return ((DefaultFlow)getElement()).getName();
+ }
+
+ public void setName(String name) {
+ ((DefaultFlow)getElement()).setName(name);
+ }
public Integer getRouterLayout() {
Integer routerLayout = (Integer) ((Flow)getElement()).getMetaData("routerLayout");
@@ -49,5 +61,20 @@
public void setAcceptsElementStrategy(AcceptsElementStrategy strategy) {
this.acceptsElementStrategy = strategy;
}
+
+ @SuppressWarnings("unchecked")
+ public Object getAdapter(Class adapter) {
+ if (adapter == IPropertySource.class) {
+ return getPropertySource();
+ }
+ return super.getAdapter(adapter);
+ }
+ private IPropertySource getPropertySource() {
+ if (propertySource == null) {
+ propertySource = new DefaultFlowPropertySource(this);
+ }
+ return propertySource;
+ }
+
}
Modified: trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/wrapper/DefaultNodeWrapper.java
===================================================================
--- trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/wrapper/DefaultNodeWrapper.java 2008-10-16 14:02:38 UTC (rev 10886)
+++ trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/wrapper/DefaultNodeWrapper.java 2008-10-16 14:14:51 UTC (rev 10887)
@@ -28,9 +28,8 @@
return getNode().getName();
}
- public void internalSetName(String name) {
+ protected void internalSetName(String name) {
getNode().setName(name);
- notifyListeners(CHANGE_VISUAL);
}
protected void internalSetConstraint(Rectangle constraint) {
Modified: trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/wrapper/Wrapper.java
===================================================================
--- trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/wrapper/Wrapper.java 2008-10-16 14:02:38 UTC (rev 10886)
+++ trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/wrapper/Wrapper.java 2008-10-16 14:14:51 UTC (rev 10887)
@@ -1,9 +1,13 @@
package org.jboss.tools.flow.common.wrapper;
-public interface Wrapper {
+import org.eclipse.core.runtime.IAdaptable;
+import org.jboss.tools.flow.common.model.Element;
+
+
+public interface Wrapper extends IAdaptable {
- void setElement(Object element);
- Object getElement();
+ void setElement(Element element);
+ Element getElement();
void addListener(ModelListener listener);
void removeListener(ModelListener listener);
17 years, 2 months
JBoss Tools SVN: r10886 - in trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse: launch and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: dgeraskov
Date: 2008-10-16 10:02:38 -0400 (Thu, 16 Oct 2008)
New Revision: 10886
Modified:
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/wizards/TableFilterView.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/CodeGenerationLaunchDelegate.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/ExporterAttributes.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/HibernateLaunchConstants.java
Log:
http://jira.jboss.com/jira/browse/JBIDE-1178
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/wizards/TableFilterView.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/wizards/TableFilterView.java 2008-10-16 14:02:28 UTC (rev 10885)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/wizards/TableFilterView.java 2008-10-16 14:02:38 UTC (rev 10886)
@@ -21,17 +21,12 @@
*/
package org.hibernate.eclipse.console.wizards;
-import java.util.ArrayList;
import java.util.Iterator;
-import java.util.List;
import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.jface.viewers.CellEditor;
import org.eclipse.jface.viewers.CheckboxCellEditor;
-import org.eclipse.jface.viewers.ICellEditorListener;
import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
import org.eclipse.jface.viewers.StructuredSelection;
import org.eclipse.jface.viewers.TableViewer;
import org.eclipse.jface.viewers.TextCellEditor;
@@ -45,7 +40,6 @@
import org.hibernate.eclipse.console.HibernateConsoleMessages;
import org.hibernate.eclipse.console.model.IReverseEngineeringDefinition;
import org.hibernate.eclipse.console.model.ITableFilter;
-import org.hibernate.eclipse.console.utils.ProjectUtils;
import org.hibernate.eclipse.console.workbench.DeferredContentProvider;
import org.hibernate.eclipse.console.workbench.LazyDatabaseSchema;
import org.hibernate.eclipse.console.workbench.TableContainer;
@@ -60,11 +54,19 @@
private TableViewer tableViewer;
- private IReverseEngineeringDefinition revEngDef;
+ protected IReverseEngineeringDefinition revEngDef;
public TableFilterView(Composite parent, int style) {
- super( parent, style );
+ super( parent, style );
+ }
+ protected TreeViewer createTreeViewer() {
+ TreeViewer viewer = new TreeViewer( tree );
+ viewer.setLabelProvider( new AnyAdaptableLabelProvider() );
+ viewer.setContentProvider( new DeferredContentProvider() );
+
+ viewer.setInput( null );
+ return viewer;
}
public void setModel(IReverseEngineeringDefinition revEngDef) {
@@ -75,13 +77,7 @@
protected void initialize() {
super.initialize();
tableViewer = createTableFilterViewer();
-
- viewer = new TreeViewer( tree );
- viewer.setLabelProvider( new AnyAdaptableLabelProvider() );
- viewer.setContentProvider( new DeferredContentProvider() );
-
- viewer.setInput( null );
-
+ viewer = createTreeViewer();
}
private TableViewer createTableFilterViewer() {
@@ -133,7 +129,7 @@
return revEngDef.getTableFilters();
}
- private void toggle(boolean exclude) {
+ protected void toggle(boolean exclude) {
ISelection selection = viewer.getSelection();
if ( !selection.isEmpty() ) {
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/CodeGenerationLaunchDelegate.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/CodeGenerationLaunchDelegate.java 2008-10-16 14:02:28 UTC (rev 10885)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/CodeGenerationLaunchDelegate.java 2008-10-16 14:02:38 UTC (rev 10886)
@@ -21,6 +21,7 @@
*/
package org.hibernate.eclipse.launch;
+import java.io.ByteArrayInputStream;
import java.io.File;
import java.lang.reflect.Constructor;
import java.util.HashSet;
@@ -65,6 +66,7 @@
import org.hibernate.cfg.reveng.OverrideRepository;
import org.hibernate.cfg.reveng.ReverseEngineeringSettings;
import org.hibernate.cfg.reveng.ReverseEngineeringStrategy;
+import org.hibernate.cfg.reveng.TableFilter;
import org.hibernate.console.ConsoleConfiguration;
import org.hibernate.console.HibernateConsoleRuntimeException;
import org.hibernate.console.KnownConfigurations;
@@ -264,7 +266,8 @@
final String reverseEngineeringStrategy = attributes.getRevengStrategy();
final boolean preferBasicCompositeids = attributes.isPreferBasicCompositeIds();
final IResource revengres = PathHelper.findMember( root, attributes.getRevengSettings());
-
+ final String revengTables = attributes.getRevengTables();
+
if(reveng) {
Configuration configuration = null;
if(cc.hasConfiguration()) {
@@ -282,20 +285,24 @@
cc.execute(new Command() { // need to execute in the consoleconfiguration to let it handle classpath stuff!
- public Object execute() {
+ public Object execute() {
+ //todo: factor this setup of revengstrategy to core
+ ReverseEngineeringStrategy res = new DefaultReverseEngineeringStrategy();
-
- //todo: factor this setup of revengstrategy to core
- DefaultReverseEngineeringStrategy configurableNamingStrategy = new DefaultReverseEngineeringStrategy();
- //configurableNamingStrategy.setSettings(qqsettings);
-
- ReverseEngineeringStrategy res = configurableNamingStrategy;
- if(revengres!=null) {
+ OverrideRepository repository = null;
+
+ if (revengTables != null){
+ repository = new OverrideRepository();
+ repository.addInputStream(new ByteArrayInputStream(revengTables.getBytes()));
+ } else if(revengres!=null) {
/*Configuration configuration = cc.buildWith(new Configuration(), false);*/
/*Settings settings = cc.getSettings(configuration);*/
File file = PathHelper.getLocation( revengres ).toFile();
- OverrideRepository repository = new OverrideRepository();///*settings.getDefaultCatalogName(),settings.getDefaultSchemaName()*/);
- repository.addFile(file);
+ repository = new OverrideRepository();
+ repository.addFile(file);
+ }
+
+ if (repository != null){
res = repository.getReverseEngineeringStrategy(res);
}
@@ -308,7 +315,6 @@
.setDetectManyToMany( attributes.detectManyToMany() )
.setDetectOptimisticLock( attributes.detectOptimisticLock() );
- configurableNamingStrategy.setSettings( qqsettings );
res.setSettings(qqsettings);
cfg.setReverseEngineeringStrategy( res );
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/ExporterAttributes.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/ExporterAttributes.java 2008-10-16 14:02:28 UTC (rev 10885)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/ExporterAttributes.java 2008-10-16 14:02:38 UTC (rev 10886)
@@ -46,6 +46,7 @@
import java.util.List;
import java.util.Map;
import java.util.Set;
+import java.util.StringTokenizer;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.Path;
@@ -58,6 +59,7 @@
import org.hibernate.eclipse.console.HibernateConsolePlugin;
import org.hibernate.eclipse.console.model.impl.ExporterDefinition;
import org.hibernate.eclipse.console.model.impl.ExporterFactory;
+import org.hibernate.mapping.Table;
// This class was created to centralize launch configuration attribute loading/saving
// (and also to clean up CodeGenerationLaunchDelegate considerably)
@@ -71,8 +73,10 @@
private String outputPath;
private String templatePath;
private List exporterFactories;
-private boolean autoManyToManyDetection;
-private boolean autoVersioning;
+ // if set then build reveng strategy relying on the list of tables
+ private String revengTables;
+ private boolean autoManyToManyDetection;
+ private boolean autoVersioning;
public ExporterAttributes () { }
@@ -106,8 +110,8 @@
}
exporterFactories = readExporterFactories(configuration);
-
- } catch (CoreException e) {
+ revengTables = configuration.getAttribute(HibernateLaunchConstants.ATTR_REVENG_TABLES, (String)null);
+ } catch (CoreException e) {
throw new CoreException(HibernateConsolePlugin.throwableToStatus(e, 666));
}
}
@@ -351,7 +355,11 @@
return autoVersioning;
}
+ public String getRevengTables() {
+ return revengTables;
+ }
+
}
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/HibernateLaunchConstants.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/HibernateLaunchConstants.java 2008-10-16 14:02:28 UTC (rev 10885)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/HibernateLaunchConstants.java 2008-10-16 14:02:38 UTC (rev 10886)
@@ -61,5 +61,6 @@
public static final String ATTR_PREFER_BASIC_COMPOSITE_IDS = ATTR_PREFIX + "prefercompositeids"; //$NON-NLS-1$
public static final String ATTR_AUTOMATIC_MANY_TO_MANY = ATTR_PREFIX + "reveng.detect_many_to_many"; //$NON-NLS-1$
public static final String ATTR_AUTOMATIC_VERSIONING = ATTR_PREFIX + "reveng.detect_optimistc_lock"; //$NON-NLS-1$
+ public static final String ATTR_REVENG_TABLES = ATTR_PREFIX + "reveng.tables";//$NON-NLS-1$
}
17 years, 2 months
JBoss Tools SVN: r10885 - in trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui: internal/reveng and 2 other directories.
by jbosstools-commits@lists.jboss.org
Author: dgeraskov
Date: 2008-10-16 10:02:28 -0400 (Thu, 16 Oct 2008)
New Revision: 10885
Added:
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/internal/reveng/
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/internal/reveng/JDBCTablesColumnsReader.java
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/internal/reveng/TablesColumnsCollector.java
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/views/DBTableFilterView.java
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/views/DBTablesViewer.java
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamGenerateEntitiesTablesWizardPage.java
Modified:
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamGenerateEnitiesWizard.java
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamGenerateEnitiesWizardPage.java
Log:
http://jira.jboss.com/jira/browse/JBIDE-1178
Added: trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/internal/reveng/JDBCTablesColumnsReader.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/internal/reveng/JDBCTablesColumnsReader.java (rev 0)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/internal/reveng/JDBCTablesColumnsReader.java 2008-10-16 14:02:28 UTC (rev 10885)
@@ -0,0 +1,197 @@
+/*******************************************************************************
+ * Copyright (c) 2008 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.seam.ui.internal.reveng;
+
+import java.sql.SQLException;
+import java.util.Iterator;
+import java.util.Map;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.hibernate.cfg.reveng.ReverseEngineeringRuntimeInfo;
+import org.hibernate.cfg.reveng.dialect.MetaDataDialect;
+import org.hibernate.connection.ConnectionProvider;
+import org.hibernate.exception.SQLExceptionConverter;
+import org.hibernate.util.StringHelper;
+
+/**
+ * @author Vitali
+ *
+ */
+public class JDBCTablesColumnsReader {
+
+ private static final Log log = LogFactory.getLog(JDBCTablesColumnsReader.class);
+
+ private MetaDataDialect metadataDialect;
+ // current catalog name - if current connection provide it
+ private String currentCatalog;
+
+ private final ConnectionProvider provider;
+ private final SQLExceptionConverter sec;
+
+ public JDBCTablesColumnsReader(MetaDataDialect dialect, ConnectionProvider provider,
+ SQLExceptionConverter sec) {
+ this.metadataDialect = dialect;
+ this.provider = provider;
+ this.sec = sec;
+ currentCatalog = null;
+ }
+
+ private boolean safeEquals(Object value, Object tf) {
+ if (value == tf)
+ return true;
+ if (null == value)
+ return false;
+ return value.equals(tf);
+ }
+
+ private String quote(String columnName) {
+ if (null == columnName) {
+ return null;
+ }
+ if (!metadataDialect.needQuote(columnName)) {
+ return columnName;
+ }
+ if (columnName.length() > 1 && columnName.charAt(0) == '`'
+ && columnName.charAt(columnName.length() - 1) == '`') {
+ return columnName; // avoid double quoting
+ }
+ return "`" + columnName + "`";
+ }
+
+ private void collectTables(TablesColumnsCollector tcc, String catalog, String schema) {
+ Iterator tableIterator = null;
+ try {
+ String tablesMask = null;
+ tableIterator = metadataDialect.getTables(StringHelper.replace(catalog, ".*", "%"),
+ StringHelper.replace(schema, ".*", "%"), StringHelper.replace(tablesMask, ".*",
+ "%"));
+ while (tableIterator.hasNext()) {
+ Map tableRs = (Map) tableIterator.next();
+ String catalogName = (String) tableRs.get("TABLE_CAT");
+/*
+ * commented by Dmitry Geraskov to prevent showing catalog name if
+ * db provider can't found it
+ * otherwise we'll set it and filter out all tables when will run code generation
+ * if (null == catalogName) {
+ * // simple workaround if db provider do not find resources
+ * // to return right catalog name here
+ * catalogName = currentCatalog;
+ * }
+ */
+ String schemaName = (String) tableRs.get("TABLE_SCHEM");
+ String tableName = (String) tableRs.get("TABLE_NAME");
+ //String comment = (String) tableRs.get("REMARKS");
+ String tableType = (String) tableRs.get("TABLE_TYPE");
+ if (("TABLE".equals(tableType) || "VIEW".equals(tableType))) {
+ log.debug("Adding table " + tableName + " of type " + tableType);
+ tcc.addTableName(catalogName, schemaName, quote(tableName));
+ } else {
+ log.debug("Ignoring table " + tableName + " of type " + tableType);
+ }
+ }
+ } finally {
+ try {
+ if (null != tableIterator) {
+ metadataDialect.close(tableIterator);
+ }
+ } catch (Exception ignore) {
+ }
+ }
+ }
+
+ public void readDatabaseTables(TablesColumnsCollector tcc, String catalog, String schema) {
+ try {
+ ReverseEngineeringRuntimeInfo info = ReverseEngineeringRuntimeInfo.createInstance(provider, sec,
+ null);
+ metadataDialect.configure(info);
+ tcc.init();
+ initCurrentCatalog(info);
+ collectTables(tcc, catalog, schema);
+ tcc.adjust();
+ } finally {
+ metadataDialect.close();
+ }
+ }
+
+ private void collectColumns(TablesColumnsCollector tcc, String catalog, String schema) {
+ Iterator columnIterator = null;
+ try {
+ String tablesMask = null;
+ String columnsMask = null;
+ columnIterator = metadataDialect.getColumns(StringHelper.replace(catalog, ".*", "%"),
+ StringHelper.replace(schema, ".*", "%"), StringHelper.replace(tablesMask, ".*",
+ "%"), StringHelper.replace(columnsMask, ".*", "%"));
+ while (columnIterator.hasNext()) {
+ Map columnRs = (Map) columnIterator.next();
+ String catalogName = (String) columnRs.get("TABLE_CAT");
+ if (null == catalogName) {
+ // simple workaround if db provider do not find resources
+ // to return right catalog name here
+ catalogName = currentCatalog;
+ }
+ String schemaName = (String) columnRs.get("TABLE_SCHEM");
+ String tableName = (String) columnRs.get("TABLE_NAME");
+ String columnName = (String) columnRs.get("COLUMN_NAME");
+ //String dataType = (String) tableRs.get("DATA_TYPE");
+ log.debug("Adding column " + tableName + "." + columnName);
+ tcc.addColumnName(catalogName, schemaName, quote(tableName), columnName);
+ }
+ } finally {
+ try {
+ if (null != columnIterator) {
+ metadataDialect.close(columnIterator);
+ }
+ } catch (Exception ignore) {
+ }
+ }
+ }
+
+ public void readDatabaseColumns(TablesColumnsCollector tcc, String catalog, String schema) {
+ try {
+ ReverseEngineeringRuntimeInfo info = ReverseEngineeringRuntimeInfo.createInstance(provider, sec,
+ null);
+ metadataDialect.configure(info);
+ tcc.init();
+ initCurrentCatalog(info);
+ collectColumns(tcc, catalog, schema);
+ tcc.adjust();
+ } finally {
+ metadataDialect.close();
+ }
+ }
+
+ public void readDatabaseTablesColumns(TablesColumnsCollector tcc, String catalog, String schema) {
+ try {
+ ReverseEngineeringRuntimeInfo info = ReverseEngineeringRuntimeInfo.createInstance(provider, sec,
+ null);
+ metadataDialect.configure(info);
+ tcc.init();
+ initCurrentCatalog(info);
+ collectTables(tcc, catalog, schema);
+ collectColumns(tcc, catalog, schema);
+ tcc.adjust();
+ } finally {
+ metadataDialect.close();
+ }
+ }
+
+ /**
+ * init current catalog name
+ **/
+ private void initCurrentCatalog(ReverseEngineeringRuntimeInfo info) {
+ currentCatalog = null;
+ try {
+ currentCatalog = info.getConnectionProvider().getConnection().getCatalog();
+ } catch (SQLException ignore) {
+ }
+ }
+}
Property changes on: trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/internal/reveng/JDBCTablesColumnsReader.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Author Id Revision Date
Name: svn:eol-style
+ native
Added: trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/internal/reveng/TablesColumnsCollector.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/internal/reveng/TablesColumnsCollector.java (rev 0)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/internal/reveng/TablesColumnsCollector.java 2008-10-16 14:02:28 UTC (rev 10885)
@@ -0,0 +1,586 @@
+/*******************************************************************************
+ * Copyright (c) 2008 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.seam.ui.internal.reveng;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.List;
+
+/**
+ * @author Vitali
+ *
+ * This is specific efficient storage for names of catalogs, schemas, tables, columns and
+ * it's relations.
+ */
+public class TablesColumnsCollector {
+
+ // filter for lower part of long
+ public static final long LOWER_MASK = 0x00000000FFFFFFFFL;
+ // filter for upper part of long
+ public static final long UPPER_MASK = 0xFFFFFFFF00000000L;
+
+ // if true - collect full exact hierarchical structure - full structure info with redundancy
+ // ---------- (useful to get the tree structure easily)
+ // ---------- all relations one-to-many
+ // if false - result structure has no duplicate strings - structure without redundancy
+ // ---------- (useful for context help)
+ // ---------- all relations many-to-many
+ protected boolean fullStructure = false;
+ // sorted in alphabetic order list of catalogs
+ protected List catalogs;
+ // sorted in alphabetic order list of schemas
+ protected List schemas;
+ // sorted in alphabetic order list of tables
+ protected List tables;
+ // sorted in alphabetic order list of columns
+ protected List columns;
+
+ /**
+ * Index relation array-maps.
+ * Maps which are used to save relations between items in both directions.
+ * Here is a short description:
+ * left <-> right;
+ * left - could be catalogs, schemas, tables;
+ * right - could be schemas, tables, columns;
+ * xMap[i] & UPPER_MASK -> this is index in left array;
+ * xMap[i] & LOWER_MASK -> this is index in right array
+ **/
+ // catalogs <-> schemas index map
+ protected long[] csMap;
+ // schemas <-> tables index map
+ protected long[] stMap;
+ // tables <-> columns index map
+ protected long[] tcMap;
+
+ // temporary structures
+ protected List tempCATList;
+ protected List tempCSTList;
+ protected List tempTblList;
+ protected List tempClnList;
+ // simple protection of duplicates
+ protected String strCAT;
+ protected String strCST;
+ protected String strTbl;
+ protected String strCln;
+
+ public TablesColumnsCollector() {
+ }
+
+ /**
+ * @param fullStructure
+ * if true - collect full exact hierarchical structure - (useful to get the tree structure easily)
+ * if false - result structure has no duplicate strings - (useful for context help)
+ */
+ public TablesColumnsCollector(boolean fullStructure) {
+ this.fullStructure = fullStructure;
+ }
+
+ /**
+ * initialize collection
+ */
+ public void init() {
+ catalogs = null;
+ schemas = null;
+ tables = null;
+ columns = null;
+ csMap = null;
+ stMap = null;
+ tcMap = null;
+ tempCATList = new ArrayList();
+ tempCSTList = new ArrayList();
+ tempTblList = new ArrayList();
+ tempClnList = new ArrayList();
+ strCAT = "%%%%";
+ strCST = "%%%%";
+ strTbl = "%%%%";
+ strCln = "%%%%";
+ }
+
+ public String updateNullValue(String str) {
+ if (null == str) {
+ return "";
+ }
+ return str;
+ }
+
+ public void addCatalogName(String catalogName) {
+ catalogName = updateNullValue(catalogName);
+ String strCurr = "" + catalogName;
+ if (!strCAT.equalsIgnoreCase(strCurr)) {
+ tempCATList.add(strCurr);
+ strCAT = strCurr;
+ }
+ }
+
+ public void addSchemaName(String catalogName, String schemaName) {
+ catalogName = updateNullValue(catalogName);
+ schemaName = updateNullValue(schemaName);
+ addCatalogName(catalogName);
+ String strCurr = schemaName + "%" + catalogName;
+ if (!strCST.equalsIgnoreCase(strCurr)) {
+ tempCSTList.add(strCurr);
+ strCST = strCurr;
+ }
+ }
+
+ public void addTableName(String catalogName, String schemaName, String tableName) {
+ catalogName = updateNullValue(catalogName);
+ schemaName = updateNullValue(schemaName);
+ tableName = updateNullValue(tableName);
+ addSchemaName(catalogName, schemaName);
+ String strCurr = fullStructure ?
+ tableName + "%" + schemaName + "%" + catalogName :
+ tableName + "%" + schemaName;
+ if (!strTbl.equalsIgnoreCase(strCurr)) {
+ tempTblList.add(strCurr);
+ strTbl = strCurr;
+ }
+ }
+
+ public void addColumnName(String catalogName, String schemaName, String tableName, String columnName) {
+ catalogName = updateNullValue(catalogName);
+ schemaName = updateNullValue(schemaName);
+ tableName = updateNullValue(tableName);
+ columnName = updateNullValue(columnName);
+ addTableName(catalogName, schemaName, tableName);
+ String strCurr = fullStructure ?
+ columnName + "%" + tableName + "%" + schemaName + "%" + catalogName :
+ columnName + "%" + tableName;
+ if (!strCln.equalsIgnoreCase(strCurr)) {
+ tempClnList.add(strCurr);
+ strCln = strCurr;
+ }
+ }
+
+ protected void copyWithoutDuplicates(List arrTmp, List formList) {
+ String strPrev = null, strCurr = null;
+ for (int i = 0; i < arrTmp.size(); i++) {
+ strCurr = (String)arrTmp.get(i);
+ if (strPrev == strCurr) {
+ continue;
+ }
+ if (null != strPrev && strPrev.equalsIgnoreCase(strCurr)) {
+ continue;
+ }
+ strPrev = strCurr;
+ formList.add(strCurr);
+ }
+ }
+
+ protected void copyIncludeDuplicates(List arrTmp, List formList) {
+ for (int i = 0; i < arrTmp.size(); i++) {
+ String strCurr = (String)arrTmp.get(i);
+ formList.add(strCurr);
+ }
+ }
+
+ /**
+ * @param tempList - relation description list (with duplicates)
+ * @param formList
+ * @return
+ * size of tempList without duplicates
+ * in case of fullStructure: tempList.size() == formList.size() & tempList <-> formList by elements
+ */
+ protected int adjustList(List tempList, List formList) {
+ ArrayList arrTmp = new ArrayList();
+ Collections.sort(tempList, String.CASE_INSENSITIVE_ORDER);
+ String strPrev = null, strCurr = null;
+ int i, j;
+ // remove duplicates
+ for (i = 0, j = 0; i < tempList.size(); i++) {
+ strCurr = (String)tempList.get(i);
+ if (strPrev == strCurr) {
+ continue;
+ }
+ if (null != strPrev && strPrev.equalsIgnoreCase(strCurr)) {
+ continue;
+ }
+ strPrev = strCurr;
+ String[] atc = strCurr.split("%", 2);
+ tempList.set(j++, strCurr);
+ arrTmp.add(fullStructure ? strCurr : atc[0]);
+ }
+ if (fullStructure) {
+ copyIncludeDuplicates(arrTmp, formList);
+ }
+ else {
+ Collections.sort(arrTmp, String.CASE_INSENSITIVE_ORDER);
+ copyWithoutDuplicates(arrTmp, formList);
+ }
+ arrTmp = null;
+ return j;
+ }
+
+ protected void adjustMap(long[] xMap, List tempList, List formList0, List formList1) {
+ // in case of fullStructure:
+ // tempList.size() == formList0.size() &
+ // tempList <-> formList0 by elements
+ int i, j = xMap.length;
+ for (i = 0; i < j; i++) {
+ String strCurr = (String)tempList.get(i);
+ String[] atc = strCurr.split("%", 2);
+ String tmp = atc[1];
+ int keyT = Collections.binarySearch(formList1, tmp, String.CASE_INSENSITIVE_ORDER);
+ if (keyT < 0 || keyT >= formList1.size() || !tmp.equalsIgnoreCase((String)formList1.get(keyT))) {
+ keyT = Integer.MAX_VALUE;
+ }
+ tmp = atc[0];
+ int keyC = fullStructure ?
+ i : Collections.binarySearch(formList0, tmp, String.CASE_INSENSITIVE_ORDER);
+ tmp = fullStructure ? strCurr : tmp;
+ if (keyC < 0 || keyC >= formList0.size() || !tmp.equalsIgnoreCase((String)formList0.get(keyC))) {
+ keyC = Integer.MAX_VALUE;
+ }
+ xMap[i] = ( ((long)keyT) << 32 ) | ((long)keyC);
+ }
+ Arrays.sort(xMap);
+ }
+
+ /**
+ * adjust collected results
+ */
+ public void adjust() {
+ strCAT = null;
+ strCST = null;
+ strTbl = null;
+ strCln = null;
+ int size;
+ catalogs = new ArrayList();
+ if (null != tempCATList) {
+ Collections.sort(tempCATList, String.CASE_INSENSITIVE_ORDER);
+ copyWithoutDuplicates(tempCATList, catalogs);
+ tempCATList = null;
+ }
+ schemas = new ArrayList();
+ csMap = new long[0];
+ if (null != tempCSTList) {
+ size = adjustList(tempCSTList, schemas);
+ csMap = new long[size];
+ adjustMap(csMap, tempCSTList, schemas, catalogs);
+ tempCSTList = null;
+ }
+ tables = new ArrayList();
+ stMap = new long[0];
+ if (null != tempTblList) {
+ size = adjustList(tempTblList, tables);
+ stMap = new long[size];
+ adjustMap(stMap, tempTblList, tables, schemas);
+ tempTblList = null;
+ }
+ columns = new ArrayList();
+ tcMap = new long[0];
+ if (null != tempClnList) {
+ size = adjustList(tempClnList, columns);
+ tcMap = new long[size];
+ adjustMap(tcMap, tempClnList, columns, tables);
+ tempClnList = null;
+ }
+ }
+
+ public static final class Bounds {
+ public int nL = 0;
+ public int nH = 0;
+ }
+
+ /**
+ * binaryBoundsSearch is a method to find lower and upper bounds
+ * in sorted array of strings for some string prefix.
+ * @param list - search array of strings (should be sorted in ascending case insensitive order);
+ * @param prefix - matching prefix;
+ * @param bounds - result interval in the list - all items in interval start from prefix.
+ * bounds.nL <= interval < bounds.nH
+ */
+ public static final Bounds binaryBoundsSearch(List list, String prefix) {
+ Bounds bounds = new Bounds();
+ if (0 == list.size()) {
+ bounds.nL = bounds.nH = 0;
+ return bounds;
+ }
+ prefix = prefix.toUpperCase();
+ int low = 0;
+ int high = list.size() - 1;
+ int mid = (low + high) >> 1;
+ // looking for mid - some element in the interval,
+ // which is matched for criteria (has the prefix)
+ while (low <= high) {
+ mid = (low + high) >> 1;
+ String midVal = ((String)list.get(mid)).toUpperCase();
+ int cmp = midVal.compareToIgnoreCase(prefix);
+ cmp = midVal.startsWith(prefix) ? 0 : cmp;
+ if (cmp < 0) {
+ low = mid + 1;
+ }
+ else if (cmp > 0) {
+ high = mid - 1;
+ }
+ else {
+ break;
+ }
+ }
+ int low2 = mid;
+ int high2 = mid;
+ // looking for low bound - indicates minimal index of element in the interval,
+ // which is matched for criteria (has the prefix)
+ while (low <= high2) {
+ mid = (low + high2) >> 1;
+ String midVal = ((String)list.get(mid)).toUpperCase();
+ int cmp = midVal.compareToIgnoreCase(prefix);
+ cmp = midVal.startsWith(prefix) ? 0 : cmp;
+ if (cmp < 0) {
+ low = mid + 1;
+ }
+ else if (cmp >= 0) {
+ high2 = mid - 1;
+ }
+ }
+ // looking for high bound - indicates maximal index of element in the interval,
+ // which is matched for criteria (has the prefix)
+ while (low2 <= high) {
+ mid = (low2 + high) >> 1;
+ String midVal = ((String)list.get(mid)).toUpperCase();
+ int cmp = midVal.compareToIgnoreCase(prefix);
+ cmp = midVal.startsWith(prefix) ? 0 : cmp;
+ if (cmp <= 0) {
+ low2 = mid + 1;
+ }
+ else if (cmp > 0) {
+ high = mid - 1;
+ }
+ }
+ // adjust low bound
+ if (low < list.size()) {
+ while (0 <= low && ((String)list.get(low)).toUpperCase().startsWith(prefix)) {
+ low--;
+ }
+ low++;
+ }
+ if (high < low) {
+ high = low;
+ }
+ // adjust high bound
+ while (high < list.size() && ((String)list.get(high)).toUpperCase().startsWith(prefix)) {
+ high++;
+ }
+ bounds.nL = low;
+ bounds.nH = high;
+ return bounds;
+ }
+
+
+ /**
+ * Clear string from redundant information.
+ * @param res
+ */
+ protected String correctName(String input) {
+ if (!fullStructure) {
+ return input;
+ }
+ String[] atc = input.split("%", 2);
+ return atc[0];
+ }
+
+ /**
+ * Clear list of string from redundant information.
+ * @param res
+ */
+ protected void correctNames(List res) {
+ if (!fullStructure) {
+ return;
+ }
+ for (int i = 0; i < res.size(); i++) {
+ String strCurr = (String)res.get(i);
+ String[] atc = strCurr.split("%", 2);
+ res.set(i, atc[0]);
+ }
+ }
+
+ protected List getXNames(List xArray, String prefix) {
+ List res = new ArrayList();
+ if (null == xArray) {
+ return res;
+ }
+ if (null != prefix) {
+ prefix = prefix.toUpperCase();
+ }
+ if (null == prefix) {
+ res.addAll(xArray);
+ }
+ else {
+ Bounds bounds = binaryBoundsSearch(xArray, prefix);
+ for (; bounds.nL < bounds.nH; bounds.nL++) {
+ res.add(xArray.get(bounds.nL));
+ }
+ }
+ return res;
+ }
+
+ public List getMatchingCatalogNames(String prefix) {
+ List res = getXNames(catalogs, prefix);
+ correctNames(res);
+ return res;
+ }
+
+ public List getMatchingSchemaNames(String prefix) {
+ List res = getXNames(schemas, prefix);
+ correctNames(res);
+ return res;
+ }
+
+ public List getMatchingTableNames(String prefix) {
+ List res = getXNames(tables, prefix);
+ correctNames(res);
+ return res;
+ }
+
+ public List getMatchingColumnNames(String prefix) {
+ List res = getXNames(columns, prefix);
+ correctNames(res);
+ return res;
+ }
+
+ /**
+ * return list of matching strings.
+ * Here is a short description what is happen here.
+ * the same schema with left <-> right which was above:
+ * xArray1 - right;
+ * xArray2 - left;
+ * xxMap - <-> index relation array-map;
+ * name - exactly string in xArray2;
+ * prefix - prefix string in xArray1.
+ * Matching criteria:
+ * list of strings from xArray1 which start from prefix and which is in relation with
+ * item from xArray2 which is exactly match the name.
+ **/
+ protected List getXNames(List xArray1, long[] xxMap, List xArray2, String name, String prefix) {
+ List res = new ArrayList();
+ if (null == xArray1) {
+ return res;
+ }
+ if (null != name) {
+ name = name.toUpperCase();
+ }
+ if (null != prefix) {
+ prefix = prefix.toUpperCase();
+ }
+ if (null == name && null == prefix) {
+ res.addAll(xArray1);
+ }
+ else if (null == name) {
+ Bounds bounds = binaryBoundsSearch(xArray1, prefix);
+ for (; bounds.nL < bounds.nH; bounds.nL++) {
+ res.add(xArray1.get(bounds.nL));
+ }
+ }
+ else {
+ if (null == xArray2 || null == xxMap) {
+ return res;
+ }
+ Bounds bounds = binaryBoundsSearch(xArray2, name);
+ for (; bounds.nL < bounds.nH; bounds.nL++) {
+ int keyT = bounds.nL;
+ String itemT = (String)xArray2.get(keyT);
+ if (fullStructure) {
+ if (!itemT.toUpperCase().startsWith(name)) {
+ continue;
+ }
+ name = correctName(name);
+ itemT = correctName(itemT);
+ }
+ if (!name.equalsIgnoreCase(itemT)) {
+ continue;
+ }
+ long keyTlong = ((long)keyT) << 32;
+ int i = Arrays.binarySearch(xxMap, keyTlong);
+ if (i < 0) {
+ i = - i - 1;
+ }
+ if (null == prefix) {
+ for ( ; i < xxMap.length; i++) {
+ if (keyTlong != (xxMap[i] & UPPER_MASK)) {
+ break;
+ }
+ int keyC = (int)(xxMap[i] & LOWER_MASK);
+ if (0 <= keyC && keyC < xArray1.size()) {
+ res.add(xArray1.get(keyC));
+ }
+ }
+ }
+ else {
+ for ( ; i < xxMap.length; i++) {
+ if (keyTlong != (xxMap[i] & UPPER_MASK)) {
+ break;
+ }
+ int keyC = (int)(xxMap[i] & LOWER_MASK);
+ if (0 <= keyC && keyC < xArray1.size() && ((String)xArray1.get(keyC)).toUpperCase().startsWith(prefix)) {
+ res.add(xArray1.get(keyC));
+ }
+ }
+ }
+ }
+ }
+ return res;
+ }
+
+ public List getCatalogNames() {
+ List res = new ArrayList();
+ if (null != catalogs) {
+ res.addAll(catalogs);
+ }
+ return res;
+ }
+
+ public List getMatchingSchemaNames(String catalogName, String prefix) {
+ List res = getXNames(schemas, csMap, catalogs, catalogName, prefix);
+ correctNames(res);
+ return res;
+ }
+
+ public List getMatchingTablesNames(String schemaName, String prefix) {
+ List res = getXNames(tables, stMap, schemas, schemaName, prefix);
+ correctNames(res);
+ return res;
+ }
+
+ public List getMatchingColumnNames(String tableName, String prefix) {
+ List res = getXNames(columns, tcMap, tables, tableName, prefix);
+ correctNames(res);
+ return res;
+ }
+
+ public List getMatchingTablesNames(String catalogName, String schemaName, String prefix) {
+ catalogName = updateNullValue(catalogName);
+ schemaName = updateNullValue(schemaName);
+ schemaName = "" + schemaName + "%" + catalogName;
+ List res = getXNames(tables, stMap, schemas, schemaName, prefix);
+ correctNames(res);
+ return res;
+ }
+
+ public List getMatchingColumnNames(String schemaName, String tableName, String prefix) {
+ schemaName = updateNullValue(schemaName);
+ tableName = updateNullValue(tableName);
+ tableName = "" + tableName + "%" + schemaName;
+ List res = getXNames(columns, tcMap, tables, tableName, prefix);
+ correctNames(res);
+ return res;
+ }
+
+ public List getMatchingColumnNames(String catalogName, String schemaName, String tableName, String prefix) {
+ catalogName = updateNullValue(catalogName);
+ schemaName = updateNullValue(schemaName);
+ tableName = updateNullValue(tableName);
+ tableName = "" + tableName + "%" + schemaName + "%" + catalogName;
+ List res = getXNames(columns, tcMap, tables, tableName, prefix);
+ correctNames(res);
+ return res;
+ }
+}
Property changes on: trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/internal/reveng/TablesColumnsCollector.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Author Id Revision Date
Name: svn:eol-style
+ native
Added: trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/views/DBTableFilterView.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/views/DBTableFilterView.java (rev 0)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/views/DBTableFilterView.java 2008-10-16 14:02:28 UTC (rev 10885)
@@ -0,0 +1,112 @@
+/*******************************************************************************
+ * Copyright (c) 2007-2008 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributor:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.seam.ui.views;
+
+import java.util.Iterator;
+
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.StructuredSelection;
+import org.eclipse.jface.viewers.TreeViewer;
+import org.eclipse.swt.widgets.Composite;
+import org.hibernate.console.ConsoleConfiguration;
+import org.hibernate.console.KnownConfigurations;
+import org.hibernate.eclipse.console.model.ITableFilter;
+import org.hibernate.eclipse.console.wizards.TableFilterView;
+import org.hibernate.mapping.Table;
+import org.hibernate.util.StringHelper;
+import org.jboss.tools.seam.ui.views.DBTablesViewer.Catalog;
+import org.jboss.tools.seam.ui.views.DBTablesViewer.Schema;
+
+/**
+ * @author Dmitry Geraskov
+ *
+ */
+public abstract class DBTableFilterView extends TableFilterView {
+
+ private DBTablesViewer viewer;
+
+ public DBTableFilterView(Composite parent, int style) {
+ super( parent, style );
+ }
+
+ @Override
+ protected TreeViewer createTreeViewer() {
+ if (viewer == null){
+ viewer = new DBTablesViewer( tree );
+ }
+ return viewer;
+ }
+
+ @Override
+ protected void doRefreshTree() {
+ ConsoleConfiguration configuration = KnownConfigurations.getInstance()
+ .find( getConsoleConfigurationName() );
+
+ if(configuration!=null) {
+ viewer.setInput( configuration );
+ }
+ }
+
+ @Override
+ protected void toggle(boolean exclude) {
+ ISelection selection = viewer.getSelection();
+
+ if ( !selection.isEmpty() ) {
+ StructuredSelection ss = (StructuredSelection) selection;
+ Iterator iterator = ss.iterator();
+ while ( iterator.hasNext() ) {
+ Object sel = iterator.next();
+ ITableFilter filter = null;
+
+ if ( sel instanceof Table ) {
+ Table table = (Table) sel;
+ filter = revEngDef.createTableFilter();
+ if ( StringHelper.isNotEmpty( table.getName() ) ) {
+ filter.setMatchName( table.getName() );
+ }
+ if ( StringHelper.isNotEmpty( table.getCatalog() ) ) {
+ filter.setMatchCatalog( table.getCatalog() );
+ }
+ if ( StringHelper.isNotEmpty( table.getSchema() ) ) {
+ filter.setMatchSchema( table.getSchema() );
+ }
+ filter.setExclude( Boolean.valueOf( exclude ) );
+ } else if ( sel instanceof Schema ) { // assume its a schema!
+ Schema tc = (Schema) sel;
+ filter = revEngDef.createTableFilter();
+ String schema = tc.getName();
+ String catalog = tc.getParent().getName();
+ if(StringHelper.isNotEmpty(schema)) {
+ filter.setMatchSchema(schema);
+ }
+ if(StringHelper.isNotEmpty(catalog)) {
+ filter.setMatchCatalog(catalog);
+ }
+ filter.setExclude( Boolean.valueOf( exclude ) );
+ } else if ( sel instanceof Catalog ) { // assume its a catalog!
+ Catalog tc = (Catalog) sel;
+ filter = revEngDef.createTableFilter();
+ if(StringHelper.isNotEmpty(tc.getName())) {
+ filter.setMatchCatalog(tc.getName());
+ }
+ filter.setExclude( Boolean.valueOf( exclude ) );
+ }
+ if ( filter != null )
+ revEngDef.addTableFilter( filter );
+ }
+ } else {
+ ITableFilter filter = revEngDef.createTableFilter();
+ filter.setExclude( Boolean.valueOf( exclude ) );
+ revEngDef.addTableFilter( filter );
+ }
+ }
+
+}
Property changes on: trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/views/DBTableFilterView.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Author Id Revision Date
Name: svn:eol-style
+ native
Added: trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/views/DBTablesViewer.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/views/DBTablesViewer.java (rev 0)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/views/DBTablesViewer.java 2008-10-16 14:02:28 UTC (rev 10885)
@@ -0,0 +1,302 @@
+/*******************************************************************************
+ * Copyright (c) 2007-2008 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributor:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.seam.ui.views;
+
+import java.util.List;
+
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.jface.viewers.ITreeContentProvider;
+import org.eclipse.jface.viewers.LabelProvider;
+import org.eclipse.jface.viewers.TreeViewer;
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Tree;
+import org.eclipse.ui.progress.WorkbenchJob;
+import org.hibernate.HibernateException;
+import org.hibernate.JDBCException;
+import org.hibernate.cfg.Configuration;
+import org.hibernate.cfg.JDBCReaderFactory;
+import org.hibernate.cfg.Settings;
+import org.hibernate.cfg.reveng.dialect.MetaDataDialect;
+import org.hibernate.console.ConsoleConfiguration;
+import org.hibernate.console.ImageConstants;
+import org.hibernate.console.execution.ExecutionContext;
+import org.hibernate.eclipse.console.utils.EclipseImages;
+import org.hibernate.mapping.Table;
+import org.jboss.tools.seam.ui.internal.reveng.JDBCTablesColumnsReader;
+import org.jboss.tools.seam.ui.internal.reveng.TablesColumnsCollector;
+
+/**
+ * Database tree viewer with three-level structure (till Tables)
+ * @author Dmitry Geraskov
+ */
+public class DBTablesViewer extends TreeViewer {
+
+ private String connectionErrorMessage = "Couldn't connect to Database"; //$NON-NLS-1$
+
+ private Image catalog = EclipseImages.getImageDescriptor(ImageConstants.DATABASE).createImage();
+ private Image schema = EclipseImages.getImageDescriptor(ImageConstants.SCHEMA).createImage();
+ private Image table = EclipseImages.getImageDescriptor(ImageConstants.TABLE).createImage();
+
+ public class Element{
+ private String name;
+ protected String defaultLabel;
+
+ Element(String name){
+ this.name = name;
+ }
+
+ public String getName(){
+ return name;
+ }
+
+ public String getLabel(){
+ return name == null ? defaultLabel : name;
+ }
+ }
+
+ public class Catalog extends Element{
+
+ public static final String DEF_CATALOG_NAME = "<Default catalog>"; //$NON-NLS-1$
+
+ Catalog(String name){
+ super(name);
+ defaultLabel = DEF_CATALOG_NAME;
+ }
+ }
+
+ public class Schema extends Element{
+
+ public static final String DEF_SCHEMA_NAME = "<Default schema>"; //$NON-NLS-1$
+
+ private Catalog parent;
+
+ Schema(String name, Catalog parent){
+ super(name);
+ this.parent = parent;
+ defaultLabel = DEF_SCHEMA_NAME;
+ }
+
+ public Catalog getParent(){
+ return parent;
+ }
+ }
+
+ public DBTablesViewer(Tree tree){
+ super(tree);
+ setContentProvider(createContentProvider());
+ setLabelProvider(createLabelProvider());
+ }
+
+ public DBTablesViewer(Composite parent) {
+ super(parent);
+
+ }
+
+ /**
+ * @return ITreeContentProvider
+ */
+ protected ITreeContentProvider createContentProvider() {
+ return new ITreeContentProvider(){
+
+ private Configuration cfg = null;
+
+ private Settings buildSettings = null;
+
+ private String placeHolder = "Pending..."; //$NON-NLS-1$
+
+ private String conErrorItem = '<' + connectionErrorMessage + '>';
+
+ private final Object[] NO_CHILDREN = new Object[0];
+
+ private static final int BEGIN_STATE = 0;
+
+ private static final int CHILDREN_FETCHED = 1;
+
+ private static final int CONNECTION_ERROR = 2;
+
+ private static final int LOADING_IN_PROGRESS = 3;
+
+ private int connectionState = BEGIN_STATE;
+
+ private TablesColumnsCollector tablesCollector;
+
+ private Object[] getCatalogs(){
+ if (connectionState == LOADING_IN_PROGRESS){
+ return new String[]{placeHolder};
+ }
+ if (connectionState == CONNECTION_ERROR){
+ return new String[]{connectionErrorMessage};
+ }
+ List catalogNames = tablesCollector.getCatalogNames();
+ Element[] catalogs = new Element[catalogNames.size()];
+ for (int i = 0; i < catalogs.length; i++) {
+ String catalogName = (String) catalogNames.get(i);
+ if (catalogName == null || "".equals(catalogName)) catalogName = null; //$NON-NLS-1$
+ catalogs[i] = new Catalog(catalogName);
+
+ }
+ return catalogs;
+ }
+
+ private Object[] getSchemas(Catalog catalog){
+ List schemaNames = tablesCollector.getMatchingSchemaNames(catalog.getName(), buildSettings.getDefaultSchemaName());
+ Element[] schemas = new Element[schemaNames.size()];
+ for (int i = 0; i < schemaNames.size(); i++) {
+ String schemaName = (String) schemaNames.get(i);
+ if (schemaName == null || "".equals(schemaName)) schemaName = null; //$NON-NLS-1$
+ schemas[i] = new Schema( schemaName, catalog);
+ }
+ return schemas;
+ }
+
+ private Object[] getTables(Schema schema){
+ List tableNames = tablesCollector.getMatchingTablesNames(schema.getParent().getName(), schema.getName(), ""); //$NON-NLS-1$
+ Table[] tables = new Table[tableNames.size()];
+ for (int i = 0; i < tables.length; i++) {
+ tables[i] = new Table((String) tableNames.get(i));
+ tables[i].setCatalog(schema.getParent().getName());
+ tables[i].setSchema(schema.getName());
+ }
+ return tables;
+ }
+
+ public Object[] getChildren(Object parent) {
+ if (parent instanceof Catalog) {
+ return getSchemas((Catalog)parent);
+ }
+ if (parent instanceof Schema) {
+ Schema schema = (Schema)parent;
+ return getTables(schema);
+ }
+ return NO_CHILDREN;
+ }
+
+ public Object getParent(Object element) {
+ if (element instanceof Schema){
+ return ((Schema)element).getParent();
+ }
+ return null;
+ }
+
+ public boolean hasChildren(Object parent) {
+ return parent instanceof Element;
+ }
+
+ public Object[] getElements(Object inputElement) {
+ if (buildSettings == null) return new String[]{conErrorItem};
+
+ if (connectionState == BEGIN_STATE){
+ tablesCollector = new TablesColumnsCollector(true);
+ if (connectionState == BEGIN_STATE)
+ connectionState = LOADING_IN_PROGRESS;
+ WorkbenchJob job = new WorkbenchJob("Fetching database structure") { //$NON-NLS-1$
+ @Override
+ public IStatus runInUIThread(IProgressMonitor monitor) {
+ try{
+ MetaDataDialect realMetaData = JDBCReaderFactory.newMetaDataDialect(buildSettings
+ .getDialect(), cfg.getProperties());
+
+ JDBCTablesColumnsReader reader = new JDBCTablesColumnsReader(realMetaData,
+ buildSettings.getConnectionProvider(), buildSettings.getSQLExceptionConverter());
+ reader.readDatabaseTables(tablesCollector, buildSettings.getDefaultCatalogName(), buildSettings.getDefaultSchemaName());
+
+ connectionState = CHILDREN_FETCHED;
+ } catch (JDBCException e){
+ connectionState = CONNECTION_ERROR;
+ }
+ DBTablesViewer.this.remove(placeHolder);
+ DBTablesViewer.this.refresh();
+ return Status.OK_STATUS;
+ }};
+ job.schedule();
+ }
+ return getCatalogs();
+ }
+
+ public void dispose() {}
+
+ /**
+ * Supported input types are:
+ * org.hibernate.console.ConsoleConfiguration,
+ * org.hibernate.cfg.Settings.
+ */
+ public void inputChanged(Viewer viewer, Object oldInput,
+ Object newInput) {
+ if (newInput == oldInput
+ && connectionState != CONNECTION_ERROR) return;
+
+ if (newInput instanceof ConsoleConfiguration) {
+ ConsoleConfiguration cc = (ConsoleConfiguration) newInput;
+ try{
+ cc.build();
+ cfg = cc.getConfiguration();
+ cc.getExecutionContext().execute(new ExecutionContext.Command() {
+ public Object execute() {
+ Settings newSettings = cfg.buildSettings();
+ if (!newSettings.equals(buildSettings)){
+ buildSettings = newSettings;
+ connectionState = BEGIN_STATE;
+ }
+ return null;
+ }});
+ } catch (HibernateException e){
+ connectionState = CONNECTION_ERROR;
+ }
+ }
+ }
+ };
+ }
+
+ protected LabelProvider createLabelProvider(){
+ return new LabelProvider(){
+
+ @Override
+ public void dispose() {
+ catalog.dispose();
+ schema.dispose();
+ table.dispose();
+ }
+
+ @Override
+ public Image getImage(Object element) {
+ if (element instanceof Catalog){
+ return catalog;
+ }
+ if (element instanceof Schema){
+ return schema;
+ }
+ if (element instanceof Table){
+ return table;
+ }
+ return null;
+ }
+
+ @Override
+ public String getText(Object element) {
+ if (element instanceof Element){
+ return ((Element)element).getLabel();
+ }
+ if (element instanceof Table){
+ return ((Table)element).getName();
+ }
+ return super.getText(element);
+ }
+ };
+ }
+
+ public void setConnectionErrorMessage(String connectionErrorMessage) {
+ this.connectionErrorMessage = connectionErrorMessage;
+ }
+}
Property changes on: trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/views/DBTablesViewer.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Author Id Revision Date
Name: svn:eol-style
+ native
Modified: trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamGenerateEnitiesWizard.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamGenerateEnitiesWizard.java 2008-10-16 13:32:18 UTC (rev 10884)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamGenerateEnitiesWizard.java 2008-10-16 14:02:28 UTC (rev 10885)
@@ -30,6 +30,7 @@
import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
import org.eclipse.debug.core.ILaunchManager;
import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.jface.wizard.IWizardPage;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.ui.INewWizard;
import org.eclipse.ui.PlatformUI;
@@ -51,6 +52,9 @@
*/
public class SeamGenerateEnitiesWizard extends SeamBaseWizard implements INewWizard {
+ IWizardPage page1 = new SeamGenerateEnitiesWizardPage();
+ IWizardPage page2 = new SeamGenerateEntitiesTablesWizardPage();
+
public void createPageControls(Composite pageContainer) {
super.createPageControls(pageContainer);
PlatformUI.getWorkbench().getHelpSystem().setHelp(pageContainer, ISeamHelpContextIds.GENERATE_SEAM_ENTITIES);
@@ -59,10 +63,16 @@
public SeamGenerateEnitiesWizard() {
super(GENERATE_SEAM_ENTITIES);
setWindowTitle(SeamUIMessages.GENERATE_SEAM_ENTITIES_WIZARD_TITLE);
- setDefaultPageImageDescriptor(ImageDescriptor.createFromFile(SeamGenerateEnitiesWizard.class, "SeamWebProjectWizBan.png"));
- addPage(new SeamGenerateEnitiesWizardPage());
+ setDefaultPageImageDescriptor(ImageDescriptor.createFromFile(SeamGenerateEnitiesWizard.class, "SeamWebProjectWizBan.png"));
+ addPage(page1);
+ addPage(page2);
}
-
+
+ @Override
+ public boolean canFinish() {
+ return page1.isPageComplete();
+ }
+
public static final IUndoableOperation GENERATE_SEAM_ENTITIES = new SeamBaseOperation(SeamUIMessages.SEAM_GENERATE_ENTITIES_WIZARD_ACTION_CREATING_OPERATION) {
/*
@@ -302,7 +312,14 @@
hbmtemplateAttributes.put("for_each", "entity"); //$NON-NLS-1$ //$NON-NLS-2$
hbmtemplateAttributes.put("hibernatetool.util.toolclass","org.hibernate.eclipse.launch.SeamUtil"); //$NON-NLS-1$ //$NON-NLS-2$
wc.setAttribute(HibernateLaunchConstants.ATTR_EXPORTERS + ".hbmtemplate9.properties", hbmtemplateAttributes); //$NON-NLS-1$
+
+ //save before adding additional attribute
wc.doSave();
+
+ if (params.containsKey(HibernateLaunchConstants.ATTR_REVENG_TABLES)){
+ wc.setAttribute(HibernateLaunchConstants.ATTR_REVENG_TABLES, params.get(HibernateLaunchConstants.ATTR_REVENG_TABLES));
+ }
+
launchManager.addLaunch(wc.launch(ILaunchManager.RUN_MODE, monitor));
WebUtils.changeTimeStamp(project);
Modified: trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamGenerateEnitiesWizardPage.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamGenerateEnitiesWizardPage.java 2008-10-16 13:32:18 UTC (rev 10884)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamGenerateEnitiesWizardPage.java 2008-10-16 14:02:28 UTC (rev 10885)
@@ -14,6 +14,7 @@
import java.beans.PropertyChangeListener;
import java.util.ArrayList;
import java.util.HashMap;
+import java.util.List;
import java.util.Map;
import org.eclipse.core.resources.IProject;
@@ -21,6 +22,7 @@
import org.eclipse.core.runtime.IAdaptable;
import org.eclipse.core.runtime.preferences.IEclipsePreferences;
import org.eclipse.jdt.core.IJavaProject;
+import org.eclipse.jface.wizard.IWizardPage;
import org.eclipse.jface.wizard.WizardPage;
import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.GridData;
@@ -60,7 +62,6 @@
* @see org.eclipse.jface.dialogs.IDialogPage#createControl(org.eclipse.swt.widgets.Composite)
*/
public void createControl(Composite parent) {
- setPageComplete(true);
rootSeamProject = SeamWizardUtils.getCurrentSelectedRootSeamProject();
String projectName = rootSeamProject==null?"":rootSeamProject.getName();
projectEditor = SeamWizardFactory.createSeamProjectSelectionFieldEditor(projectName);
@@ -231,8 +232,23 @@
values.put(configEditor.getName(), configEditor.getValueAsString());
String mode = radios.getValue().toString();
values.put(HibernateLaunchConstants.ATTR_REVERSE_ENGINEER, ("reverse".equals(mode) ? "true" : "false")); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ IWizardPage page2 = getWizard().getPage(SeamGenerateEntitiesTablesWizardPage.pageName);
+ if (page2 instanceof SeamGenerateEntitiesTablesWizardPage){
+ SeamGenerateEntitiesTablesWizardPage page = (SeamGenerateEntitiesTablesWizardPage)page2;
+ String filters = page.getFilters();
+ if (filters.length() > 0) values.put(HibernateLaunchConstants.ATTR_REVENG_TABLES, filters);
+ }
return values;
}
return null;
}
+
+ @Override
+ public boolean canFlipToNextPage() {
+ return "reverse".equals(radios.getValue()) && (getErrorMessage() == null); //$NON-NLS-1$
+ }
+
+ public String getConsoleCongigurationName(){
+ return configEditor.getValueAsString();
+ }
}
\ No newline at end of file
Added: trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamGenerateEntitiesTablesWizardPage.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamGenerateEntitiesTablesWizardPage.java (rev 0)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamGenerateEntitiesTablesWizardPage.java 2008-10-16 14:02:28 UTC (rev 10885)
@@ -0,0 +1,110 @@
+/*******************************************************************************
+ * Copyright (c) 2007-2008 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributor:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.seam.ui.wizard;
+
+import org.eclipse.jface.dialogs.IPageChangedListener;
+import org.eclipse.jface.dialogs.PageChangedEvent;
+import org.eclipse.jface.wizard.WizardDialog;
+import org.eclipse.jface.wizard.WizardPage;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.layout.FillLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.hibernate.eclipse.console.model.IReverseEngineeringDefinition;
+import org.hibernate.eclipse.console.model.ITableFilter;
+import org.hibernate.eclipse.console.model.impl.ReverseEngineeringDefinitionImpl;
+import org.jboss.tools.seam.ui.SeamUIMessages;
+import org.jboss.tools.seam.ui.views.DBTableFilterView;
+
+/**
+ * The page for selection table filters.
+ * @author Dmitry Geraskov
+ */
+public class SeamGenerateEntitiesTablesWizardPage extends WizardPage /*implements ISelectionChangedListener*/ {
+
+ public static final String pageName = "seam.generate.entities.tablesPage"; //$NON-NLS-1$
+
+ private String cfgName;
+
+ private IReverseEngineeringDefinition model;
+
+ public SeamGenerateEntitiesTablesWizardPage() {
+ super(pageName, SeamUIMessages.GENERATE_SEAM_ENTITIES_WIZARD_TITLE, null);
+ setMessage("Select Tables"); //$NON-NLS-1$
+ }
+
+ public void createControl(Composite parent) {
+ setPageComplete(true);
+ Composite top = new Composite(parent, SWT.NONE);
+ top.setLayout(new FillLayout());
+ final DBTableFilterView tfView = new DBTableFilterView(top, SWT.NONE){
+
+ @Override
+ protected String getConsoleConfigurationName() {
+ return cfgName;
+ }
+ };
+
+ model = new ReverseEngineeringDefinitionImpl();
+
+ tfView.setModel(model);
+
+ if (getWizard().getContainer() instanceof WizardDialog){
+ WizardDialog wd = (WizardDialog) getWizard().getContainer();
+ wd.addPageChangedListener(new IPageChangedListener(){
+
+ //set console configuration as treeViewer input
+ public void pageChanged(PageChangedEvent event) {
+ if (event.getSelectedPage() == SeamGenerateEntitiesTablesWizardPage.this){
+ SeamGenerateEnitiesWizardPage page1 = (SeamGenerateEnitiesWizardPage)getWizard().getPreviousPage(SeamGenerateEntitiesTablesWizardPage.this);
+ cfgName = page1.getConsoleCongigurationName();
+ }
+ }});
+ }
+ setControl(top);
+ }
+
+ /*
+ * Get filters founded on the selected tables
+ */
+ public String getFilters() {
+ StringBuilder builder = new StringBuilder();
+ if (model != null){
+ ITableFilter[] filters = model.getTableFilters();
+ if (filters.length == 0) return builder.toString();
+ builder.append("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n")//$NON-NLS-1$
+ .append("<!DOCTYPE hibernate-reverse-engineering PUBLIC \"-//Hibernate/Hibernate Reverse Engineering DTD 3.0//EN\"")//$NON-NLS-1$
+ .append(" \"http://hibernate.sourceforge.net/hibernate-reverse-engineering-3.0.dtd\" >\r\n")//$NON-NLS-1$
+ .append("\r\n")//$NON-NLS-1$
+ .append("<hibernate-reverse-engineering>\r\n");//$NON-NLS-1$
+ for (ITableFilter element : filters) {
+ builder.append(generateStringForFilter(element));
+ }
+ builder.append("</hibernate-reverse-engineering>\r\n"); //$NON-NLS-1$
+ }
+ return builder.toString();
+ }
+
+ private String generateStringForFilter(ITableFilter filter){
+ String filterStr = "<table-filter match-name=\"" + filter.getMatchName() + "\""; //$NON-NLS-1$ //$NON-NLS-2$
+ if (filter.getMatchSchema() != null){
+ filterStr += " match-schema=\"" + filter.getMatchSchema() + "\"";//$NON-NLS-1$ //$NON-NLS-2$
+ }
+ //TODO some DBs jdbc readers filters by catalog name incorrectly
+ if (filter.getMatchCatalog() != null){
+ filterStr += " match-catalog=\"" + filter.getMatchCatalog() + "\""; //$NON-NLS-1$//$NON-NLS-2$
+ }
+ if (filter.getExclude()){
+ filterStr += " exclude=\"true\""; //$NON-NLS-1$
+ }
+ return filterStr += "></table-filter>\r\n"; //$NON-NLS-1$
+ }
+
+}
Property changes on: trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamGenerateEntitiesTablesWizardPage.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Author Id Revision Date
Name: svn:eol-style
+ native
17 years, 2 months
JBoss Tools SVN: r10884 - in trunk/seam/plugins/org.jboss.tools.seam.xml: resources/meta and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2008-10-16 09:32:18 -0400 (Thu, 16 Oct 2008)
New Revision: 10884
Added:
trunk/seam/plugins/org.jboss.tools.seam.xml/resources/meta/seam-ui.meta
trunk/seam/plugins/org.jboss.tools.seam.xml/resources/meta/seam-wicket.meta
Modified:
trunk/seam/plugins/org.jboss.tools.seam.xml/plugin.xml
trunk/seam/plugins/org.jboss.tools.seam.xml/resources/meta/seam-components.meta
trunk/seam/plugins/org.jboss.tools.seam.xml/resources/meta/seam-remoting.meta
Log:
JBIDE-2855
Modified: trunk/seam/plugins/org.jboss.tools.seam.xml/plugin.xml
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.xml/plugin.xml 2008-10-16 12:49:06 UTC (rev 10883)
+++ trunk/seam/plugins/org.jboss.tools.seam.xml/plugin.xml 2008-10-16 13:32:18 UTC (rev 10884)
@@ -19,6 +19,8 @@
<meta path="meta/seam-remoting.meta"/>
<meta path="meta/seam-spring.meta"/>
<meta path="meta/seam-transaction.meta"/>
+ <meta path="meta/seam-ui.meta"/>
+ <meta path="meta/seam-wicket.meta"/>
</extension>
<extension point="org.jboss.tools.common.model.keys">
Modified: trunk/seam/plugins/org.jboss.tools.seam.xml/resources/meta/seam-components.meta
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.xml/resources/meta/seam-components.meta 2008-10-16 12:49:06 UTC (rev 10883)
+++ trunk/seam/plugins/org.jboss.tools.seam.xml/resources/meta/seam-components.meta 2008-10-16 13:32:18 UTC (rev 10884)
@@ -516,7 +516,7 @@
<XEntityRenderer/>
<XModelAttributes/>
<XActionItem kind="list">
- <XActionItemReference entity="FileSeamComponent20"
+ <XActionItemReference entity="FileSeamComponent21"
name="CreateActions" path="CreateActions"/>
<XActionItemReference entity="FileSeamComponent20" name="Properties" path="Properties"/>
<XActionItem kind="list" name="VerifyActions">
@@ -1423,7 +1423,7 @@
</XModelAttribute>
<XModelAttribute PROPERTIES="category=advanced" name="precedence" xmlname="precedence">
<Constraint loader="%ListIntEL%">
- <value name=""/>
+ <value/>
<value name="BUILT_IN"/>
<value name="FRAMEWORK"/>
<value name="APPLICATION"/>
Modified: trunk/seam/plugins/org.jboss.tools.seam.xml/resources/meta/seam-remoting.meta
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.xml/resources/meta/seam-remoting.meta 2008-10-16 12:49:06 UTC (rev 10883)
+++ trunk/seam/plugins/org.jboss.tools.seam.xml/resources/meta/seam-remoting.meta 2008-10-16 13:32:18 UTC (rev 10884)
@@ -31,6 +31,44 @@
<GlobalActions kind="list"/>
<XModelEntity ImplementingClass="%Custom%"
PROPERTIES="formFactory=%Default%;formLayout=org.jboss.tools.seam.xml.ui.editor.form.core.SeamComponentsCoreFormLayoutData"
+ XMLSUBPATH="remoting:remoting" name="SeamRemoting21">
+ <XChildrenEntities/>
+ <XEntityRenderer>
+ <ICONS>
+ <ICON info="main.seam.remoting.config" type="main"/>
+ </ICONS>
+ </XEntityRenderer>
+ <XModelAttributes>
+ <XModelAttribute default="remoting" loader="ElementType" name="element type">
+ <Editor name="Uneditable"/>
+ </XModelAttribute>
+ <XModelAttribute PROPERTIES="id=true;category=general"
+ default="org.jboss.seam.remoting.remoting" name="name" xmlname="name"/>
+ <XModelAttributeReference
+ attributes="class,scope,precedence,installed,auto-create,startup"
+ entity="SeamComponent20" name="component"/>
+ <XModelAttributeReference
+ attributes="poll-interval,poll-timeout,debug"
+ entity="SeamRemotingConfig20" name="remoting"/>
+ <XModelAttribute TRIM="no" name="comment" visibility="false" xmlname="#comment">
+ <Editor name="Note"/>
+ </XModelAttribute>
+ </XModelAttributes>
+ <XActionItem kind="list">
+ <XActionItem kind="list" name="CreateActions"/>
+ <XActionItem ICON="action.empty" displayName="Create" kind="list" name="EditActions"/>
+ <XActionItemReference entity="SeamRemotingConfig20"
+ name="CopyActions" path="CopyActions"/>
+ <XActionItemReference entity="SeamRemotingConfig20"
+ name="DeleteActions" path="DeleteActions"/>
+ <XActionItemReference entity="SeamRemotingConfig20" name="Properties" path="Properties"/>
+ <XActionItemReference entity="SeamRemotingConfig20"
+ name="MoveActions" path="MoveActions"/>
+ </XActionItem>
+ <XDependencies/>
+ </XModelEntity>
+ <XModelEntity ImplementingClass="%Custom%"
+ PROPERTIES="formFactory=%Default%;formLayout=org.jboss.tools.seam.xml.ui.editor.form.core.SeamComponentsCoreFormLayoutData"
XMLSUBPATH="remoting:remoting-config" name="SeamRemotingConfig">
<XChildrenEntities/>
<XEntityRenderer>
@@ -103,10 +141,14 @@
<XModelAttributeReference
attributes="class,scope,precedence,installed,auto-create,startup"
entity="SeamComponent20" name="component"/>
- <XModelAttribute PROPERTIES="category=general" name="poll-interval" xmlname="poll-interval"/>
- <XModelAttribute PROPERTIES="category=general" name="poll-timeout" xmlname="poll-timeout"/>
+ <XModelAttribute PROPERTIES="category=general" name="poll-interval" xmlname="poll-interval">
+ <Constraint loader="%IntEL%"/>
+ </XModelAttribute>
+ <XModelAttribute PROPERTIES="category=general" name="poll-timeout" xmlname="poll-timeout">
+ <Constraint loader="%IntEL%"/>
+ </XModelAttribute>
<XModelAttribute PROPERTIES="category=advanced" name="debug" xmlname="debug">
- <Constraint loader="ListString">
+ <Constraint loader="%ListEL%">
<value/>
<value name="true"/>
<value name="false"/>
@@ -209,7 +251,7 @@
</XEntityExtension>
<XEntityExtension name="FileSeamComponents21">
<XChildrenEntities>
- <XChildEntity name="SeamRemotingConfig20"/>
+ <XChildEntity name="SeamRemoting21"/>
</XChildrenEntities>
<XActionItem kind="list">
<XActionItem ICON="action.empty" displayName="New" group="1"
@@ -219,7 +261,7 @@
<XActionItem HandlerClassName="%Create%" ICON="action.empty"
PROPERTIES="validator.add=true" WizardClassName="%Default%"
displayName="Config..." kind="action" name="AddRemotingConfig">
- <EntityData EntityName="SeamRemotingConfig20">
+ <EntityData EntityName="SeamRemoting21">
<AttributeData AttributeName="name"/>
<AttributeData AttributeName="poll-interval" Mandatory="no"/>
<AttributeData AttributeName="poll-timeout" Mandatory="no"/>
Added: trunk/seam/plugins/org.jboss.tools.seam.xml/resources/meta/seam-ui.meta
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.xml/resources/meta/seam-ui.meta (rev 0)
+++ trunk/seam/plugins/org.jboss.tools.seam.xml/resources/meta/seam-ui.meta 2008-10-16 13:32:18 UTC (rev 10884)
@@ -0,0 +1,176 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE XModelEntityGroup PUBLIC "-//Red Hat, Inc.//DTD Meta 1.0//EN"
+ "meta.dtd">
+<XModelEntityGroup>
+ <VERSION DEPENDS="Model:1.0" MODULE="Seam Components Editor" VERSION="1.0"/>
+ <MAPPINGS>
+ <MAPPING name="Handlers"/>
+ <MAPPING name="SeamNamespaces">
+ <PAIR name="ui" value="http://jboss.com/products/seam/ui"/>
+ </MAPPING>
+ <MAPPING name="SeamSchemas">
+ <PAIR name="ui$21" value="http://jboss.com/products/seam/ui-2.1.xsd"/>
+ </MAPPING>
+ </MAPPINGS>
+ <ICONS>
+ <GROUP name="action">
+ <GROUP name="new"/>
+ </GROUP>
+ <GROUP name="main">
+ <GROUP name="seam">
+ <GROUP name="ui">
+ <ICON name="loader" path="images/struts/plug_in.gif"/>
+ </GROUP>
+ </GROUP>
+ </GROUP>
+ </ICONS>
+ <GlobalActions kind="list"/>
+ <XModelEntity ImplementingClass="%Custom%"
+ PROPERTIES="formFactory=%Default%;formLayout=org.jboss.tools.seam.xml.ui.editor.form.core.SeamComponentsCoreFormLayoutData"
+ XMLSUBPATH="ui:entity-converter" name="SeamUIEntityConverter21">
+ <XChildrenEntities/>
+ <XEntityRenderer>
+ <ICONS>
+ <ICON info="main.seam.ui.loader" type="main"/>
+ </ICONS>
+ </XEntityRenderer>
+ <XModelAttributes>
+ <XModelAttribute default="entity-converter" loader="ElementType" name="element type">
+ <Editor name="Uneditable"/>
+ </XModelAttribute>
+ <XModelAttribute PROPERTIES="id=true;category=general"
+ default="org.jboss.seam.ui.entityConverter" name="name" xmlname="name"/>
+ <XModelAttributeReference
+ attributes="class,scope,precedence,installed,auto-create,startup"
+ entity="SeamComponent20" name="component"/>
+ <XModelAttribute PROPERTIES="category=general" name="entity-loader" xmlname="entity-loader"/>
+ <XModelAttribute TRIM="no" name="comment" visibility="false" xmlname="#comment">
+ <Editor name="Note"/>
+ </XModelAttribute>
+ </XModelAttributes>
+ <XActionItem kind="list">
+ <XActionItem kind="list" name="CreateActions"/>
+ <XActionItem ICON="action.empty" displayName="Create" kind="list" name="EditActions"/>
+ <XActionItemReference entity="SeamRemotingConfig20"
+ name="CopyActions" path="CopyActions"/>
+ <XActionItemReference entity="SeamRemotingConfig20"
+ name="DeleteActions" path="DeleteActions"/>
+ <XActionItemReference entity="SeamRemotingConfig20" name="Properties" path="Properties"/>
+ <XActionItemReference entity="SeamRemotingConfig20"
+ name="MoveActions" path="MoveActions"/>
+ </XActionItem>
+ <XDependencies/>
+ </XModelEntity>
+ <XModelEntity ImplementingClass="%Custom%"
+ PROPERTIES="formFactory=%Default%;formLayout=org.jboss.tools.seam.xml.ui.editor.form.core.SeamComponentsCoreFormLayoutData"
+ XMLSUBPATH="ui:hibernate-entity-loader" name="SeamUIHibernate21">
+ <XChildrenEntities/>
+ <XEntityRenderer>
+ <ICONS>
+ <ICON info="main.seam.ui.loader" type="main"/>
+ </ICONS>
+ </XEntityRenderer>
+ <XModelAttributes>
+ <XModelAttribute default="hibernate-entity-loader"
+ loader="ElementType" name="element type">
+ <Editor name="Uneditable"/>
+ </XModelAttribute>
+ <XModelAttribute PROPERTIES="id=true;category=general"
+ default="org.jboss.seam.ui.hibernateEntityLoader" name="name" xmlname="name"/>
+ <XModelAttributeReference
+ attributes="class,scope,precedence,installed,auto-create,startup"
+ entity="SeamComponent20" name="component"/>
+ <XModelAttribute PROPERTIES="category=general" name="session" xmlname="session"/>
+ <XModelAttribute TRIM="no" name="comment" visibility="false" xmlname="#comment">
+ <Editor name="Note"/>
+ </XModelAttribute>
+ </XModelAttributes>
+ <XActionItem kind="list">
+ <XActionItem kind="list" name="CreateActions"/>
+ <XActionItem ICON="action.empty" displayName="Create" kind="list" name="EditActions"/>
+ <XActionItemReference entity="SeamRemotingConfig20"
+ name="CopyActions" path="CopyActions"/>
+ <XActionItemReference entity="SeamRemotingConfig20"
+ name="DeleteActions" path="DeleteActions"/>
+ <XActionItemReference entity="SeamRemotingConfig20" name="Properties" path="Properties"/>
+ <XActionItemReference entity="SeamRemotingConfig20"
+ name="MoveActions" path="MoveActions"/>
+ </XActionItem>
+ <XDependencies/>
+ </XModelEntity>
+ <XModelEntity ImplementingClass="%Custom%"
+ PROPERTIES="formFactory=%Default%;formLayout=org.jboss.tools.seam.xml.ui.editor.form.core.SeamComponentsCoreFormLayoutData"
+ XMLSUBPATH="ui:jpa-entity-loader" name="SeamUIJPA21">
+ <XChildrenEntities/>
+ <XEntityRenderer>
+ <ICONS>
+ <ICON info="main.seam.ui.loader" type="main"/>
+ </ICONS>
+ </XEntityRenderer>
+ <XModelAttributes>
+ <XModelAttribute default="jpa-entity-loader" loader="ElementType" name="element type">
+ <Editor name="Uneditable"/>
+ </XModelAttribute>
+ <XModelAttribute PROPERTIES="id=true;category=general"
+ default="org.jboss.seam.ui.jpaEntityLoader" name="name" xmlname="name"/>
+ <XModelAttributeReference
+ attributes="class,scope,precedence,installed,auto-create,startup"
+ entity="SeamComponent20" name="component"/>
+ <XModelAttribute PROPERTIES="category=general" name="entity-manager" xmlname="entity-manager"/>
+ <XModelAttribute TRIM="no" name="comment" visibility="false" xmlname="#comment">
+ <Editor name="Note"/>
+ </XModelAttribute>
+ </XModelAttributes>
+ <XActionItem kind="list">
+ <XActionItem kind="list" name="CreateActions"/>
+ <XActionItem ICON="action.empty" displayName="Create" kind="list" name="EditActions"/>
+ <XActionItemReference entity="SeamRemotingConfig20"
+ name="CopyActions" path="CopyActions"/>
+ <XActionItemReference entity="SeamRemotingConfig20"
+ name="DeleteActions" path="DeleteActions"/>
+ <XActionItemReference entity="SeamRemotingConfig20" name="Properties" path="Properties"/>
+ <XActionItemReference entity="SeamRemotingConfig20"
+ name="MoveActions" path="MoveActions"/>
+ </XActionItem>
+ <XDependencies/>
+ </XModelEntity>
+ <XEntityExtension name="FileSeamComponents21">
+ <XChildrenEntities>
+ <XChildEntity name="SeamUIJPA21"/>
+ <XChildEntity name="SeamUIHibernate21"/>
+ <XChildEntity name="SeamUIEntityConverter21"/>
+ </XChildrenEntities>
+ <XActionItem kind="list">
+ <XActionItem ICON="action.empty" displayName="New" group="1"
+ kind="list" name="CreateActions">
+ <XActionItem ICON="action.empty" displayName="UI" group="1"
+ kind="list" name="UI">
+ <XActionItem HandlerClassName="%Create%" ICON="action.empty"
+ PROPERTIES="validator.add=true" WizardClassName="%Default%"
+ displayName="JPA Entity Loader..." kind="action" name="AddJPAEntityLoader">
+ <EntityData EntityName="SeamUIJPA21">
+ <AttributeData AttributeName="name"/>
+ <AttributeData AttributeName="entity-manager" Mandatory="no"/>
+ </EntityData>
+ </XActionItem>
+ <XActionItem HandlerClassName="%Create%" ICON="action.empty"
+ PROPERTIES="validator.add=true" WizardClassName="%Default%"
+ displayName="Hibernate Entity Loader..." kind="action" name="AddHibernateEntityLoader">
+ <EntityData EntityName="SeamUIHibernate21">
+ <AttributeData AttributeName="name"/>
+ <AttributeData AttributeName="session" Mandatory="no"/>
+ </EntityData>
+ </XActionItem>
+ <XActionItem HandlerClassName="%Create%" ICON="action.empty"
+ PROPERTIES="validator.add=true" WizardClassName="%Default%"
+ displayName="Entity Converter..." kind="action" name="AddEntityConverter">
+ <EntityData EntityName="SeamUIEntityConverter21">
+ <AttributeData AttributeName="name"/>
+ <AttributeData AttributeName="entity-loader" Mandatory="no"/>
+ </EntityData>
+ </XActionItem>
+ </XActionItem>
+ </XActionItem>
+ </XActionItem>
+ </XEntityExtension>
+</XModelEntityGroup>
Added: trunk/seam/plugins/org.jboss.tools.seam.xml/resources/meta/seam-wicket.meta
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.xml/resources/meta/seam-wicket.meta (rev 0)
+++ trunk/seam/plugins/org.jboss.tools.seam.xml/resources/meta/seam-wicket.meta 2008-10-16 13:32:18 UTC (rev 10884)
@@ -0,0 +1,90 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE XModelEntityGroup PUBLIC "-//Red Hat, Inc.//DTD Meta 1.0//EN"
+ "meta.dtd">
+<XModelEntityGroup>
+ <VERSION DEPENDS="Model:1.0" MODULE="Seam Components Editor" VERSION="1.0"/>
+ <MAPPINGS>
+ <MAPPING name="Handlers"/>
+ <MAPPING name="SeamNamespaces">
+ <PAIR name="wicket" value="http://jboss.com/products/seam/wicket"/>
+ </MAPPING>
+ <MAPPING name="SeamSchemas">
+ <PAIR name="wicket$21" value="http://jboss.com/products/seam/wicket-2.1.xsd"/>
+ </MAPPING>
+ </MAPPINGS>
+ <ICONS>
+ <GROUP name="action">
+ <GROUP name="new">
+ <GROUP name="mail"/>
+ </GROUP>
+ </GROUP>
+ <GROUP name="main">
+ <GROUP name="seam">
+ <GROUP name="remoting">
+ <ICON name="config" path="images/struts/plug_in.gif"/>
+ </GROUP>
+ </GROUP>
+ </GROUP>
+ </ICONS>
+ <GlobalActions kind="list"/>
+ <XModelEntity ImplementingClass="%Custom%"
+ PROPERTIES="formFactory=%Default%;formLayout=org.jboss.tools.seam.xml.ui.editor.form.core.SeamComponentsCoreFormLayoutData"
+ XMLSUBPATH="wicket:web-application" name="SeamWicketWebApp21">
+ <XChildrenEntities/>
+ <XEntityRenderer>
+ <ICONS>
+ <ICON info="main.seam.remoting.config" type="main"/>
+ </ICONS>
+ </XEntityRenderer>
+ <XModelAttributes>
+ <XModelAttribute default="web-application" loader="ElementType" name="element type">
+ <Editor name="Uneditable"/>
+ </XModelAttribute>
+ <XModelAttribute PROPERTIES="id=true;category=general"
+ default="org.jboss.seam.wicket.webApplication" name="name" xmlname="name"/>
+ <XModelAttributeReference
+ attributes="class,scope,precedence,installed,auto-create,startup"
+ entity="SeamComponent20" name="component"/>
+ <XModelAttribute PROPERTIES="category=general"
+ name="application-class" xmlname="application-class">
+ <Editor name="AccessibleJava"/>
+ </XModelAttribute>
+ <XModelAttribute TRIM="no" name="comment" visibility="false" xmlname="#comment">
+ <Editor name="Note"/>
+ </XModelAttribute>
+ </XModelAttributes>
+ <XActionItem kind="list">
+ <XActionItem kind="list" name="CreateActions"/>
+ <XActionItem ICON="action.empty" displayName="Create" kind="list" name="EditActions"/>
+ <XActionItemReference entity="SeamRemotingConfig20"
+ name="CopyActions" path="CopyActions"/>
+ <XActionItemReference entity="SeamRemotingConfig20"
+ name="DeleteActions" path="DeleteActions"/>
+ <XActionItemReference entity="SeamRemotingConfig20" name="Properties" path="Properties"/>
+ <XActionItemReference entity="SeamRemotingConfig20"
+ name="MoveActions" path="MoveActions"/>
+ </XActionItem>
+ <XDependencies/>
+ </XModelEntity>
+ <XEntityExtension name="FileSeamComponents21">
+ <XChildrenEntities>
+ <XChildEntity name="SeamWicketWebApp21"/>
+ </XChildrenEntities>
+ <XActionItem kind="list">
+ <XActionItem ICON="action.empty" displayName="New" group="1"
+ kind="list" name="CreateActions">
+ <XActionItem ICON="action.empty" displayName="Wicket" group="1"
+ kind="list" name="Wicket">
+ <XActionItem HandlerClassName="%Create%" ICON="action.empty"
+ PROPERTIES="validator.add=true" WizardClassName="%Default%"
+ displayName="Web Application..." kind="action" name="AddWebApplication">
+ <EntityData EntityName="SeamWicketWebApp21">
+ <AttributeData AttributeName="name"/>
+ <AttributeData AttributeName="application-class" Mandatory="no"/>
+ </EntityData>
+ </XActionItem>
+ </XActionItem>
+ </XActionItem>
+ </XActionItem>
+ </XEntityExtension>
+</XModelEntityGroup>
17 years, 2 months
JBoss Tools SVN: r10883 - trunk/common/plugins/org.jboss.tools.common.text.xml/src/org/jboss/tools/common/text/xml/contentassist.
by jbosstools-commits@lists.jboss.org
Author: vrubezhny
Date: 2008-10-16 08:49:06 -0400 (Thu, 16 Oct 2008)
New Revision: 10883
Modified:
trunk/common/plugins/org.jboss.tools.common.text.xml/src/org/jboss/tools/common/text/xml/contentassist/SortingCompoundContentAssistProcessor.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-2118 Cleanup/unify the EL code completion used in JSF, Java, Seam completions
Modified: trunk/common/plugins/org.jboss.tools.common.text.xml/src/org/jboss/tools/common/text/xml/contentassist/SortingCompoundContentAssistProcessor.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.text.xml/src/org/jboss/tools/common/text/xml/contentassist/SortingCompoundContentAssistProcessor.java 2008-10-16 12:27:22 UTC (rev 10882)
+++ trunk/common/plugins/org.jboss.tools.common.text.xml/src/org/jboss/tools/common/text/xml/contentassist/SortingCompoundContentAssistProcessor.java 2008-10-16 12:49:06 UTC (rev 10883)
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007 Red Hat, Inc.
+ * Copyright (c) 2008 Red Hat, Inc.
* Distributed under license by Red Hat, Inc. All rights reserved.
* This program is made available under the terms of the
* Eclipse Public License v1.0 which accompanies this distribution,
@@ -37,6 +37,8 @@
import org.eclipse.wst.sse.core.internal.provisional.IModelManager;
import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
import org.eclipse.wst.sse.core.internal.provisional.StructuredModelManager;
+import org.eclipse.wst.sse.ui.internal.contentassist.IRelevanceCompletionProposal;
+import org.eclipse.wst.sse.ui.internal.util.Sorter;
/**
* Reads the plugin.xml file for the processors defined using the
@@ -203,19 +205,39 @@
}
ICompletionProposal[] resultArray = ret.toArray(new ICompletionProposal[ret.size()]);
- // TODO: Need to improve the sorting algorithm
-/* Arrays.sort(resultArray, new Comparator<ICompletionProposal>() {
- public int compare(ICompletionProposal arg0,
- ICompletionProposal arg1) {
- String str0 = (arg0 == null ? "" : arg0.getDisplayString()); //$NON-NLS-1$
- String str1 = (arg1 == null ? "" : arg1.getDisplayString()); //$NON-NLS-1$
- return str0.compareTo(str1);
- }});
-*/
+ Object[] sorted = createSorter().sort(resultArray);
+ System.arraycopy(sorted, 0, resultArray, 0, sorted.length);
return resultArray;
}
+ protected Sorter createSorter() {
+ return new Sorter() {
+ public boolean compare(Object proposal1, Object proposal2) {
+ ICompletionProposal p1 = (ICompletionProposal)proposal1;
+ ICompletionProposal p2 = (ICompletionProposal)proposal2;
+
+ int pr1 = Integer.MIN_VALUE;
+ int pr2 = Integer.MIN_VALUE;
+
+ if (p1 instanceof IRelevanceCompletionProposal)
+ pr1 = ((IRelevanceCompletionProposal)p1).getRelevance();
+
+ if (p2 instanceof IRelevanceCompletionProposal)
+ pr2 = ((IRelevanceCompletionProposal)p2).getRelevance();
+
+
+ if (pr1 == pr2) {
+ String str1 = p1.getDisplayString(); //$NON-NLS-1$
+ String str2 = p2.getDisplayString(); //$NON-NLS-1$
+ return str2.compareTo(str1) > 0;
+ }
+
+ return (pr1 < pr2);
+ }
+ };
+ }
+
/**
* Returns information about possible contexts based on the
* specified location within the document that corresponds
17 years, 2 months
JBoss Tools SVN: r10882 - in trunk: vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor and 2 other directories.
by jbosstools-commits@lists.jboss.org
Author: dsakovich
Date: 2008-10-16 08:27:22 -0400 (Thu, 16 Oct 2008)
New Revision: 10882
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/ComponentUtil.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeVisualDomBuilder.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/context/VpePageContext.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeLinkCreator.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-2860
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/ComponentUtil.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/ComponentUtil.java 2008-10-16 12:21:49 UTC (rev 10881)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/ComponentUtil.java 2008-10-16 12:27:22 UTC (rev 10882)
@@ -44,19 +44,19 @@
/** The Constant EMPTY_SELECT_ITEM_VALUE. */
- private static final String EMPTY_SELECT_ITEM_VALUE = "<f:selectItem/>";
+ private static final String EMPTY_SELECT_ITEM_VALUE = "<f:selectItem/>"; //$NON-NLS-1$
/** The Constant EMPTY_SELECT_ITEMS_VALUE. */
- private static final String EMPTY_SELECT_ITEMS_VALUE = "<f:selectItems/>";
+ private static final String EMPTY_SELECT_ITEMS_VALUE = "<f:selectItems/>"; //$NON-NLS-1$
/** The Constant SELECT_ITEMS. */
- private static final String SELECT_ITEMS = "selectItems";
+ private static final String SELECT_ITEMS = "selectItems"; //$NON-NLS-1$
/** The Constant PX_SUFFIX. */
- public static final String PX_SUFFIX = "px";
+ public static final String PX_SUFFIX = "px"; //$NON-NLS-1$
/** The Constant SELECT_ITEM. */
- private static final String SELECT_ITEM = "selectItem";
+ private static final String SELECT_ITEM = "selectItem"; //$NON-NLS-1$
/**
* Gets child of Facet element by name. If facet has a few children the
@@ -172,7 +172,7 @@
File cssFile = pluginFile.append(cssHref).toFile();
if (cssFile.exists()) {
String cssPath = "file:///" + cssFile.getPath(); //$NON-NLS-1$
- pageContext.getVisualBuilder().replaceLinkNodeToHead(cssPath, ext);
+ pageContext.getVisualBuilder().replaceLinkNodeToHead(cssPath, ext, true);
}
}
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeVisualDomBuilder.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeVisualDomBuilder.java 2008-10-16 12:21:49 UTC (rev 10881)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeVisualDomBuilder.java 2008-10-16 12:27:22 UTC (rev 10882)
@@ -750,7 +750,7 @@
if (l != null) {
for (int i = 0; i < l.length; i++) {
ResourceReference item = l[i];
- addLinkNodeToHead("file:///" + item.getLocation(), YES_STRING); //$NON-NLS-1$
+ addLinkNodeToHead("file:///" + item.getLocation(), YES_STRING, false); //$NON-NLS-1$
}
}
}
@@ -1366,16 +1366,29 @@
scroll);
}
- public nsIDOMNode addLinkNodeToHead(String href_val, String ext_val) {
- nsIDOMElement newNode = createLinkNode(href_val,
- ATTR_REL_STYLESHEET_VALUE, ext_val);
+ /**
+ *
+ * @param href_val
+ * @param ext_val
+ * @param firstElement
+ * true - first node in head, false - last node
+ * @return
+ */
+ public nsIDOMNode addLinkNodeToHead(String href_val, String ext_val,
+ boolean firstElement) {
+ nsIDOMElement newNode = createLinkNode(href_val,
+ ATTR_REL_STYLESHEET_VALUE, ext_val);
- // TODO Dzmitry Sakovich
- // Fix priority CSS classes JBIDE-1713
- nsIDOMNode firstNode = getHeadNode().getFirstChild();
- getHeadNode().insertBefore(newNode, firstNode);
- return newNode;
+ // TODO Dzmitry Sakovich
+ // Fix priority CSS classes JBIDE-1713
+ if (firstElement) {
+ nsIDOMNode firstNode = getHeadNode().getFirstChild();
+ getHeadNode().insertBefore(newNode, firstNode);
+ } else {
+ getHeadNode().appendChild(newNode);
}
+ return newNode;
+ }
public nsIDOMNode replaceLinkNodeToHead(nsIDOMNode oldNode,
String href_val, String ext_val) {
@@ -1385,11 +1398,11 @@
return newNode;
}
- public nsIDOMNode replaceLinkNodeToHead(String href_val, String ext_val) {
+ public nsIDOMNode replaceLinkNodeToHead(String href_val, String ext_val, boolean firstElement) {
nsIDOMNode newNode = null;
nsIDOMNode oldNode = getLinkNode(href_val, ext_val);
if (oldNode == null) {
- newNode = addLinkNodeToHead(href_val, ext_val);
+ newNode = addLinkNodeToHead(href_val, ext_val, firstElement);
}
return newNode;
}
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/context/VpePageContext.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/context/VpePageContext.java 2008-10-16 12:21:49 UTC (rev 10881)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/context/VpePageContext.java 2008-10-16 12:27:22 UTC (rev 10882)
@@ -258,7 +258,7 @@
ResourceReference[] list = getIncludeCss();
for (int i = 0; i < list.length; i++) {
- visualBuilder.addLinkNodeToHead(list[i].getLocation(), "yes");
+ visualBuilder.addLinkNodeToHead(list[i].getLocation(), "yes", false);
}
}
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeLinkCreator.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeLinkCreator.java 2008-10-16 12:21:49 UTC (rev 10881)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeLinkCreator.java 2008-10-16 12:27:22 UTC (rev 10882)
@@ -72,7 +72,7 @@
String href_value = getExprValue(pageContext, hrefExpr, sourceNode);
String rel_value = getExprValue(pageContext, relExpr, sourceNode);
- nsIDOMNode newNode = pageContext.getVisualBuilder().addLinkNodeToHead(href_value, "no");
+ nsIDOMNode newNode = pageContext.getVisualBuilder().addLinkNodeToHead(href_value, "no", false);
visualNodeMap.put(this, newNode);
VpeCreatorInfo creatorInfo = new VpeCreatorInfo(null);
return creatorInfo;
@@ -94,7 +94,7 @@
nsIDOMNode oldNode = (nsIDOMNode)visualNodeMap.get(this);
nsIDOMNode newNode;
if(oldNode == null){
- newNode = pageContext.getVisualBuilder().addLinkNodeToHead(href_value, "no");
+ newNode = pageContext.getVisualBuilder().addLinkNodeToHead(href_value, "no", false);
}else{
newNode = pageContext.getVisualBuilder().replaceLinkNodeToHead(oldNode, href_value, "no");
if(visualNodeMap.containsKey(this)) visualNodeMap.remove(this);
17 years, 2 months
JBoss Tools SVN: r10881 - trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2008-10-16 08:21:49 -0400 (Thu, 16 Oct 2008)
New Revision: 10881
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamResourceVisitor.java
Log:
JBIDE-2056
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamResourceVisitor.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamResourceVisitor.java 2008-10-16 12:14:54 UTC (rev 10880)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamResourceVisitor.java 2008-10-16 12:21:49 UTC (rev 10881)
@@ -10,6 +10,9 @@
******************************************************************************/
package org.jboss.tools.seam.internal.core;
+import java.util.ArrayList;
+import java.util.List;
+
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IFolder;
import org.eclipse.core.resources.IProject;
@@ -17,8 +20,13 @@
import org.eclipse.core.resources.IResourceVisitor;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IPath;
+import org.eclipse.jdt.core.IClasspathEntry;
import org.eclipse.jdt.core.IJavaProject;
-import org.eclipse.jdt.core.JavaCore;
+import org.jboss.tools.common.model.XModel;
+import org.jboss.tools.common.model.XModelObject;
+import org.jboss.tools.common.model.filesystems.FileSystemsHelper;
+import org.jboss.tools.common.model.plugin.ModelPlugin;
+import org.jboss.tools.common.model.util.EclipseResourceUtil;
import org.jboss.tools.seam.core.SeamCorePlugin;
import org.jboss.tools.seam.internal.core.scanner.IFileScanner;
import org.jboss.tools.seam.internal.core.scanner.LoadedDeclarations;
@@ -38,11 +46,27 @@
};
SeamProject p;
- IPath output = null;
+ IPath[] outs = new IPath[0];
+ IPath[] srcs = new IPath[0];
+ IPath webinf = null;
public SeamResourceVisitor(SeamProject p) {
this.p = p;
- getJavaProjectOutput(p.getProject());
+
+ if(p.getProject() != null && p.getProject().isOpen()) {
+ getJavaSourceRoots(p.getProject());
+
+ XModel model = InnerModelHelper.createXModel(p.getProject());
+ if(model != null) {
+ XModelObject wio = FileSystemsHelper.getWebInf(model);
+ if(wio != null) {
+ IResource wir = (IResource)wio.getAdapter(IResource.class);
+ if(wir != null) {
+ webinf = wir.getFullPath();
+ }
+ }
+ }
+ }
}
public IResourceVisitor getVisitor() {
@@ -52,8 +76,10 @@
public boolean visit(IResource resource) {
if(resource instanceof IFile) {
IFile f = (IFile)resource;
- if(output != null && output.isPrefixOf(resource.getFullPath())) {
- return false;
+ for (int i = 0; i < outs.length; i++) {
+ if(outs[i].isPrefixOf(resource.getFullPath())) {
+ return false;
+ }
}
for (int i = 0; i < FILE_SCANNERS.length; i++) {
IFileScanner scanner = FILE_SCANNERS[i];
@@ -77,9 +103,26 @@
}
}
if(resource instanceof IFolder) {
- if(output != null && output.isPrefixOf(resource.getFullPath())) {
- return false;
+ IPath path = resource.getFullPath();
+ for (int i = 0; i < outs.length; i++) {
+ if(outs[i].isPrefixOf(path)) {
+ return false;
+ }
}
+ for (int i = 0; i < srcs.length; i++) {
+ if(srcs[i].isPrefixOf(path) || path.isPrefixOf(srcs[i])) {
+ return true;
+ }
+ }
+ if(webinf != null) {
+ if(webinf.isPrefixOf(path) || path.isPrefixOf(webinf)) {
+ return true;
+ }
+ }
+ if(resource == resource.getProject()) {
+ return true;
+ }
+ return false;
}
//return true to continue visiting children.
return true;
@@ -92,16 +135,31 @@
p.registerComponents(c, resource.getFullPath());
}
- public IPath getJavaProjectOutput(IProject project) {
- if(project == null || !project.isOpen()) return null;
- if(output != null) return output;
+ void getJavaSourceRoots(IProject project) {
+ IJavaProject javaProject = EclipseResourceUtil.getJavaProject(project);
+ if(javaProject == null) return;
+ List<IPath> ps = new ArrayList<IPath>();
+ List<IPath> os = new ArrayList<IPath>();
try {
- if(!project.hasNature(JavaCore.NATURE_ID)) return null;
- IJavaProject javaProject = JavaCore.create(project);
- return output = javaProject.getOutputLocation();
- } catch (CoreException e) {
- SeamCorePlugin.getPluginLog().logError(e);
- return null;
+ IPath output = javaProject.getOutputLocation();
+ if(output != null) os.add(output);
+ IClasspathEntry[] es = javaProject.getResolvedClasspath(true);
+ for (int i = 0; i < es.length; i++) {
+ if(es[i].getEntryKind() == IClasspathEntry.CPE_SOURCE) {
+ IResource findMember = ModelPlugin.getWorkspace().getRoot().findMember(es[i].getPath());
+ if(findMember != null && findMember.exists()) {
+ ps.add(findMember.getFullPath());
+ }
+ IPath out = es[i].getOutputLocation();
+ if(out != null && !os.contains(out)) {
+ os.add(out);
+ }
+ }
+ }
+ srcs = ps.toArray(new IPath[0]);
+ outs = os.toArray(new IPath[0]);
+ } catch(CoreException ce) {
+ ModelPlugin.getPluginLog().logError("Error while locating java source roots for " + project, ce);
}
}
17 years, 2 months
JBoss Tools SVN: r10880 - trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/text/java.
by jbosstools-commits@lists.jboss.org
Author: vrubezhny
Date: 2008-10-16 08:14:54 -0400 (Thu, 16 Oct 2008)
New Revision: 10880
Modified:
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/text/java/SeamELProposalProcessor.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-2118 Cleanup/unify the EL code completion used in JSF, Java, Seam completions
Modified: trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/text/java/SeamELProposalProcessor.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/text/java/SeamELProposalProcessor.java 2008-10-16 11:35:55 UTC (rev 10879)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/text/java/SeamELProposalProcessor.java 2008-10-16 12:14:54 UTC (rev 10880)
@@ -49,10 +49,12 @@
import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
import org.eclipse.wst.sse.ui.internal.contentassist.ContentAssistUtils;
+import org.eclipse.wst.sse.ui.internal.contentassist.IRelevanceCompletionProposal;
import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
import org.eclipse.wst.xml.core.internal.regions.DOMRegionContext;
import org.eclipse.wst.xml.ui.internal.contentassist.AbstractContentAssistProcessor;
+import org.eclipse.wst.xml.ui.internal.contentassist.XMLRelevanceConstants;
import org.eclipse.wst.xml.ui.internal.util.SharedXMLEditorPluginImageHelper;
import org.jboss.tools.common.el.core.model.ELInvocationExpression;
import org.jboss.tools.common.el.core.model.ELModel;
@@ -83,7 +85,7 @@
private static final ICompletionProposal[] NO_PROPOSALS= new ICompletionProposal[0];
private static final IContextInformation[] NO_CONTEXTS= new IContextInformation[0];
- public static final class Proposal implements ICompletionProposal, ICompletionProposalExtension, ICompletionProposalExtension2, ICompletionProposalExtension3, ICompletionProposalExtension4 {
+ public static final class Proposal implements ICompletionProposal, ICompletionProposalExtension, ICompletionProposalExtension2, ICompletionProposalExtension3, ICompletionProposalExtension4, IRelevanceCompletionProposal {
private final String fString;
private final String fPrefix;
@@ -265,6 +267,13 @@
return fNewPosition;
}
+ /**
+ * Returns the relevance of the proposal
+ */
+ public int getRelevance() {
+ return XMLRelevanceConstants.R_XML_ATTRIBUTE_VALUE;
+ }
+
}
/**
17 years, 2 months
JBoss Tools SVN: r10879 - in trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse: launch and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: dgeraskov
Date: 2008-10-16 07:35:55 -0400 (Thu, 16 Oct 2008)
New Revision: 10879
Modified:
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/model/impl/ExporterFactory.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/AddPropertyDialog.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-1913
return ';' back
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/model/impl/ExporterFactory.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/model/impl/ExporterFactory.java 2008-10-16 11:33:23 UTC (rev 10878)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/model/impl/ExporterFactory.java 2008-10-16 11:35:55 UTC (rev 10879)
@@ -205,7 +205,7 @@
List templatePathList = new ArrayList();
if(props.containsKey("template_path")) { //$NON-NLS-1$
String resolveTemplatePath = resolve(props.getProperty("template_path")); //$NON-NLS-1$
- StringTokenizer st = new StringTokenizer(resolveTemplatePath, File.pathSeparator);
+ StringTokenizer st = new StringTokenizer(resolveTemplatePath, ";");
String out = new String();
while (st.hasMoreTokens()) {
String locationAsStringPath = PathHelper.getLocationAsStringPath(st.nextToken());
@@ -224,7 +224,7 @@
}
if (StringHelper.isNotEmpty(customTemplatePath)){
String resolvedCustomTemplatePath = resolve(customTemplatePath);
- StringTokenizer st = new StringTokenizer(resolvedCustomTemplatePath, File.pathSeparator);
+ StringTokenizer st = new StringTokenizer(resolvedCustomTemplatePath, ";");
String out = "";
while (st.hasMoreTokens()) {
String locationAsStringPath = PathHelper.getLocationAsStringPath(st.nextToken());
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/AddPropertyDialog.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/AddPropertyDialog.java 2008-10-16 11:33:23 UTC (rev 10878)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/AddPropertyDialog.java 2008-10-16 11:35:55 UTC (rev 10879)
@@ -229,14 +229,14 @@
strPath = paths[0].toOSString();
if (isPath){
for (int i = 1; i < paths.length; i++) {
- strPath += File.pathSeparator + paths[i].toOSString();
+ strPath += ';' + paths[i].toOSString();
}
}
}
} else return;
String oldPath = ((Text)value).getText();
if (isPath && oldPath.trim().length() > 0 && strPath != null)
- ((Text)value).setText( oldPath + File.pathSeparator + strPath );
+ ((Text)value).setText( oldPath + ';' + strPath );
else {
if (strPath != null)
((Text)value).setText( strPath );
17 years, 2 months
JBoss Tools SVN: r10878 - trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/.settings.
by jbosstools-commits@lists.jboss.org
Author: vyemialyanchyk
Date: 2008-10-16 07:33:23 -0400 (Thu, 16 Oct 2008)
New Revision: 10878
Modified:
trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/.settings/.cvsignore
Log:
JBIDE-2077
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/.settings/.cvsignore
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/.settings/.cvsignore 2008-10-16 10:41:47 UTC (rev 10877)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/.settings/.cvsignore 2008-10-16 11:33:23 UTC (rev 10878)
@@ -1 +1,2 @@
org.eclipse.wst.validation.prefs
+org.eclipse.ltk.core.refactoring.prefs
17 years, 2 months
JBoss Tools SVN: r10877 - in trunk/hibernatetools: plugins/org.hibernate.eclipse.jdt.ui/META-INF and 15 other directories.
by jbosstools-commits@lists.jboss.org
Author: vyemialyanchyk
Date: 2008-10-16 06:41:47 -0400 (Thu, 16 Oct 2008)
New Revision: 10877
Added:
trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/jpa/
trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/jpa/actions/
trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/jpa/actions/JPAMapToolActionDelegate.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/jpa/actions/JPAMapToolActionPulldownDelegate.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/jpa/actions/JPAMapToolActor.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/jpa/collect/
trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/jpa/collect/AllEntitiesInfoCollector.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/jpa/collect/CollectEntityInfo.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/jpa/common/
trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/jpa/common/EntityInfo.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/jpa/common/JPAConst.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/jpa/common/RefEntityInfo.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/jpa/common/RefFieldInfo.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/jpa/common/RefType.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/jpa/common/Utils.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/jpa/process/
trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/jpa/process/AllEntitiesProcessor.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/jpa/process/ProcessEntityInfo.java
trunk/hibernatetools/tests/org.hibernate.eclipse.jdt.ui.test/res/
trunk/hibernatetools/tests/org.hibernate.eclipse.jdt.ui.test/res/project/
trunk/hibernatetools/tests/org.hibernate.eclipse.jdt.ui.test/res/project/test/
trunk/hibernatetools/tests/org.hibernate.eclipse.jdt.ui.test/res/project/test/annotated/
trunk/hibernatetools/tests/org.hibernate.eclipse.jdt.ui.test/res/project/test/annotated/Document.java
trunk/hibernatetools/tests/org.hibernate.eclipse.jdt.ui.test/res/project/test/annotated/Foto.java
trunk/hibernatetools/tests/org.hibernate.eclipse.jdt.ui.test/res/project/test/annotated/Passport.java
trunk/hibernatetools/tests/org.hibernate.eclipse.jdt.ui.test/res/project/test/annotated/Person.java
trunk/hibernatetools/tests/org.hibernate.eclipse.jdt.ui.test/res/project/test/annotated/Staff.java
trunk/hibernatetools/tests/org.hibernate.eclipse.jdt.ui.test/res/specimen/
trunk/hibernatetools/tests/org.hibernate.eclipse.jdt.ui.test/res/specimen/test/
trunk/hibernatetools/tests/org.hibernate.eclipse.jdt.ui.test/res/specimen/test/annotated/
trunk/hibernatetools/tests/org.hibernate.eclipse.jdt.ui.test/res/specimen/test/annotated/Document.java
trunk/hibernatetools/tests/org.hibernate.eclipse.jdt.ui.test/res/specimen/test/annotated/Foto.java
trunk/hibernatetools/tests/org.hibernate.eclipse.jdt.ui.test/res/specimen/test/annotated/Passport.java
trunk/hibernatetools/tests/org.hibernate.eclipse.jdt.ui.test/res/specimen/test/annotated/Person.java
trunk/hibernatetools/tests/org.hibernate.eclipse.jdt.ui.test/res/specimen/test/annotated/Staff.java
trunk/hibernatetools/tests/org.hibernate.eclipse.jdt.ui.test/src/org/hibernate/eclipse/jdt/ui/test/JPAMapTest.java
Modified:
trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/META-INF/MANIFEST.MF
trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/plugin.xml
trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/JdtUiMessages.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/JdtUiMessages.properties
trunk/hibernatetools/tests/org.hibernate.eclipse.jdt.ui.test/.classpath
Log:
JBIDE-2077
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/META-INF/MANIFEST.MF
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/META-INF/MANIFEST.MF 2008-10-16 10:41:46 UTC (rev 10876)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/META-INF/MANIFEST.MF 2008-10-16 10:41:47 UTC (rev 10877)
@@ -22,4 +22,8 @@
org.eclipse.ltk.ui.refactoring
Eclipse-LazyStart: true
Export-Package: org.hibernate.eclipse.jdt.ui,
- org.hibernate.eclipse.jdt.ui.internal
+ org.hibernate.eclipse.jdt.ui.internal,
+ org.hibernate.eclipse.jdt.ui.internal.jpa.actions,
+ org.hibernate.eclipse.jdt.ui.internal.jpa.collect,
+ org.hibernate.eclipse.jdt.ui.internal.jpa.common,
+ org.hibernate.eclipse.jdt.ui.internal.jpa.process
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/plugin.xml
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/plugin.xml 2008-10-16 10:41:46 UTC (rev 10876)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/plugin.xml 2008-10-16 10:41:47 UTC (rev 10877)
@@ -38,4 +38,69 @@
<super type="org.eclipse.core.resources.textmarker"/>
<persistent value="true"/>
</extension>
+ <extension point="org.eclipse.ui.actionSets">
+ <!-- main menu -->
+ <actionSet label="Java Coding" description="Action set containing coding related Java actions"
+ visible="true" id="org.eclipse.jdt.ui.CodingActionSet3">
+ <menu label="&Source" path="edit" id="org.eclipse.jdt.ui.source.menu">
+ <separator name="commentGroup"/>
+ <separator name="editGroup"/>
+ <separator name="importGroup"/>
+ <separator name="generateGroup"/>
+ <separator name="codeGroup"/>
+ <separator name="externalizeGroup"/>
+ <separator name="convertGroup"/>
+ </menu>
+ <action
+ class="org.hibernate.eclipse.jdt.ui.internal.jpa.actions.JPAMapToolActionPulldownDelegate"
+ id="org.hibernate.eclipse.jdt.ui.run_jpaaction"
+ label="Generate &Hibernate/JPA annotations"
+ menubarPath="org.eclipse.jdt.ui.source.menu/generateGroup"
+ style="push">
+ </action>
+ </actionSet>
+ </extension>
+ <extension point="org.eclipse.ui.popupMenus">
+ <!-- java editor context menu -->
+ <viewerContribution
+ id="org.hibernate.eclipse.jdt.ui.run_jpa.popupMenu"
+ targetID="#CompilationUnitEditorContext">
+ <menu label="&Source" path="edit" id="org.eclipse.jdt.ui.source.menu">
+ <separator name="commentGroup"/>
+ <separator name="editGroup"/>
+ <separator name="importGroup"/>
+ <separator name="generateGroup"/>
+ <separator name="codeGroup"/>
+ <separator name="externalizeGroup"/>
+ <separator name="convertGroup"/>
+ </menu>
+ <action
+ class="org.hibernate.eclipse.jdt.ui.internal.jpa.actions.JPAMapToolActionDelegate"
+ id="org.hibernate.eclipse.jdt.ui.run_jpaaction2"
+ label="Generate &Hibernate/JPA annotations"
+ menubarPath="org.eclipse.jdt.ui.source.menu/generateGroup"
+ style="push">
+ </action>
+ </viewerContribution>
+ <!-- java element context menu -->
+ <objectContribution adaptable="false"
+ id="org.hibernate.eclipse.jdt.ui.run_jpa.popupMenu.IJavaElementContribution"
+ objectClass="org.eclipse.jdt.core.IJavaElement">
+ <menu label="&Source" path="edit" id="org.eclipse.jdt.ui.source.menu">
+ <separator name="commentGroup"/>
+ <separator name="editGroup"/>
+ <separator name="importGroup"/>
+ <separator name="generateGroup"/>
+ <separator name="codeGroup"/>
+ <separator name="externalizeGroup"/>
+ <separator name="convertGroup"/>
+ </menu>
+ <action class="org.hibernate.eclipse.jdt.ui.internal.jpa.actions.JPAMapToolActionDelegate"
+ id="org.hibernate.eclipse.jdt.ui.run_jpaaction3"
+ label="Generate &Hibernate/JPA annotations"
+ menubarPath="org.eclipse.jdt.ui.source.menu/generateGroup">
+ </action>
+ </objectContribution>
+ </extension>
+
</plugin>
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/JdtUiMessages.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/JdtUiMessages.java 2008-10-16 10:41:46 UTC (rev 10876)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/JdtUiMessages.java 2008-10-16 10:41:47 UTC (rev 10877)
@@ -4,11 +4,14 @@
public class JdtUiMessages extends NLS {
private static final String BUNDLE_NAME = "org.hibernate.eclipse.jdt.ui.internal.JdtUiMessages"; //$NON-NLS-1$
+ public static String AllEntitiesProcessor_header;
+ public static String AllEntitiesProcessor_message;
public static String CriteriaQuickAssistProcessor_copy_to_criteria_editor;
public static String CriteriaQuickAssistProcessor_errormessage;
public static String DebugJavaCompletionProposalComputer_displaystring;
public static String HQLJavaCompletionProposalComputer_errormessage;
public static String HQLQuickAssistProcessor_copy_to_hql_editor;
+ public static String JPAMapToolActionPulldownDelegate_menu;
public static String SaveQueryEditorListener_replacequestion;
public static String SaveQueryEditorListener_replacetitle;
public static String SaveQueryEditorListener_hql_editor;
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/JdtUiMessages.properties
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/JdtUiMessages.properties 2008-10-16 10:41:46 UTC (rev 10876)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/JdtUiMessages.properties 2008-10-16 10:41:47 UTC (rev 10877)
@@ -8,12 +8,14 @@
# Contributor:
# Red Hat, Inc. - initial API and implementation
##############################################################################/
-
+AllEntitiesProcessor_header=Hibernate: add JPA annotations
+AllEntitiesProcessor_message=Add JPA annotations to the related set of entities. The following classes will be changed:
CriteriaQuickAssistProcessor_copy_to_criteria_editor=Copy to Criteria Editor
CriteriaQuickAssistProcessor_errormessage= Could not get document contents for CriteriaQuickAssist
DebugJavaCompletionProposalComputer_displaystring= I wanna show a dialog!
HQLJavaCompletionProposalComputer_errormessage= Error while performing HQL completion in java
HQLQuickAssistProcessor_copy_to_hql_editor=Copy to HQL Editor
+JPAMapToolActionPulldownDelegate_menu=JPA annotations
SaveQueryEditorListener_replacequestion= Do you want to save this {0} query into ''{1}''?
SaveQueryEditorListener_replacetitle= Query replace
SaveQueryEditorListener_hql_editor=HQL
Added: trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/jpa/actions/JPAMapToolActionDelegate.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/jpa/actions/JPAMapToolActionDelegate.java (rev 0)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/jpa/actions/JPAMapToolActionDelegate.java 2008-10-16 10:41:47 UTC (rev 10877)
@@ -0,0 +1,83 @@
+/*******************************************************************************
+ * Copyright (c) 2007-2008 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributor:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.hibernate.eclipse.jdt.ui.internal.jpa.actions;
+
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.commands.IHandler;
+import org.eclipse.core.commands.IHandlerListener;
+import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.ui.IEditorActionDelegate;
+import org.eclipse.ui.IEditorPart;
+import org.eclipse.ui.IObjectActionDelegate;
+import org.eclipse.ui.IViewActionDelegate;
+import org.eclipse.ui.IViewPart;
+import org.eclipse.ui.IWorkbenchPart;
+
+/**
+ *
+ *
+ * @author Vitali
+ */
+public class JPAMapToolActionDelegate implements IObjectActionDelegate,
+ IEditorActionDelegate, IViewActionDelegate, IHandler {
+
+ public JPAMapToolActor actor = new JPAMapToolActor();
+
+ public void setActivePart(IAction action, IWorkbenchPart targetPart) {
+ }
+
+ public void run(IAction action) {
+ actor.updateSelected();
+ //actor.updateOpen();
+ }
+
+ public void selectionChanged(IAction action, ISelection selection) {
+ actor.updateSelectedItems(selection);
+ if (action != null) {
+ action.setEnabled(actor.getSelectedSize() > 0);
+ }
+ }
+
+ public void setActiveEditor(IAction action, IEditorPart targetEditor) {
+ if (action != null) {
+ action.setEnabled(actor.getSelectedSize() > 0);
+ }
+ }
+
+ public void addHandlerListener(IHandlerListener handlerListener) {
+ }
+
+ public void dispose() {
+ }
+
+ public Object execute(ExecutionEvent event) throws ExecutionException {
+ actor.updateSelected();
+ //actor.updateOpen();
+ return null;
+ }
+
+ public boolean isEnabled() {
+ return (actor.getSelectedSize() > 0);
+ }
+
+ public boolean isHandled() {
+ return true;
+ }
+
+ public void removeHandlerListener(IHandlerListener handlerListener) {
+ }
+
+ public void init(IViewPart view) {
+ view = null;
+ }
+}
Added: trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/jpa/actions/JPAMapToolActionPulldownDelegate.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/jpa/actions/JPAMapToolActionPulldownDelegate.java (rev 0)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/jpa/actions/JPAMapToolActionPulldownDelegate.java 2008-10-16 10:41:47 UTC (rev 10877)
@@ -0,0 +1,153 @@
+/*******************************************************************************
+ * Copyright (c) 2007-2008 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributor:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.hibernate.eclipse.jdt.ui.internal.jpa.actions;
+
+import org.eclipse.jface.action.Action;
+import org.eclipse.jface.action.ActionContributionItem;
+import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.action.IMenuCreator;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.swt.events.MenuAdapter;
+import org.eclipse.swt.events.MenuEvent;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Event;
+import org.eclipse.swt.widgets.Menu;
+import org.eclipse.swt.widgets.MenuItem;
+import org.eclipse.ui.IActionDelegate2;
+import org.eclipse.ui.IEditorActionDelegate;
+import org.eclipse.ui.IEditorPart;
+import org.eclipse.ui.IWorkbenchWindow;
+import org.eclipse.ui.IWorkbenchWindowPulldownDelegate2;
+import org.hibernate.eclipse.jdt.ui.internal.JdtUiMessages;
+
+/**
+ *
+ *
+ * @author Vitali
+ */
+public class JPAMapToolActionPulldownDelegate implements
+ IWorkbenchWindowPulldownDelegate2, IEditorActionDelegate, IActionDelegate2, IMenuCreator {
+
+ /**
+ * The menu created by this action
+ */
+ private Menu fMenu;
+ protected boolean fRecreateMenu = false;
+
+ public JPAMapToolActor actor = new JPAMapToolActor();
+
+ public Menu getMenu(Menu parent) {
+ setMenu(new Menu(parent));
+ fillMenu(fMenu);
+ initMenu();
+ return fMenu;
+ }
+
+ public Menu getMenu(Control parent) {
+ setMenu(new Menu(parent));
+ fillMenu(fMenu);
+ initMenu();
+ return fMenu;
+ }
+
+ public void dispose() {
+ setMenu(null);
+ }
+
+ public void init(IWorkbenchWindow window) {
+ }
+
+ public void run(IAction action) {
+ action = null;
+ }
+
+ public void selectionChanged(IAction action, ISelection selection) {
+ actor.updateSelectedItems(selection);
+ if (action != null) {
+ action.setEnabled(actor.getSelectedSize() > 0);
+ }
+ }
+
+ protected void addToMenu(Menu menu, IAction action, int accelerator) {
+ StringBuffer label = new StringBuffer();
+ if (accelerator >= 0 && accelerator < 10) {
+ // add the numerical accelerator
+ label.append('&');
+ label.append(accelerator);
+ label.append(' ');
+ }
+ label.append(action.getText());
+ action.setText(label.toString());
+ ActionContributionItem item = new ActionContributionItem(action);
+ item.fill(menu, -1);
+ }
+
+ protected void fillMenu(Menu menu) {
+ IAction action = new Action(JdtUiMessages.JPAMapToolActionPulldownDelegate_menu) {
+ public void run() {
+ //actor.updateOpen();
+ actor.updateSelected();
+ }
+ };
+ addToMenu(menu, action, -1);
+ }
+
+ private void initMenu() {
+ // Add listener to re-populate the menu each time
+ // it is shown because of dynamic list
+ fMenu.addMenuListener(new MenuAdapter() {
+ public void menuShown(MenuEvent e) {
+ Menu m = (Menu) e.widget;
+ if (fRecreateMenu) {
+ MenuItem[] items = m.getItems();
+ for (int i = 0; i < items.length; i++) {
+ items[i].dispose();
+ }
+ fillMenu(m);
+ fRecreateMenu = false;
+ }
+ m.setEnabled(actor.getSelectedSize() > 0);
+ MenuItem[] items = m.getItems();
+ for (int i = 0; i < items.length; i++) {
+ items[i].setEnabled(actor.getSelectedSize() > 0);
+ }
+ }
+ public void menuHidden(MenuEvent e) {
+ fRecreateMenu = true;
+ }
+ });
+ }
+
+ private void setMenu(Menu menu) {
+ if (fMenu != null) {
+ fMenu.dispose();
+ }
+ fMenu = menu;
+ }
+
+ public void setActiveEditor(IAction action, IEditorPart targetEditor) {
+ if (action != null) {
+ action.setEnabled(actor.getSelectedSize() > 0);
+ }
+ }
+
+ public void init(IAction action) {
+ if (action instanceof Action) {
+ ((Action)action).setMenuCreator(this);
+ }
+ }
+
+ public void runWithEvent(IAction action, Event event) {
+ //actor.updateOpen();
+ actor.updateSelected();
+ }
+
+}
Added: trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/jpa/actions/JPAMapToolActor.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/jpa/actions/JPAMapToolActor.java (rev 0)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/jpa/actions/JPAMapToolActor.java 2008-10-16 10:41:47 UTC (rev 10877)
@@ -0,0 +1,219 @@
+/*******************************************************************************
+ * Copyright (c) 2007-2008 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributor:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.hibernate.eclipse.jdt.ui.internal.jpa.actions;
+
+import java.lang.reflect.Field;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.Map;
+import java.util.Set;
+
+import org.eclipse.core.internal.filebuffers.SynchronizableDocument;
+import org.eclipse.core.internal.resources.File;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.jdt.core.ICompilationUnit;
+import org.eclipse.jdt.core.IJavaProject;
+import org.eclipse.jdt.core.JavaCore;
+import org.eclipse.jdt.core.dom.AST;
+import org.eclipse.jdt.core.dom.ASTParser;
+import org.eclipse.jdt.core.dom.TypeDeclaration;
+import org.eclipse.jdt.internal.core.JavaElement;
+import org.eclipse.jdt.internal.ui.javaeditor.CompilationUnitEditor;
+import org.eclipse.jface.text.IDocument;
+import org.eclipse.jface.text.TextSelection;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.TreeSelection;
+import org.eclipse.ui.IEditorPart;
+import org.eclipse.ui.IWorkbench;
+import org.eclipse.ui.IWorkbenchPage;
+import org.hibernate.eclipse.console.HibernateConsolePlugin;
+import org.hibernate.eclipse.jdt.ui.Activator;
+import org.hibernate.eclipse.jdt.ui.internal.jpa.collect.AllEntitiesInfoCollector;
+import org.hibernate.eclipse.jdt.ui.internal.jpa.common.Utils;
+import org.hibernate.eclipse.jdt.ui.internal.jpa.process.AllEntitiesProcessor;
+
+/**
+ *
+ *
+ * @author Vitali
+ */
+public class JPAMapToolActor {
+
+ protected Set<ICompilationUnit> selectionCU = new HashSet<ICompilationUnit>();
+ protected AllEntitiesInfoCollector collector = new AllEntitiesInfoCollector();
+ protected AllEntitiesProcessor processor = new AllEntitiesProcessor();
+
+
+ protected org.eclipse.jdt.core.dom.CompilationUnit getCompilationUnit(ICompilationUnit source) {
+ ASTParser parser = ASTParser.newParser(AST.JLS3);
+ parser.setSource(source);
+ org.eclipse.jdt.core.dom.CompilationUnit result = (org.eclipse.jdt.core.dom.CompilationUnit) parser.createAST(null);
+ return result;
+ }
+
+ public void clearSelectionCU() {
+ selectionCU.clear();
+ }
+
+ public void addCompilationUnit(ICompilationUnit cu) {
+ if (cu != null) {
+ selectionCU.add(cu);
+ }
+ }
+
+ public void updateSelected() {
+ Iterator<ICompilationUnit> it = selectionCU.iterator();
+ Map<IJavaProject, Set<ICompilationUnit>> mapJP_CUSet =
+ new HashMap<IJavaProject, Set<ICompilationUnit>>();
+ while (it.hasNext()) {
+ ICompilationUnit cu = it.next();
+ Set<ICompilationUnit> set =
+ mapJP_CUSet.get(cu.getJavaProject());
+ if (set == null) {
+ set = new HashSet<ICompilationUnit>();
+ mapJP_CUSet.put(cu.getJavaProject(), set);
+ }
+ set.add(cu);
+ }
+ Iterator<Map.Entry<IJavaProject, Set<ICompilationUnit>>>
+ mapIt = mapJP_CUSet.entrySet().iterator();
+ while (mapIt.hasNext()) {
+ Map.Entry<IJavaProject, Set<ICompilationUnit>>
+ entry = mapIt.next();
+ IJavaProject javaProject = entry.getKey();
+ Iterator<ICompilationUnit> setIt = entry.getValue().iterator();
+ collector.initCollector(javaProject);
+ while (setIt.hasNext()) {
+ ICompilationUnit icu = setIt.next();
+ collector.collect(icu);
+ }
+ collector.resolveRelations();
+ processor.modify(javaProject, collector.getMapCUs_Info(), true);
+ }
+ }
+
+ public void updateOpen() {
+ IWorkbench workbench = Activator.getDefault().getWorkbench();
+ IWorkbenchPage page = workbench.getActiveWorkbenchWindow().getActivePage();
+
+ IEditorPart editor = page.getActiveEditor();
+ if (editor instanceof CompilationUnitEditor) {
+ CompilationUnitEditor cue = (CompilationUnitEditor)editor;
+ ICompilationUnit cu = (ICompilationUnit)cue.getViewPartInput();
+ if (cu != null) {
+ IJavaProject javaProject = cu.getJavaProject();
+ collector.initCollector(javaProject);
+ collector.collect(cu);
+ collector.resolveRelations();
+ processor.modify(javaProject, collector.getMapCUs_Info(), true);
+ }
+ }
+ }
+
+ public void makePersistent(ICompilationUnit cu) throws CoreException {
+ collector.collect(cu);
+ }
+
+ public int getSelectedSize() {
+ return selectionCU.size();
+ }
+
+ public void updateSelectedItems(ISelection selection) {
+ //System.out.println("Blah! " + selection); //$NON-NLS-1$
+ if (selection instanceof TextSelection) {
+ String fullyQualifiedName = ""; //$NON-NLS-1$
+ IDocument fDocument = null;
+ SynchronizableDocument sDocument = null;
+ org.eclipse.jdt.core.dom.CompilationUnit resultCU = null;
+ Class clazz = selection.getClass();
+ Field fd = null;
+ try {
+ fd = clazz.getDeclaredField("fDocument"); //$NON-NLS-1$
+ } catch (NoSuchFieldException e) {
+ // just ignore it!
+ }
+ if (fd != null) {
+ try {
+ fd.setAccessible(true);
+ fDocument = (IDocument)fd.get(selection);
+ if (fDocument instanceof SynchronizableDocument) {
+ sDocument = (SynchronizableDocument)fDocument;
+ }
+ if (sDocument != null) {
+ ASTParser parser = ASTParser.newParser(AST.JLS3);
+ parser.setSource(sDocument.get().toCharArray());
+ parser.setResolveBindings(false);
+ resultCU = (org.eclipse.jdt.core.dom.CompilationUnit) parser.createAST(null);
+ }
+ if (resultCU != null && resultCU.types().size() > 0 ) {
+ if (resultCU.getPackage() != null) {
+ fullyQualifiedName = resultCU.getPackage().getName().getFullyQualifiedName() + "."; //$NON-NLS-1$
+ }
+ else {
+ fullyQualifiedName = ""; //$NON-NLS-1$
+ }
+ fullyQualifiedName += ((TypeDeclaration)(resultCU.types().get(0))).getName();
+ }
+ } catch (IllegalArgumentException e) {
+ HibernateConsolePlugin.getDefault().logErrorMessage("IllegalArgumentException: ", e); //$NON-NLS-1$
+ } catch (IllegalAccessException e) {
+ HibernateConsolePlugin.getDefault().logErrorMessage("IllegalAccessException: ", e); //$NON-NLS-1$
+ } catch (SecurityException e) {
+ HibernateConsolePlugin.getDefault().logErrorMessage("SecurityException: ", e); //$NON-NLS-1$
+ }
+ }
+ clearSelectionCU();
+ if (fullyQualifiedName.length() > 0) {
+ ICompilationUnit cu = Utils.findCompilationUnit(fullyQualifiedName);
+ addCompilationUnit(cu);
+ }
+ }
+ else if (selection instanceof TreeSelection) {
+ clearSelectionCU();
+ TreeSelection treeSelection = (TreeSelection)selection;
+ Iterator it = treeSelection.iterator();
+ while (it.hasNext()) {
+ Object obj = it.next();
+ if (obj instanceof ICompilationUnit) {
+ ICompilationUnit cu = (ICompilationUnit)obj;
+ addCompilationUnit(cu);
+ }
+ else if (obj instanceof File) {
+ File file = (File)obj;
+ if (file != null && file.getProject() != null) {
+ IJavaProject javaProject = JavaCore.create(file.getProject());
+ ICompilationUnit[] cus = Utils.findCompilationUnits(javaProject,
+ file.getFullPath());
+ if (cus != null) {
+ for (int i = 0; i < cus.length; i++) {
+ addCompilationUnit(cus[i]);
+ }
+ }
+ }
+ }
+ else if (obj instanceof JavaElement) {
+ JavaElement javaElement = (JavaElement)obj;
+ ICompilationUnit cu = javaElement.getCompilationUnit();
+ addCompilationUnit(cu);
+ }
+ else {
+ // ignore
+ //System.out.println("1 Blah! " + selection); //$NON-NLS-1$
+ }
+ }
+ }
+ else {
+ //System.out.println("2 Blah! " + selection); //$NON-NLS-1$
+ selection = null;
+ }
+ }
+}
Added: trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/jpa/collect/AllEntitiesInfoCollector.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/jpa/collect/AllEntitiesInfoCollector.java (rev 0)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/jpa/collect/AllEntitiesInfoCollector.java 2008-10-16 10:41:47 UTC (rev 10877)
@@ -0,0 +1,357 @@
+/*******************************************************************************
+ * Copyright (c) 2007-2008 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributor:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.hibernate.eclipse.jdt.ui.internal.jpa.collect;
+
+import java.util.Iterator;
+import java.util.Map;
+import java.util.Set;
+import java.util.TreeMap;
+
+import org.eclipse.jdt.core.ICompilationUnit;
+import org.eclipse.jdt.core.IJavaProject;
+import org.hibernate.eclipse.jdt.ui.internal.jpa.common.EntityInfo;
+import org.hibernate.eclipse.jdt.ui.internal.jpa.common.JPAConst;
+import org.hibernate.eclipse.jdt.ui.internal.jpa.common.RefEntityInfo;
+import org.hibernate.eclipse.jdt.ui.internal.jpa.common.RefFieldInfo;
+import org.hibernate.eclipse.jdt.ui.internal.jpa.common.RefType;
+import org.hibernate.eclipse.jdt.ui.internal.jpa.common.Utils;
+
+/**
+ *
+ *
+ * @author Vitali
+ */
+public class AllEntitiesInfoCollector {
+
+ protected IJavaProject javaProject;
+ // fullyQualifiedName -> EntityInfo
+ protected Map<String, EntityInfo> mapCUs_Info = new TreeMap<String, EntityInfo>();
+
+ public void initCollector(IJavaProject javaProject) {
+ this.javaProject = javaProject;
+ mapCUs_Info.clear();
+ }
+
+ protected class ProcessItem {
+ //
+ public String fieldId = null;
+ public String fieldId2 = null;
+ //
+ public RefEntityInfo refEntityInfo = null;
+ public RefEntityInfo refEntityInfo2 = null;
+ }
+
+ protected abstract class IConnector {
+
+ protected ProcessItem pi;
+
+ public void setProcessItem(ProcessItem processItem) {
+ this.pi = processItem;
+ }
+ public abstract boolean updateRelation();
+ }
+
+ protected class EntityProcessor {
+
+ protected IConnector connector;
+
+ public void setConnector(IConnector connector) {
+ this.connector = connector;
+ }
+
+ public void enumEntityPairs() {
+ Iterator<Map.Entry<String, EntityInfo>> it = mapCUs_Info.entrySet().iterator();
+ ProcessItem pi = new ProcessItem();
+ while (it.hasNext()) {
+ Map.Entry<String, EntityInfo> entry = it.next();
+ // entry.getKey() - fully qualified name
+ // entry.getValue() - EntityInfo
+ EntityInfo entryInfo = entry.getValue();
+ assert(entry.getKey().equals(entryInfo.getFullyQualifiedName()));
+ String fullyQualifiedName = entryInfo.getFullyQualifiedName();
+ // get references map:
+ // * field id -> RefEntityInfo
+ Iterator<Map.Entry<String, RefEntityInfo>> referencesIt =
+ entryInfo.getReferences().entrySet().iterator();
+ while (referencesIt.hasNext()) {
+ Map.Entry<String, RefEntityInfo> entry2 = referencesIt.next();
+ // entry2.getKey() - field id
+ // entry2.getValue() - RefEntityInfo
+ pi.fieldId = entry2.getKey();
+ pi.refEntityInfo = entry2.getValue();
+ String fullyQualifiedName2 = pi.refEntityInfo.fullyQualifiedName;
+ EntityInfo entryInfo2 = mapCUs_Info.get(fullyQualifiedName2);
+ assert(fullyQualifiedName2.equals(entryInfo2.getFullyQualifiedName()));
+ if (entryInfo2 != null && pi.refEntityInfo != null) {
+ pi.refEntityInfo2 = null;
+ pi.fieldId2 = null;
+ Set<RefFieldInfo> setRefEntityInfo = entryInfo2.getRefFieldInfoSet(fullyQualifiedName);
+ if (setRefEntityInfo != null) {
+ if (setRefEntityInfo.size() == 1) {
+ Iterator<RefFieldInfo> itTmp = setRefEntityInfo.iterator();
+ RefFieldInfo rfi = itTmp.next();
+ pi.fieldId2 = rfi.fieldId;
+ pi.refEntityInfo2 = entryInfo2.getFieldIdRefEntityInfo(pi.fieldId2);
+ }
+ else if (setRefEntityInfo.size() > 1) {
+ // this case of complex decision - omit this,
+ // give other entities opportunity to solve this.
+ // in case of no solution - user should define this himself
+ pi.refEntityInfo2 = null;
+ }
+ }
+ if (connector != null) {
+ connector.setProcessItem(pi);
+ connector.updateRelation();
+ }
+ }
+ }
+ }
+ }
+ }
+
+ public void resolveRelations() {
+ Iterator<Map.Entry<String, EntityInfo>> it = null;
+ // generate RefFieldInfoMap (for simple process)
+ it = mapCUs_Info.entrySet().iterator();
+ while (it.hasNext()) {
+ Map.Entry<String, EntityInfo> entry = it.next();
+ EntityInfo entryInfo = entry.getValue();
+ entryInfo.generateRefFieldInfoMap();
+ }
+ // update relations
+ EntityProcessor ep = new EntityProcessor();
+ // 0)
+ // process the user prompts
+ IConnector promptsConnector = new IConnector() {
+ public boolean updateRelation() {
+ if (pi == null) {
+ return false;
+ }
+ if (pi.refEntityInfo == null || pi.refEntityInfo2 == null) {
+ return false;
+ }
+ boolean hasPrompt = false;
+ // - use it as prompting from the user
+ if ((pi.fieldId != null && pi.fieldId.equals(pi.refEntityInfo2.mappedBy)) ||
+ (pi.fieldId2 != null && pi.fieldId2.equals(pi.refEntityInfo.mappedBy))) {
+ hasPrompt = true;
+ }
+ if (hasPrompt) {
+ if (pi.refEntityInfo.refType == RefType.ONE2ONE) {
+ if (pi.refEntityInfo2.refType == RefType.ONE2ONE) {
+ pi.refEntityInfo.refType = RefType.ONE2ONE;
+ pi.refEntityInfo.mappedBy = pi.fieldId2;
+ pi.refEntityInfo2.refType = RefType.ONE2ONE;
+ pi.refEntityInfo2.mappedBy = pi.fieldId;
+ }
+ else if (pi.refEntityInfo2.refType == RefType.ONE2MANY) {
+ pi.refEntityInfo.refType = RefType.MANY2ONE;
+ pi.refEntityInfo.mappedBy = pi.fieldId2;
+ pi.refEntityInfo2.refType = RefType.ONE2MANY;
+ pi.refEntityInfo2.mappedBy = pi.fieldId;
+ }
+ }
+ else if (pi.refEntityInfo.refType == RefType.ONE2MANY) {
+ if (pi.refEntityInfo2.refType == RefType.ONE2ONE) {
+ pi.refEntityInfo.refType = RefType.ONE2MANY;
+ pi.refEntityInfo.mappedBy = pi.fieldId2;
+ pi.refEntityInfo2.refType = RefType.MANY2ONE;
+ pi.refEntityInfo2.mappedBy = pi.fieldId;
+ }
+ else if (pi.refEntityInfo2.refType == RefType.ONE2MANY) {
+ pi.refEntityInfo.refType = RefType.MANY2MANY;
+ pi.refEntityInfo.mappedBy = pi.fieldId2;
+ pi.refEntityInfo2.refType = RefType.MANY2MANY;
+ pi.refEntityInfo2.mappedBy = pi.fieldId;
+ }
+ }
+ }
+ return true;
+ }
+ };
+ ep.setConnector(promptsConnector);
+ ep.enumEntityPairs();
+ // prefer other mapping type to ManyToMany, so
+ // 1)
+ // first - try to assign other relations
+ IConnector simpleRelConnector = new IConnector() {
+ public boolean updateRelation() {
+ if (pi == null) {
+ return false;
+ }
+ if (pi.refEntityInfo == null || pi.refEntityInfo2 == null) {
+ return false;
+ }
+ if (pi.refEntityInfo.mappedBy == null && pi.refEntityInfo2.mappedBy == null) {
+ if (pi.refEntityInfo.refType == RefType.ONE2ONE) {
+ if (pi.refEntityInfo2.refType == RefType.ONE2ONE) {
+ pi.refEntityInfo.refType = RefType.ONE2ONE;
+ pi.refEntityInfo.mappedBy = pi.fieldId2;
+ pi.refEntityInfo2.refType = RefType.ONE2ONE;
+ pi.refEntityInfo2.mappedBy = pi.fieldId;
+ }
+ else if (pi.refEntityInfo2.refType == RefType.ONE2MANY) {
+ pi.refEntityInfo.refType = RefType.MANY2ONE;
+ pi.refEntityInfo.mappedBy = pi.fieldId2;
+ pi.refEntityInfo2.refType = RefType.ONE2MANY;
+ pi.refEntityInfo2.mappedBy = pi.fieldId;
+ }
+ }
+ else if (pi.refEntityInfo.refType == RefType.ONE2MANY) {
+ if (pi.refEntityInfo2.refType == RefType.ONE2ONE) {
+ pi.refEntityInfo.refType = RefType.ONE2MANY;
+ pi.refEntityInfo.mappedBy = pi.fieldId2;
+ pi.refEntityInfo2.refType = RefType.MANY2ONE;
+ pi.refEntityInfo2.mappedBy = pi.fieldId;
+ }
+ }
+ }
+ return true;
+ }
+ };
+ ep.setConnector(simpleRelConnector);
+ ep.enumEntityPairs();
+ // 2)
+ // second - try to assign - ManyToMany
+ // remember - here prefer other mapping type to ManyToMany
+ IConnector m2mRelConnector = new IConnector() {
+ public boolean updateRelation() {
+ if (pi == null) {
+ return false;
+ }
+ if (pi.refEntityInfo == null || pi.refEntityInfo2 == null) {
+ return false;
+ }
+ if (pi.refEntityInfo.mappedBy == null && pi.refEntityInfo2.mappedBy == null) {
+ if (pi.refEntityInfo.refType == RefType.ONE2MANY) {
+ if (pi.refEntityInfo2.refType == RefType.ONE2MANY) {
+ if (pi.refEntityInfo2.mappedBy == null) {
+ pi.refEntityInfo.refType = RefType.MANY2MANY;
+ pi.refEntityInfo.mappedBy = pi.fieldId2;
+ pi.refEntityInfo2.refType = RefType.MANY2MANY;
+ pi.refEntityInfo2.mappedBy = pi.fieldId;
+ }
+ }
+ }
+ }
+ return true;
+ }
+ };
+ ep.setConnector(m2mRelConnector);
+ ep.enumEntityPairs();
+ // update import flags
+ it = mapCUs_Info.entrySet().iterator();
+ while (it.hasNext()) {
+ Map.Entry<String, EntityInfo> entry = it.next();
+ EntityInfo entryInfo = entry.getValue();
+ Iterator<Map.Entry<String, RefEntityInfo>> referencesIt =
+ entryInfo.getReferences().entrySet().iterator();
+ boolean isOne2One = false;
+ boolean isOne2Many = false;
+ boolean isMany2One = false;
+ boolean isMany2Many = false;
+ for ( ; referencesIt.hasNext(); ) {
+ Map.Entry<String, RefEntityInfo> entry2 = referencesIt.next();
+ RefEntityInfo refEntityInfo = entry2.getValue();
+ if (refEntityInfo != null) {
+ if (refEntityInfo.refType == RefType.ONE2ONE && !refEntityInfo.resolvedAnnotationName) {
+ isOne2One = true;
+ }
+ else if (refEntityInfo.refType == RefType.ONE2MANY && !refEntityInfo.resolvedAnnotationName) {
+ isOne2Many = true;
+ }
+ else if (refEntityInfo.refType == RefType.MANY2ONE && !refEntityInfo.resolvedAnnotationName) {
+ isMany2One = true;
+ }
+ else if (refEntityInfo.refType == RefType.MANY2MANY && !refEntityInfo.resolvedAnnotationName) {
+ isMany2Many = true;
+ }
+ }
+ }
+ if (isOne2One) {
+ entryInfo.addRequiredImport(JPAConst.IMPORT_ONE2ONE);
+ }
+ if (isOne2Many) {
+ entryInfo.addRequiredImport(JPAConst.IMPORT_ONE2MANY);
+ }
+ if (isMany2One) {
+ entryInfo.addRequiredImport(JPAConst.IMPORT_MANY2ONE);
+ }
+ if (isMany2Many) {
+ entryInfo.addRequiredImport(JPAConst.IMPORT_MANY2MANY);
+ }
+ }
+ // re-generate RefFieldInfoMap (for simple process)
+ it = mapCUs_Info.entrySet().iterator();
+ while (it.hasNext()) {
+ Map.Entry<String, EntityInfo> entry = it.next();
+ EntityInfo entryInfo = entry.getValue();
+ entryInfo.generateRefFieldInfoMap();
+ }
+ // if the parent has primary id - child should not generate it
+ it = mapCUs_Info.entrySet().iterator();
+ while (it.hasNext()) {
+ Map.Entry<String, EntityInfo> entry = it.next();
+ EntityInfo entryInfo = entry.getValue();
+ adjustParentId(entryInfo);
+ }
+ }
+
+ public void adjustParentId(EntityInfo ei) {
+ if (ei == null) {
+ return;
+ }
+ EntityInfo parentEI = mapCUs_Info.get(ei.getFullyQualifiedParentName());
+ adjustParentId(parentEI);
+ ei.adjustPrimaryId(parentEI);
+ }
+
+ public void collect(String fullyQualifiedName) {
+
+ if (fullyQualifiedName == null) {
+ return;
+ }
+ if (mapCUs_Info.containsKey(fullyQualifiedName)) {
+ return;
+ }
+ ICompilationUnit icu = Utils.findCompilationUnit(javaProject, fullyQualifiedName);
+ collect(icu);
+ }
+
+ public void collect(ICompilationUnit icu) {
+
+ if (icu == null) {
+ return;
+ }
+ org.eclipse.jdt.core.dom.CompilationUnit cu = Utils.getCompilationUnit(icu, true);
+ String fullyQualifiedName = cu.getTypeRoot().findPrimaryType().getFullyQualifiedName();
+ if (mapCUs_Info.containsKey(fullyQualifiedName)) {
+ return;
+ }
+ CollectEntityInfo finder = new CollectEntityInfo();
+ cu.accept(finder);
+ EntityInfo result = finder.getEntityInfo();
+ result.adjustParameters();
+ if (result != null) {
+ mapCUs_Info.put(fullyQualifiedName, result);
+ }
+ Iterator<String> it = result.getDependences();
+ while (it.hasNext()) {
+ String fullyQualifiedNameTmp = it.next();
+ collect(fullyQualifiedNameTmp);
+ }
+ }
+
+ public Map<String, EntityInfo> getMapCUs_Info() {
+ return mapCUs_Info;
+ }
+}
Added: trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/jpa/collect/CollectEntityInfo.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/jpa/collect/CollectEntityInfo.java (rev 0)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/jpa/collect/CollectEntityInfo.java 2008-10-16 10:41:47 UTC (rev 10877)
@@ -0,0 +1,348 @@
+/*******************************************************************************
+ * Copyright (c) 2007-2008 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributor:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.hibernate.eclipse.jdt.ui.internal.jpa.collect;
+
+import java.util.Iterator;
+import java.util.List;
+
+import org.eclipse.jdt.core.JavaModelException;
+import org.eclipse.jdt.core.dom.Annotation;
+import org.eclipse.jdt.core.dom.ASTNode;
+import org.eclipse.jdt.core.dom.ASTVisitor;
+import org.eclipse.jdt.core.dom.ArrayType;
+import org.eclipse.jdt.core.dom.CompilationUnit;
+import org.eclipse.jdt.core.dom.FieldDeclaration;
+import org.eclipse.jdt.core.dom.ITypeBinding;
+import org.eclipse.jdt.core.dom.ImportDeclaration;
+import org.eclipse.jdt.core.dom.MarkerAnnotation;
+import org.eclipse.jdt.core.dom.MemberValuePair;
+import org.eclipse.jdt.core.dom.MethodDeclaration;
+import org.eclipse.jdt.core.dom.Modifier;
+import org.eclipse.jdt.core.dom.NormalAnnotation;
+import org.eclipse.jdt.core.dom.ParameterizedType;
+import org.eclipse.jdt.core.dom.PrimitiveType;
+import org.eclipse.jdt.core.dom.QualifiedType;
+import org.eclipse.jdt.core.dom.SimpleType;
+import org.eclipse.jdt.core.dom.Type;
+import org.eclipse.jdt.core.dom.TypeDeclaration;
+import org.eclipse.jdt.core.dom.VariableDeclarationFragment;
+import org.eclipse.jdt.core.dom.WildcardType;
+import org.eclipse.jdt.internal.core.BinaryType;
+import org.eclipse.jdt.internal.core.SourceType;
+import org.hibernate.eclipse.console.HibernateConsolePlugin;
+import org.hibernate.eclipse.jdt.ui.internal.jpa.common.EntityInfo;
+import org.hibernate.eclipse.jdt.ui.internal.jpa.common.JPAConst;
+import org.hibernate.eclipse.jdt.ui.internal.jpa.common.RefType;
+
+/**
+ *
+ *
+ * @author Vitali
+ */
+public class CollectEntityInfo extends ASTVisitor {
+
+ protected EntityInfo entityInfo = new EntityInfo();
+
+ public EntityInfo getEntityInfo() {
+ return entityInfo;
+ }
+
+ public boolean visit(CompilationUnit node) {
+ entityInfo.setFullyQualifiedName(
+ node.getTypeRoot().findPrimaryType().getFullyQualifiedName());
+ if (node.getProblems().length > 0) {
+ entityInfo.setCompilerProblemsFlag(true);
+ }
+ return true;
+ }
+
+ public boolean visit(MarkerAnnotation node) {
+ return processAnnotation(node, null);
+ }
+
+ public boolean visit(NormalAnnotation node) {
+ // try to extract mapping prompts
+ String mappedBy = null;
+ Iterator it = node.values().iterator();
+ while (it.hasNext()) {
+ MemberValuePair mvp = (MemberValuePair)it.next();
+ if ("mappedBy".equals(mvp.getName().toString())) { //$NON-NLS-1$
+ mappedBy = mvp.getValue().toString().replaceAll("\"", ""); //$NON-NLS-1$ //$NON-NLS-2$
+ break;
+ }
+ }
+ return processAnnotation(node, mappedBy);
+ }
+
+ public boolean processAnnotation(Annotation node, String mappedBy) {
+ String fullyQualifiedName = node.getTypeName().getFullyQualifiedName();
+ if (JPAConst.isAnnotationEntity(fullyQualifiedName)) {
+ ITypeBinding tb = node.resolveTypeBinding();
+ CompilationUnit cu = null;
+ ASTNode astNode = node.getParent();
+ if (astNode instanceof TypeDeclaration) {
+ astNode = astNode.getParent();
+ if (astNode instanceof CompilationUnit) {
+ cu = (CompilationUnit)astNode;
+ }
+ }
+ if (cu != null) {
+ entityInfo.setAddEntityFlag(false);
+ if (tb == null) {
+ entityInfo.addRequiredImport(JPAConst.IMPORT_ENTITY);
+ }
+ }
+ }
+ else if (JPAConst.isAnnotationId(fullyQualifiedName)) {
+ ITypeBinding tb = node.resolveTypeBinding();
+ CompilationUnit cu = null;
+ ASTNode astNode = node.getParent();
+ if (astNode instanceof FieldDeclaration ||
+ astNode instanceof MethodDeclaration) {
+ astNode = astNode.getParent();
+ if (astNode instanceof TypeDeclaration) {
+ astNode = astNode.getParent();
+ if (astNode instanceof CompilationUnit) {
+ cu = (CompilationUnit)astNode;
+ }
+ }
+ }
+ if (cu != null) {
+ if (tb == null) {
+ entityInfo.addRequiredImport(JPAConst.IMPORT_ID);
+ }
+ entityInfo.setAddPrimaryIdFlag(false);
+ }
+ }
+ else if (JPAConst.isAnnotationGeneratedValue(fullyQualifiedName)) {
+ ITypeBinding tb = node.resolveTypeBinding();
+ CompilationUnit cu = null;
+ ASTNode astNode = node.getParent();
+ if (astNode instanceof FieldDeclaration ||
+ astNode instanceof MethodDeclaration) {
+ astNode = astNode.getParent();
+ if (astNode instanceof TypeDeclaration) {
+ astNode = astNode.getParent();
+ if (astNode instanceof CompilationUnit) {
+ cu = (CompilationUnit)astNode;
+ }
+ }
+ }
+ if (cu != null) {
+ if (tb == null) {
+ entityInfo.addRequiredImport(JPAConst.IMPORT_GENERATED_VALUE);
+ }
+ entityInfo.setAddGeneratedValueFlag(false);
+ }
+ }
+ else if (JPAConst.isAnnotationOne2One(fullyQualifiedName)) {
+ updateAnnotationRelInfo(node, mappedBy, fullyQualifiedName,
+ RefType.ONE2ONE, JPAConst.ANNOTATION_ONE2ONE, JPAConst.IMPORT_ONE2ONE);
+ }
+ else if (JPAConst.isAnnotationOne2Many(fullyQualifiedName)) {
+ updateAnnotationRelInfo(node, mappedBy, fullyQualifiedName,
+ RefType.ONE2MANY, JPAConst.ANNOTATION_ONE2MANY, JPAConst.IMPORT_ONE2MANY);
+ }
+ else if (JPAConst.isAnnotationMany2One(fullyQualifiedName)) {
+ updateAnnotationRelInfo(node, mappedBy, fullyQualifiedName,
+ RefType.MANY2ONE, JPAConst.ANNOTATION_MANY2ONE, JPAConst.IMPORT_MANY2ONE);
+ }
+ else if (JPAConst.isAnnotationMany2Many(fullyQualifiedName)) {
+ updateAnnotationRelInfo(node, mappedBy, fullyQualifiedName,
+ RefType.MANY2MANY, JPAConst.ANNOTATION_MANY2MANY, JPAConst.IMPORT_MANY2MANY);
+ }
+ return true;
+ }
+
+ public void updateAnnotationRelInfo(Annotation node, String mappedBy, String fullyQualifiedName,
+ RefType type, String annNameShort, String annNameFull) {
+ ITypeBinding tb = node.resolveTypeBinding();
+ CompilationUnit cu = null;
+ ASTNode astNode = node.getParent();
+ if (astNode instanceof FieldDeclaration) {
+ FieldDeclaration fd = (FieldDeclaration)astNode;
+ Iterator itVarNames = fd.fragments().iterator();
+ while (itVarNames.hasNext()) {
+ VariableDeclarationFragment var = (VariableDeclarationFragment)itVarNames.next();
+ String name = var.getName().getIdentifier();
+ entityInfo.updateReference(name, true, type, mappedBy,
+ 0 != annNameShort.compareTo(fullyQualifiedName));
+ }
+ astNode = astNode.getParent();
+ if (astNode instanceof TypeDeclaration) {
+ astNode = astNode.getParent();
+ if (astNode instanceof CompilationUnit) {
+ cu = (CompilationUnit)astNode;
+ }
+ }
+ }
+ if (cu != null) {
+ if (tb == null) {
+ entityInfo.addRequiredImport(annNameFull);
+ }
+ }
+ }
+
+ public boolean visit(ImportDeclaration node) {
+ String name = node.getName().getFullyQualifiedName();
+ for (int i = 0; i < JPAConst.ALL_IMPORTS.size(); i++) {
+ String tmp = JPAConst.ALL_IMPORTS.get(i);
+ if (tmp.compareTo(name) == 0) {
+ entityInfo.addExistingImport(name);
+ break;
+ }
+ }
+ return true;
+ }
+
+ public boolean visit(Modifier node) {
+ if (node.isAbstract()) {
+ entityInfo.setAbstractFlag(true);
+ }
+ return true;
+ }
+
+ public boolean visit(TypeDeclaration node) {
+ entityInfo.setAbstractFlag(entityInfo.isAbstractFlag() || node.isInterface());
+ entityInfo.setInterfaceFlag(node.isInterface());
+ Type superType = node.getSuperclassType();
+ if (superType != null) {
+ ITypeBinding tb = superType.resolveBinding();
+ String entityFullyQualifiedName = ""; //$NON-NLS-1$
+ if (tb.getJavaElement() instanceof SourceType) {
+ SourceType sourceT = (SourceType)tb.getJavaElement();
+ try {
+ entityFullyQualifiedName = sourceT.getFullyQualifiedParameterizedName();
+ } catch (JavaModelException e) {
+ HibernateConsolePlugin.getDefault().logErrorMessage("error", e);
+ }
+ }
+ entityInfo.addDependency(entityFullyQualifiedName);
+ entityInfo.setFullyQualifiedParentName(entityFullyQualifiedName);
+ }
+ List superInterfaces = node.superInterfaceTypes();
+ Iterator it = superInterfaces.iterator();
+ while (it.hasNext()) {
+ Object obj = it.next();
+ if (obj instanceof SimpleType) {
+ SimpleType st = (SimpleType)obj;
+ String fullyQualifiedName = st.getName().getFullyQualifiedName();
+ if (JPAConst.IMPORT_SERIALIZABLE.compareTo(fullyQualifiedName) == 0) {
+ entityInfo.setAddSerializableInterfaceFlag(false);
+ }
+ else if (JPAConst.ANNOTATION_SERIALIZABLE.compareTo(fullyQualifiedName) == 0) {
+ entityInfo.setAddSerializableInterfaceFlag(false);
+ entityInfo.addRequiredImport(JPAConst.IMPORT_SERIALIZABLE);
+ }
+ }
+ }
+ ITypeBinding tb = node.resolveBinding();
+ return true;
+ }
+
+ public boolean visit(MethodDeclaration node) {
+ if (node.getName().getFullyQualifiedName().compareTo(entityInfo.getName()) == 0) {
+ // this is constructor declaration - process it
+ entityInfo.setImplicitConstructorFlag(false);
+ if (node.parameters().size() == 0) {
+ entityInfo.setDefaultConstructorFlag(true);
+ }
+ }
+ return true;
+ }
+
+ public boolean visit(FieldDeclaration node) {
+ if (node.getType().isPrimitiveType()) {
+ PrimitiveType pt = (PrimitiveType)node.getType();
+ ITypeBinding tb = pt.resolveBinding();
+ } else if (node.getType().isSimpleType()) {
+ SimpleType st = (SimpleType)node.getType();
+ ITypeBinding tb = st.resolveBinding();
+ String entityFullyQualifiedName = ""; //$NON-NLS-1$
+ if (tb.getJavaElement() instanceof SourceType) {
+ SourceType sourceT = (SourceType)tb.getJavaElement();
+ try {
+ entityFullyQualifiedName = sourceT.getFullyQualifiedParameterizedName();
+ } catch (JavaModelException e) {
+ HibernateConsolePlugin.getDefault().logErrorMessage("JavaModelException: ", e); //$NON-NLS-1$
+ }
+ entityInfo.addDependency(entityFullyQualifiedName);
+ Iterator itVarNames = node.fragments().iterator();
+ while (itVarNames.hasNext()) {
+ VariableDeclarationFragment var = (VariableDeclarationFragment)itVarNames.next();
+ String name = var.getName().getIdentifier();
+ entityInfo.addReference(name, entityFullyQualifiedName, RefType.ONE2ONE);
+ }
+ }
+ else if (tb.getJavaElement() instanceof BinaryType) {
+ ITypeBinding tbParent = tb.getTypeDeclaration().getSuperclass();
+ if (tbParent != null && "java.lang.Number".equals(tbParent.getBinaryName())) { //$NON-NLS-1$
+ // this is candidate for primary id
+ Iterator itVarNames = node.fragments().iterator();
+ while (itVarNames.hasNext()) {
+ VariableDeclarationFragment var = (VariableDeclarationFragment)itVarNames.next();
+ String name = var.getName().getIdentifier();
+ entityInfo.addPrimaryIdCandidate(name);
+ }
+ }
+ }
+ } else if (node.getType().isArrayType()) {
+ ArrayType at = (ArrayType)node.getType();
+ ITypeBinding tb = at.resolveBinding();
+ } else if (node.getType().isParameterizedType()) {
+ ParameterizedType pt = (ParameterizedType)node.getType();
+ Type type = (Type)pt.getType();
+ ITypeBinding tb = type.resolveBinding();
+ ITypeBinding[] interfaces = tb.getTypeDeclaration().getInterfaces();
+ String fullyQualifiedNameTypeName = ""; //$NON-NLS-1$
+ for (int i = 0; i < interfaces.length; i++) {
+ if (interfaces[i].getJavaElement() instanceof BinaryType) {
+ BinaryType binaryT = (BinaryType)interfaces[i].getJavaElement();
+ String tmp = binaryT.getFullyQualifiedName('.');
+ if (0 == "java.util.Collection".compareTo(tmp)) { //$NON-NLS-1$
+ fullyQualifiedNameTypeName = tmp;
+ break;
+ }
+ }
+ }
+ if (fullyQualifiedNameTypeName.length() > 0) {
+ Iterator typeArgsIt = pt.typeArguments().iterator();
+ while (typeArgsIt.hasNext()) {
+ type = (Type)typeArgsIt.next();
+ tb = type.resolveBinding();
+ String entityFullyQualifiedName = ""; //$NON-NLS-1$
+ if (tb.getJavaElement() instanceof SourceType) {
+ SourceType sourceT = (SourceType)tb.getJavaElement();
+ try {
+ entityFullyQualifiedName = sourceT.getFullyQualifiedParameterizedName();
+ } catch (JavaModelException e) {
+ HibernateConsolePlugin.getDefault().logErrorMessage("JavaModelException: ", e); //$NON-NLS-1$
+ }
+ entityInfo.addDependency(entityFullyQualifiedName);
+ Iterator itVarNames = node.fragments().iterator();
+ while (itVarNames.hasNext()) {
+ VariableDeclarationFragment var = (VariableDeclarationFragment)itVarNames.next();
+ String name = var.getName().getIdentifier();
+ entityInfo.addReference(name, entityFullyQualifiedName, RefType.ONE2MANY);
+ }
+ }
+ }
+ }
+ } else if (node.getType().isQualifiedType()) {
+ QualifiedType qt = (QualifiedType)node.getType();
+ ITypeBinding tb = qt.resolveBinding();
+ } else if (node.getType().isWildcardType()) {
+ WildcardType wt = (WildcardType)node.getType();
+ ITypeBinding tb = wt.resolveBinding();
+ }
+ return true;
+ }
+}
Added: trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/jpa/common/EntityInfo.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/jpa/common/EntityInfo.java (rev 0)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/jpa/common/EntityInfo.java 2008-10-16 10:41:47 UTC (rev 10877)
@@ -0,0 +1,380 @@
+/*******************************************************************************
+ * Copyright (c) 2007-2008 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributor:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.hibernate.eclipse.jdt.ui.internal.jpa.common;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.TreeMap;
+import java.util.TreeSet;
+
+/**
+ *
+ *
+ * @author Vitali
+ */
+public class EntityInfo {
+
+ /*
+ * fully qualified entity name
+ */
+ protected String fullyQualifiedName = ""; //$NON-NLS-1$
+ /*
+ * fully qualified parent name
+ */
+ protected String fullyQualifiedParentName = ""; //$NON-NLS-1$
+ /*
+ * true in case of compiler problems
+ */
+ protected boolean compilerProblemsFlag = false;
+ /*
+ * true in case of implicit constructor
+ */
+ protected boolean implicitConstructorFlag = true;
+ /*
+ * true in case of default constructor
+ */
+ protected boolean defaultConstructorFlag = false;
+ /*
+ * if true - "@Entity" annotation should be added
+ */
+ protected boolean addEntityFlag = true;
+ /*
+ * existing imports set
+ */
+ protected Set<String> setExistingImports = new TreeSet<String>();
+ /*
+ * required imports set
+ */
+ protected Set<String> setRequiredImports = new TreeSet<String>();
+ /*
+ * if true - "implements java.io.Serializable" or
+ * "implements Serializable" should be added
+ */
+ protected boolean addSerializableInterfaceFlag = true;
+ /*
+ * if true - this is abstract class declaration
+ */
+ protected boolean isAbstractFlag = false;
+ /*
+ * if true - this is interface declaration
+ */
+ protected boolean isInterfaceFlag = false;
+ /*
+ * paths to entity java files which has a reference from current entity
+ */
+ protected Set<String> dependences = new TreeSet<String>();
+ /*
+ * reference to primary id property
+ */
+ protected String primaryIdName = ""; //$NON-NLS-1$
+ /*
+ * if true - add primary id marker for primaryIdName
+ */
+ protected boolean addPrimaryIdFlag = true;
+ /*
+ * if true - add generated value marker for primaryIdName
+ */
+ protected boolean addGeneratedValueFlag = true;
+ /*
+ * define relations between entities
+ * field id -> RefEntityInfo
+ */
+ protected Map<String, RefEntityInfo> references = new TreeMap<String, RefEntityInfo>();
+ /*
+ * fully qualified entity name -> Set<RefFieldInfo>
+ * this is generated from references map for easy information get
+ */
+ protected Map<String, Set<RefFieldInfo>> mapRefFieldInfo = null;
+ /*
+ */
+ protected List<String> primaryIdCandidates = new ArrayList<String>();
+
+ public void generateRefFieldInfoMap() {
+ mapRefFieldInfo = new TreeMap<String, Set<RefFieldInfo>>();
+ Iterator<Map.Entry<String, RefEntityInfo>> referencesIt =
+ getReferences().entrySet().iterator();
+ while (referencesIt.hasNext()) {
+ Map.Entry<String, RefEntityInfo> entry = referencesIt.next();
+ RefEntityInfo refEntityInfo = entry.getValue();
+ Set<RefFieldInfo> fieldInfoSet = null;
+ if (mapRefFieldInfo.containsKey(refEntityInfo.fullyQualifiedName)) {
+ fieldInfoSet = mapRefFieldInfo.get(refEntityInfo.fullyQualifiedName);
+ }
+ else {
+ fieldInfoSet = new TreeSet<RefFieldInfo>();
+ }
+ RefFieldInfo fieldInfo = new RefFieldInfo(entry.getKey(), refEntityInfo.refType);
+ fieldInfoSet.add(fieldInfo);
+ mapRefFieldInfo.put(refEntityInfo.fullyQualifiedName, fieldInfoSet);
+ }
+ referencesIt = null;
+ }
+
+ public void adjustPrimaryId(EntityInfo parentEI) {
+ if (parentEI != null) {
+ String parentPrimaryIdName = parentEI.getPrimaryIdName();
+ if (parentPrimaryIdName != null && parentPrimaryIdName.length() > 0) {
+ primaryIdName = ""; //$NON-NLS-1$
+ }
+ }
+ if (isAddPrimaryIdFlag()) {
+ setAddPrimaryIdFlag(primaryIdName.length() > 0);
+ if (isAddPrimaryIdFlag()) {
+ addRequiredImport(JPAConst.IMPORT_ID);
+ }
+ }
+ if (isAddGeneratedValueFlag()) {
+ setAddGeneratedValueFlag(primaryIdName.length() > 0);
+ if (isAddGeneratedValueFlag()) {
+ addRequiredImport(JPAConst.IMPORT_GENERATED_VALUE);
+ }
+ }
+ }
+
+ public RefType getFieldIdRelValue(String fieldId) {
+ if (references == null || !references.containsKey(fieldId)) {
+ return RefType.UNDEF;
+ }
+ return references.get(fieldId).refType;
+ }
+
+ public boolean getFieldIdAnnotatedValue(String fieldId) {
+ if (references == null || !references.containsKey(fieldId)) {
+ return false;
+ }
+ return references.get(fieldId).annotated;
+ }
+
+ public String getFieldIdFQNameValue(String fieldId) {
+ if (references == null || !references.containsKey(fieldId)) {
+ return ""; //$NON-NLS-1$
+ }
+ return references.get(fieldId).fullyQualifiedName;
+ }
+
+ public RefEntityInfo getFieldIdRefEntityInfo(String fieldId) {
+ if (references == null || !references.containsKey(fieldId)) {
+ return null;
+ }
+ return references.get(fieldId);
+ }
+
+ public void adjustParameters() {
+ if (isImplicitConstructorFlag() == true || isDefaultConstructorFlag() == true) {
+ setAddSerializableInterfaceFlag(false);
+ }
+ else {
+ addRequiredImport(JPAConst.IMPORT_SERIALIZABLE);
+ }
+ if (isAddEntityFlag()) {
+ addRequiredImport(JPAConst.IMPORT_ENTITY);
+ }
+ // try to intellectually get primary id
+ primaryIdName = null;
+ String entityName = getName().toLowerCase();
+ Iterator<String> it = primaryIdCandidates.iterator();
+ while (it.hasNext()) {
+ String name = it.next();
+ String check = name.toLowerCase();
+ if ("id".equalsIgnoreCase(check)) { //$NON-NLS-1$
+ primaryIdName = name;
+ break;
+ }
+ else if (check.indexOf("id") != -1 && check.indexOf(entityName) != -1) { //$NON-NLS-1$
+ if (primaryIdName == null) {
+ primaryIdName = name;
+ }
+ else if (primaryIdName.length() > name.length()) {
+ primaryIdName = name;
+ }
+ }
+ else if (check.indexOf("id") != -1) { //$NON-NLS-1$
+ if (primaryIdName == null) {
+ primaryIdName = name;
+ }
+ else if (primaryIdName.toLowerCase().indexOf(entityName) == -1 &&
+ primaryIdName.length() > name.length()) {
+ primaryIdName = name;
+ }
+ }
+ }
+ if (primaryIdName == null) {
+ primaryIdName = ""; //$NON-NLS-1$
+ }
+ }
+
+ public String getName() {
+ String[] arr = fullyQualifiedName.split("\\."); //$NON-NLS-1$
+ if (arr.length > 0) {
+ return arr[arr.length - 1];
+ }
+ return ""; //$NON-NLS-1$
+ }
+
+ public String getFullyQualifiedName() {
+ return fullyQualifiedName;
+ }
+
+ public void setFullyQualifiedName(String fullyQualifiedName) {
+ this.fullyQualifiedName = fullyQualifiedName;
+ }
+
+ public String getFullyQualifiedParentName() {
+ return fullyQualifiedParentName;
+ }
+
+ public void setFullyQualifiedParentName(String fullyQualifiedParentName) {
+ this.fullyQualifiedParentName = fullyQualifiedParentName;
+ }
+
+ public boolean isCompilerProblemsFlag() {
+ return compilerProblemsFlag;
+ }
+
+ public void setCompilerProblemsFlag(boolean compilerProblemsFlag) {
+ this.compilerProblemsFlag = compilerProblemsFlag;
+ }
+
+ public boolean isImplicitConstructorFlag() {
+ return implicitConstructorFlag;
+ }
+
+ public void setImplicitConstructorFlag(boolean implicitConstructorFlag) {
+ this.implicitConstructorFlag = implicitConstructorFlag;
+ }
+
+ public boolean isDefaultConstructorFlag() {
+ return defaultConstructorFlag;
+ }
+
+ public void setDefaultConstructorFlag(boolean defaultConstructorFlag) {
+ this.defaultConstructorFlag = defaultConstructorFlag;
+ }
+
+ public boolean isAddEntityFlag() {
+ return addEntityFlag;
+ }
+
+ public void setAddEntityFlag(boolean addEntityFlag) {
+ this.addEntityFlag = addEntityFlag;
+ }
+
+ public boolean isAddSerializableInterfaceFlag() {
+ return addSerializableInterfaceFlag;
+ }
+
+ public void setAddSerializableInterfaceFlag(boolean addSerializableInterfaceFlag) {
+ this.addSerializableInterfaceFlag = addSerializableInterfaceFlag;
+ }
+
+ public boolean isAbstractFlag() {
+ return isAbstractFlag;
+ }
+
+ public void setAbstractFlag(boolean isAbstractFlag) {
+ this.isAbstractFlag = isAbstractFlag;
+ }
+
+ public boolean isInterfaceFlag() {
+ return isInterfaceFlag;
+ }
+
+ public void setInterfaceFlag(boolean isInterfaceFlag) {
+ this.isInterfaceFlag = isInterfaceFlag;
+ }
+
+ public String getPrimaryIdName() {
+ return primaryIdName;
+ }
+
+ public void setPrimaryIdName(String primaryIdName) {
+ this.primaryIdName = primaryIdName;
+ }
+
+ public Map<String, RefEntityInfo> getReferences() {
+ return references;
+ }
+
+ public void addReference(String fieldId, String fullyQualifiedName, RefType refType) {
+ references.put(fieldId, new RefEntityInfo(fullyQualifiedName, refType));
+ }
+
+ public void updateReference(String fieldId, boolean annotated, RefType refType, String mappedBy,
+ boolean resolvedAnnotationName) {
+ RefEntityInfo rei = references.get(fieldId);
+ if (rei != null) {
+ rei.annotated = annotated;
+ rei.refType = refType;
+ rei.mappedBy = mappedBy;
+ rei.resolvedAnnotationName = resolvedAnnotationName;
+ }
+ }
+
+ public Set<RefFieldInfo> getRefFieldInfoSet(String fullyQualifiedName) {
+ if (mapRefFieldInfo == null) {
+ return null;
+ }
+ return mapRefFieldInfo.get(fullyQualifiedName);
+ }
+
+ public Iterator<String> getDependences() {
+ return dependences.iterator();
+ }
+
+ public void addDependency(String entityFullyQualifiedName) {
+ dependences.add(entityFullyQualifiedName);
+ }
+
+ public void addPrimaryIdCandidate(String name) {
+ if (name != null && name.length() > 0) {
+ primaryIdCandidates.add(name);
+ }
+ }
+
+ public boolean isAddPrimaryIdFlag() {
+ return addPrimaryIdFlag;
+ }
+
+ public void setAddPrimaryIdFlag(boolean addPrimaryIdFlag) {
+ this.addPrimaryIdFlag = addPrimaryIdFlag;
+ }
+
+ public boolean isAddGeneratedValueFlag() {
+ return addGeneratedValueFlag;
+ }
+
+ public void setAddGeneratedValueFlag(boolean addGeneratedValueFlag) {
+ this.addGeneratedValueFlag = addGeneratedValueFlag;
+ }
+
+ public void addExistingImport(String existingImport) {
+ setExistingImports.add(existingImport);
+ }
+
+ public void removeExistingImport(String existingImport) {
+ setExistingImports.remove(existingImport);
+ }
+
+ public void addRequiredImport(String requiredImport) {
+ setRequiredImports.add(requiredImport);
+ }
+
+ public void removeRequiredImport(String requiredImport) {
+ setRequiredImports.remove(requiredImport);
+ }
+
+ public boolean needImport(String checkImport) {
+ return (!setExistingImports.contains(checkImport) && setRequiredImports.contains(checkImport));
+ }
+}
Added: trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/jpa/common/JPAConst.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/jpa/common/JPAConst.java (rev 0)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/jpa/common/JPAConst.java 2008-10-16 10:41:47 UTC (rev 10877)
@@ -0,0 +1,109 @@
+package org.hibernate.eclipse.jdt.ui.internal.jpa.common;
+
+import java.util.Vector;
+
+public class JPAConst {
+
+ static public String IMPORT_SERIALIZABLE = "java.io.Serializable"; //$NON-NLS-1$
+ static public String IMPORT_ENTITY = "javax.persistence.Entity"; //$NON-NLS-1$
+ static public String IMPORT_GENERATED_VALUE = "javax.persistence.GeneratedValue"; //$NON-NLS-1$
+ static public String IMPORT_ID = "javax.persistence.Id"; //$NON-NLS-1$
+ static public String IMPORT_ONE2ONE = "javax.persistence.OneToOne"; //$NON-NLS-1$
+ static public String IMPORT_ONE2MANY = "javax.persistence.OneToMany"; //$NON-NLS-1$
+ static public String IMPORT_MANY2ONE = "javax.persistence.ManyToOne"; //$NON-NLS-1$
+ static public String IMPORT_MANY2MANY = "javax.persistence.ManyToMany"; //$NON-NLS-1$
+
+ static public String ANNOTATION_SERIALIZABLE = "Serializable"; //$NON-NLS-1$
+ static public String ANNOTATION_ENTITY = "Entity"; //$NON-NLS-1$
+ static public String ANNOTATION_GENERATED_VALUE = "GeneratedValue"; //$NON-NLS-1$
+ static public String ANNOTATION_ID = "Id"; //$NON-NLS-1$
+ static public String ANNOTATION_ONE2ONE = "OneToOne"; //$NON-NLS-1$
+ static public String ANNOTATION_ONE2MANY = "OneToMany"; //$NON-NLS-1$
+ static public String ANNOTATION_MANY2ONE = "ManyToOne"; //$NON-NLS-1$
+ static public String ANNOTATION_MANY2MANY = "ManyToMany"; //$NON-NLS-1$
+
+ static public Vector<String> ALL_IMPORTS = new Vector<String>();
+
+ static {
+ //ALL_IMPORTS.add(IMPORT_SERIALIZABLE);
+ ALL_IMPORTS.add(IMPORT_ENTITY);
+ ALL_IMPORTS.add(IMPORT_GENERATED_VALUE);
+ ALL_IMPORTS.add(IMPORT_ID);
+ ALL_IMPORTS.add(IMPORT_ONE2ONE);
+ ALL_IMPORTS.add(IMPORT_ONE2MANY);
+ ALL_IMPORTS.add(IMPORT_MANY2ONE);
+ ALL_IMPORTS.add(IMPORT_MANY2MANY);
+ }
+
+ static public String getRefType(RefType refType) {
+ if (refType == RefType.ONE2ONE) {
+ return ANNOTATION_ONE2ONE;
+ }
+ else if (refType == RefType.ONE2MANY) {
+ return ANNOTATION_ONE2MANY;
+ }
+ else if (refType == RefType.MANY2ONE) {
+ return ANNOTATION_MANY2ONE;
+ }
+ else if (refType == RefType.MANY2MANY) {
+ return ANNOTATION_MANY2MANY;
+ }
+ return ""; //$NON-NLS-1$
+ }
+
+ static public boolean isAnnotationEntity(String fullyQualifiedName) {
+ if (ANNOTATION_ENTITY.compareTo(fullyQualifiedName) == 0 ||
+ IMPORT_ENTITY.compareTo(fullyQualifiedName) == 0) {
+ return true;
+ }
+ return false;
+ }
+
+ static public boolean isAnnotationId(String fullyQualifiedName) {
+ if (ANNOTATION_ID.compareTo(fullyQualifiedName) == 0 ||
+ IMPORT_ID.compareTo(fullyQualifiedName) == 0) {
+ return true;
+ }
+ return false;
+ }
+
+ static public boolean isAnnotationGeneratedValue(String fullyQualifiedName) {
+ if (ANNOTATION_GENERATED_VALUE.compareTo(fullyQualifiedName) == 0 ||
+ IMPORT_GENERATED_VALUE.compareTo(fullyQualifiedName) == 0) {
+ return true;
+ }
+ return false;
+ }
+
+ static public boolean isAnnotationOne2One(String fullyQualifiedName) {
+ if (ANNOTATION_ONE2ONE.compareTo(fullyQualifiedName) == 0 ||
+ IMPORT_ONE2ONE.compareTo(fullyQualifiedName) == 0) {
+ return true;
+ }
+ return false;
+ }
+
+ static public boolean isAnnotationOne2Many(String fullyQualifiedName) {
+ if (ANNOTATION_ONE2MANY.compareTo(fullyQualifiedName) == 0 ||
+ IMPORT_ONE2MANY.compareTo(fullyQualifiedName) == 0) {
+ return true;
+ }
+ return false;
+ }
+
+ static public boolean isAnnotationMany2One(String fullyQualifiedName) {
+ if (ANNOTATION_MANY2ONE.compareTo(fullyQualifiedName) == 0 ||
+ IMPORT_MANY2ONE.compareTo(fullyQualifiedName) == 0) {
+ return true;
+ }
+ return false;
+ }
+
+ static public boolean isAnnotationMany2Many(String fullyQualifiedName) {
+ if (ANNOTATION_MANY2MANY.compareTo(fullyQualifiedName) == 0 ||
+ IMPORT_MANY2MANY.compareTo(fullyQualifiedName) == 0) {
+ return true;
+ }
+ return false;
+ }
+}
Added: trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/jpa/common/RefEntityInfo.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/jpa/common/RefEntityInfo.java (rev 0)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/jpa/common/RefEntityInfo.java 2008-10-16 10:41:47 UTC (rev 10877)
@@ -0,0 +1,52 @@
+/*******************************************************************************
+ * Copyright (c) 2007-2008 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributor:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.hibernate.eclipse.jdt.ui.internal.jpa.common;
+
+/**
+ *
+ *
+ * @author Vitali
+ */
+public class RefEntityInfo implements Comparable<RefEntityInfo> {
+ /*
+ * fully qualified entity name
+ */
+ public String fullyQualifiedName;
+ /*
+ * ONE2ONE - one2one reference
+ * ONE2MANY - one2many reference
+ * MANY2ONE - many2one reference
+ * MANY2MANY - many2many reference
+ * so it be possible to resolve @OneToMany & @ManyToMany
+ */
+ public RefType refType;
+ /*
+ * mappedBy attribute for reference
+ */
+ public String mappedBy = null;
+ //
+ public boolean annotated = false;
+ //
+ public boolean resolvedAnnotationName = false;
+ //
+ public boolean hasGetter = false;
+ //
+ public boolean hasSetter = false;
+ //
+ public RefEntityInfo(String fullyQualifiedName, RefType refType) {
+ this.fullyQualifiedName = fullyQualifiedName;
+ this.refType = refType;
+ }
+
+ public int compareTo(RefEntityInfo rei) {
+ return fullyQualifiedName.compareTo(rei.fullyQualifiedName);
+ }
+}
Added: trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/jpa/common/RefFieldInfo.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/jpa/common/RefFieldInfo.java (rev 0)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/jpa/common/RefFieldInfo.java 2008-10-16 10:41:47 UTC (rev 10877)
@@ -0,0 +1,40 @@
+/*******************************************************************************
+ * Copyright (c) 2007-2008 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributor:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.hibernate.eclipse.jdt.ui.internal.jpa.common;
+
+/**
+ *
+ *
+ * @author Vitali
+ */
+public class RefFieldInfo implements Comparable<RefFieldInfo> {
+ /*
+ * field id
+ */
+ public String fieldId;
+ /*
+ * ONE2ONE - one2one reference
+ * ONE2MANY - one2many reference
+ * MANY2ONE - many2one reference
+ * MANY2MANY - many2many reference
+ * so it be possible to resolve @OneToMany & @ManyToMany
+ */
+ public RefType refType;
+ //
+ public RefFieldInfo(String fieldId, RefType refType) {
+ this.fieldId = fieldId;
+ this.refType = refType;
+ }
+
+ public int compareTo(RefFieldInfo rfi) {
+ return fieldId.compareTo(rfi.fieldId);
+ }
+}
Added: trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/jpa/common/RefType.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/jpa/common/RefType.java (rev 0)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/jpa/common/RefType.java 2008-10-16 10:41:47 UTC (rev 10877)
@@ -0,0 +1,24 @@
+/*******************************************************************************
+ * Copyright (c) 2007-2008 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributor:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.hibernate.eclipse.jdt.ui.internal.jpa.common;
+
+/**
+ *
+ *
+ * @author Vitali
+ */
+public enum RefType {
+ UNDEF,
+ ONE2ONE,
+ ONE2MANY,
+ MANY2ONE,
+ MANY2MANY,
+}
Added: trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/jpa/common/Utils.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/jpa/common/Utils.java (rev 0)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/jpa/common/Utils.java 2008-10-16 10:41:47 UTC (rev 10877)
@@ -0,0 +1,106 @@
+/*******************************************************************************
+ * Copyright (c) 2007-2008 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributor:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.hibernate.eclipse.jdt.ui.internal.jpa.common;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IWorkspaceRoot;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.jdt.core.IClassFile;
+import org.eclipse.jdt.core.ICompilationUnit;
+import org.eclipse.jdt.core.IJavaElement;
+import org.eclipse.jdt.core.IJavaProject;
+import org.eclipse.jdt.core.IPackageFragment;
+import org.eclipse.jdt.core.IType;
+import org.eclipse.jdt.core.JavaCore;
+import org.eclipse.jdt.core.JavaModelException;
+import org.eclipse.jdt.core.dom.AST;
+import org.eclipse.jdt.core.dom.ASTParser;
+import org.hibernate.eclipse.console.HibernateConsolePlugin;
+
+/**
+ *
+ *
+ * @author Vitali
+ */
+public class Utils {
+
+ static public org.eclipse.jdt.core.dom.CompilationUnit getCompilationUnit(
+ ICompilationUnit source, boolean bindings) {
+ ASTParser parser = ASTParser.newParser(AST.JLS3);
+ parser.setSource(source);
+ parser.setResolveBindings(bindings);
+ org.eclipse.jdt.core.dom.CompilationUnit result = (org.eclipse.jdt.core.dom.CompilationUnit) parser.createAST(null);
+ return result;
+ }
+
+ static public ICompilationUnit findCompilationUnit(IJavaProject javaProject,
+ String fullyQualifiedName) {
+ IType lwType = null;
+ try {
+ lwType = javaProject.findType(fullyQualifiedName);
+ } catch (JavaModelException e) {
+ HibernateConsolePlugin.getDefault().logErrorMessage("JavaModelException: ", e); //$NON-NLS-1$
+ }
+ ICompilationUnit resCompilationUnit = null;
+ if (lwType != null) {
+ resCompilationUnit = lwType.getCompilationUnit();
+ }
+ return resCompilationUnit;
+ }
+
+ static public ICompilationUnit findCompilationUnit(String fullyQualifiedName) {
+ IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
+ IProject[] projects = root.getProjects();
+ ICompilationUnit resCompilationUnit = null;
+ for (int i = 0; i < projects.length; i++) {
+ IJavaProject javaProject = JavaCore.create(projects[i]);
+ IType lwType = null;
+ try {
+ lwType = javaProject.findType(fullyQualifiedName);
+ } catch (JavaModelException e) {
+ HibernateConsolePlugin.getDefault().logErrorMessage("JavaModelException: ", e); //$NON-NLS-1$
+ }
+ if (lwType != null) {
+ resCompilationUnit = lwType.getCompilationUnit();
+ }
+ if (resCompilationUnit != null) {
+ break;
+ }
+ }
+ return resCompilationUnit;
+ }
+
+ static public ICompilationUnit[] findCompilationUnits(IJavaProject javaProject,
+ IPath path) {
+ IJavaElement javaElement = null;
+ try {
+ javaElement = javaProject.findElement(path.makeRelative());
+ } catch (JavaModelException e) {
+ HibernateConsolePlugin.getDefault().logErrorMessage("JavaModelException: ", e); //$NON-NLS-1$
+ }
+ ICompilationUnit[] res = null;
+ if (javaElement instanceof ICompilationUnit) {
+ res = new ICompilationUnit[]{ (ICompilationUnit)javaElement };
+ }
+ else if (javaElement instanceof IPackageFragment) {
+ try {
+ res = ((IPackageFragment)javaElement).getCompilationUnits();
+ } catch (JavaModelException e) {
+ HibernateConsolePlugin.getDefault().logErrorMessage("JavaModelException: ", e); //$NON-NLS-1$
+ }
+ }
+ else if (javaElement instanceof IClassFile) {
+ }
+ return res;
+ }
+
+}
Added: trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/jpa/process/AllEntitiesProcessor.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/jpa/process/AllEntitiesProcessor.java (rev 0)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/jpa/process/AllEntitiesProcessor.java 2008-10-16 10:41:47 UTC (rev 10877)
@@ -0,0 +1,312 @@
+/*******************************************************************************
+ * Copyright (c) 2007-2008 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributor:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.hibernate.eclipse.jdt.ui.internal.jpa.process;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.Map;
+
+import org.eclipse.core.filebuffers.FileBuffers;
+import org.eclipse.core.filebuffers.ITextFileBuffer;
+import org.eclipse.core.filebuffers.ITextFileBufferManager;
+import org.eclipse.core.filebuffers.LocationKind;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.jdt.core.ICompilationUnit;
+import org.eclipse.jdt.core.IJavaProject;
+import org.eclipse.jdt.core.JavaCore;
+import org.eclipse.jdt.core.JavaModelException;
+import org.eclipse.jdt.core.dom.AST;
+import org.eclipse.jdt.core.dom.rewrite.ASTRewrite;
+import org.eclipse.jdt.internal.ui.refactoring.RefactoringSaveHelper;
+import org.eclipse.jdt.internal.ui.refactoring.actions.RefactoringStarter;
+import org.eclipse.jface.dialogs.IDialogConstants;
+import org.eclipse.jface.layout.GridDataFactory;
+import org.eclipse.jface.text.BadLocationException;
+import org.eclipse.jface.text.IDocument;
+import org.eclipse.ltk.core.refactoring.Change;
+import org.eclipse.ltk.core.refactoring.CompositeChange;
+import org.eclipse.ltk.core.refactoring.DocumentChange;
+import org.eclipse.ltk.core.refactoring.Refactoring;
+import org.eclipse.ltk.core.refactoring.RefactoringStatus;
+import org.eclipse.ltk.ui.refactoring.RefactoringWizard;
+import org.eclipse.ltk.ui.refactoring.UserInputWizardPage;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Text;
+import org.eclipse.text.edits.MalformedTreeException;
+import org.eclipse.text.edits.TextEdit;
+import org.eclipse.text.edits.UndoEdit;
+import org.eclipse.ui.IWorkbenchWindow;
+import org.eclipse.ui.PlatformUI;
+import org.hibernate.eclipse.console.HibernateConsolePlugin;
+import org.hibernate.eclipse.jdt.ui.internal.JdtUiMessages;
+import org.hibernate.eclipse.jdt.ui.internal.jpa.common.EntityInfo;
+import org.hibernate.eclipse.jdt.ui.internal.jpa.common.Utils;
+
+/**
+ *
+ *
+ * @author Vitali
+ */
+public class AllEntitiesProcessor {
+
+ protected IJavaProject javaProject;
+
+ protected class ChangeStructure {
+ public String fullyQualifiedName;
+ public IPath path;
+ public IDocument document;
+ public TextEdit textEdit;
+ public ITextFileBuffer textFileBuffer;
+ public Change change;
+ };
+ protected ArrayList<ChangeStructure> changes = new ArrayList<ChangeStructure>();
+
+ public void modify(IJavaProject project, Map<String, EntityInfo> entities,
+ boolean askConfirmation) {
+ changes.clear();
+ setJavaProject(project);
+ // get the buffer manager
+ ITextFileBufferManager bufferManager = FileBuffers.getTextFileBufferManager();
+ Iterator<Map.Entry<String, EntityInfo>> it = entities.entrySet().iterator();
+ String outText = ""; //$NON-NLS-1$
+ String ls = System.getProperties().getProperty("line.separator", "\n"); //$NON-NLS-1$//$NON-NLS-2$
+ while (it.hasNext()) {
+ Map.Entry<String, EntityInfo> entry = it.next();
+ if (entry.getValue().isAbstractFlag()) {
+ continue;
+ }
+ if (entry.getValue().isCompilerProblemsFlag()) {
+ // TODO: save entity name as has compiler problems
+ }
+ outText += entry.getKey() + (it.hasNext() ? ls : ""); //$NON-NLS-1$
+ }
+ boolean performChange = true;
+ int res = 0;
+ if (askConfirmation) {
+ /** /
+ final String outText2 = outText;
+ MessageDialog dialog = new MessageDialog(JavaPlugin.getActiveWorkbenchShell(),
+ JdtUiMessages.AllEntitiesProcessor_header, null,
+ JdtUiMessages.AllEntitiesProcessor_message,
+ MessageDialog.QUESTION,
+ new String[] { IDialogConstants.OK_LABEL, IDialogConstants.CANCEL_LABEL }, 0) {
+ protected Control createCustomArea(Composite parent) {
+ Text messageText = new Text(parent, SWT.WRAP | SWT.V_SCROLL);
+ messageText.setText(outText2);
+ messageText.setEditable(false);
+ GridDataFactory.fillDefaults().align(SWT.FILL, SWT.FILL)
+ .grab(true, true)
+ .hint(convertHorizontalDLUsToPixels(IDialogConstants.MINIMUM_MESSAGE_AREA_WIDTH),
+ convertHorizontalDLUsToPixels(2 * IDialogConstants.BUTTON_BAR_HEIGHT)).applyTo(messageText);
+
+ return messageText;
+ }
+ protected boolean isResizable() {
+ return true;
+ }
+ };
+ res = dialog.open();
+ /**/
+ }
+ if (res == 0) {
+ // TODO:
+ // show warning about abstract classes
+ // show warning about compiler problems
+ // ...
+ // modify accepted items
+ it = entities.entrySet().iterator();
+ try {
+ while (it.hasNext()) {
+ Map.Entry<String, EntityInfo> entry = it.next();
+ if (entry.getValue().isAbstractFlag()) {
+ continue;
+ }
+ // this is not only errors, but warnings too
+ //if (entry.getValue().isCompilerProblemsFlag()) {
+ // continue;
+ //}
+ // modify only non-abstract classes
+ collectModification(bufferManager, entry.getKey(), entry.getValue());
+ }
+ } catch (CoreException e) {
+ HibernateConsolePlugin.getDefault().logErrorMessage("CoreException: ", e); //$NON-NLS-1$
+ }
+ }
+ else {
+ performChange = false;
+ }
+ //
+ if (askConfirmation) {
+ if (!showRefactoringDialog(outText)) {
+ performChange = false;
+ }
+ }
+ if (performChange) {
+ performChange(bufferManager);
+ }
+ performDisconnect(bufferManager);
+ }
+
+ protected void performDisconnect(ITextFileBufferManager bufferManager) {
+ for (int i = 0; i < changes.size(); i++) {
+ ChangeStructure cs = changes.get(i);
+ try {
+ bufferManager.disconnect(cs.path, LocationKind.IFILE, null);
+ } catch (CoreException e) {
+ HibernateConsolePlugin.getDefault().logErrorMessage("CoreException: ", e); //$NON-NLS-1$
+ }
+ }
+ changes.clear();
+ }
+
+ protected void performChange(ITextFileBufferManager bufferManager) {
+ for (int i = 0; i < changes.size(); i++) {
+ ChangeStructure cs = changes.get(i);
+ try {
+ if (cs.textFileBuffer != null && cs.document != null && cs.textEdit != null &&
+ ((cs.change != null && cs.change.isEnabled()) || (cs.change == null))) {
+ cs.document = cs.textFileBuffer.getDocument();
+ UndoEdit undo = cs.textEdit.apply(cs.document);
+ // commit changes to underlying file
+ cs.textFileBuffer.commit(null, true);
+ }
+ } catch (CoreException e) {
+ HibernateConsolePlugin.getDefault().logErrorMessage("CoreException: ", e); //$NON-NLS-1$
+ } catch (MalformedTreeException e) {
+ HibernateConsolePlugin.getDefault().logErrorMessage("MalformedTreeException: ", e); //$NON-NLS-1$
+ } catch (BadLocationException e) {
+ HibernateConsolePlugin.getDefault().logErrorMessage("BadLocationException: ", e); //$NON-NLS-1$
+ }
+ }
+ }
+
+ public void collectModification(ITextFileBufferManager bufferManager, String fullyQualifiedName,
+ EntityInfo entityInfo) throws CoreException {
+
+ ChangeStructure cs = new ChangeStructure();
+ cs.fullyQualifiedName = fullyQualifiedName;
+ ICompilationUnit icu = Utils.findCompilationUnit(javaProject, fullyQualifiedName);
+ org.eclipse.jdt.core.dom.CompilationUnit cu = Utils.getCompilationUnit(icu, false);
+ cs.path = cu.getJavaElement().getPath();
+ try {
+ bufferManager.connect(cs.path, LocationKind.IFILE, null);
+ cs.textFileBuffer = bufferManager.getTextFileBuffer(cs.path, LocationKind.IFILE);
+ // retrieve the buffer
+ cs.document = cs.textFileBuffer.getDocument();
+ AST ast = cu.getAST();
+ ASTRewrite rewriter = ASTRewrite.create(ast);
+ // ... rewrite
+ ProcessEntityInfo processor = new ProcessEntityInfo();
+ processor.setEntityInfo(entityInfo);
+ processor.setASTRewrite(rewriter);
+ cu.accept(processor);
+ //
+ cs.textEdit = rewriter.rewriteAST(cs.document, JavaCore.getOptions());
+ // add change to array of changes
+ changes.add(cs);
+ } catch (JavaModelException e) {
+ HibernateConsolePlugin.getDefault().logErrorMessage("JavaModelException: ", e); //$NON-NLS-1$
+ } catch (MalformedTreeException e) {
+ HibernateConsolePlugin.getDefault().logErrorMessage("MalformedTreeException: ", e); //$NON-NLS-1$
+ }
+ }
+
+ public boolean showRefactoringDialog(final String text) {
+
+ final String wizard_title = JdtUiMessages.AllEntitiesProcessor_header;
+
+ Refactoring ref = new Refactoring(){
+
+ @Override
+ public RefactoringStatus checkFinalConditions(IProgressMonitor pm){
+ return RefactoringStatus.create(Status.OK_STATUS);
+ }
+
+ @Override
+ public RefactoringStatus checkInitialConditions(IProgressMonitor pm) {
+ return RefactoringStatus.create(Status.OK_STATUS);
+ }
+
+ @Override
+ public Change createChange(IProgressMonitor pm){
+
+ final CompositeChange cc = new CompositeChange("");
+ for (int i = 0; i < changes.size(); i++) {
+ ChangeStructure cs = changes.get(i);
+ String change_name = cs.fullyQualifiedName;
+ DocumentChange change = new DocumentChange(change_name, cs.document);
+ change.setEdit(cs.textEdit);
+ cs.change = change;
+ cc.add(change);
+ }
+ cc.markAsSynthetic();
+ return cc;
+ }
+
+ @Override
+ public String getName() {
+ return JdtUiMessages.SaveQueryEditorListener_composite_change_name;
+ }
+ };
+
+ RefactoringWizard wizard = new RefactoringWizard(ref, RefactoringWizard.DIALOG_BASED_USER_INTERFACE) {
+
+ @Override
+ protected void addUserInputPages() {
+ UserInputWizardPage page = new UserInputWizardPage(wizard_title) {
+ public void createControl(Composite parent) {
+ initializeDialogUnits(parent);
+ Composite container = new Composite(parent, SWT.NULL);
+ GridLayout layout = new GridLayout();
+ container.setLayout(layout);
+ layout.numColumns = 1;
+ Label label = new Label(container, SWT.NULL);
+ label.setText(JdtUiMessages.AllEntitiesProcessor_message);
+
+ Text messageText = new Text(container, SWT.WRAP | SWT.V_SCROLL);
+ messageText.setText(text);
+ messageText.setEditable(false);
+ GridDataFactory.fillDefaults().align(SWT.FILL, SWT.FILL)
+ .grab(true, true)
+ .hint(convertHorizontalDLUsToPixels(IDialogConstants.MINIMUM_MESSAGE_AREA_WIDTH),
+ convertHorizontalDLUsToPixels(2 * IDialogConstants.BUTTON_BAR_HEIGHT)).applyTo(messageText);
+ setControl(container);
+ }
+ };
+ addPage(page);
+ }
+
+ };
+
+ wizard.setWindowTitle(wizard_title);
+ wizard.setDefaultPageTitle(wizard_title);
+
+ IWorkbenchWindow win = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
+ RefactoringStarter rStarter = new RefactoringStarter();
+ boolean res = rStarter.activate(wizard, win.getShell(), wizard_title, RefactoringSaveHelper.SAVE_ALL);
+ RefactoringStatus rs = rStarter.getInitialConditionCheckingStatus();
+ return res;
+ }
+
+ public IJavaProject getJavaProject() {
+ return javaProject;
+ }
+
+ protected void setJavaProject(IJavaProject project) {
+ javaProject = project;
+ }
+}
Added: trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/jpa/process/ProcessEntityInfo.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/jpa/process/ProcessEntityInfo.java (rev 0)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/jpa/process/ProcessEntityInfo.java 2008-10-16 10:41:47 UTC (rev 10877)
@@ -0,0 +1,269 @@
+/*******************************************************************************
+ * Copyright (c) 2007-2008 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributor:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.hibernate.eclipse.jdt.ui.internal.jpa.process;
+
+import java.util.Iterator;
+import java.util.List;
+import java.util.Set;
+
+import org.eclipse.jdt.core.dom.ASTVisitor;
+import org.eclipse.jdt.core.dom.Block;
+import org.eclipse.jdt.core.dom.CompilationUnit;
+import org.eclipse.jdt.core.dom.FieldDeclaration;
+import org.eclipse.jdt.core.dom.ImportDeclaration;
+import org.eclipse.jdt.core.dom.MarkerAnnotation;
+import org.eclipse.jdt.core.dom.MemberValuePair;
+import org.eclipse.jdt.core.dom.MethodDeclaration;
+import org.eclipse.jdt.core.dom.Modifier;
+import org.eclipse.jdt.core.dom.NormalAnnotation;
+import org.eclipse.jdt.core.dom.QualifiedName;
+import org.eclipse.jdt.core.dom.SimpleName;
+import org.eclipse.jdt.core.dom.SimpleType;
+import org.eclipse.jdt.core.dom.StringLiteral;
+import org.eclipse.jdt.core.dom.TypeDeclaration;
+import org.eclipse.jdt.core.dom.VariableDeclarationFragment;
+import org.eclipse.jdt.core.dom.rewrite.ASTRewrite;
+import org.eclipse.jdt.core.dom.rewrite.ListRewrite;
+import org.hibernate.eclipse.jdt.ui.internal.jpa.common.EntityInfo;
+import org.hibernate.eclipse.jdt.ui.internal.jpa.common.JPAConst;
+import org.hibernate.eclipse.jdt.ui.internal.jpa.common.RefEntityInfo;
+import org.hibernate.eclipse.jdt.ui.internal.jpa.common.RefFieldInfo;
+import org.hibernate.eclipse.jdt.ui.internal.jpa.common.RefType;
+
+/**
+ *
+ *
+ * @author Vitali
+ */
+public class ProcessEntityInfo extends ASTVisitor {
+
+ protected EntityInfo entityInfo;
+ protected ASTRewrite rewriter;
+
+ public void setEntityInfo(EntityInfo entityInfo) {
+ this.entityInfo = entityInfo;
+ }
+
+ public void setASTRewrite(ASTRewrite rewriter) {
+ this.rewriter = rewriter;
+ }
+
+ public boolean visit(CompilationUnit node) {
+ for (int i = 0; i < JPAConst.ALL_IMPORTS.size(); i++) {
+ String tmp = JPAConst.ALL_IMPORTS.get(i);
+ if (entityInfo.needImport(tmp)) {
+ addImport(node, tmp);
+ }
+ }
+ return true;
+ }
+
+ public boolean addImport(CompilationUnit node, String importDeclaration) {
+ String[] importDeclarations = importDeclaration.split("\\."); //$NON-NLS-1$
+ if (importDeclarations.length <= 1) {
+ return false;
+ }
+ ImportDeclaration importDecl = rewriter.getAST().newImportDeclaration();
+ SimpleName simpleName0 = rewriter.getAST().newSimpleName(importDeclarations[0]);
+ SimpleName simpleName1 = rewriter.getAST().newSimpleName(importDeclarations[1]);
+ QualifiedName qualifiedName0 = rewriter.getAST().newQualifiedName(simpleName0, simpleName1);
+ for (int i = 2; i < importDeclarations.length; i++) {
+ SimpleName simpleNameI = rewriter.getAST().newSimpleName(importDeclarations[i]);
+ qualifiedName0 = rewriter.getAST().newQualifiedName(qualifiedName0, simpleNameI);
+ }
+ importDecl.setName(qualifiedName0);
+ ListRewrite lrw = rewriter.getListRewrite(node, CompilationUnit.IMPORTS_PROPERTY);
+ // TODO: insert import declaration in the proper place
+ // prefer alphabetic order and package separation
+ lrw.insertLast(importDecl, null);
+ return true;
+ }
+
+ public boolean visit(TypeDeclaration node) {
+ if (entityInfo.isAddEntityFlag()) {
+ MarkerAnnotation matd = rewriter.getAST().newMarkerAnnotation();
+ matd.setTypeName(rewriter.getAST().newSimpleName(JPAConst.ANNOTATION_ENTITY));
+ ListRewrite lrw = rewriter.getListRewrite(node, TypeDeclaration.MODIFIERS2_PROPERTY);
+ lrw.insertFirst(matd, null);
+ }
+ /** /
+ if (!entityInfo.isImplicitConstructorFlag() && !entityInfo.isDefaultConstructorFlag() &&
+ entityInfo.isAddSerializableInterfaceFlag()) {
+ // add serializable interface
+ SimpleName sn = null;
+ //if (!entityInfo.isAddSerializableInterfaceImportFlag()) {
+ sn = rewriter.getAST().newSimpleName(JPAConst.ANNOTATION_SERIALIZABLE);
+ //}
+ //else {
+ // sn = rewriter.getAST().newSimpleName(JPAConst.IMPORT_SERIALIZABLE);
+ //}
+ SimpleType st = rewriter.getAST().newSimpleType(sn);
+ ListRewrite lrw = rewriter.getListRewrite(node, TypeDeclaration.SUPER_INTERFACE_TYPES_PROPERTY);
+ lrw.insertFirst(st, null);
+ // add "private static final long serialVersionUID = 1L;"
+ // ...
+ }
+ /**/
+ if (!entityInfo.isImplicitConstructorFlag() && !entityInfo.isDefaultConstructorFlag() &&
+ entityInfo.isAddSerializableInterfaceFlag()) {
+
+ MethodDeclaration md = rewriter.getAST().newMethodDeclaration();
+ md.setConstructor(true);
+ Modifier modifier = rewriter.getAST().newModifier(Modifier.ModifierKeyword.PROTECTED_KEYWORD);
+ md.modifiers().add(modifier);
+ Block body = rewriter.getAST().newBlock();
+ md.setBody(body);
+ SimpleName sn = rewriter.getAST().newSimpleName(entityInfo.getName());
+ md.setName(sn);
+ ListRewrite lrw = rewriter.getListRewrite(node, TypeDeclaration.BODY_DECLARATIONS_PROPERTY);
+ List list = lrw.getOriginalList();
+ MethodDeclaration insertBeforeNode = null;
+ Iterator it = list.iterator();
+ while (it.hasNext()) {
+ Object obj = it.next();
+ if (obj instanceof MethodDeclaration) {
+ insertBeforeNode = (MethodDeclaration)obj;
+ break;
+ }
+ }
+ if (insertBeforeNode == null) {
+ lrw.insertLast(md, null);
+ }
+ else {
+ lrw.insertBefore(md, insertBeforeNode, null);
+ }
+ }
+ return true;
+ }
+
+ public boolean visit(FieldDeclaration node) {
+ if (node.getType().isSimpleType()) {
+ if (entityInfo.isAddGeneratedValueFlag()) {
+ String primaryIdName = entityInfo.getPrimaryIdName();
+ Iterator itVarNames = node.fragments().iterator();
+ boolean addGeneratedValueMarker = false;
+ while (itVarNames.hasNext()) {
+ VariableDeclarationFragment var = (VariableDeclarationFragment)itVarNames.next();
+ String name = var.getName().getIdentifier();
+ if (primaryIdName.equals(name)) {
+ addGeneratedValueMarker = true;
+ break;
+ }
+ }
+ if (addGeneratedValueMarker) {
+ MarkerAnnotation matd = rewriter.getAST().newMarkerAnnotation();
+ matd.setTypeName(rewriter.getAST().newSimpleName(JPAConst.ANNOTATION_GENERATED_VALUE));
+ ListRewrite lrw = rewriter.getListRewrite(node, FieldDeclaration.MODIFIERS2_PROPERTY);
+ lrw.insertFirst(matd, null);
+ }
+ }
+ if (entityInfo.isAddPrimaryIdFlag()) {
+ String primaryIdName = entityInfo.getPrimaryIdName();
+ Iterator itVarNames = node.fragments().iterator();
+ boolean addIdMarker = false;
+ while (itVarNames.hasNext()) {
+ VariableDeclarationFragment var = (VariableDeclarationFragment)itVarNames.next();
+ String name = var.getName().getIdentifier();
+ if (primaryIdName.equals(name)) {
+ addIdMarker = true;
+ break;
+ }
+ }
+ if (addIdMarker) {
+ MarkerAnnotation matd = rewriter.getAST().newMarkerAnnotation();
+ matd.setTypeName(rewriter.getAST().newSimpleName(JPAConst.ANNOTATION_ID));
+ ListRewrite lrw = rewriter.getListRewrite(node, FieldDeclaration.MODIFIERS2_PROPERTY);
+ lrw.insertFirst(matd, null);
+ }
+ }
+ }
+ if (node.getType().isSimpleType() || node.getType().isParameterizedType()) {
+ Iterator itVarNames = node.fragments().iterator();
+ String fieldId = ""; //$NON-NLS-1$
+ RefType refType = RefType.UNDEF;
+ boolean annotated = false;
+ String fullyQualifiedName2 = ""; //$NON-NLS-1$
+ while (itVarNames.hasNext()) {
+ VariableDeclarationFragment var = (VariableDeclarationFragment)itVarNames.next();
+ String name = var.getName().getIdentifier();
+ fieldId = name;
+ refType = entityInfo.getFieldIdRelValue(fieldId);
+ annotated = entityInfo.getFieldIdAnnotatedValue(fieldId);
+ fullyQualifiedName2 = entityInfo.getFieldIdFQNameValue(fieldId);
+ if (refType != RefType.UNDEF) {
+ break;
+ }
+ }
+ Set<RefFieldInfo> setRFI = entityInfo.getRefFieldInfoSet(fullyQualifiedName2);
+ if (!annotated && setRFI != null) {
+ RefEntityInfo rei = entityInfo.getFieldIdRefEntityInfo(fieldId);
+ // try to process bidirectional relationships:
+ // nRefType == JPAConst.ONE2ONE - OneToOne - the owning side corresponds
+ // to the side that contains the corresponding foreign key
+ // nRefType == JPAConst.MANY2ONE - ManyToOne - owning side is always the "many" side
+ // nRefType == JPAConst.MANY2MANY - ManyToMany bidirectional relationships
+ // either side may be the owning side
+ if (setRFI.size() > 1 && refType != RefType.MANY2ONE) {
+ if (rei.mappedBy == null || rei.mappedBy == "") { //$NON-NLS-1$
+ addSimpleMarkerAnnotation(node, JPAConst.getRefType(refType));
+ }
+ else {
+ // give to the user information about selected mapping
+ addComplexNormalAnnotation(node, JPAConst.getRefType(refType), rei);
+ }
+ }
+ else if (refType == RefType.MANY2ONE || rei.mappedBy == null || rei.mappedBy == "") { //$NON-NLS-1$
+ addSimpleMarkerAnnotation(node, JPAConst.getRefType(refType));
+ }
+ else {
+ // in case of bidirectional OneToOne - mark both sides with mappedBy -
+ // user should select the right decision
+ addComplexNormalAnnotation(node, JPAConst.getRefType(refType), rei);
+ }
+ }
+ }
+ return true;
+ }
+
+ public boolean addSimpleMarkerAnnotation(FieldDeclaration node, String name) {
+ if (name == null || name.length() == 0) {
+ return false;
+ }
+ MarkerAnnotation matd = rewriter.getAST().newMarkerAnnotation();
+ matd.setTypeName(rewriter.getAST().newSimpleName(name));
+ ListRewrite lrw = rewriter.getListRewrite(node, FieldDeclaration.MODIFIERS2_PROPERTY);
+ lrw.insertFirst(matd, null);
+ return true;
+ }
+
+ public boolean addComplexNormalAnnotation(FieldDeclaration node, String name, RefEntityInfo rei) {
+ if (name == null || name.length() == 0) {
+ return false;
+ }
+ NormalAnnotation natd = rewriter.getAST().newNormalAnnotation();
+ MemberValuePair mvp = null;
+ if (rei.mappedBy != null) {
+ mvp = rewriter.getAST().newMemberValuePair();
+ mvp.setName(rewriter.getAST().newSimpleName("mappedBy")); //$NON-NLS-1$
+ StringLiteral sl = rewriter.getAST().newStringLiteral();
+ sl.setLiteralValue(rei.mappedBy);
+ mvp.setValue(sl);
+ }
+ natd.setTypeName(rewriter.getAST().newSimpleName(name));
+ if (mvp != null) {
+ natd.values().add(mvp);
+ }
+ ListRewrite lrw = rewriter.getListRewrite(node, FieldDeclaration.MODIFIERS2_PROPERTY);
+ lrw.insertFirst(natd, null);
+ return true;
+ }
+
+}
Modified: trunk/hibernatetools/tests/org.hibernate.eclipse.jdt.ui.test/.classpath
===================================================================
--- trunk/hibernatetools/tests/org.hibernate.eclipse.jdt.ui.test/.classpath 2008-10-16 10:41:46 UTC (rev 10876)
+++ trunk/hibernatetools/tests/org.hibernate.eclipse.jdt.ui.test/.classpath 2008-10-16 10:41:47 UTC (rev 10877)
@@ -1,11 +1,11 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="src" path="src"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
- <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins">
- <accessrules>
- <accessrule kind="accessible" pattern="**/internal/**"/>
- </accessrules>
- </classpathentry>
- <classpathentry kind="output" path="bin"/>
-</classpath>
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins">
+ <accessrules>
+ <accessrule kind="accessible" pattern="**/internal/**"/>
+ </accessrules>
+ </classpathentry>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
Added: trunk/hibernatetools/tests/org.hibernate.eclipse.jdt.ui.test/res/project/test/annotated/Document.java
===================================================================
--- trunk/hibernatetools/tests/org.hibernate.eclipse.jdt.ui.test/res/project/test/annotated/Document.java (rev 0)
+++ trunk/hibernatetools/tests/org.hibernate.eclipse.jdt.ui.test/res/project/test/annotated/Document.java 2008-10-16 10:41:47 UTC (rev 10877)
@@ -0,0 +1,60 @@
+/*******************************************************************************
+ * Copyright (c) 2007-2008 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributor:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package test.annotated;
+
+import java.util.Set;
+
+(a)javax.persistence.Entity
+public class Document {
+
+ @javax.persistence.Id
+ protected Long documentId;
+
+ protected Person documentOwner;
+
+ @javax.persistence.OneToMany
+ protected Set<Person> persons;
+
+ protected Byte docType = 0;
+
+ public Long getDocumentId() {
+ return documentId;
+ }
+
+ public void setDocumentId(Long documentId) {
+ this.documentId = documentId;
+ }
+
+ public Person getDocumentOwner() {
+ return documentOwner;
+ }
+
+ public void setDocumentOwner(Person documentOwner) {
+ this.documentOwner = documentOwner;
+ }
+
+ public Set<Person> getPersons() {
+ return persons;
+ }
+
+ public void setPersons(Set<Person> persons) {
+ this.persons = persons;
+ }
+
+ public Byte getDocType() {
+ return docType;
+ }
+
+ protected void setDocType(Byte docType) {
+ this.docType = docType;
+ }
+
+}
Added: trunk/hibernatetools/tests/org.hibernate.eclipse.jdt.ui.test/res/project/test/annotated/Foto.java
===================================================================
--- trunk/hibernatetools/tests/org.hibernate.eclipse.jdt.ui.test/res/project/test/annotated/Foto.java (rev 0)
+++ trunk/hibernatetools/tests/org.hibernate.eclipse.jdt.ui.test/res/project/test/annotated/Foto.java 2008-10-16 10:41:47 UTC (rev 10877)
@@ -0,0 +1,68 @@
+/*******************************************************************************
+ * Copyright (c) 2007-2008 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributor:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package test.annotated;
+
+public class Foto {
+
+ protected Long fid;
+
+ protected Short id;
+
+ protected Person person;
+
+ protected Short width_IDtest;
+
+ protected Short height_testID;
+
+ public Foto() {
+ }
+
+ public Long getFid() {
+ return fid;
+ }
+
+ public void setFid(Long fid) {
+ this.fid = fid;
+ }
+
+ public Short getId() {
+ return id;
+ }
+
+ public void setId(Short id) {
+ this.id = id;
+ }
+
+ public Person getPerson() {
+ return person;
+ }
+
+ public void setPerson(Person person) {
+ this.person = person;
+ }
+
+ public Short getWidth_IDtest() {
+ return width_IDtest;
+ }
+
+ public void setWidth_IDtest(Short width_IDtest) {
+ this.width_IDtest = width_IDtest;
+ }
+
+ public Short getHeight_testID() {
+ return height_testID;
+ }
+
+ public void setHeight_testID(Short height_testID) {
+ this.height_testID = height_testID;
+ }
+
+}
Added: trunk/hibernatetools/tests/org.hibernate.eclipse.jdt.ui.test/res/project/test/annotated/Passport.java
===================================================================
--- trunk/hibernatetools/tests/org.hibernate.eclipse.jdt.ui.test/res/project/test/annotated/Passport.java (rev 0)
+++ trunk/hibernatetools/tests/org.hibernate.eclipse.jdt.ui.test/res/project/test/annotated/Passport.java 2008-10-16 10:41:47 UTC (rev 10877)
@@ -0,0 +1,21 @@
+/*******************************************************************************
+ * Copyright (c) 2007-2008 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributor:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package test.annotated;
+
+public class Passport extends Document {
+
+ protected Long fakeId;
+
+ public Passport() {
+ setDocType((byte)1);
+ }
+
+}
Added: trunk/hibernatetools/tests/org.hibernate.eclipse.jdt.ui.test/res/project/test/annotated/Person.java
===================================================================
--- trunk/hibernatetools/tests/org.hibernate.eclipse.jdt.ui.test/res/project/test/annotated/Person.java (rev 0)
+++ trunk/hibernatetools/tests/org.hibernate.eclipse.jdt.ui.test/res/project/test/annotated/Person.java 2008-10-16 10:41:47 UTC (rev 10877)
@@ -0,0 +1,50 @@
+/*******************************************************************************
+ * Copyright (c) 2007-2008 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributor:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package test.annotated;
+
+import java.util.Set;
+
+public class Person {
+
+ protected Long personId;
+
+ @OneToMany(mappedBy="documentOwner")
+ protected Set<Document> documents;
+
+ protected Foto foto;
+
+ protected Set someTestSet;
+
+ public Long getPersonId() {
+ return personId;
+ }
+
+ public void setPersonId(Long personId) {
+ this.personId = personId;
+ }
+
+ public Set<Document> getDocuments() {
+ return documents;
+ }
+
+ public void setDocuments(Set<Document> documents) {
+ this.documents = documents;
+ }
+
+ public Foto getFoto() {
+ return foto;
+ }
+
+ public void setFoto(Foto foto) {
+ this.foto = foto;
+ }
+
+}
Added: trunk/hibernatetools/tests/org.hibernate.eclipse.jdt.ui.test/res/project/test/annotated/Staff.java
===================================================================
--- trunk/hibernatetools/tests/org.hibernate.eclipse.jdt.ui.test/res/project/test/annotated/Staff.java (rev 0)
+++ trunk/hibernatetools/tests/org.hibernate.eclipse.jdt.ui.test/res/project/test/annotated/Staff.java 2008-10-16 10:41:47 UTC (rev 10877)
@@ -0,0 +1,21 @@
+/*******************************************************************************
+ * Copyright (c) 2007-2008 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributor:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package test.annotated;
+
+public class Staff extends Document {
+
+ protected Long code;
+
+ public Staff(long code) {
+ this.code = code;
+ setDocType((byte)2);
+ }
+}
Added: trunk/hibernatetools/tests/org.hibernate.eclipse.jdt.ui.test/res/specimen/test/annotated/Document.java
===================================================================
--- trunk/hibernatetools/tests/org.hibernate.eclipse.jdt.ui.test/res/specimen/test/annotated/Document.java (rev 0)
+++ trunk/hibernatetools/tests/org.hibernate.eclipse.jdt.ui.test/res/specimen/test/annotated/Document.java 2008-10-16 10:41:47 UTC (rev 10877)
@@ -0,0 +1,64 @@
+/*******************************************************************************
+ * Copyright (c) 2007-2008 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributor:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package test.annotated;
+
+import java.util.Set;
+
+import javax.persistence.GeneratedValue;
+import javax.persistence.ManyToOne;
+
+(a)javax.persistence.Entity
+public class Document {
+
+ @GeneratedValue @javax.persistence.Id
+ protected Long documentId;
+
+ @ManyToOne
+ protected Person documentOwner;
+
+ @javax.persistence.OneToMany
+ protected Set<Person> persons;
+
+ protected Byte docType = 0;
+
+ public Long getDocumentId() {
+ return documentId;
+ }
+
+ public void setDocumentId(Long documentId) {
+ this.documentId = documentId;
+ }
+
+ public Person getDocumentOwner() {
+ return documentOwner;
+ }
+
+ public void setDocumentOwner(Person documentOwner) {
+ this.documentOwner = documentOwner;
+ }
+
+ public Set<Person> getPersons() {
+ return persons;
+ }
+
+ public void setPersons(Set<Person> persons) {
+ this.persons = persons;
+ }
+
+ public Byte getDocType() {
+ return docType;
+ }
+
+ protected void setDocType(Byte docType) {
+ this.docType = docType;
+ }
+
+}
Added: trunk/hibernatetools/tests/org.hibernate.eclipse.jdt.ui.test/res/specimen/test/annotated/Foto.java
===================================================================
--- trunk/hibernatetools/tests/org.hibernate.eclipse.jdt.ui.test/res/specimen/test/annotated/Foto.java (rev 0)
+++ trunk/hibernatetools/tests/org.hibernate.eclipse.jdt.ui.test/res/specimen/test/annotated/Foto.java 2008-10-16 10:41:47 UTC (rev 10877)
@@ -0,0 +1,76 @@
+/*******************************************************************************
+ * Copyright (c) 2007-2008 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributor:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package test.annotated;
+
+import javax.persistence.Entity;
+import javax.persistence.GeneratedValue;
+import javax.persistence.Id;
+import javax.persistence.OneToOne;
+
+@Entity
+public class Foto {
+
+ protected Long fid;
+
+ @Id @GeneratedValue
+ protected Short id;
+
+ @OneToOne(mappedBy="foto")
+ protected Person person;
+
+ protected Short width_IDtest;
+
+ protected Short height_testID;
+
+ public Foto() {
+ }
+
+ public Long getFid() {
+ return fid;
+ }
+
+ public void setFid(Long fid) {
+ this.fid = fid;
+ }
+
+ public Short getId() {
+ return id;
+ }
+
+ public void setId(Short id) {
+ this.id = id;
+ }
+
+ public Person getPerson() {
+ return person;
+ }
+
+ public void setPerson(Person person) {
+ this.person = person;
+ }
+
+ public Short getWidth_IDtest() {
+ return width_IDtest;
+ }
+
+ public void setWidth_IDtest(Short width_IDtest) {
+ this.width_IDtest = width_IDtest;
+ }
+
+ public Short getHeight_testID() {
+ return height_testID;
+ }
+
+ public void setHeight_testID(Short height_testID) {
+ this.height_testID = height_testID;
+ }
+
+}
Added: trunk/hibernatetools/tests/org.hibernate.eclipse.jdt.ui.test/res/specimen/test/annotated/Passport.java
===================================================================
--- trunk/hibernatetools/tests/org.hibernate.eclipse.jdt.ui.test/res/specimen/test/annotated/Passport.java (rev 0)
+++ trunk/hibernatetools/tests/org.hibernate.eclipse.jdt.ui.test/res/specimen/test/annotated/Passport.java 2008-10-16 10:41:47 UTC (rev 10877)
@@ -0,0 +1,24 @@
+/*******************************************************************************
+ * Copyright (c) 2007-2008 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributor:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package test.annotated;
+
+import javax.persistence.Entity;
+
+@Entity
+public class Passport extends Document {
+
+ protected Long fakeId;
+
+ public Passport() {
+ setDocType((byte)1);
+ }
+
+}
Added: trunk/hibernatetools/tests/org.hibernate.eclipse.jdt.ui.test/res/specimen/test/annotated/Person.java
===================================================================
--- trunk/hibernatetools/tests/org.hibernate.eclipse.jdt.ui.test/res/specimen/test/annotated/Person.java (rev 0)
+++ trunk/hibernatetools/tests/org.hibernate.eclipse.jdt.ui.test/res/specimen/test/annotated/Person.java 2008-10-16 10:41:47 UTC (rev 10877)
@@ -0,0 +1,59 @@
+/*******************************************************************************
+ * Copyright (c) 2007-2008 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributor:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package test.annotated;
+
+import java.util.Set;
+
+import javax.persistence.Entity;
+import javax.persistence.GeneratedValue;
+import javax.persistence.Id;
+import javax.persistence.OneToOne;
+import javax.persistence.OneToMany;
+
+@Entity
+public class Person {
+
+ @Id @GeneratedValue
+ protected Long personId;
+
+ @OneToMany(mappedBy="documentOwner")
+ protected Set<Document> documents;
+
+ @OneToOne(mappedBy="person")
+ protected Foto foto;
+
+ protected Set someTestSet;
+
+ public Long getPersonId() {
+ return personId;
+ }
+
+ public void setPersonId(Long personId) {
+ this.personId = personId;
+ }
+
+ public Set<Document> getDocuments() {
+ return documents;
+ }
+
+ public void setDocuments(Set<Document> documents) {
+ this.documents = documents;
+ }
+
+ public Foto getFoto() {
+ return foto;
+ }
+
+ public void setFoto(Foto foto) {
+ this.foto = foto;
+ }
+
+}
Added: trunk/hibernatetools/tests/org.hibernate.eclipse.jdt.ui.test/res/specimen/test/annotated/Staff.java
===================================================================
--- trunk/hibernatetools/tests/org.hibernate.eclipse.jdt.ui.test/res/specimen/test/annotated/Staff.java (rev 0)
+++ trunk/hibernatetools/tests/org.hibernate.eclipse.jdt.ui.test/res/specimen/test/annotated/Staff.java 2008-10-16 10:41:47 UTC (rev 10877)
@@ -0,0 +1,27 @@
+/*******************************************************************************
+ * Copyright (c) 2007-2008 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributor:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package test.annotated;
+
+import javax.persistence.Entity;
+
+@Entity
+public class Staff extends Document {
+
+ protected Long code;
+
+ protected Staff() {
+ }
+
+ public Staff(long code) {
+ this.code = code;
+ setDocType((byte)2);
+ }
+}
Added: trunk/hibernatetools/tests/org.hibernate.eclipse.jdt.ui.test/src/org/hibernate/eclipse/jdt/ui/test/JPAMapTest.java
===================================================================
--- trunk/hibernatetools/tests/org.hibernate.eclipse.jdt.ui.test/src/org/hibernate/eclipse/jdt/ui/test/JPAMapTest.java (rev 0)
+++ trunk/hibernatetools/tests/org.hibernate.eclipse.jdt.ui.test/src/org/hibernate/eclipse/jdt/ui/test/JPAMapTest.java 2008-10-16 10:41:47 UTC (rev 10877)
@@ -0,0 +1,205 @@
+/*******************************************************************************
+ * Copyright (c) 2007-2008 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributor:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.hibernate.eclipse.jdt.ui.test;
+
+import java.io.BufferedReader;
+import java.io.File;
+import java.io.FileReader;
+import java.io.IOException;
+import java.io.StringReader;
+import java.net.URL;
+import java.util.List;
+
+import org.eclipse.core.resources.IFolder;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.FileLocator;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.jdt.core.ICompilationUnit;
+import org.eclipse.jdt.core.IJavaProject;
+import org.eclipse.jdt.core.IPackageFragmentRoot;
+import org.eclipse.jdt.core.JavaModelException;
+import org.eclipse.jdt.core.dom.AST;
+import org.eclipse.jdt.core.dom.ASTNode;
+import org.eclipse.jdt.core.dom.ASTParser;
+import org.eclipse.osgi.util.NLS;
+import org.hibernate.eclipse.console.test.ConsoleTestMessages;
+import org.hibernate.eclipse.console.test.mappingproject.TestUtilsCommon;
+import org.hibernate.eclipse.console.utils.ProjectUtils;
+import org.hibernate.eclipse.jdt.ui.internal.jpa.collect.AllEntitiesInfoCollector;
+import org.hibernate.eclipse.jdt.ui.internal.jpa.common.Utils;
+import org.hibernate.eclipse.jdt.ui.internal.jpa.process.AllEntitiesProcessor;
+
+import junit.framework.TestCase;
+
+/**
+ *
+ *
+ * @author Vitali
+ */
+public class JPAMapTest extends TestCase {
+
+ public static String PROJECT_NAME = "TestProject"; //$NON-NLS-1$
+ public static String RESOURCE_PATH = "res/project/"; //$NON-NLS-1$
+ public static String SPECIMEN_PATH = "res/specimen/"; //$NON-NLS-1$
+ public static String TESTRESOURCE_PATH = "testresources"; //$NON-NLS-1$
+ static {
+ RESOURCE_PATH.replaceAll("//", File.separator); //$NON-NLS-1$
+ SPECIMEN_PATH.replaceAll("//", File.separator); //$NON-NLS-1$
+ }
+
+ protected AllEntitiesInfoCollector collector = new AllEntitiesInfoCollector();
+ protected AllEntitiesProcessor processor = new AllEntitiesProcessor();
+
+ protected IProject project;
+ protected IJavaProject javaProject;
+
+ protected void setUp() throws Exception {
+ try {
+ createTestProject();
+ } catch (JavaModelException e1) {
+ fail(e1.getMessage());
+ } catch (CoreException e1) {
+ fail(e1.getMessage());
+ } catch (IOException e1) {
+ fail(e1.getMessage());
+ }
+ assertNotNull(project);
+ assertNotNull(javaProject);
+ }
+
+ protected void tearDown() throws Exception {
+ try {
+ project.delete(true, true, null);
+ project = null;
+ javaProject = null;
+ } catch (CoreException e) {
+ fail(e.getMessage());
+ }
+ assertNull(project);
+ assertNull(javaProject);
+ }
+
+ public void testTransformer() {
+ javaProject = ProjectUtils.findJavaProject(PROJECT_NAME);
+ assertNotNull(javaProject);
+ try {
+ javaProject.getProject().open(null);
+ } catch (CoreException e) {
+ fail(e.getMessage());
+ }
+ ICompilationUnit icu = Utils.findCompilationUnit(javaProject,
+ "test.annotated.Passport"); //$NON-NLS-1$
+ ICompilationUnit icu2 = Utils.findCompilationUnit(javaProject,
+ "test.annotated.Staff"); //$NON-NLS-1$
+ assertNotNull(icu);
+ assertNotNull(icu2);
+ collector.initCollector(javaProject);
+ collector.collect(icu);
+ collector.collect(icu2);
+ collector.resolveRelations();
+ processor.modify(javaProject, collector.getMapCUs_Info(), false);
+ //
+ checkItem("Document"); //$NON-NLS-1$
+ checkItem("Foto"); //$NON-NLS-1$
+ checkItem("Passport"); //$NON-NLS-1$
+ checkItem("Person"); //$NON-NLS-1$
+ checkItem("Staff"); //$NON-NLS-1$
+ }
+
+ protected void checkItem(String strCheckItem) {
+ ASTNode specimen, generated;
+ specimen = null;
+ try {
+ specimen = getSpecimen(strCheckItem);
+ } catch (IOException e) {
+ fail(e.getMessage());
+ }
+ assertNotNull(specimen);
+ generated = getGenerated(strCheckItem);
+ assertNotNull(generated);
+ assertEquals(specimen.toString(), generated.toString());
+ }
+
+ protected ASTNode getGenerated(String strName) {
+ ICompilationUnit icu = Utils.findCompilationUnit(javaProject,
+ "test.annotated." + strName); //$NON-NLS-1$
+ ASTParser parser = ASTParser.newParser(AST.JLS3);
+ parser.setSource(icu);
+ ASTNode astNode = parser.createAST(null);
+ return astNode;
+ }
+
+ protected ASTNode getSpecimen(String strName) throws IOException {
+ File resourceFile = getResourceItem(SPECIMEN_PATH
+ + "test" + File.separator + "annotated" + File.separator + strName + ".java"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ if (!resourceFile.exists()) {
+ return null;
+ }
+ ASTParser parser = ASTParser.newParser(AST.JLS3);
+ StringBuffer cbuf = new StringBuffer((int) resourceFile.length());
+ try {
+ String ls = System.getProperties().getProperty("line.separator", "\n"); //$NON-NLS-1$//$NON-NLS-2$
+ BufferedReader in = new BufferedReader(new FileReader(resourceFile));
+ String str;
+ while ((str = in.readLine()) != null) {
+ cbuf.append(str + ls);
+ }
+ in.close();
+ } catch (IOException e) {
+ }
+
+ parser.setSource(cbuf.toString().toCharArray());
+ ASTNode astNode = parser.createAST(null);
+ return astNode;
+ }
+
+ protected File getResourceItem(String strResPath) throws IOException {
+ IPath resourcePath = new Path(strResPath);
+ File resourceFolder = resourcePath.toFile();
+ URL entry = HibernateJDTuiTestPlugin.getDefault().getBundle().getEntry(
+ strResPath);
+ URL resProject = FileLocator.resolve(entry);
+ String tplPrjLcStr = FileLocator.resolve(resProject).getFile();
+ resourceFolder = new File(tplPrjLcStr);
+ return resourceFolder;
+ }
+
+ protected void createTestProject() throws JavaModelException,
+ CoreException, IOException {
+ TestUtilsCommon commonUtil = new TestUtilsCommon();
+ project = commonUtil.buildNewProject(PROJECT_NAME);
+ javaProject = commonUtil.buildJavaProject(project);
+ File resourceFolder = getResourceItem(RESOURCE_PATH);
+ if (!resourceFolder.exists()) {
+ String out = NLS.bind(
+ ConsoleTestMessages.MappingTestProject_folder_not_found,
+ RESOURCE_PATH);
+ throw new RuntimeException(out);
+ }
+ IPackageFragmentRoot sourceFolder = commonUtil.createSourceFolder(
+ project, javaProject);
+ commonUtil.recursiveCopyFiles(resourceFolder, (IFolder) sourceFolder
+ .getResource());
+ File resourceFolderLib = getResourceItem(TESTRESOURCE_PATH);
+ if (!resourceFolderLib.exists()) {
+ String out = NLS.bind(
+ ConsoleTestMessages.MappingTestProject_folder_not_found,
+ RESOURCE_PATH);
+ throw new RuntimeException(out);
+ }
+ List<IPath> libs = commonUtil.copyLibs2(project, javaProject,
+ resourceFolderLib.getAbsolutePath());
+ commonUtil.generateClassPath(javaProject, libs, sourceFolder);
+ }
+
+}
17 years, 2 months
JBoss Tools SVN: r10876 - trunk/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/module.
by jbosstools-commits@lists.jboss.org
Author: dennyxu
Date: 2008-10-16 06:41:46 -0400 (Thu, 16 Oct 2008)
New Revision: 10876
Modified:
trunk/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/module/JBossESBModuleDelegate.java
Log:
JBIDE-2875: rollback the change
Modified: trunk/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/module/JBossESBModuleDelegate.java
===================================================================
--- trunk/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/module/JBossESBModuleDelegate.java 2008-10-16 10:37:28 UTC (rev 10875)
+++ trunk/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/module/JBossESBModuleDelegate.java 2008-10-16 10:41:46 UTC (rev 10876)
@@ -40,8 +40,11 @@
IJavaProject javaPrj = JavaCore.create(project);
IPath output = javaPrj.getOutputLocation();
// if the jboss-esb.xml file is not in META-INF folder, try to get it from other folder of the project
- List<IModuleResource> mrs = getConfigModuleFile(project, configFolder);
+ // block this logic as Max's suggestion
+ //List<IModuleResource> mrs = getConfigModuleFile(project, configFolder);
+ List<IModuleResource> mrs = new ArrayList<IModuleResource>();
+
IModuleResource[] esbContent = getModuleResources(Path.EMPTY, configFolder);
IModuleResource[] classes = getModuleResources(Path.EMPTY, project.getWorkspace().getRoot().getFolder(output));
IModuleResource[] allResource = new IModuleResource[esbContent.length + classes.length + mrs.size()];
17 years, 2 months
JBoss Tools SVN: r10875 - trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/mappingproject.
by jbosstools-commits@lists.jboss.org
Author: vyemialyanchyk
Date: 2008-10-16 06:37:28 -0400 (Thu, 16 Oct 2008)
New Revision: 10875
Modified:
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/mappingproject/TestUtilsCommon.java
Log:
refactoring for JBIDE-2077
Modified: trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/mappingproject/TestUtilsCommon.java
===================================================================
--- trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/mappingproject/TestUtilsCommon.java 2008-10-16 10:31:27 UTC (rev 10874)
+++ trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/mappingproject/TestUtilsCommon.java 2008-10-16 10:37:28 UTC (rev 10875)
@@ -203,17 +203,22 @@
public List<IPath> copyLibs(IProject project, IJavaProject javaProject,
File res) throws CoreException {
+ return copyLibs2(project, javaProject,
+ res.getAbsolutePath() + File.separator + TestUtilsCommon.LIB_FOLDER);
+ }
+
+ public List<IPath> copyLibs2(IProject project, IJavaProject javaProject,
+ String absolutePath) throws CoreException {
IFolder dst = project.getFolder(TestUtilsCommon.LIB_FOLDER);
if (!dst.exists()) {
dst.create(false, true, null);
javaProject.getPackageFragmentRoot(dst);
}
- File libFolder = new File(res.getAbsolutePath()
- + "/" + TestUtilsCommon.LIB_FOLDER); //$NON-NLS-1$
+ File libFolder = new File(absolutePath);
if (!libFolder.exists()) {
String out = NLS.bind(
ConsoleTestMessages.MappingTestProject_folder_not_found,
- res.getAbsolutePath() + "/" + TestUtilsCommon.LIB_FOLDER); //$NON-NLS-1$
+ absolutePath);
throw new RuntimeException(out);
}
List<IPath> libs = new ArrayList<IPath>();
17 years, 2 months
JBoss Tools SVN: r10874 - trunk/hibernatetools/plugins/org.hibernate.eclipse.mapper/src/org/hibernate/eclipse/mapper/editors/reveng.
by jbosstools-commits@lists.jboss.org
Author: vyemialyanchyk
Date: 2008-10-16 06:31:27 -0400 (Thu, 16 Oct 2008)
New Revision: 10874
Modified:
trunk/hibernatetools/plugins/org.hibernate.eclipse.mapper/src/org/hibernate/eclipse/mapper/editors/reveng/TablePropertiesBlock.java
Log:
JBIDE-2784
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.mapper/src/org/hibernate/eclipse/mapper/editors/reveng/TablePropertiesBlock.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.mapper/src/org/hibernate/eclipse/mapper/editors/reveng/TablePropertiesBlock.java 2008-10-16 10:26:40 UTC (rev 10873)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.mapper/src/org/hibernate/eclipse/mapper/editors/reveng/TablePropertiesBlock.java 2008-10-16 10:31:27 UTC (rev 10874)
@@ -26,6 +26,7 @@
import java.util.Iterator;
import java.util.List;
import java.util.Map;
+import java.util.TreeSet;
import org.eclipse.jface.action.Action;
import org.eclipse.jface.action.IAction;
@@ -163,7 +164,27 @@
Map tables = new HashMap();
Map columns = new HashMap();
- if(lds!=null) {
+ if (lds == null) {
+ String tableName = "", namePrefix = "TABLE_"; //$NON-NLS-1$ //$NON-NLS-2$
+ IRevEngTable retable = editor.getReverseEngineeringDefinition().createTable();
+ retable.setCatalog(""); //$NON-NLS-1$
+ retable.setSchema(""); //$NON-NLS-1$
+ TreeSet ts = new TreeSet();
+ IRevEngTable[] retables = editor.getReverseEngineeringDefinition().getTables();
+ char separartor = '%';
+ for (int i = 0; i < retables.length; i++) {
+ ts.add(retables[i].getCatalog() + separartor + retables[i].getSchema() +
+ separartor + retables[i].getName());
+ }
+ String strCatalogSchema = retable.getCatalog() + separartor + retable.getSchema() + separartor;
+ int i = 0;
+ do {
+ tableName = namePrefix + (i++);
+ } while (ts.contains(strCatalogSchema + tableName));
+ retable.setName(tableName);
+ editor.getReverseEngineeringDefinition().addTable(retable);
+ }
+ else {
dialog.setTitle(MapperMessages.TablePropertiesBlock_add_tables_columns);
dialog.setMessage(MapperMessages.TablePropertiesBlock_select_tables_columns);
dialog.setInput(lds);
17 years, 2 months
JBoss Tools SVN: r10873 - trunk/documentation/guides/GettingStartedGuide/en/modules.
by jbosstools-commits@lists.jboss.org
Author: ochikvina
Date: 2008-10-16 06:26:40 -0400 (Thu, 16 Oct 2008)
New Revision: 10873
Modified:
trunk/documentation/guides/GettingStartedGuide/en/modules/first_seam.xml
Log:
https://jira.jboss.org/jira/browse/JBDS-446 - updating the section;
Modified: trunk/documentation/guides/GettingStartedGuide/en/modules/first_seam.xml
===================================================================
--- trunk/documentation/guides/GettingStartedGuide/en/modules/first_seam.xml 2008-10-16 10:23:14 UTC (rev 10872)
+++ trunk/documentation/guides/GettingStartedGuide/en/modules/first_seam.xml 2008-10-16 10:26:40 UTC (rev 10873)
@@ -23,7 +23,8 @@
<section id="start_dev_db">
<title>Start Development Database</title>
- <para>Before opening the JBoss Developer studio you need to <ulink url="http://anonsvn.jboss.org/repos/jbosstools/trunk/documentation/guides/Gett..."
+ <para>Before opening the JBoss Developer studio you need to <ulink
+ url="http://anonsvn.jboss.org/repos/jbosstools/trunk/documentation/guides/Gett..."
>download</ulink> and start a Workshop Database.</para>
<para>To start the database just run <property>./runDBServer.sh</property> or
<property>runDBServer.bat</property> from the database directory.</para>
@@ -43,8 +44,8 @@
<section id="create_deploy_seam">
<title>Create and deploy Seam Web Project</title>
- <para>Minimize the terminal window and run the JBoss Developer Studio from Applications Menu
- or from the desktop icon.</para>
+ <para>Minimize the terminal window and run the <property>JBoss Developer Studio</property>
+ from Applications Menu or from the desktop icon.</para>
<para>First of all you get the Workspace Launcher. Change the default workspace location if
it's needed. Click on <property>Ok</property>. </para>
@@ -61,12 +62,11 @@
in <link linkend="Welcome">previous</link> chapter. Now select <property>Create
New...</property> icon and then press on <property>Create Seam Project</property> link.</para>
- <para>The New Seam Project wizard is started. You need to enter a name (e.g.,
- "workshop") and a location directory for your new project. The wizard has
- an option for selecting the actual Server (and not just WTP runtime) that will be used for
- the project. This allow the wizard to correctly identify where the needed datasource and
- driver libraries need to go. All settings are already specified. Click on
- <property>Next</property>.</para>
+ <para>The <property>New Seam Project wizard</property> is started. You need to enter a name
+ (e.g., "workshop") and a location directory for your new project. The
+ wizard has an option for selecting the actual Server (and not just WTP runtime) that will be
+ used for the project. This allows the wizard to correctly identify where the needed
+ datasource and driver libraries need to go.</para>
<figure>
<title>New Seam Project Wizard</title>
@@ -77,13 +77,19 @@
</mediaobject>
</figure>
- <para>Next, you will be asked to select the "features" you want to use in your project. This
- allows JBoss Developer Studio to setup the appropriate tooling for your project. Since JBoss
- Seam integrates all popular Java EE frameworks, you can select any combination of
- technologies from the list. Here, for this project, we will select Dynamic Web Module, Java,
- JavaServer Faces (JSF), and Seam Facet for a typical database-driven web application. The
- default project facets should suffice, click on <property>Next</property>.</para>
+ <para>All settings are already specified here, you can just modify the Configuration. Chose needed
+ one from the list of already predefined configurations or click on the <emphasis>
+ <property>Modify...</property>
+ </emphasis> to configure your custom facets pattern.</para>
+ <para>On the hole appeared dialog allows to select the "features" you want to use in your
+ project. Doing this <property>JBoss Developer Studio</property> setups the appropriate
+ tooling for your project. Since JBoss Seam integrates all popular Java EE frameworks, you
+ can select any combination of technologies from the list. Here, for the default
+ configuration, Dynamic Web Module, Java, JavaServer Faces (JSF), and Seam Facet are already
+ selected for a typical database-driven web application. The default project facets should
+ suffice.</para>
+
<figure id="ProjectFacetsSpecifyingScreen">
<title>Project Facets Specifying</title>
<mediaobject>
@@ -93,11 +99,9 @@
</mediaobject>
</figure>
- <para>In the <link linkend="ProjectFacetsSpecifyingScreen">Project Facets Specifying</link>
- form you can also bring up server runtimes panel by clicking <property>Show
- Runtimes</property> in the bottom right corner. This panel shows available server runtimes.
- Then this button will be changed into <property>Hide Runtimes</property> one.</para>
- <para>Click <property>Next</property> to proceed further.</para>
+ <para>In the <property>Project Facets wizard</property> form you can also bring up server
+ runtimes panel by clicking <property> Runtimes</property> tab on the right corner. This
+ panel shows available server runtimes.</para>
<figure>
<title>Runtimes Selecting</title>
@@ -107,7 +111,13 @@
</imageobject>
</mediaobject>
</figure>
-
+
+ <para>Click on <emphasis>
+ <property>Ok</property>
+ </emphasis> and then <emphasis>
+ <property>Next</property>
+ </emphasis> to proceed further.</para>
+
<para>A dynamic web application contains both web pages and Java code. The wizard will ask you
where you want to put those files. You can just leave the default values or choose another
folder.</para>
@@ -764,8 +774,8 @@
<section id="use_hibernate_tools">
<title>Use Hibernate Tools to Query Data via JPA</title>
- <para>Now, it's time to write some JPA queries using the Hibernate perspective in <property>JBoss
- Developer Studio</property>.</para>
+ <para>Now, it's time to write some JPA queries using the Hibernate perspective in
+ <property>JBoss Developer Studio</property>.</para>
<para>In the upper right corner of the workbench there is a small icon (see the figure below),
click on it and choose <property>Hibernate</property>.</para>
17 years, 2 months
JBoss Tools SVN: r10872 - trunk/documentation/guides/GettingStartedGuide/en/images/first_seam.
by jbosstools-commits@lists.jboss.org
Author: ochikvina
Date: 2008-10-16 06:23:14 -0400 (Thu, 16 Oct 2008)
New Revision: 10872
Modified:
trunk/documentation/guides/GettingStartedGuide/en/images/first_seam/first_seam3.png
trunk/documentation/guides/GettingStartedGuide/en/images/first_seam/first_seam4.png
trunk/documentation/guides/GettingStartedGuide/en/images/first_seam/first_seam5.png
Log:
https://jira.jboss.org/jira/browse/JBDS-446 - replacing the screenshots by new ones;
Modified: trunk/documentation/guides/GettingStartedGuide/en/images/first_seam/first_seam3.png
===================================================================
(Binary files differ)
Modified: trunk/documentation/guides/GettingStartedGuide/en/images/first_seam/first_seam4.png
===================================================================
(Binary files differ)
Modified: trunk/documentation/guides/GettingStartedGuide/en/images/first_seam/first_seam5.png
===================================================================
(Binary files differ)
17 years, 2 months
JBoss Tools SVN: r10871 - in trunk/smooks/plugins: org.jboss.tools.smooks.javabean/src/org/jboss/tools/smooks/javabean/ui and 4 other directories.
by jbosstools-commits@lists.jboss.org
Author: DartPeng
Date: 2008-10-16 05:28:22 -0400 (Thu, 16 Oct 2008)
New Revision: 10871
Added:
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/IStructuredDataCreationWizard.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/wizards/ISmooksDataCreationAddtionWizard.java
Removed:
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/IStrucutredDataCreationWizard.java
Modified:
trunk/smooks/plugins/org.jboss.tools.smooks.javabean/src/org/jboss/tools/smooks/javabean/analyzer/JavaBeanAnalyzer.java
trunk/smooks/plugins/org.jboss.tools.smooks.javabean/src/org/jboss/tools/smooks/javabean/ui/JavaBeanConfigWizardPage.java
trunk/smooks/plugins/org.jboss.tools.smooks.javabean/src/org/jboss/tools/smooks/javabean/ui/NewJavaBeanStrucutredDataWizard.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/BaseViewerInitor.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/IViewerInitor.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/StructuredDataCreationWizardDailog.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/ViewerInitorStore.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/editors/SmooksGraphicalFormPage.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/editors/TypeIDSelectionWizardPage.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/wizards/SmooksConfigFileNewWizard.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/wizards/TransformDataWizardSelectionPage.java
trunk/smooks/plugins/org.jboss.tools.smooks.xml/src/org/jboss/tools/smooks/xml/AbstractFileSelectionWizardPage.java
trunk/smooks/plugins/org.jboss.tools.smooks.xml/src/org/jboss/tools/smooks/xml/AbstractStructuredDdataWizard.java
Log:
JBIDE-2837
1.Modify the SmooksNewConfigFileWizard file , make it can add addition wizard page and show them.
2.Make the TypeID Selection page can load the Wizard instance by the typeID selected by user.
3.check some bugs
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.javabean/src/org/jboss/tools/smooks/javabean/analyzer/JavaBeanAnalyzer.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.javabean/src/org/jboss/tools/smooks/javabean/analyzer/JavaBeanAnalyzer.java 2008-10-16 08:37:41 UTC (rev 10870)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.javabean/src/org/jboss/tools/smooks/javabean/analyzer/JavaBeanAnalyzer.java 2008-10-16 09:28:22 UTC (rev 10871)
@@ -648,7 +648,9 @@
buildSourceInputProperties(listType, model, false, isError,
current, classLoader);
}
- return model;
+ List list = new ArrayList();
+ if(model != null) list.add(model);
+ return list;
}
public Object buildSourceInputObjects(GraphInformations graphInfo,
@@ -719,7 +721,9 @@
setSelectorIsUsed(rootClassName);
buildChildrenOfTargetInputModel(listType, rootModel, false,
rootIsError, current, loader);
- return rootModel;
+ List list = new ArrayList();
+ list.add(rootModel);
+ return list;
}
protected void buildChildrenOfTargetInputModel(
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.javabean/src/org/jboss/tools/smooks/javabean/ui/JavaBeanConfigWizardPage.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.javabean/src/org/jboss/tools/smooks/javabean/ui/JavaBeanConfigWizardPage.java 2008-10-16 08:37:41 UTC (rev 10870)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.javabean/src/org/jboss/tools/smooks/javabean/ui/JavaBeanConfigWizardPage.java 2008-10-16 09:28:22 UTC (rev 10871)
@@ -11,29 +11,24 @@
package org.jboss.tools.smooks.javabean.ui;
import org.eclipse.jdt.core.IJavaProject;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.StructuredSelection;
import org.eclipse.jface.viewers.TreeViewer;
-import org.eclipse.jface.wizard.IWizard;
import org.eclipse.jface.wizard.IWizardNode;
import org.eclipse.jface.wizard.IWizardPage;
-import org.eclipse.jface.wizard.WizardSelectionPage;
+import org.eclipse.jface.wizard.WizardPage;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.events.SelectionListener;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Text;
-import org.eclipse.ui.INewWizard;
import org.jboss.tools.smooks.javabean.model.JavaBeanModel;
-import org.jboss.tools.smooks.ui.IStrucutredDataCreationWizard;
/**
* @author Dart Peng
*
* @CreateTime Jul 21, 2008
*/
-public class JavaBeanConfigWizardPage extends WizardSelectionPage implements
+public class JavaBeanConfigWizardPage extends WizardPage implements
SelectionListener {
TreeViewer treeViewer;
@@ -58,38 +53,6 @@
setDescription("Select the JavaBean class");
}
- public void activeNextWizardNode(IWizardNode node){
- setSelectedNode(node);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.wizard.WizardSelectionPage#getNextPage()
- */
- public IWizardPage getNextPage() {
- if (this.getSelectedNode() == null) {
- return null;
- }
-
- boolean isCreated = getSelectedNode().isContentCreated();
-
- IWizard wizard = getSelectedNode().getWizard();
-
- if (wizard == null) {
- setSelectedNode(null);
- return null;
- }
- if (!isCreated) {
- if (wizard instanceof INewWizard) {
- StructuredSelection selection = new StructuredSelection(project);
- ((INewWizard) wizard).init(null, selection);
- }
- wizard.addPages();
- }
- return wizard.getStartingPage();
- }
-
protected void initilize() {
}
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.javabean/src/org/jboss/tools/smooks/javabean/ui/NewJavaBeanStrucutredDataWizard.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.javabean/src/org/jboss/tools/smooks/javabean/ui/NewJavaBeanStrucutredDataWizard.java 2008-10-16 08:37:41 UTC (rev 10870)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.javabean/src/org/jboss/tools/smooks/javabean/ui/NewJavaBeanStrucutredDataWizard.java 2008-10-16 09:28:22 UTC (rev 10871)
@@ -20,7 +20,6 @@
import org.eclipse.jdt.core.JavaCore;
import org.eclipse.jdt.internal.core.JavaProject;
import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.wizard.IWizardNode;
import org.eclipse.jface.wizard.Wizard;
import org.eclipse.ui.IEditorInput;
import org.eclipse.ui.IEditorSite;
@@ -28,17 +27,16 @@
import org.eclipse.ui.INewWizard;
import org.eclipse.ui.IWorkbench;
import org.jboss.tools.smooks.javabean.JavaBeanActivator;
-import org.jboss.tools.smooks.ui.IStrucutredDataCreationWizard;
+import org.jboss.tools.smooks.ui.IStructuredDataCreationWizard;
/**
* @author Dart Peng
* @Date Aug 5, 2008
*/
-public class NewJavaBeanStrucutredDataWizard extends Wizard implements IStrucutredDataCreationWizard,INewWizard{
+public class NewJavaBeanStrucutredDataWizard extends Wizard implements IStructuredDataCreationWizard,INewWizard{
JavaBeanConfigWizardPage page = null;
IJavaProject project = null;
Object result = null;
- IWizardNode wizard;
Properties properties = new Properties();
/* (non-Javadoc)
* @see org.eclipse.jface.wizard.Wizard#addPages()
@@ -48,9 +46,6 @@
super.addPages();
if(page == null){
page = new JavaBeanConfigWizardPage(project);
- if(this.wizard != null){
- page.activeNextWizardNode(wizard);
- }
this.addPage(page);
}
}
@@ -102,12 +97,4 @@
}
}
}
-
- public void setNextDataCreationWizardNode(IWizardNode wizard) {
- this.wizard = wizard;
- if(page != null){
- page.activeNextWizardNode(this.wizard);
- }
- }
-
}
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/BaseViewerInitor.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/BaseViewerInitor.java 2008-10-16 08:37:41 UTC (rev 10870)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/BaseViewerInitor.java 2008-10-16 09:28:22 UTC (rev 10871)
@@ -63,9 +63,9 @@
/**
* @return the structuredDataLoadWizard
*/
- public IStrucutredDataCreationWizard getStructuredDataLoadWizard() {
+ public IStructuredDataCreationWizard getStructuredDataLoadWizard() {
try {
- return ((IStrucutredDataCreationWizard) configurationElement
+ return ((IStructuredDataCreationWizard) configurationElement
.createExecutableExtension(SmooksExtensionPointConstants.EXTENTION_POINT_ATTRIBUTE_CREATION_WIZARD));
} catch (CoreException e) {
e.printStackTrace();
Copied: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/IStructuredDataCreationWizard.java (from rev 10820, trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/IStrucutredDataCreationWizard.java)
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/IStructuredDataCreationWizard.java (rev 0)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/IStructuredDataCreationWizard.java 2008-10-16 09:28:22 UTC (rev 10871)
@@ -0,0 +1,34 @@
+/*******************************************************************************
+ * Copyright (c) 2008 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.smooks.ui;
+
+import java.util.Properties;
+
+import org.eclipse.jface.wizard.IWizard;
+import org.eclipse.jface.wizard.IWizardNode;
+import org.eclipse.ui.IEditorInput;
+import org.eclipse.ui.IEditorSite;
+
+/**
+ * @author Dart Peng
+ * @Date Aug 5, 2008
+ */
+public interface IStructuredDataCreationWizard extends IWizard {
+
+ public Object getTreeViewerInputContents();
+
+ public void init(IEditorSite site, IEditorInput input);
+
+ public String getInputDataTypeID();
+
+ public Properties getProperties();
+
+}
Property changes on: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/IStructuredDataCreationWizard.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Deleted: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/IStrucutredDataCreationWizard.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/IStrucutredDataCreationWizard.java 2008-10-16 08:37:41 UTC (rev 10870)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/IStrucutredDataCreationWizard.java 2008-10-16 09:28:22 UTC (rev 10871)
@@ -1,36 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Red Hat, Inc.
- * Distributed under license by Red Hat, Inc. All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-package org.jboss.tools.smooks.ui;
-
-import java.util.Properties;
-
-import org.eclipse.jface.wizard.IWizard;
-import org.eclipse.jface.wizard.IWizardNode;
-import org.eclipse.ui.IEditorInput;
-import org.eclipse.ui.IEditorSite;
-
-/**
- * @author Dart Peng
- * @Date Aug 5, 2008
- */
-public interface IStrucutredDataCreationWizard extends IWizard {
-
- public Object getTreeViewerInputContents();
-
- public void init(IEditorSite site, IEditorInput input);
-
- public String getInputDataTypeID();
-
- public Properties getProperties();
-
- public void setNextDataCreationWizardNode(IWizardNode wizardNode);
-
-}
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/IViewerInitor.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/IViewerInitor.java 2008-10-16 08:37:41 UTC (rev 10870)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/IViewerInitor.java 2008-10-16 09:28:22 UTC (rev 10871)
@@ -25,7 +25,7 @@
String getTypeID();
- IStrucutredDataCreationWizard getStructuredDataLoadWizard();
+ IStructuredDataCreationWizard getStructuredDataLoadWizard();
String getName();
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/StructuredDataCreationWizardDailog.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/StructuredDataCreationWizardDailog.java 2008-10-16 08:37:41 UTC (rev 10870)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/StructuredDataCreationWizardDailog.java 2008-10-16 09:28:22 UTC (rev 10871)
@@ -25,10 +25,10 @@
super(parentShell, newWizard);
}
- public IStrucutredDataCreationWizard getCurrentCreationWizard(){
+ public IStructuredDataCreationWizard getCurrentCreationWizard(){
IWizard w = getWizard();
- if(w != null && w instanceof IStrucutredDataCreationWizard){
- return (IStrucutredDataCreationWizard)w;
+ if(w != null && w instanceof IStructuredDataCreationWizard){
+ return (IStructuredDataCreationWizard)w;
}
return null;
}
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/ViewerInitorStore.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/ViewerInitorStore.java 2008-10-16 08:37:41 UTC (rev 10870)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/ViewerInitorStore.java 2008-10-16 09:28:22 UTC (rev 10871)
@@ -43,7 +43,7 @@
return null;
}
- public IStrucutredDataCreationWizard getStructuredDataCreationWizard(String typeID) {
+ public IStructuredDataCreationWizard getStructuredDataCreationWizard(String typeID) {
if (this.getInitorMap() == null)
return null;
IViewerInitor initor = this.getInitorMap().get(typeID);
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/editors/SmooksGraphicalFormPage.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/editors/SmooksGraphicalFormPage.java 2008-10-16 08:37:41 UTC (rev 10870)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/editors/SmooksGraphicalFormPage.java 2008-10-16 09:28:22 UTC (rev 10871)
@@ -112,7 +112,7 @@
import org.jboss.tools.smooks.model.SmooksFactory;
import org.jboss.tools.smooks.model.SmooksResourceListType;
import org.jboss.tools.smooks.model.util.SmooksModelConstants;
-import org.jboss.tools.smooks.ui.IStrucutredDataCreationWizard;
+import org.jboss.tools.smooks.ui.IStructuredDataCreationWizard;
import org.jboss.tools.smooks.ui.IViewerInitor;
import org.jboss.tools.smooks.ui.StructuredDataCreationWizardDailog;
import org.jboss.tools.smooks.ui.gef.editparts.SmooksEditPartFactory;
@@ -454,9 +454,7 @@
protected void initTargetTreeViewer() {
if (this.targetTreeViewerInputModel != null) {
- List arrayList = new ArrayList();
- arrayList.add(targetTreeViewerInputModel);
- targetViewer.setInput(arrayList);
+ targetViewer.setInput(targetTreeViewerInputModel);
}
}
@@ -476,9 +474,7 @@
protected void initSourceTreeViewer() {
if (this.sourceTreeViewerInputModel != null) {
- List arrayList = new ArrayList();
- arrayList.add(sourceTreeViewerInputModel);
- sourceViewer.setInput(arrayList);
+ sourceViewer.setInput(sourceTreeViewerInputModel);
}
}
@@ -993,7 +989,7 @@
StructuredDataCreationWizardDailog dialog = new StructuredDataCreationWizardDailog(
getEditorSite().getShell(), wizard);
if (dialog.open() == WizardDialog.OK) {
- IStrucutredDataCreationWizard cw = dialog
+ IStructuredDataCreationWizard cw = dialog
.getCurrentCreationWizard();
this.getSmooksConfigurationFileGenerateContext().addProperties(
cw.getProperties());
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/editors/TypeIDSelectionWizardPage.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/editors/TypeIDSelectionWizardPage.java 2008-10-16 08:37:41 UTC (rev 10870)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/editors/TypeIDSelectionWizardPage.java 2008-10-16 09:28:22 UTC (rev 10871)
@@ -25,7 +25,9 @@
import org.eclipse.jface.viewers.LabelProvider;
import org.eclipse.jface.viewers.Viewer;
import org.eclipse.jface.wizard.IWizard;
+import org.eclipse.jface.wizard.IWizardContainer;
import org.eclipse.jface.wizard.IWizardNode;
+import org.eclipse.jface.wizard.IWizardPage;
import org.eclipse.jface.wizard.WizardPage;
import org.eclipse.swt.SWT;
import org.eclipse.swt.graphics.Image;
@@ -40,10 +42,11 @@
import org.eclipse.ui.forms.widgets.Hyperlink;
import org.jboss.tools.smooks.analyzer.AnalyzerFactory;
import org.jboss.tools.smooks.analyzer.DataTypeID;
-import org.jboss.tools.smooks.ui.IStrucutredDataCreationWizard;
+import org.jboss.tools.smooks.ui.IStructuredDataCreationWizard;
import org.jboss.tools.smooks.ui.IViewerInitor;
import org.jboss.tools.smooks.ui.StructuredDataCreationWizardDailog;
import org.jboss.tools.smooks.ui.ViewerInitorStore;
+import org.jboss.tools.smooks.ui.wizards.ISmooksDataCreationAddtionWizard;
import org.jboss.tools.smooks.ui.wizards.TransformSelectWizardNode;
/**
@@ -51,15 +54,9 @@
* Date : Sep 5, 2008
*/
public class TypeIDSelectionWizardPage extends WizardPage {
- /**
- * @deprecated
- */
- protected IStrucutredDataCreationWizard sourceWizard;
+ protected IWizard sourceDataCreationWizard;
- /**
- * @deprecated
- */
- protected IStrucutredDataCreationWizard targetWizard;
+ protected IWizard targetDataCreationWizard;
private Object sourceTreeViewerInputContents;
@@ -70,6 +67,8 @@
private List sourceList;
private String sourceID = null;
private String targetID = null;
+ private String oldSourceID = null;
+ private String oldTargetID = null;
private IStructuredSelection selection;
private boolean showDataSelectPage = false;
@@ -106,6 +105,91 @@
this.showDataSelectPage = showDataSelectPage;
}
+ @Override
+ public boolean canFlipToNextPage() {
+ if (this.getSourceID() != null || getTargetID() != null) {
+ return true;
+ }
+ return false;
+ }
+
+ @Override
+ public IWizardPage getNextPage() {
+ String sourceID = this.getSourceID();
+ String targetID = this.getTargetID();
+ IStructuredDataCreationWizard sourceWizard = null;
+ IStructuredDataCreationWizard targetWizard = null;
+ IWizard rootWizard = getWizard();
+ ISmooksDataCreationAddtionWizard wizard = (ISmooksDataCreationAddtionWizard) rootWizard;
+ if (sourceID == null) {
+ wizard.clearSourceWizardPages();
+ }
+ if (targetID == null) {
+ wizard.clearTargetWizardPages();
+ }
+ if (sourceID != null && (!sourceID.equals(oldSourceID))) {
+ sourceWizard = ViewerInitorStore.getInstance()
+ .getStructuredDataCreationWizard(sourceID);
+ oldSourceID = sourceID;
+ }
+ if (targetID != null && (!targetID.equals(oldTargetID))) {
+ targetWizard = ViewerInitorStore.getInstance()
+ .getStructuredDataCreationWizard(targetID);
+ oldTargetID = targetID;
+ }
+ if (!wizardIsCreated(sourceWizard) && sourceWizard != null) {
+ if (sourceWizard instanceof INewWizard) {
+ ((INewWizard) sourceWizard).init(null, selection);
+ }
+ sourceWizard.addPages();
+ }
+ if (!wizardIsCreated(targetWizard) && targetWizard != null) {
+ if (targetWizard instanceof INewWizard) {
+ ((INewWizard) targetWizard).init(null, selection);
+ }
+ targetWizard.addPages();
+ }
+ addDataCreationPages(sourceWizard, targetWizard);
+ return super.getNextPage();
+ }
+
+ private void addDataCreationPages(IWizard sourceWizard, IWizard targetWizard) {
+ IWizard rootWizard = getWizard();
+ if (rootWizard instanceof ISmooksDataCreationAddtionWizard) {
+ ISmooksDataCreationAddtionWizard wizard = (ISmooksDataCreationAddtionWizard) rootWizard;
+ if (sourceWizard != null) {
+ wizard.clearSourceWizardPages();
+ IWizardPage[] pages = sourceWizard.getPages();
+ for (int i = 0; i < pages.length; i++) {
+ IWizardPage p = pages[i];
+ wizard.addSourceWizardPage(p);
+ p.setWizard(rootWizard);
+ }
+ }
+
+ if (targetWizard != null) {
+ wizard.clearTargetWizardPages();
+ IWizardPage[] pages = targetWizard.getPages();
+ for (int i = 0; i < pages.length; i++) {
+ IWizardPage p = pages[i];
+ wizard.addTargetWizardPage(p);
+ p.setWizard(rootWizard);
+ }
+ }
+ }
+ sourceDataCreationWizard = sourceWizard;
+ targetDataCreationWizard = targetWizard;
+ }
+
+ private boolean wizardIsCreated(IWizard wizard) {
+ if (wizard == null)
+ return false;
+ if (wizard.getPageCount() <= 0) {
+ return false;
+ }
+ return true;
+ }
+
/*
* (non-Javadoc)
*
@@ -151,6 +235,8 @@
}
});
+ // TODO don't show this
+ sourceDataLink.setVisible(false);
targetDataLink = new Hyperlink(mainComposite, SWT.NONE);
targetDataLink.setText("Target Model Select:Empty");
targetDataLink.addHyperlinkListener(new IHyperlinkListener() {
@@ -168,6 +254,8 @@
}
});
+ // TODO don't show this
+ targetDataLink.setVisible(false);
this.setControl(mainComposite);
}
@@ -183,7 +271,7 @@
IWizardNode wn = getSourceWizard(dataID);
// setSelectedNode(wn);
IWizard sw = wn.getWizard();
- if (sw instanceof IStrucutredDataCreationWizard) {
+ if (sw instanceof IStructuredDataCreationWizard) {
// ((IStrucutredDataCreationWizard)sw).i
}
if (sw instanceof INewWizard) {
@@ -269,7 +357,7 @@
IViewerInitor viewerInitor = (IViewerInitor) iterator.next();
if (viewerInitor.getTypeID().equals(id)) {
TransformSelectWizardNode wn = new TransformSelectWizardNode();
- IStrucutredDataCreationWizard wizard = viewerInitor
+ IStructuredDataCreationWizard wizard = viewerInitor
.getStructuredDataLoadWizard();
if (wizard == null)
return null;
@@ -309,6 +397,10 @@
String targetID = getDataTypeID(target);
setTargetID(targetID);
}
+ IWizardContainer container = getContainer();
+ if (container != null) {
+ container.updateButtons();
+ }
}
});
@@ -360,22 +452,7 @@
}
- public IStrucutredDataCreationWizard getSourceWizard() {
- return sourceWizard;
- }
- public void setSourceWizard(IStrucutredDataCreationWizard sourceWizard) {
- this.sourceWizard = sourceWizard;
- }
-
- public IStrucutredDataCreationWizard getTargetWizard() {
- return targetWizard;
- }
-
- public void setTargetWizard(IStrucutredDataCreationWizard targetWizard) {
- this.targetWizard = targetWizard;
- }
-
public Object getSourceTreeViewerInputContents() {
return sourceTreeViewerInputContents;
}
@@ -393,4 +470,12 @@
Object targetTreeViewerInputContents) {
this.targetTreeViewerInputContents = targetTreeViewerInputContents;
}
+
+ public IWizard getSourceDataCreationWizard() {
+ return sourceDataCreationWizard;
+ }
+
+ public IWizard getTargetDataCreationWizard() {
+ return targetDataCreationWizard;
+ }
}
Added: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/wizards/ISmooksDataCreationAddtionWizard.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/wizards/ISmooksDataCreationAddtionWizard.java (rev 0)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/wizards/ISmooksDataCreationAddtionWizard.java 2008-10-16 09:28:22 UTC (rev 10871)
@@ -0,0 +1,26 @@
+/**
+ *
+ */
+package org.jboss.tools.smooks.ui.wizards;
+
+import org.eclipse.jface.wizard.IWizardPage;
+
+/**
+ * @author dart
+ *
+ */
+public interface ISmooksDataCreationAddtionWizard {
+
+ public void addSourceWizardPage(IWizardPage page);
+
+ public void removeSourceWIzardPage(IWizardPage page);
+
+ public void clearSourceWizardPages();
+
+ public void addTargetWizardPage(IWizardPage page);
+
+ public void removeTargetWIzardPage(IWizardPage page);
+
+ public void clearTargetWizardPages();
+
+}
Property changes on: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/wizards/ISmooksDataCreationAddtionWizard.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/wizards/SmooksConfigFileNewWizard.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/wizards/SmooksConfigFileNewWizard.java 2008-10-16 08:37:41 UTC (rev 10870)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/wizards/SmooksConfigFileNewWizard.java 2008-10-16 09:28:22 UTC (rev 10871)
@@ -4,6 +4,7 @@
import java.io.IOException;
import java.io.InputStream;
import java.lang.reflect.InvocationTargetException;
+import java.util.ArrayList;
import java.util.List;
import org.eclipse.core.resources.IFile;
@@ -14,6 +15,8 @@
import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.jface.operation.IRunnableWithProgress;
import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.wizard.IWizard;
+import org.eclipse.jface.wizard.IWizardPage;
import org.eclipse.jface.wizard.Wizard;
import org.eclipse.ui.INewWizard;
import org.eclipse.ui.IWorkbench;
@@ -22,6 +25,7 @@
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.ide.IDE;
import org.jboss.tools.smooks.graphical.util.GraphicalInformationSaver;
+import org.jboss.tools.smooks.ui.IStructuredDataCreationWizard;
import org.jboss.tools.smooks.ui.editors.SmooksFileEditorInput;
import org.jboss.tools.smooks.ui.editors.SmooksFormEditor;
import org.jboss.tools.smooks.ui.editors.TypeIDSelectionWizardPage;
@@ -35,10 +39,15 @@
* the same extension, it will be able to open it.
*/
-public class SmooksConfigFileNewWizard extends Wizard implements INewWizard {
+public class SmooksConfigFileNewWizard extends Wizard implements INewWizard,
+ ISmooksDataCreationAddtionWizard {
private SmooksConfigFileNewWizardPage page;
private TypeIDSelectionWizardPage typeIDPage;
+ private List<IWizardPage> sourceCreationPages = new ArrayList<IWizardPage>();
+
+ private List<IWizardPage> targetCreationPages = new ArrayList<IWizardPage>();
+
private IStructuredSelection selection;
private IWorkbench workbench;
@@ -131,22 +140,39 @@
try {
SmooksFileEditorInput input = new SmooksFileEditorInput(
file);
- Object sourceObj = typeIDPage.getSourceTreeViewerInputContents();
- if(sourceObj instanceof List){
- if(!((List)sourceObj).isEmpty()){
- sourceObj = ((List)sourceObj).get(0);
- }
+ IWizard sourceWizard = typeIDPage
+ .getSourceDataCreationWizard();
+ IWizard targetWizard = typeIDPage
+ .getTargetDataCreationWizard();
+ if (sourceWizard != null) {
+ sourceWizard.performFinish();
}
- input.setSourceTreeViewerInputContents(sourceObj);
-
- Object targetObj = typeIDPage.getSourceTreeViewerInputContents();
- if(targetObj instanceof List){
- if(!((List)targetObj).isEmpty()){
- targetObj = ((List)targetObj).get(0);
- }
+ if (targetWizard != null) {
+ targetWizard.performFinish();
}
- input.setTargetTreeViewerInputContents(targetObj);
+ if (sourceWizard instanceof IStructuredDataCreationWizard) {
+ Object sourceObj = ((IStructuredDataCreationWizard) sourceWizard)
+ .getTreeViewerInputContents();
+// if (sourceObj instanceof List) {
+// if (!((List) sourceObj).isEmpty()) {
+// sourceObj = ((List) sourceObj).get(0);
+// }
+// }
+ input.setSourceTreeViewerInputContents(sourceObj);
+ }
+ if (targetWizard instanceof IStructuredDataCreationWizard) {
+ Object targetObj = ((IStructuredDataCreationWizard) targetWizard)
+ .getTreeViewerInputContents();
+// if (targetObj instanceof List) {
+// if (!((List) targetObj).isEmpty()) {
+// targetObj = ((List) targetObj).get(0);
+// }
+// }
+ input.setTargetTreeViewerInputContents(targetObj);
+
+ }
+
IDE.openEditor(page, input, SmooksFormEditor.EDITOR_ID,
true);// openEditor(page, file, true);
} catch (PartInitException e) {
@@ -184,4 +210,92 @@
public void setSelection(IStructuredSelection selection) {
this.selection = selection;
}
+
+ public void addSourceWizardPage(IWizardPage page) {
+ sourceCreationPages.add(page);
+ page.setTitle("Source Data Selection Page");
+ }
+
+ public void addTargetWizardPage(IWizardPage page) {
+ targetCreationPages.add(page);
+ page.setTitle("Target Data Selection Page");
+ }
+
+ public void clearSourceWizardPages() {
+ // for (Iterator iterator = sourceCreationPages.iterator();
+ // iterator.hasNext();) {
+ // IWizardPage page = (IWizardPage) iterator.next();
+ // if(page != null){
+ // page.dispose();
+ // }
+ // }
+ sourceCreationPages.clear();
+ }
+
+ private IWizardPage getSourceCreationPage(IWizardPage page) {
+ if (page == typeIDPage) {
+ if (sourceCreationPages.isEmpty())
+ return null;
+ return (IWizardPage) sourceCreationPages.get(0);
+ }
+ if (sourceCreationPages.contains(page)) {
+ int i = sourceCreationPages.indexOf(page);
+ if ((i + 1) >= sourceCreationPages.size()) {
+ return null;
+ }
+ return (IWizardPage) sourceCreationPages.get(i + 1);
+ }
+ return null;
+ }
+
+ private IWizardPage getTargetCreationPage(IWizardPage page) {
+ if (page == typeIDPage) {
+ if (targetCreationPages.isEmpty())
+ return null;
+ return (IWizardPage) targetCreationPages.get(0);
+ }
+ if (targetCreationPages.contains(page)) {
+ int i = targetCreationPages.indexOf(page);
+ if ((i + 1) >= targetCreationPages.size()) {
+ return null;
+ }
+ return (IWizardPage) targetCreationPages.get(i + 1);
+ }
+ if (sourceCreationPages.contains(page)) {
+ if (sourceCreationPages.get(sourceCreationPages.size() - 1) == page) {
+ return (IWizardPage) targetCreationPages.get(0);
+ }
+ }
+ return null;
+ }
+
+ @Override
+ public IWizardPage getNextPage(IWizardPage page) {
+ IWizardPage p = getSourceCreationPage(page);
+ if (p != null)
+ return p;
+ p = getTargetCreationPage(page);
+ if (p != null)
+ return p;
+ return super.getNextPage(page);
+ }
+
+ public void clearTargetWizardPages() {
+ // for (Iterator iterator = sourceCreationPages.iterator();
+ // iterator.hasNext();) {
+ // IWizardPage page = (IWizardPage) iterator.next();
+ // if(page != null){
+ // page.dispose();
+ // }
+ // }
+ targetCreationPages.clear();
+ }
+
+ public void removeSourceWIzardPage(IWizardPage page) {
+ sourceCreationPages.remove(page);
+ }
+
+ public void removeTargetWIzardPage(IWizardPage page) {
+ targetCreationPages.remove(page);
+ }
}
\ No newline at end of file
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/wizards/TransformDataWizardSelectionPage.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/wizards/TransformDataWizardSelectionPage.java 2008-10-16 08:37:41 UTC (rev 10870)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/wizards/TransformDataWizardSelectionPage.java 2008-10-16 09:28:22 UTC (rev 10871)
@@ -35,7 +35,7 @@
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Label;
-import org.jboss.tools.smooks.ui.IStrucutredDataCreationWizard;
+import org.jboss.tools.smooks.ui.IStructuredDataCreationWizard;
import org.jboss.tools.smooks.ui.IViewerInitor;
import org.jboss.tools.smooks.ui.ViewerInitorStore;
@@ -89,7 +89,7 @@
String des = ((TransformSelectWizardNode)node).getDescription();
desLabel.setText(des);
}
- IStrucutredDataCreationWizard wizard = (IStrucutredDataCreationWizard) node
+ IStructuredDataCreationWizard wizard = (IStructuredDataCreationWizard) node
.getWizard();
TransformDataSelectionWizard pw = (TransformDataSelectionWizard) getWizard();
wizard.init(pw.getSite(), pw.getInput());
@@ -141,7 +141,7 @@
for (Iterator iterator = viewers.iterator(); iterator.hasNext();) {
IViewerInitor viewerInitor = (IViewerInitor) iterator.next();
TransformSelectWizardNode wn = new TransformSelectWizardNode();
- IStrucutredDataCreationWizard wizard = viewerInitor
+ IStructuredDataCreationWizard wizard = viewerInitor
.getStructuredDataLoadWizard();
if (wizard == null)
continue;
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.xml/src/org/jboss/tools/smooks/xml/AbstractFileSelectionWizardPage.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.xml/src/org/jboss/tools/smooks/xml/AbstractFileSelectionWizardPage.java 2008-10-16 08:37:41 UTC (rev 10870)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.xml/src/org/jboss/tools/smooks/xml/AbstractFileSelectionWizardPage.java 2008-10-16 09:28:22 UTC (rev 10871)
@@ -7,14 +7,13 @@
import java.util.Collections;
import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.emf.common.ui.dialogs.WorkspaceResourceDialog;
import org.eclipse.jface.viewers.CheckboxTableViewer;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.wizard.IWizard;
import org.eclipse.jface.wizard.IWizardNode;
import org.eclipse.jface.wizard.IWizardPage;
-import org.eclipse.jface.wizard.WizardSelectionPage;
+import org.eclipse.jface.wizard.WizardPage;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.ModifyEvent;
import org.eclipse.swt.events.ModifyListener;
@@ -35,7 +34,7 @@
*
* @author Dart Peng Date : 2008-8-13
*/
-public abstract class AbstractFileSelectionWizardPage extends WizardSelectionPage
+public abstract class AbstractFileSelectionWizardPage extends WizardPage
implements SelectionListener {
protected IStructuredSelection selection;
protected Object returnObject = null;
@@ -66,33 +65,6 @@
/*
* (non-Javadoc)
*
- * @see org.eclipse.jface.wizard.WizardSelectionPage#getNextPage()
- */
- public IWizardPage getNextPage() {
- if (this.getSelectedNode() == null) {
- return null;
- }
-
- boolean isCreated = getSelectedNode().isContentCreated();
-
- IWizard wizard = getSelectedNode().getWizard();
-
- if (wizard == null) {
- setSelectedNode(null);
- return null;
- }
- if (!isCreated) {
- if (wizard instanceof INewWizard) {
- ((INewWizard) wizard).init(null, getSelection());
- }
- wizard.addPages();
- }
- return wizard.getStartingPage();
- }
-
- /*
- * (non-Javadoc)
- *
* @see org.eclipse.jface.dialogs.IDialogPage#createControl(org.eclipse.swt.widgets.Composite)
*/
public void createControl(Composite parent) {
@@ -262,10 +234,6 @@
return xsdComposite;
}
-
- public void activeNextWizardNode(IWizardNode node){
- setSelectedNode(node);
- }
abstract protected Object loadedTheObject(String path) throws Exception;
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.xml/src/org/jboss/tools/smooks/xml/AbstractStructuredDdataWizard.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.xml/src/org/jboss/tools/smooks/xml/AbstractStructuredDdataWizard.java 2008-10-16 08:37:41 UTC (rev 10870)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.xml/src/org/jboss/tools/smooks/xml/AbstractStructuredDdataWizard.java 2008-10-16 09:28:22 UTC (rev 10871)
@@ -10,14 +10,14 @@
import org.eclipse.ui.IEditorSite;
import org.eclipse.ui.INewWizard;
import org.eclipse.ui.IWorkbench;
-import org.jboss.tools.smooks.ui.IStrucutredDataCreationWizard;
+import org.jboss.tools.smooks.ui.IStructuredDataCreationWizard;
/**
* @author Dart
*
*/
public abstract class AbstractStructuredDdataWizard extends Wizard implements
- IStrucutredDataCreationWizard ,INewWizard{
+ IStructuredDataCreationWizard ,INewWizard{
protected IWorkbench workbench;
protected IStructuredSelection selection;
@@ -37,7 +37,6 @@
if(page == null){
page = createAbstractFileSelectionWizardPage();
page.setSelection(this.selection);
- page.activeNextWizardNode(strucutredDataCreationWizardNode);
}
this.addPage(page);
}
@@ -61,12 +60,6 @@
public void init(IEditorSite site, IEditorInput input) {
}
- public void setNextDataCreationWizardNode(IWizardNode wizardNode) {
- strucutredDataCreationWizardNode = wizardNode;
- if(page != null){
- page.activeNextWizardNode(strucutredDataCreationWizardNode);
- }
- }
public void init(IWorkbench workbench, IStructuredSelection selection) {
this.workbench = workbench;
17 years, 2 months
JBoss Tools SVN: r10870 - trunk/jbpm/plugins/org.jboss.tools.jbpm.convert.
by jbosstools-commits@lists.jboss.org
Author: Grid.Qian
Date: 2008-10-16 04:37:41 -0400 (Thu, 16 Oct 2008)
New Revision: 10870
Modified:
trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/build.properties
Log:
JBIDE-2912: remove bin folder from build.properties
Modified: trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/build.properties
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/build.properties 2008-10-16 08:17:06 UTC (rev 10869)
+++ trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/build.properties 2008-10-16 08:37:41 UTC (rev 10870)
@@ -4,5 +4,4 @@
.,\
plugin.xml,\
plugin.properties,\
- lib/dom4j-1.6.1.jar,\
- bin/
+ lib/dom4j-1.6.1.jar
17 years, 2 months
JBoss Tools SVN: r10868 - trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/b2j/translate.
by jbosstools-commits@lists.jboss.org
Author: Grid.Qian
Date: 2008-10-16 04:09:32 -0400 (Thu, 16 Oct 2008)
New Revision: 10868
Modified:
trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/b2j/translate/BPMN2JPDL.java
Log:
JBIDE-2911: fix this issue that the generated jpdl decision element's name is null.
Modified: trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/b2j/translate/BPMN2JPDL.java
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/b2j/translate/BPMN2JPDL.java 2008-10-16 07:13:49 UTC (rev 10867)
+++ trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/b2j/translate/BPMN2JPDL.java 2008-10-16 08:09:32 UTC (rev 10868)
@@ -426,7 +426,7 @@
// create a decision
Element decision = DomXmlWriter.addElement(element.getParent(),
B2JMessages.Jpdl_Decision_Element_Name);
- String name = activity.attributeValue(B2JMessages.Dom_Element_Name)
+ String name = TranslateHelper.generateElementName(activity)
+ B2JMessages.Underline + B2JMessages.Loop_Decision;
DomXmlWriter.addAttribute(decision, B2JMessages.Dom_Element_Name, name);
17 years, 2 months
JBoss Tools SVN: r10867 - in trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/b2j: wizard and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: Grid.Qian
Date: 2008-10-16 03:13:49 -0400 (Thu, 16 Oct 2008)
New Revision: 10867
Modified:
trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/b2j/translate/GraphicalFileGenerator.java
trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/b2j/wizard/B2JExportWizard.java
Log:
JBIDE-2901: fix the issue: not correctly generate jpdl files when multi-pools in a bpmn diagram
Modified: trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/b2j/translate/GraphicalFileGenerator.java
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/b2j/translate/GraphicalFileGenerator.java 2008-10-16 06:02:13 UTC (rev 10866)
+++ trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/b2j/translate/GraphicalFileGenerator.java 2008-10-16 07:13:49 UTC (rev 10867)
@@ -242,4 +242,12 @@
}
+ public List<Document> getGpdDefs() {
+ return gpdDefs;
+ }
+
+ public void setGpdDefs(List<Document> gpdDefs) {
+ this.gpdDefs = gpdDefs;
+ }
+
}
Modified: trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/b2j/wizard/B2JExportWizard.java
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/b2j/wizard/B2JExportWizard.java 2008-10-16 06:02:13 UTC (rev 10866)
+++ trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/b2j/wizard/B2JExportWizard.java 2008-10-16 07:13:49 UTC (rev 10867)
@@ -35,20 +35,22 @@
private List<String> strForProcessList = new ArrayList<String>();
private List<String> strForGpdList = new ArrayList<String>();
private List<String> generatedFoldersList = new ArrayList<String>();
+ private List<String> generatedGpdFoldersList = new ArrayList<String>();
public void createGeneratedFile(boolean isOverWrite) {
String[] jpdlFolderNames = new String[this.generatedFoldersList.size()];
- int i = 0;
- for (String name : this.generatedFoldersList) {
- jpdlFolderNames[i] = name;
- i++;
- }
-
String location = super.getContainerPath((IContainer) super
.getTargetLocationSelection().getFirstElement());
+ int i = 0;
if (this.strForProcessList.size() > 0) {
+ // get a jpdl folders array from jpdl folder list
+ for (String name : this.generatedFoldersList) {
+ jpdlFolderNames[i] = name;
+ i++;
+ }
+
i = 0;
String[] strs = new String[strForProcessList.size()];
for (String pro : this.strForProcessList) {
@@ -66,6 +68,12 @@
if (this.strForGpdList.size() > 0) {
i = 0;
+ // get a gpd folders array from gpd folder list
+ for (String name : this.generatedGpdFoldersList) {
+ jpdlFolderNames[i] = name;
+ i++;
+ }
+ i = 0;
String[] strs = new String[strForGpdList.size()];
for (String pro : this.strForGpdList) {
strs[i] = pro;
@@ -105,6 +113,8 @@
warningList.addAll(translator.getWarnings());
errorList.addAll(translator.getErrors());
+
+
// generate jpdl gpd file from *.bpmn_diagram
Document bpmnDiagramDocument = null;
@@ -120,7 +130,11 @@
bpmnFileName);
this.setStrForGpdList(Arrays.asList(generator.translateToStrings()));
-
+
+ for (Document def : generator.getGpdDefs()) {
+ this.generatedGpdFoldersList.add(def.getRootElement().attributeValue(B2JMessages.Dom_Element_Name));
+ }
+
warningList.addAll(generator.getWarnings());
errorList.addAll(generator.getErrors());
17 years, 2 months
JBoss Tools SVN: r10866 - trunk/common/tests/org.jboss.tools.common.text.ext.test/src/org/jboss/tools/common/text/ext/test.
by jbosstools-commits@lists.jboss.org
Author: dgolovin
Date: 2008-10-16 02:02:13 -0400 (Thu, 16 Oct 2008)
New Revision: 10866
Modified:
trunk/common/tests/org.jboss.tools.common.text.ext.test/src/org/jboss/tools/common/text/ext/test/OpenOnsTest.java
Log:
test for bean property hiperlink added
Modified: trunk/common/tests/org.jboss.tools.common.text.ext.test/src/org/jboss/tools/common/text/ext/test/OpenOnsTest.java
===================================================================
--- trunk/common/tests/org.jboss.tools.common.text.ext.test/src/org/jboss/tools/common/text/ext/test/OpenOnsTest.java 2008-10-15 20:32:43 UTC (rev 10865)
+++ trunk/common/tests/org.jboss.tools.common.text.ext.test/src/org/jboss/tools/common/text/ext/test/OpenOnsTest.java 2008-10-16 06:02:13 UTC (rev 10866)
@@ -344,7 +344,28 @@
String fileName = editor.getEditorInput().getName();
assertTrue("TestBean1.java".equals(fileName));
}
+
+ public void testGetBeanPropertyOpenOn() throws CoreException, BadLocationException {
+ IEditorPart editor = WorkbenchUtils.openEditor(USE_BEAN_TEST_FILE);
+ assertTrue(editor instanceof JSPMultiPageEditor);
+ JSPMultiPageEditor jspMultyPageEditor = (JSPMultiPageEditor) editor;
+ ISourceViewer viewer = jspMultyPageEditor.getSourceEditor().getTextViewer();
+
+ IRegion reg = new FindReplaceDocumentAdapter(jspMultyPageEditor.getSourceEditor().getTextViewer().getDocument()).find(0,
+ "property1", true, true, false, false);
+ IHyperlink[] links = HyperlinkDetector.getInstance().detectHyperlinks(viewer, reg, false);
+ assertNotNull(links);
+ assertTrue(links.length!=0);
+ //assertNotNull(links[0].getHyperlinkText());
+ assertNotNull(links[0].toString());
+ links[0].open();
+ JobUtils.waitForIdle();
+ editor = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor();
+ String fileName = editor.getEditorInput().getName();
+ assertTrue("TestBean1.java".equals(fileName));
+ }
+
public static final String FORWARD_TEST_FILE = OPENON_TEST_PROJECT + "/WebContent/forwardHiperlinkTests.jsp";
@@ -419,4 +440,5 @@
fileName = editor.getEditorInput().getName();
assertTrue("includeHiperlinkPage1Tests.jsp".equals(fileName));
}
+
}
17 years, 2 months
JBoss Tools SVN: r10865 - in trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server: providers and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2008-10-15 16:32:43 -0400 (Wed, 15 Oct 2008)
New Revision: 10865
Removed:
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/util/
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/providers/DescriptorXPathViewProvider.java
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/providers/jmx/JMXViewProvider.java
Log:
JBIDE-2908 - infuriating properties view behavior
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/providers/DescriptorXPathViewProvider.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/providers/DescriptorXPathViewProvider.java 2008-10-15 20:25:43 UTC (rev 10864)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/providers/DescriptorXPathViewProvider.java 2008-10-15 20:32:43 UTC (rev 10865)
@@ -27,10 +27,8 @@
import org.eclipse.jface.action.Action;
import org.eclipse.jface.action.IMenuManager;
import org.eclipse.jface.action.Separator;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
import org.eclipse.jface.viewers.ITreeContentProvider;
import org.eclipse.jface.viewers.LabelProvider;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
import org.eclipse.jface.viewers.Viewer;
import org.eclipse.jface.window.Window;
import org.eclipse.swt.SWT;
@@ -39,10 +37,8 @@
import org.eclipse.swt.widgets.MessageBox;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.ui.ISharedImages;
-import org.eclipse.ui.IViewReference;
import org.eclipse.ui.IWorkbench;
import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.IWorkbenchPart;
import org.eclipse.ui.IWorkbenchWindow;
import org.eclipse.ui.PartInitException;
import org.eclipse.ui.PlatformUI;
@@ -62,8 +58,6 @@
import org.jboss.ide.eclipse.as.ui.views.server.extensions.JBossServerViewExtension;
import org.jboss.ide.eclipse.as.ui.views.server.extensions.ServerViewProvider;
import org.jboss.ide.eclipse.as.ui.views.server.providers.descriptors.DescriptorXPathPropertySheetPage;
-import org.jboss.ide.eclipse.as.ui.views.server.util.ViewUtilityMethods;
-import org.jboss.tools.as.wst.server.ui.views.server.JBossServerView;
/**
*
@@ -88,18 +82,8 @@
contentProvider = new XPathTreeContentProvider();
labelProvider = new XPathTreeLabelProvider();
createActions();
- addListeners();
}
- protected void addListeners() {
- JBossServerView.addExtensionFrameListener(
- new ISelectionChangedListener() {
- public void selectionChanged(SelectionChangedEvent event) {
- ViewUtilityMethods.activatePropertiesView(propertyPage);
- }
- });
- }
-
public void setActiveCategory(XPathCategory o) {
if( o != null && o != activeCategory) {
activeCategory = o;
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/providers/jmx/JMXViewProvider.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/providers/jmx/JMXViewProvider.java 2008-10-15 20:25:43 UTC (rev 10864)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/providers/jmx/JMXViewProvider.java 2008-10-15 20:32:43 UTC (rev 10865)
@@ -24,7 +24,6 @@
import org.eclipse.jface.viewers.ISelectionChangedListener;
import org.eclipse.jface.viewers.ITreeContentProvider;
import org.eclipse.jface.viewers.LabelProvider;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.FillLayout;
import org.eclipse.swt.widgets.Composite;
@@ -41,7 +40,6 @@
import org.jboss.ide.eclipse.as.core.server.UnitedServerListenerManager;
import org.jboss.ide.eclipse.as.ui.views.server.extensions.JBossServerViewExtension;
import org.jboss.ide.eclipse.as.ui.views.server.extensions.ServerViewProvider;
-import org.jboss.ide.eclipse.as.ui.views.server.util.ViewUtilityMethods;
import org.jboss.tools.as.wst.server.ui.views.server.JBossServerView;
import org.jboss.tools.as.wst.server.ui.views.server.ExtensionTableViewer.ContentWrapper;
@@ -85,21 +83,6 @@
protected void addListeners() {
- jbossServerViewSelectionListener = new ISelectionChangedListener() {
- public void selectionChanged(SelectionChangedEvent event) {
- Object o = JBossServerView.getDefault()
- .getExtensionFrame().getViewer()
- .getSelectedElement();
- if (o instanceof JMXBean) {
- Display.getDefault().asyncExec(new Runnable() { public void run() {
- ViewUtilityMethods.activatePropertiesView(null);
- }});
- }
- }
- };
-
- JBossServerView.addExtensionFrameListener(jbossServerViewSelectionListener);
-
// make sure we know about server events
serverListener = new JMXServerListener();
UnitedServerListenerManager.getDefault().addListener(serverListener);
17 years, 2 months
JBoss Tools SVN: r10864 - in trunk/seam/plugins/org.jboss.tools.seam.core: src/org/jboss/tools/seam/internal/core/project/facet and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: akazakov
Date: 2008-10-15 16:25:43 -0400 (Wed, 15 Oct 2008)
New Revision: 10864
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/META-INF/MANIFEST.MF
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/Seam2FacetInstallDelegate.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamFacetAbstractInstallDelegate.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamFacetInstallDelegate.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamProjectCreator.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-2731
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/META-INF/MANIFEST.MF
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/META-INF/MANIFEST.MF 2008-10-15 19:42:20 UTC (rev 10863)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/META-INF/MANIFEST.MF 2008-10-15 20:25:43 UTC (rev 10864)
@@ -47,7 +47,8 @@
org.eclipse.wst.sse.ui,
org.eclipse.jst.jsf.common,
org.eclipse.emf.ecore,
- org.eclipse.jst.j2ee.core
+ org.eclipse.jst.j2ee.core,
+ org.eclipse.jst.jsf.facesconfig;bundle-version="1.1.0"
Provide-Package: org.jboss.tools.seam.core,
org.jboss.tools.seam.internal.core,
org.jboss.tools.seam.internal.core.scanner,
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/Seam2FacetInstallDelegate.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/Seam2FacetInstallDelegate.java 2008-10-15 19:42:20 UTC (rev 10863)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/Seam2FacetInstallDelegate.java 2008-10-15 20:25:43 UTC (rev 10864)
@@ -11,12 +11,25 @@
package org.jboss.tools.seam.internal.core.project.facet;
import java.io.File;
+import java.util.Iterator;
+import org.apache.tools.ant.types.FilterSet;
+import org.apache.tools.ant.types.FilterSetCollection;
import org.eclipse.core.resources.IContainer;
import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.emf.common.util.EList;
import org.eclipse.jst.javaee.web.WebApp;
+import org.eclipse.jst.jsf.facesconfig.emf.ApplicationType;
+import org.eclipse.jst.jsf.facesconfig.emf.DefaultLocaleType;
+import org.eclipse.jst.jsf.facesconfig.emf.FacesConfigFactory;
+import org.eclipse.jst.jsf.facesconfig.emf.FacesConfigType;
+import org.eclipse.jst.jsf.facesconfig.emf.LocaleConfigType;
+import org.eclipse.jst.jsf.facesconfig.emf.SupportedLocaleType;
+import org.eclipse.jst.jsf.facesconfig.emf.ViewHandlerType;
+import org.eclipse.jst.jsf.facesconfig.util.FacesConfigArtifactEdit;
import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
import org.eclipse.wst.common.project.facet.core.IProjectFacetVersion;
@@ -82,7 +95,19 @@
@Override
protected void doExecuteForEjb(final IProject project, IProjectFacetVersion fv,
IDataModel model, IProgressMonitor monitor) throws CoreException {
- // TODO
+ FilterSet jdbcFilterSet = SeamFacetFilterSetFactory.createJdbcFilterSet(model);
+ FilterSet projectFilterSet = SeamFacetFilterSetFactory.createProjectFilterSet(model);
+ ejbViewFilterSetCollection = new FilterSetCollection();
+ ejbViewFilterSetCollection.addFilterSet(jdbcFilterSet);
+ ejbViewFilterSetCollection.addFilterSet(projectFilterSet);
+
+ super.doExecuteForEjb(project, fv, model, monitor);
+
+ IResource src = getSrcFolder(project);
+ if(src!=null) {
+ File srcFile = src.getLocation().toFile();
+ AntCopyUtils.copyFileToFolder(new File(seamGenResFolder, "security.drl"), srcFile, false); //$NON-NLS-1$
+ }
}
/*
@@ -110,6 +135,84 @@
/*
* (non-Javadoc)
+ * @see org.jboss.tools.seam.internal.core.project.facet.SeamFacetAbstractInstallDelegate#configureFacesConfigXml(org.eclipse.core.resources.IProject, org.eclipse.core.runtime.IProgressMonitor, java.lang.String)
+ */
+ @Override
+ protected void configureFacesConfigXml(final IProject project, IProgressMonitor monitor, String webConfigName) {
+ FacesConfigArtifactEdit facesConfigEdit = null;
+ try {
+ facesConfigEdit = FacesConfigArtifactEdit.getFacesConfigArtifactEditForWrite(project, webConfigName);
+ FacesConfigType facesConfig = facesConfigEdit.getFacesConfig();
+ EList applications = facesConfig.getApplication();
+ ApplicationType applicationType = null;
+ boolean applicationExists = false;
+ if (applications.size() <= 0) {
+ applicationType = FacesConfigFactory.eINSTANCE.createApplicationType();
+ } else {
+ applicationType = (ApplicationType) applications.get(0);
+ applicationExists = true;
+ }
+ boolean localeConfigExists = false;
+ for (Iterator iterator = applications.iterator(); iterator.hasNext();) {
+ ApplicationType application = (ApplicationType) iterator.next();
+ EList localeConfigs = application.getLocaleConfig();
+ if(localeConfigs.size()>0) {
+ localeConfigExists = true;
+ break;
+ }
+ }
+ if (!localeConfigExists) {
+ LocaleConfigType locale = FacesConfigFactory.eINSTANCE.createLocaleConfigType();
+ DefaultLocaleType defaultLocale = FacesConfigFactory.eINSTANCE.createDefaultLocaleType();
+ defaultLocale.setTextContent("en");
+ locale.setDefaultLocale(defaultLocale);
+ SupportedLocaleType supportedLocale = FacesConfigFactory.eINSTANCE.createSupportedLocaleType();
+ supportedLocale.setTextContent("bg");
+ locale.getSupportedLocale().add(supportedLocale);
+ supportedLocale = FacesConfigFactory.eINSTANCE.createSupportedLocaleType();
+ supportedLocale.setTextContent("de");
+ locale.getSupportedLocale().add(supportedLocale);
+ supportedLocale = FacesConfigFactory.eINSTANCE.createSupportedLocaleType();
+ supportedLocale.setTextContent("en");
+ locale.getSupportedLocale().add(supportedLocale);
+ supportedLocale = FacesConfigFactory.eINSTANCE.createSupportedLocaleType();
+ supportedLocale.setTextContent("fr");
+ locale.getSupportedLocale().add(supportedLocale);
+ supportedLocale = FacesConfigFactory.eINSTANCE.createSupportedLocaleType();
+ supportedLocale.setTextContent("tr");
+ locale.getSupportedLocale().add(supportedLocale);
+ applicationType.getLocaleConfig().add(locale);
+ }
+ boolean viewHandlerExists = false;
+ for (Iterator iterator = applications.iterator(); iterator.hasNext();) {
+ ApplicationType application = (ApplicationType) iterator.next();
+ EList viewHandlers = application.getViewHandler();
+ for (Iterator iterator2 = viewHandlers.iterator(); iterator2.hasNext();) {
+ ViewHandlerType viewHandlerType = (ViewHandlerType)iterator2.next();
+ if ("com.sun.facelets.FaceletViewHandler".equals(viewHandlerType.getTextContent().trim())) {
+ viewHandlerExists = true;
+ break;
+ }
+ }
+ }
+ if (!viewHandlerExists) {
+ ViewHandlerType viewHandler = FacesConfigFactory.eINSTANCE.createViewHandlerType();
+ viewHandler.setTextContent("com.sun.facelets.FaceletViewHandler");
+ applicationType.getViewHandler().add(viewHandler);
+ }
+ if (!applicationExists) {
+ facesConfig.getApplication().add(applicationType);
+ }
+ facesConfigEdit.save(monitor);
+ } finally {
+ if (facesConfigEdit != null) {
+ facesConfigEdit.dispose();
+ }
+ }
+ }
+
+ /*
+ * (non-Javadoc)
* @see org.jboss.tools.seam.internal.core.project.facet.SeamFacetAbstractInstallDelegate#configure(org.eclipse.jst.javaee.web.WebApp)
*/
@Override
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamFacetAbstractInstallDelegate.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamFacetAbstractInstallDelegate.java 2008-10-15 19:42:20 UTC (rev 10863)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamFacetAbstractInstallDelegate.java 2008-10-15 20:25:43 UTC (rev 10864)
@@ -38,6 +38,9 @@
import org.eclipse.core.runtime.preferences.IScopeContext;
import org.eclipse.datatools.connectivity.IConnectionProfile;
import org.eclipse.datatools.connectivity.ProfileManager;
+import org.eclipse.jdt.core.IJavaProject;
+import org.eclipse.jdt.core.IPackageFragmentRoot;
+import org.eclipse.jdt.core.JavaModelException;
import org.eclipse.jface.dialogs.ErrorDialog;
import org.eclipse.jst.common.project.facet.core.ClasspathHelper;
import org.eclipse.jst.j2ee.model.IModelProvider;
@@ -104,6 +107,11 @@
public static final String DEV_WAR_PROFILE = "dev-war"; //$NON-NLS-1$
public static final String DEV_EAR_PROFILE = "dev"; //$NON-NLS-1$
+ public static AntCopyUtils.FileSet JBOOS_EJB_WEB_INF_CLASSES_SET = new AntCopyUtils.FileSet()
+ .include("import\\.sql") //$NON-NLS-1$
+ .include("seam\\.properties")
+ .exclude(".*/WEB-INF"); //$NON-NLS-1$
+
public static AntCopyUtils.FileSet VIEW_FILESET = new AntCopyUtils.FileSet()
.include("home\\.xhtml") //$NON-NLS-1$
.include("error\\.xhtml") //$NON-NLS-1$
@@ -258,6 +266,7 @@
protected File seamGenResFolder;
protected File srcFolder;
protected File webContentFolder;
+ protected IPath webContentPath;
protected File webLibFolder;
protected IContainer webRootFolder;
protected File seamGenHomeFolder;
@@ -287,19 +296,8 @@
srcRootFolder = component.getRootFolder().getFolder(new Path("/WEB-INF/classes")); //$NON-NLS-1$
webRootFolder = webRootVirtFolder.getUnderlyingFolder();
- model.setProperty(ISeamFacetDataModelProperties.SEAM_PROJECT_NAME, project.getName());
-
- Boolean dbExists = (Boolean) model.getProperty(ISeamFacetDataModelProperties.DB_ALREADY_EXISTS);
- Boolean dbRecreate = (Boolean) model.getProperty(ISeamFacetDataModelProperties.RECREATE_TABLES_AND_DATA_ON_DEPLOY);
- if (!dbExists && !dbRecreate) {
- model.setProperty(ISeamFacetDataModelProperties.HIBERNATE_HBM2DDL_AUTO, "update"); //$NON-NLS-1$
- } else if (dbExists && !dbRecreate) {
- model.setProperty(ISeamFacetDataModelProperties.HIBERNATE_HBM2DDL_AUTO, "validate"); //$NON-NLS-1$
- } else if (dbRecreate) {
- model.setProperty(ISeamFacetDataModelProperties.HIBERNATE_HBM2DDL_AUTO, "create-drop"); //$NON-NLS-1$
- }
-
webContentFolder = webRootFolder.getLocation().toFile();
+ webContentPath = webRootFolder.getFullPath();
webInfFolder = new File(webContentFolder, "WEB-INF"); //$NON-NLS-1$
webInfClasses = new File(webInfFolder, "classes"); //$NON-NLS-1$
webInfClassesMetaInf = new File(webInfClasses, "META-INF"); //$NON-NLS-1$
@@ -331,11 +329,6 @@
// If seam runtime is null then just modify web.xml and add seam nature.
configureWebXml(project);
}
-
- ClasspathHelper.addClasspathEntries(project, fv);
- createSeamProjectPreferenes(project, model);
- EclipseResourceUtil.addNatureToProject(project, ISeamProject.NATURE_ID);
- project.refreshLocal(IResource.DEPTH_INFINITE, monitor);
}
/**
@@ -366,7 +359,7 @@
webContentFolder,
new AntCopyUtils.FileSetFileFilter(viewFileSet),
viewFilterSetCollection,
- true);
+ false);
// *******************************************************************
// Copy manifest and configuration resources the same way as view
@@ -378,10 +371,17 @@
AntCopyUtils.copyFileToFile(
componentsFile,
new File(webInfFolder, "components.xml"), //$NON-NLS-1$
- new FilterSetCollection(projectFilterSet), true);
+ new FilterSetCollection(projectFilterSet), false);
+ File facesConfig = new File(webContentFolder, "WEB-INF/faces-config.xml");
+ IPath webConfigPath = webContentPath.append("WEB-INF").append("faces-config.xml");
+ String webConfigName = webConfigPath.removeFirstSegments(1).toString();
+ if(facesConfig.exists()) {
+ configureFacesConfigXml(project, monitor, webConfigName);
+ }
+
AntCopyUtils.copyFilesAndFolders(
- seamGenResFolder, webContentFolder, new AntCopyUtils.FileSetFileFilter(webInfSet), viewFilterSetCollection, true);
+ seamGenResFolder, webContentFolder, new AntCopyUtils.FileSetFileFilter(webInfSet), viewFilterSetCollection, false);
final FilterSetCollection hibernateDialectFilterSet = new FilterSetCollection();
hibernateDialectFilterSet.addFilterSet(jdbcFilterSet);
@@ -394,15 +394,10 @@
if (isWarConfiguration(model)) {
AntCopyUtils.FileSet webInfClassesSet = new AntCopyUtils.FileSet(JBOOS_WAR_WEB_INF_CLASSES_SET).dir(seamGenResFolder);
AntCopyUtils.copyFilesAndFolders(
- seamGenResFolder, srcFolder, new AntCopyUtils.FileSetFileFilter(webInfClassesSet), viewFilterSetCollection, true);
+ seamGenResFolder, srcFolder, new AntCopyUtils.FileSetFileFilter(webInfClassesSet), viewFilterSetCollection, false);
- createComponentsProperties(srcFolder, "", false); //$NON-NLS-1$ //$NON-NLS-2$
+ createComponentsProperties(srcFolder, "", false); //$NON-NLS-1$
- /*AntCopyUtils.copyFileToFolder(
- hibernateConsolePref,
- new File(project.getLocation().toFile(),".settings"), //$NON-NLS-1$
- new FilterSetCollection(projectFilterSet), true);*/
-
// ********************************************************************************************
// Copy seam project indicator
// ********************************************************************************************
@@ -426,33 +421,33 @@
AntCopyUtils.copyFileToFile(
new File(seamGenHomeFolder, "src/Authenticator.java"), //$NON-NLS-1$
new File(actionsSrc,model.getProperty(ISeamFacetDataModelProperties.SESSION_BEAN_PACKAGE_NAME).toString().replace('.', '/') + "/" + "Authenticator.java"), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- new FilterSetCollection(filtersFilterSet), true);
+ new FilterSetCollection(filtersFilterSet), false);
AntCopyUtils.copyFileToFile(
persistenceFile,
new File(srcFolder, "META-INF/persistence.xml"), //$NON-NLS-1$
- viewFilterSetCollection, true);
+ viewFilterSetCollection, false);
File resources = new File(project.getLocation().toFile(), "resources");
AntCopyUtils.copyFileToFile(
dataSourceDsFile,
new File(resources, project.getName() + "-ds.xml"), //$NON-NLS-1$
- viewFilterSetCollection, true);
+ viewFilterSetCollection, false);
AntCopyUtils.copyFileToFile(
hibernateConsoleLaunchFile,
new File(project.getLocation().toFile(), project.getName() + ".launch"), //$NON-NLS-1$
- viewFilterSetCollection, true);
+ viewFilterSetCollection, false);
AntCopyUtils.copyFileToFolder(
hibernateConsolePropsFile,
project.getLocation().toFile(),
- hibernateDialectFilterSet, true);
+ hibernateDialectFilterSet, false);
WtpUtils.setClasspathEntryAsExported(project, new Path("org.eclipse.jst.j2ee.internal.web.container"), monitor); //$NON-NLS-1$
} else {
// In case of EAR configuration
- AntCopyUtils.copyFileToFolder(new File(seamGenResFolder, "messages_en.properties"), srcFolder, true); //$NON-NLS-1$
+ AntCopyUtils.copyFileToFolder(new File(seamGenResFolder, "messages_en.properties"), srcFolder, false); //$NON-NLS-1$
}
}
@@ -467,6 +462,24 @@
protected abstract void doExecuteForEar(IProject project, IProjectFacetVersion fv,
IDataModel model, IProgressMonitor monitor) throws CoreException;
+ protected IResource getSrcFolder(IProject project) throws JavaModelException {
+ IJavaProject javaProject = EclipseResourceUtil.getJavaProject(project);
+
+ IPackageFragmentRoot[] roots = javaProject.getPackageFragmentRoots();
+ IPackageFragmentRoot src = null;
+ for (int i= 0; i < roots.length; i++) {
+ if (roots[i].getKind() == IPackageFragmentRoot.K_SOURCE) {
+ src = roots[i];
+ }
+ }
+ if(src!=null) {
+ return src.getResource();
+ }
+ return null;
+ }
+
+ protected FilterSetCollection ejbViewFilterSetCollection;
+
/**
*
* @param project
@@ -475,9 +488,71 @@
* @param monitor
* @throws CoreException
*/
- protected abstract void doExecuteForEjb(IProject project, IProjectFacetVersion fv,
- IDataModel model, IProgressMonitor monitor) throws CoreException;
+ protected void doExecuteForEjb(final IProject project, IProjectFacetVersion fv,
+ IDataModel model, IProgressMonitor monitor) throws CoreException {
+ IResource src = getSrcFolder(project);
+ if(src==null) {
+ return;
+ }
+
+ File ejbProjectFolder = project.getLocation().toFile();
+ FilterSet filtersFilterSet = SeamFacetFilterSetFactory.createFiltersFilterSet(model);
+ FilterSet jdbcFilterSet = SeamFacetFilterSetFactory.createJdbcFilterSet(model);
+ FilterSet projectFilterSet = SeamFacetFilterSetFactory.createProjectFilterSet(model);
+
+ if(ejbViewFilterSetCollection==null) {
+ ejbViewFilterSetCollection = new FilterSetCollection();
+ ejbViewFilterSetCollection.addFilterSet(jdbcFilterSet);
+ ejbViewFilterSetCollection.addFilterSet(projectFilterSet);
+ }
+
+ FilterSetCollection hibernateDialectFilterSet = new FilterSetCollection();
+ hibernateDialectFilterSet.addFilterSet(jdbcFilterSet);
+ hibernateDialectFilterSet.addFilterSet(projectFilterSet);
+ hibernateDialectFilterSet.addFilterSet(SeamFacetFilterSetFactory.createHibernateDialectFilterSet(model));
+
+ File srcFile = src.getLocation().toFile();
+ // Copy sources to EJB project in case of EAR configuration
+ AntCopyUtils.copyFileToFile(
+ new File(seamGenHomeFolder, "src/Authenticator.java"), //$NON-NLS-1$
+ new File(srcFile, model.getProperty(ISeamFacetDataModelProperties.SESSION_BEAN_PACKAGE_NAME).toString().replace('.', '/') + "/" + "Authenticator.java"), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ new FilterSetCollection(filtersFilterSet), false);
+
+ File persistentXml = new File(srcFile, "META-INF/persistence.xml"); //$NON-NLS-1$
+ if(!persistentXml.exists()) {
+ AntCopyUtils.copyFileToFile(persistenceFile, new File(srcFile, "META-INF/persistence.xml"), //$NON-NLS-1$
+ ejbViewFilterSetCollection, false);
+ } else {
+ // TODO modify persistence.xml
+ }
+
+ File componentProperties = new File(srcFile, "components.properties"); //$NON-NLS-1$
+ if(!componentProperties.exists()) {
+ SeamFacetAbstractInstallDelegate.createComponentsProperties(srcFile, project.getName(), false);
+ }
+
+ AntCopyUtils.FileSet ejbSrcResourcesSet = new AntCopyUtils.FileSet(JBOOS_EJB_WEB_INF_CLASSES_SET).dir(seamGenResFolder);
+ AntCopyUtils.copyFilesAndFolders(seamGenResFolder, srcFile, new AntCopyUtils.FileSetFileFilter(ejbSrcResourcesSet), ejbViewFilterSetCollection, false);
+
+ File ejbJarXml = new File(srcFile, "META-INF/ejb-jar.xml");
+ if(!ejbJarXml.exists()) {
+ AntCopyUtils.copyFileToFolder(new File(seamGenResFolder, "META-INF/ejb-jar.xml"), //$NON-NLS-1$
+ new File(srcFile, "META-INF"), ejbViewFilterSetCollection, false); //$NON-NLS-1$
+ } else {
+ // TODO modify ejb-jar.xml
+ }
+ FilterSet ejbFilterSet = new FilterSet();
+ ejbFilterSet.addFilter("projectName", ejbProjectFolder.getName()); //$NON-NLS-1$
+
+ AntCopyUtils.copyFileToFile(hibernateConsoleLaunchFile, new File(
+ ejbProjectFolder, ejbProjectFolder.getName() + ".launch"), //$NON-NLS-1$
+ new FilterSetCollection(ejbFilterSet), false);
+
+ AntCopyUtils.copyFileToFolder(hibernateConsolePropsFile,
+ ejbProjectFolder, hibernateDialectFilterSet, false);
+ }
+
/**
*
* @param project
@@ -494,6 +569,19 @@
IProjectFacetVersion webVersion = facetedProject.getProjectFacetVersion(IJ2EEFacetConstants.DYNAMIC_WEB_FACET);
IProjectFacetVersion earVersion = facetedProject.getProjectFacetVersion(IJ2EEFacetConstants.ENTERPRISE_APPLICATION_FACET);
initDefaultModelValues(model, webVersion!=null);
+
+ model.setProperty(ISeamFacetDataModelProperties.SEAM_PROJECT_NAME, project.getName());
+
+ Boolean dbExists = (Boolean) model.getProperty(ISeamFacetDataModelProperties.DB_ALREADY_EXISTS);
+ Boolean dbRecreate = (Boolean) model.getProperty(ISeamFacetDataModelProperties.RECREATE_TABLES_AND_DATA_ON_DEPLOY);
+ if (!dbExists && !dbRecreate) {
+ model.setProperty(ISeamFacetDataModelProperties.HIBERNATE_HBM2DDL_AUTO, "update"); //$NON-NLS-1$
+ } else if (dbExists && !dbRecreate) {
+ model.setProperty(ISeamFacetDataModelProperties.HIBERNATE_HBM2DDL_AUTO, "validate"); //$NON-NLS-1$
+ } else if (dbRecreate) {
+ model.setProperty(ISeamFacetDataModelProperties.HIBERNATE_HBM2DDL_AUTO, "create-drop"); //$NON-NLS-1$
+ }
+
if(ejbVersion!=null) {
doExecuteForEjb(project, fv, model, monitor);
} else if(webVersion!=null) {
@@ -501,6 +589,11 @@
} else if(earVersion!=null) {
doExecuteForEar(project, fv, model, monitor);
}
+
+ ClasspathHelper.addClasspathEntries(project, fv);
+ createSeamProjectPreferenes(project, model);
+ EclipseResourceUtil.addNatureToProject(project, ISeamProject.NATURE_ID);
+ project.refreshLocal(IResource.DEPTH_INFINITE, monitor);
}
private void initDefaultModelValues(IDataModel model, boolean warProject) {
@@ -818,7 +911,15 @@
webApp.getContextParams().add(paramValue);
}
}
-
+
+ /**
+ *
+ * @param project
+ * @param monitor
+ * @param webConfigName
+ */
+ abstract protected void configureFacesConfigXml(final IProject project, IProgressMonitor monitor, String webConfigName);
+
protected abstract void configure(WebApp webApp);
protected void configureWebXml(final IProject project) {
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamFacetInstallDelegate.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamFacetInstallDelegate.java 2008-10-15 19:42:20 UTC (rev 10863)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamFacetInstallDelegate.java 2008-10-15 20:25:43 UTC (rev 10864)
@@ -11,14 +11,23 @@
package org.jboss.tools.seam.internal.core.project.facet;
import java.io.File;
+import java.util.Iterator;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.emf.common.util.EList;
import org.eclipse.jst.javaee.core.DisplayName;
import org.eclipse.jst.javaee.core.JavaeeFactory;
import org.eclipse.jst.javaee.web.Filter;
import org.eclipse.jst.javaee.web.WebApp;
+import org.eclipse.jst.jsf.facesconfig.emf.ApplicationType;
+import org.eclipse.jst.jsf.facesconfig.emf.FacesConfigFactory;
+import org.eclipse.jst.jsf.facesconfig.emf.FacesConfigType;
+import org.eclipse.jst.jsf.facesconfig.emf.LifecycleType;
+import org.eclipse.jst.jsf.facesconfig.emf.MessageBundleType;
+import org.eclipse.jst.jsf.facesconfig.emf.PhaseListenerType;
+import org.eclipse.jst.jsf.facesconfig.util.FacesConfigArtifactEdit;
import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
import org.eclipse.wst.common.project.facet.core.IProjectFacetVersion;
@@ -106,16 +115,6 @@
/*
* (non-Javadoc)
- * @see org.jboss.tools.seam.internal.core.project.facet.SeamFacetAbstractInstallDelegate#doExecuteForEjb(org.eclipse.core.resources.IProject, org.eclipse.wst.common.project.facet.core.IProjectFacetVersion, org.eclipse.wst.common.frameworks.datamodel.IDataModel, org.eclipse.core.runtime.IProgressMonitor)
- */
- @Override
- protected void doExecuteForEjb(final IProject project, IProjectFacetVersion fv,
- IDataModel model, IProgressMonitor monitor) throws CoreException {
- // TODO
- }
-
- /*
- * (non-Javadoc)
* @see org.jboss.tools.seam.internal.core.project.facet.SeamFacetAbstractInstallDelegate#copyFilesToWarProject(org.eclipse.core.resources.IProject, org.eclipse.wst.common.project.facet.core.IProjectFacetVersion, org.eclipse.wst.common.frameworks.datamodel.IDataModel, org.eclipse.core.runtime.IProgressMonitor)
*/
@Override
@@ -136,6 +135,84 @@
/*
* (non-Javadoc)
+ * @see org.jboss.tools.seam.internal.core.project.facet.SeamFacetAbstractInstallDelegate#configureFacesConfigXml(org.eclipse.core.resources.IProject, org.eclipse.core.runtime.IProgressMonitor, java.lang.String)
+ */
+ @Override
+ protected void configureFacesConfigXml(final IProject project, IProgressMonitor monitor, String webConfigName) {
+ FacesConfigArtifactEdit facesConfigEdit = null;
+ try {
+ facesConfigEdit = FacesConfigArtifactEdit.getFacesConfigArtifactEditForWrite(project, webConfigName);
+ FacesConfigType facesConfig = facesConfigEdit.getFacesConfig();
+ EList applications = facesConfig.getApplication();
+ ApplicationType applicationType = null;
+ boolean applicationExists = false;
+ if (applications.size() <= 0) {
+ applicationType = FacesConfigFactory.eINSTANCE.createApplicationType();
+ } else {
+ applicationType = (ApplicationType) applications.get(0);
+ applicationExists = true;
+ }
+ boolean messageBundleExists = false;
+ for (Iterator iterator = applications.iterator(); iterator.hasNext();) {
+ ApplicationType application = (ApplicationType) iterator.next();
+ EList messageBundles = application.getMessageBundle();
+ for (Iterator iterator2 = messageBundles.iterator(); iterator2.hasNext();) {
+ MessageBundleType messageBundle = (MessageBundleType)iterator2.next();
+ if ("messages".equals(messageBundle.getTextContent().trim())) {
+ messageBundleExists = true;
+ break;
+ }
+ }
+ }
+ if (!messageBundleExists) {
+ MessageBundleType messageBundle = FacesConfigFactory.eINSTANCE.createMessageBundleType();
+ messageBundle.setTextContent("messages");
+ applicationType.getMessageBundle().add(messageBundle);
+ }
+ if (!applicationExists) {
+ facesConfig.getApplication().add(applicationType);
+ }
+ EList lifecycles = facesConfig.getLifecycle();
+ LifecycleType lifecycleType = null;
+ boolean lifecycleExists = false;
+ if (lifecycles.size() <= 0) {
+ lifecycleType = FacesConfigFactory.eINSTANCE.createLifecycleType();
+ } else {
+ lifecycleType = (LifecycleType)lifecycles.get(0);
+ lifecycleExists = true;
+ }
+ boolean phaseListenerExists = false;
+ for (Iterator iterator = lifecycles.iterator(); iterator.hasNext();) {
+ LifecycleType lifecycle = (LifecycleType) iterator.next();
+ EList phaseListeners = lifecycle.getPhaseListener();
+ for (Iterator iterator2 = phaseListeners.iterator(); iterator2.hasNext();) {
+ PhaseListenerType messageBundle = (PhaseListenerType)iterator2.next();
+ if ("org.jboss.seam.jsf.TransactionalSeamPhaseListener".equals(messageBundle.getTextContent().trim()) ||
+ "org.jboss.seam.jsf.SeamPhaseListener".equals(messageBundle.getTextContent().trim())) {
+ phaseListenerExists = true;
+ break;
+ }
+ }
+ }
+ if (!phaseListenerExists) {
+ PhaseListenerType phaseListener = FacesConfigFactory.eINSTANCE.createPhaseListenerType();
+ phaseListener.setTextContent("org.jboss.seam.jsf.TransactionalSeamPhaseListener");
+ lifecycleType.getPhaseListener().add(phaseListener);
+ }
+ if (!lifecycleExists) {
+ facesConfig.getLifecycle().add(lifecycleType);
+ }
+
+ facesConfigEdit.save(monitor);
+ } finally {
+ if (facesConfigEdit != null) {
+ facesConfigEdit.dispose();
+ }
+ }
+ }
+
+ /*
+ * (non-Javadoc)
* @see org.jboss.tools.seam.internal.core.project.facet.SeamFacetAbstractInstallDelegate#configure(org.eclipse.jst.javaee.web.WebApp)
*/
@Override
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamProjectCreator.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamProjectCreator.java 2008-10-15 19:42:20 UTC (rev 10863)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamProjectCreator.java 2008-10-15 20:25:43 UTC (rev 10864)
@@ -52,11 +52,6 @@
protected static final String DEV_WAR_PROFILE = "dev-war"; //$NON-NLS-1$
protected static final String DEV_EAR_PROFILE = "dev"; //$NON-NLS-1$
- protected static AntCopyUtils.FileSet JBOOS_EJB_WEB_INF_CLASSES_SET = new AntCopyUtils.FileSet()
- .include("import\\.sql") //$NON-NLS-1$
- .include("seam\\.properties")
- .exclude(".*/WEB-INF"); //$NON-NLS-1$
-
private static AntCopyUtils.FileSet JBOSS_TEST_LIB_FILESET = new AntCopyUtils.FileSet()
.include("testng-.*-jdk15\\.jar") //$NON-NLS-1$
.include("myfaces-api-.*\\.jar") //$NON-NLS-1$
@@ -382,7 +377,7 @@
SeamFacetAbstractInstallDelegate.createComponentsProperties(new File(ejbProjectFolder, "ejbModule"), earProjectName, false); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- AntCopyUtils.FileSet ejbSrcResourcesSet = new AntCopyUtils.FileSet(JBOOS_EJB_WEB_INF_CLASSES_SET).dir(seamGenResFolder);
+ AntCopyUtils.FileSet ejbSrcResourcesSet = new AntCopyUtils.FileSet(SeamFacetAbstractInstallDelegate.JBOOS_EJB_WEB_INF_CLASSES_SET).dir(seamGenResFolder);
AntCopyUtils.copyFilesAndFolders(
seamGenResFolder, new File(ejbProjectFolder, "ejbModule"), new AntCopyUtils.FileSetFileFilter(ejbSrcResourcesSet), viewFilterSetCollection, true); //$NON-NLS-1$
17 years, 2 months
JBoss Tools SVN: r10863 - trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test.
by jbosstools-commits@lists.jboss.org
Author: snjeza
Date: 2008-10-15 15:42:20 -0400 (Wed, 15 Oct 2008)
New Revision: 10863
Modified:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/JsfAllTests.java
Log:
JBIDE-2907 The org.jboss.tools.jsf.vpe.jsf.test tests aren't being run
Modified: trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/JsfAllTests.java
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/JsfAllTests.java 2008-10-15 17:43:41 UTC (rev 10862)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/JsfAllTests.java 2008-10-15 19:42:20 UTC (rev 10863)
@@ -61,7 +61,7 @@
public class JsfAllTests {
public static final String IMPORT_PROJECT_NAME = "jsfTest"; //$NON-NLS-1$
- public static final String IMPORT_JSF_20_PROJECT_NAME = "jsf2Test"; //$NON-NLS-1$
+ public static final String IMPORT_JSF_20_PROJECT_NAME = "jsf2test"; //$NON-NLS-1$
public static Test suite() {
17 years, 2 months
JBoss Tools SVN: r10862 - in trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4: model and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: koen.aers(a)jboss.com
Date: 2008-10-15 13:43:41 -0400 (Wed, 15 Oct 2008)
New Revision: 10862
Added:
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/editor/JpdlSerializer.java
Modified:
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/editor/JpdlEditor.java
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/model/Process.java
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/model/Transition.java
Log:
basic serialization
Modified: trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/editor/JpdlEditor.java
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/editor/JpdlEditor.java 2008-10-15 16:23:38 UTC (rev 10861)
+++ trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/editor/JpdlEditor.java 2008-10-15 17:43:41 UTC (rev 10862)
@@ -3,17 +3,12 @@
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
-import java.util.List;
import org.eclipse.gef.EditPartFactory;
import org.eclipse.gef.palette.PaletteRoot;
import org.jboss.tools.flow.common.editor.GenericModelEditor;
import org.jboss.tools.flow.common.editpart.DefaultEditPartFactory;
-import org.jboss.tools.flow.common.model.Element;
import org.jboss.tools.flow.common.registry.ElementRegistry;
-import org.jboss.tools.flow.common.wrapper.ConnectionWrapper;
-import org.jboss.tools.flow.common.wrapper.ContainerWrapper;
-import org.jboss.tools.flow.common.wrapper.NodeWrapper;
import org.jboss.tools.flow.common.wrapper.Wrapper;
public class JpdlEditor extends GenericModelEditor {
@@ -30,33 +25,10 @@
return ElementRegistry.createWrapper("org.jboss.tools.flow.jpdl4.process");
}
- private void write(Wrapper wrapper, OutputStream os) {
- Object object = wrapper.getElement();
- if (object instanceof Element) {
- Element element = (Element)object;
- String xml = (String)element.getMetaData("xml");
- System.out.println(xml);
- }
- if (wrapper instanceof ContainerWrapper) {
- ContainerWrapper containerWrapper = (ContainerWrapper)wrapper;
- List<NodeWrapper> children = containerWrapper.getElements();
- for (NodeWrapper nodeWrapper : children) {
- write(nodeWrapper, os);
- }
- }
- if (wrapper instanceof NodeWrapper) {
- NodeWrapper nodeWrapper = (NodeWrapper)wrapper;
- List<ConnectionWrapper> children = nodeWrapper.getOutgoingConnections();
- for (ConnectionWrapper connectionWrapper : children) {
- write(connectionWrapper, os);
- }
- }
- }
-
protected void writeModel(OutputStream os) throws IOException {
Object object = getModel();
if (object instanceof Wrapper) {
- write((Wrapper)object, os);
+ JpdlSerializer.serialize((Wrapper)object, os);
}
}
Added: trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/editor/JpdlSerializer.java
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/editor/JpdlSerializer.java (rev 0)
+++ trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/editor/JpdlSerializer.java 2008-10-15 17:43:41 UTC (rev 10862)
@@ -0,0 +1,149 @@
+package org.jboss.tools.flow.jpdl4.editor;
+
+import java.io.IOException;
+import java.io.OutputStream;
+import java.io.OutputStreamWriter;
+import java.io.Writer;
+import java.util.List;
+
+import org.jboss.tools.flow.common.model.Element;
+import org.jboss.tools.flow.common.wrapper.ConnectionWrapper;
+import org.jboss.tools.flow.common.wrapper.ContainerWrapper;
+import org.jboss.tools.flow.common.wrapper.NodeWrapper;
+import org.jboss.tools.flow.common.wrapper.Wrapper;
+import org.jboss.tools.flow.jpdl4.model.EndState;
+import org.jboss.tools.flow.jpdl4.model.Process;
+import org.jboss.tools.flow.jpdl4.model.StartState;
+import org.jboss.tools.flow.jpdl4.model.State;
+import org.jboss.tools.flow.jpdl4.model.SuperState;
+import org.jboss.tools.flow.jpdl4.model.Transition;
+
+public class JpdlSerializer {
+
+ public static void serialize(Wrapper wrapper, OutputStream os) throws IOException {
+ StringBuffer buffer = new StringBuffer();
+ appendToBuffer(buffer, wrapper, 0);
+ Writer writer = new OutputStreamWriter(os);
+ writer.write(buffer.toString());
+ System.out.println(buffer.toString());
+ }
+
+ private static void appendToBuffer(StringBuffer buffer, Wrapper wrapper, int level) {
+ Object object = wrapper.getElement();
+ if (!(object instanceof Element)) return;
+ appendOpening(buffer, wrapper, level);
+ appendBody(buffer, wrapper, level);
+ appendClosing(buffer, wrapper, level);
+ }
+
+ private static void appendOpening(StringBuffer buffer, Wrapper wrapper, int level) {
+ Element element = (Element)wrapper.getElement();
+ buffer.append("\n");
+ appendPadding(buffer, level);
+ if (element instanceof Transition) {
+ buffer.append("<transition");
+ Transition transition = (Transition)element;
+ if (transition.getTo() != null) {
+ String value = transition.getTo().getName();
+ value = value == null ? "" : value;
+ buffer.append("to=\"" + value + "\"");
+ }
+ buffer.append(">");
+ } else if (element instanceof EndState) {
+ buffer.append("<end-state");
+ EndState endState = (EndState)element;
+ if (endState.getName() != null) {
+ buffer.append(" ");
+ String value = endState.getName();
+ buffer.append("name=\"" + value + "\"");
+ }
+ buffer.append(">");
+ } else if (element instanceof StartState) {
+ buffer.append("<start-state");
+ StartState startState = (StartState)element;
+ if (startState.getName() != null) {
+ buffer.append(" ");
+ String value = startState.getName();
+ buffer.append("name=\"" + value + "\"");
+ }
+ buffer.append(">");
+ } else if (element instanceof SuperState) {
+ buffer.append("<super-state");
+ SuperState superState = (SuperState)element;
+ if (superState.getName() != null) {
+ buffer.append(" ");
+ String value = superState.getName();
+ buffer.append("name=\"" + value + "\"");
+ }
+ buffer.append(">");
+ } else if (element instanceof State) {
+ buffer.append("<state");
+ State state = (State)element;
+ if (state.getName() != null) {
+ buffer.append(" ");
+ String value = state.getName();
+ buffer.append("name=\"" + value + "\"");
+ }
+ buffer.append(">");
+ } else if (element instanceof Process) {
+ buffer.append("<process");
+ Process process = (Process)element;
+ if (process.getInitial() != null) {
+ buffer.append(" ");
+ String value = process.getInitial().getName();
+ value = value == null ? "" : value;
+ buffer.append("initial=\"" + value + "\"");
+ }
+ if (process.getName() != null) {
+ buffer.append(" ");
+ String value = process.getName();
+ buffer.append("name=\"" + value + "\"");
+ }
+ buffer.append(">");
+ }
+
+ }
+
+ private static void appendPadding(StringBuffer buffer, int level) {
+ for (int i = 0; i < level; i++) {
+ buffer.append(" ");
+ }
+ }
+
+ private static void appendClosing(StringBuffer buffer, Wrapper wrapper, int level) {
+ Element element = (Element)wrapper.getElement();
+ buffer.append("\n");
+ appendPadding(buffer, level);
+ if (element instanceof Transition) {
+ buffer.append("</transition>");
+ } else if (element instanceof EndState) {
+ buffer.append("</end-state>");
+ } else if (element instanceof StartState) {
+ buffer.append("</start-state>");
+ } else if (element instanceof SuperState) {
+ buffer.append("</super-state>");
+ } else if (element instanceof State) {
+ buffer.append("</state>");
+ } else if (element instanceof Process) {
+ buffer.append("</process>");
+ }
+ }
+
+ private static void appendBody(StringBuffer buffer, Wrapper wrapper, int level) {
+ if (wrapper instanceof ContainerWrapper) {
+ ContainerWrapper containerWrapper = (ContainerWrapper)wrapper;
+ List<NodeWrapper> children = containerWrapper.getElements();
+ for (NodeWrapper nodeWrapper : children) {
+ appendToBuffer(buffer, nodeWrapper, ++level);
+ }
+ }
+ if (wrapper instanceof NodeWrapper) {
+ NodeWrapper nodeWrapper = (NodeWrapper)wrapper;
+ List<ConnectionWrapper> children = nodeWrapper.getOutgoingConnections();
+ for (ConnectionWrapper connectionWrapper : children) {
+ appendToBuffer(buffer, connectionWrapper, ++level);
+ }
+ }
+ }
+
+}
Modified: trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/model/Process.java
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/model/Process.java 2008-10-15 16:23:38 UTC (rev 10861)
+++ trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/model/Process.java 2008-10-15 17:43:41 UTC (rev 10862)
@@ -7,6 +7,8 @@
public class Process extends DefaultFlow {
+ private Node initial = null;
+
public Process() {
super();
setMetaData("xml", "process-definition");
@@ -21,5 +23,13 @@
}
return null;
}
+
+ public Node getInitial() {
+ return initial;
+ }
+
+ public void setInitial(Node node) {
+ initial = node;
+ }
}
Modified: trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/model/Transition.java
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/model/Transition.java 2008-10-15 16:23:38 UTC (rev 10861)
+++ trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/model/Transition.java 2008-10-15 17:43:41 UTC (rev 10862)
@@ -5,13 +5,28 @@
public class Transition extends DefaultConnection {
+ private static final String SCHEMA =
+ "<element name='transition'>" +
+ " <complexType>" +
+ " <attribute name='to' type='string'/>" +
+ " </complexType>" +
+ "</element>";
+
public Transition() {
this(null, null);
}
public Transition(Node from, Node to) {
super(from, to);
- setMetaData("xml", "transition");
+ setMetaData("schema", SCHEMA);
}
+ String getToAsString() {
+ if (getTo() == null) {
+ return null;
+ } else {
+ return getTo().getName();
+ }
+ }
+
}
17 years, 2 months
JBoss Tools SVN: r10861 - in trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces: resources/menuGroup and 3 other directories.
by jbosstools-commits@lists.jboss.org
Author: dmaliarevich
Date: 2008-10-15 12:23:38 -0400 (Wed, 15 Oct 2008)
New Revision: 10861
Added:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/resources/dropDownMenu/list-bg.png
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/resources/menuGroup/arrow.gif
Removed:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/resources/menuGroup/list-bg.png
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/resources/dropDownMenu/dropDownMenu.css
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/resources/menuGroup/menuGroup.css
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/resources/menuItem/menuItem.css
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesDropDownMenuTemplate.java
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesMenuGroupTemplate.java
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesMenuItemTemplate.java
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/templates/vpe-templates-richfaces.xml
Log:
JBIDE-2497, items value creation was updated, folder icon was added to menuGroup, css styles were updated.
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/resources/dropDownMenu/dropDownMenu.css
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/resources/dropDownMenu/dropDownMenu.css 2008-10-15 16:23:34 UTC (rev 10860)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/resources/dropDownMenu/dropDownMenu.css 2008-10-15 16:23:38 UTC (rev 10861)
@@ -20,40 +20,56 @@
font-weight:bold;
}
.rich-menu-list-border {
-
+ font-family:Arial,Verdana,sans-serif;
+ background-color:#F1EEE9;
+ border-color:#C4C0B9;
+ border:1px solid;
}
.rich-menu-list-bg {
-
+ background:transparent none repeat-y scroll left center;
+ background-image:url(list-bg.png);
+ background-color:#F1EEE9;
}
-[vpe-ddm-menu-ul] {
+[vpe-ddm-menu-ul],
+[vpe-ddm-menu-title-ul],
+[vpe-ddm-menu-children-ul] {
margin: 0;
padding: 0;
list-style: none;
width: 150px;
display: block;
+ cursor: pointer;
}
-[vpe-ddm-menu-li] {
+[vpe-ddm-menu-li],
+[vpe-ddm-menu-title-li] {
position: relative;
- height: 30px;
+ height: 20px;
}
-[vpe-ddm-menu-li] ul {
+[vpe-ddm-menu-li] ul,
+[vpe-ddm-menu-title-li] ul {
position: absolute;
left: 149px; /* Set 1px less than menu width */
top: 0;
display: none;
}
-[vpe-ddm-menu-li] div { /* ddm item/group div */
-
+/*
+* Droping-down for top menu elements
+*/
+[vpe-ddm-menu-title-ul]:hover > li,
+[vpe-ddm-menu-title-ul]:hover > li > ul,
+[vpe-ddm-menu-title-ul]:hover > li > ul > li {
+ display: block;
}
-[vpe-ddm-menu-li] div:hover {
-
-}
-[vpe-ddm-menu-ul]:hover {
-
-}
-/*drop-down mechanism*/
+/*
+* Droping-down for nested items
+*/
[vpe-ddm-menu-li]:hover > ul,
[vpe-ddm-menu-li]:hover > li {
display: block;
}
+.dr-menu-top-div {
+ width: 100%;
+ height: 100%;
+ overflow: hidden;
+}
\ No newline at end of file
Copied: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/resources/dropDownMenu/list-bg.png (from rev 10844, trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/resources/menuGroup/list-bg.png)
===================================================================
(Binary files differ)
Added: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/resources/menuGroup/arrow.gif
===================================================================
(Binary files differ)
Property changes on: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/resources/menuGroup/arrow.gif
___________________________________________________________________
Name: svn:mime-type
+ image/gif
Deleted: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/resources/menuGroup/list-bg.png
===================================================================
(Binary files differ)
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/resources/menuGroup/menuGroup.css
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/resources/menuGroup/menuGroup.css 2008-10-15 16:23:34 UTC (rev 10860)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/resources/menuGroup/menuGroup.css 2008-10-15 16:23:38 UTC (rev 10861)
@@ -7,7 +7,8 @@
padding-left: 10px; /*padding for group icon*/
}
.rich-menu-group-folder {
-
+ padding-left: 10px; /*padding for group folder icon*/
+ padding-right: 10px; /*padding for group folder icon*/
}
.rich-menu-group-over {
@@ -32,28 +33,18 @@
}
.rich-menu-item-icon-enabled {
border:0pt solid transparent;
- /*padding:2px 10px 2px 2px;*/
}
.rich-menu-item-icon-selected {
}
.rich-menu-list-border {
- font-family:Arial,Verdana,sans-serif;
- background-color:#F1EEE9;
- border-color:#C4C0B9;
- border:1px solid;
+
}
.rich-menu-list-bg {
- background:transparent none repeat-y scroll left center;
- background-image:url(list-bg.png);
- background-color:#F1EEE9;
- border-left-color:#C4C0B9;
- border-right-color:#C4C0B9;
- border-top-color:#C4C0B9;
- border-left-style:solid;
- border-left-width:1px;
- border-right-style:solid;
- border-right-width:1px;
- border-top-style:solid;
- border-top-width:1px;
+
+}
+.dr-menu-group-top-div {
+ width: 100%;
+ height: 100%;
+ overflow: hidden;
}
\ No newline at end of file
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/resources/menuItem/menuItem.css
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/resources/menuItem/menuItem.css 2008-10-15 16:23:34 UTC (rev 10860)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/resources/menuItem/menuItem.css 2008-10-15 16:23:38 UTC (rev 10861)
@@ -1,7 +1,5 @@
.rich-menu-item {
font-family:Arial,Verdana,sans-serif;
- border-color:#C4C0B9;
- border:1px solid;
}
.rich-menu-item-label {
/*padding-left: 10px;*/ /*padding for item icon*/
@@ -37,3 +35,8 @@
.rich-menu-item-icon-selected {
}
+.dr-menu-item-top-div {
+ width: 100%;
+ height: 100%;
+ overflow: hidden;
+}
\ No newline at end of file
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesDropDownMenuTemplate.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesDropDownMenuTemplate.java 2008-10-15 16:23:34 UTC (rev 10860)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesDropDownMenuTemplate.java 2008-10-15 16:23:38 UTC (rev 10861)
@@ -29,24 +29,25 @@
public class RichFacesDropDownMenuTemplate extends VpeAbstractTemplate {
/*
- * Public constants for drop down mechanism.
- */
- public final static String MENU_PARENT_ID = "vpe-ddm-menu-ul"; //$NON-NLS-1$
- public final static String MENU_CHILD_ID = "vpe-ddm-menu-li"; //$NON-NLS-1$
-
- /*
* rich:dropDownMenu constants
*/
- private final static String COMPONENT_NAME = "dropDownMenu"; //$NON-NLS-1$
- private final static String STYLE_PATH = "dropDownMenu/dropDownMenu.css"; //$NON-NLS-1$
- private final static String CHILD_GROUP_NAME = ":menuGroup"; //$NON-NLS-1$
- private final static String CHILD_ITEM_NAME = ":menuItem"; //$NON-NLS-1$
+ private static final String COMPONENT_NAME = "dropDownMenu"; //$NON-NLS-1$
+ private static final String STYLE_PATH = "dropDownMenu/dropDownMenu.css"; //$NON-NLS-1$
+ private static final String CHILD_GROUP_NAME = ":menuGroup"; //$NON-NLS-1$
+ private static final String CHILD_ITEM_NAME = ":menuItem"; //$NON-NLS-1$
private static final String LABEL_FACET_NAME = "label"; //$NON-NLS-1$
private static final String DEFAULT_DDM_TITLE = "ddm"; //$NON-NLS-1$
private static final String EMPTY = ""; //$NON-NLS-1$
private static final String SPACE = " "; //$NON-NLS-1$
/*
+ * Constants for drop down mechanism.
+ */
+ private static final String MENU_TOP_ID = "vpe-ddm-menu-title-ul"; //$NON-NLS-1$
+ private static final String MENU_TOP_ITEM_ID = "vpe-ddm-menu-title-li"; //$NON-NLS-1$
+ private static final String MENU_CHILDREN_LIST_ID = "vpe-ddm-menu-children-ul"; //$NON-NLS-1$
+
+ /*
* rich:dropDownMenu css styles names
*/
private static final String CSS_RICH_DDMENU_LABEL = "rich-ddmenu-label"; //$NON-NLS-1$
@@ -58,6 +59,7 @@
private static final String CSS_RICH_MENU_LIST_BG = "rich-menu-list-bg"; //$NON-NLS-1$
private static final String CSS_RICH_DDEMENU_LIST_DIV_STYLE = ""; //$NON-NLS-1$
private static final String CSS_RICH_DDEMENU_BORDER_DIV_STYLE = ""; //$NON-NLS-1$
+ private static final String CSS_MENU_TOP_DIV = "dr-menu-top-div"; //$NON-NLS-1$
/*
* rich:dropDownMenu attributes names
@@ -116,7 +118,6 @@
nsIDOMElement ddmMainUL;
nsIDOMElement ddmMainLI;
nsIDOMElement ddmChildrenUL;
-
nsIDOMElement ddmLabelDiv;
nsIDOMElement ddmTextSpan;
nsIDOMText ddmLabelText;
@@ -127,7 +128,6 @@
/*
* Creating visual elements
*/
-
ddmMainUL = visualDocument.createElement(HTML.TAG_UL);
ddmMainLI = visualDocument.createElement(HTML.TAG_LI);
ddmChildrenUL = visualDocument.createElement(HTML.TAG_UL);
@@ -147,21 +147,15 @@
// ddmLabelDiv.appendChild(ddmListDiv);
ddmListDiv.appendChild(ddmListBorderDiv);
ddmListBorderDiv.appendChild(ddmListBgDiv);
-
ddmMainUL.appendChild(ddmMainLI);
ddmMainLI.appendChild(ddmLabelDiv);
/*
- * Children <ul> will be added only if there are some of them.
- */
-// ddmMainLI.appendChild(ddmChildrenUL);
-
- /*
* Setting attributes for the drop-down mechanism
*/
- ddmMainUL.setAttribute(MENU_PARENT_ID, EMPTY);
- ddmMainLI.setAttribute(MENU_CHILD_ID, EMPTY);
- ddmChildrenUL.setAttribute(MENU_PARENT_ID, EMPTY);
+ ddmMainUL.setAttribute(MENU_TOP_ID, EMPTY);
+ ddmMainLI.setAttribute(MENU_TOP_ITEM_ID, EMPTY);
+ ddmChildrenUL.setAttribute(MENU_CHILDREN_LIST_ID, EMPTY);
/*
* Setting css classes
@@ -169,7 +163,8 @@
String labelDivClass = EMPTY;
String listBorderDivClass = EMPTY;
- labelDivClass += SPACE + CSS_RICH_DDMENU_LABEL + SPACE + CSS_RICH_DDMENU_LABEL_UNSELECT;
+ labelDivClass += SPACE + CSS_RICH_DDMENU_LABEL + SPACE
+ + CSS_RICH_DDMENU_LABEL_UNSELECT;
listBorderDivClass += SPACE + CSS_RICH_MENU_LIST_BORDER;
if (attrPresents(ddm_styleClass)) {
@@ -177,12 +172,14 @@
listBorderDivClass += SPACE + ddm_styleClass;
}
-// ddmLabelDiv.setAttribute(HTML.CLASS_ATTR, labelDivClass);
+// ddmLabelDiv.setAttribute(HTML.ATTR_CLASS, labelDivClass);
+ ddmLabelDiv.setAttribute(HTML.ATTR_CLASS, CSS_MENU_TOP_DIV);
ddmMainLI.setAttribute(HTML.ATTR_CLASS, labelDivClass);
ddmTextSpan.setAttribute(HTML.ATTR_CLASS, CSS_RICH_LABEL_TEXT_DECOR);
// ddmListBorderDiv.setAttribute(HTML.ATTR_CLASS, listBorderDivClass);
// ddmListBgDiv.setAttribute(HTML.ATTR_CLASS, CSS_RICH_MENU_LIST_BG);
- ddmChildrenUL.setAttribute(HTML.ATTR_CLASS, listBorderDivClass + SPACE + CSS_RICH_MENU_LIST_BG);
+ ddmChildrenUL.setAttribute(HTML.ATTR_CLASS, listBorderDivClass + SPACE
+ + CSS_RICH_MENU_LIST_BG);
/*
* Setting css styles
*/
@@ -197,11 +194,13 @@
cssLabelDivStyle += SPACE + ddm_style;
}
-// ddmListDiv.setAttribute(HTML.STYLE_ATTR, cssListDivStyle);
-// ddmListBorderDiv.setAttribute(HTML.STYLE_ATTR, cssListBorderDivStyle);
-// ddmLabelDiv.setAttribute(HTML.STYLE_ATTR, cssLabelDivStyle);
- ddmMainLI.setAttribute(HTML.ATTR_STYLE, cssListDivStyle + SPACE + cssListBorderDivStyle + SPACE + cssLabelDivStyle);
- ddmChildrenUL.setAttribute(HTML.ATTR_STYLE, cssListDivStyle + SPACE + cssListBorderDivStyle + SPACE + cssLabelDivStyle);
+// ddmListDiv.setAttribute(HTML.ATTR_STYLE, cssListDivStyle);
+// ddmListBorderDiv.setAttribute(HTML.ATTR_STYLE, cssListBorderDivStyle);
+// ddmLabelDiv.setAttribute(HTML.ATTR_STYLE, cssLabelDivStyle);
+ ddmMainLI.setAttribute(HTML.ATTR_STYLE, cssListDivStyle + SPACE
+ + cssListBorderDivStyle + SPACE + cssLabelDivStyle);
+ ddmChildrenUL.setAttribute(HTML.ATTR_STYLE, cssListDivStyle + SPACE
+ + cssListBorderDivStyle + SPACE + cssLabelDivStyle);
/*
* Encoding label value
*/
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesMenuGroupTemplate.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesMenuGroupTemplate.java 2008-10-15 16:23:34 UTC (rev 10860)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesMenuGroupTemplate.java 2008-10-15 16:23:38 UTC (rev 10861)
@@ -29,22 +29,29 @@
public class RichFacesMenuGroupTemplate extends VpeAbstractTemplate {
- public static final String MENU_GROUP_ID = "MENU-GROUP-ID"; //$NON-NLS-1$
-
/*
* rich:menuGroup constants
*/
- private final static String COMPONENT_NAME = "menuGroup"; //$NON-NLS-1$
- private final static String STYLE_PATH = "menuGroup/menuGroup.css"; //$NON-NLS-1$
+ private static final String COMPONENT_NAME = "menuGroup"; //$NON-NLS-1$
+ private static final String STYLE_PATH = "menuGroup/menuGroup.css"; //$NON-NLS-1$
private static final String SPACER_IMG_PATH = "menuGroup/spacer.gif"; //$NON-NLS-1$
- private final static String CHILD_GROUP_NAME = ":menuGroup"; //$NON-NLS-1$
- private final static String CHILD_ITEM_NAME = ":menuItem"; //$NON-NLS-1$
+ private static final String FOLDER_IMG_PATH = "menuGroup/arrow.gif"; //$NON-NLS-1$
+ private static final String FOLDER_IMG_WIDTH = "16px;"; //$NON-NLS-1$
+ private static final String FOLDER_IMG_HEIGHT = "16px;"; //$NON-NLS-1$
+ private static final String CHILD_GROUP_NAME = ":menuGroup"; //$NON-NLS-1$
+ private static final String CHILD_ITEM_NAME = ":menuItem"; //$NON-NLS-1$
private static final String ICON_FACET_NAME = "icon"; //$NON-NLS-1$
private static final String ICON_DISABLED_FACET_NAME = "iconDisabled"; //$NON-NLS-1$
private static final String EMPTY = ""; //$NON-NLS-1$
private static final String SPACE = " "; //$NON-NLS-1$
/*
+ * Constants for drop down mechanism.
+ */
+ private static final String MENU_PARENT_ID = "vpe-ddm-menu-ul"; //$NON-NLS-1$
+ private static final String MENU_CHILD_ID = "vpe-ddm-menu-li"; //$NON-NLS-1$
+
+ /*
* rich:menuGroup css styles names
*/
private static final String CSS_RICH_MENU_GROUP = "rich-menu-group"; //$NON-NLS-1$
@@ -63,6 +70,7 @@
private static final String CSS_RICH_MENU_LIST_BG = "rich-menu-list-bg"; //$NON-NLS-1$
private static final String CSS_RICH_LIST_FOLDER_DIV_STYLE = ""; //$NON-NLS-1$
private static final String CSS_RICH_LIST_BORDER_DIV_STYLE = ""; //$NON-NLS-1$
+ private static final String CSS_MENU_GROUP_TOP_DIV = "dr-menu-group-top-div"; //$NON-NLS-1$
/*
* rich:menuGroup attributes names
@@ -123,9 +131,10 @@
nsIDOMElement grTopDiv;
nsIDOMElement grImgSpan;
nsIDOMElement grImg;
+ nsIDOMElement grFolderImg;
nsIDOMElement grLabelSpan;
nsIDOMText grLabelText;
- nsIDOMElement grFolderDiv;
+ nsIDOMElement grFolderImgSpan;
nsIDOMElement grListBorderDiv;
nsIDOMElement grListBgDiv;
@@ -137,9 +146,10 @@
grTopDiv = visualDocument.createElement(HTML.TAG_DIV);
grImgSpan = visualDocument.createElement(HTML.TAG_SPAN);
grImg = visualDocument.createElement(HTML.TAG_IMG);
+ grFolderImg = visualDocument.createElement(HTML.TAG_IMG);
grLabelSpan = visualDocument.createElement(HTML.TAG_SPAN);
grLabelText = visualDocument.createTextNode(EMPTY);
- grFolderDiv = visualDocument.createElement(HTML.TAG_DIV);
+ grFolderImgSpan = visualDocument.createElement(HTML.TAG_SPAN);
grListBorderDiv = visualDocument.createElement(HTML.TAG_DIV);
grListBgDiv = visualDocument.createElement(HTML.TAG_DIV);
creationData = new VpeCreationData(grMainLI);
@@ -150,21 +160,16 @@
grTopDiv.appendChild(grImgSpan);
grTopDiv.appendChild(grLabelSpan);
grLabelSpan.appendChild(grLabelText);
-// grTopDiv.appendChild(grFolderDiv);
+ grTopDiv.appendChild(grFolderImgSpan);
// grFolderDiv.appendChild(grListBorderDiv);
// grListBorderDiv.appendChild(grListBgDiv);
grMainLI.appendChild(grTopDiv);
-
+
/*
- * Children <ul> will be added only if there are some of them.
- */
-// grMainLI.appendChild(grChildrenUL);
-
- /*
* Setting attributes for the drop-down mechanism
*/
- grMainLI.setAttribute(RichFacesDropDownMenuTemplate.MENU_CHILD_ID, EMPTY);
- grChildrenUL.setAttribute(RichFacesDropDownMenuTemplate.MENU_PARENT_ID, EMPTY);
+ grMainLI.setAttribute(MENU_CHILD_ID, EMPTY);
+ grChildrenUL.setAttribute(MENU_PARENT_ID, EMPTY);
/*
* Setting css classes
@@ -190,14 +195,16 @@
labelSpanClass += SPACE + mg_labelClass;
}
-// grTopDiv.setAttribute(HTML.CLASS_ATTR, topDivClass);
+// grTopDiv.setAttribute(HTML.ATTR_CLASS, topDivClass);
+ grTopDiv.setAttribute(HTML.ATTR_CLASS, CSS_MENU_GROUP_TOP_DIV);
grMainLI.setAttribute(HTML.ATTR_CLASS, topDivClass);
grImgSpan.setAttribute(HTML.ATTR_CLASS, imgSpanClass);
grLabelSpan.setAttribute(HTML.ATTR_CLASS, labelSpanClass);
-// grFolderDiv.setAttribute(HTML.ATTR_CLASS, folderDivClass);
+ grFolderImgSpan.setAttribute(HTML.ATTR_CLASS, folderDivClass);
// grListBorderDiv.setAttribute(HTML.ATTR_CLASS, CSS_RICH_MENU_LIST_BORDER);
// grListBgDiv.setAttribute(HTML.ATTR_CLASS, CSS_RICH_MENU_LIST_BG);
- grChildrenUL.setAttribute(HTML.ATTR_CLASS, folderDivClass + SPACE + CSS_RICH_MENU_LIST_BORDER + SPACE + CSS_RICH_MENU_LIST_BG);
+ grChildrenUL.setAttribute(HTML.ATTR_CLASS, CSS_RICH_MENU_LIST_BORDER
+ + SPACE + CSS_RICH_MENU_LIST_BG);
/*
* Setting css styles
*/
@@ -207,11 +214,12 @@
topDivStyle += SPACE + mg_style;
}
-// grTopDiv.setAttribute(HTML.STYLE_ATTR, topDivStyle);
grMainLI.setAttribute(HTML.ATTR_STYLE, topDivStyle);
-// grFolderDiv.setAttribute(HTML.ATTR_STYLE, CSS_RICH_LIST_FOLDER_DIV_STYLE);
+ grFolderImgSpan.setAttribute(HTML.ATTR_STYLE, CSS_RICH_LIST_FOLDER_DIV_STYLE);
// grListBorderDiv.setAttribute(HTML.ATTR_STYLE, CSS_RICH_LIST_BORDER_DIV_STYLE);
- grChildrenUL.setAttribute(HTML.ATTR_STYLE, CSS_RICH_LIST_FOLDER_DIV_STYLE + SPACE + CSS_RICH_LIST_BORDER_DIV_STYLE);
+// grChildrenUL.setAttribute(HTML.ATTR_STYLE,
+// CSS_RICH_LIST_FOLDER_DIV_STYLE + SPACE
+// + CSS_RICH_LIST_BORDER_DIV_STYLE);
/*
* Encode label value
@@ -231,12 +239,11 @@
childInfo.addSourceChild(iconFacet);
creationData.addChildrenInfo(childInfo);
} else {
- String iconPath = sourceElement.getAttribute(ICON);
- if (attrPresents(iconPath)) {
+ if (attrPresents(mg_icon)) {
/*
* Add path to specified image
*/
- String imgFullPath = VpeStyleUtil.addFullPathToImgSrc(iconPath, pageContext, true);
+ String imgFullPath = VpeStyleUtil.addFullPathToImgSrc(mg_icon, pageContext, true);
grImg.setAttribute(HTML.ATTR_SRC, imgFullPath);
} else {
/*
@@ -252,6 +259,26 @@
}
/*
+ * Add group folder icon
+ */
+ if (attrPresents(mg_iconFolder)) {
+ /*
+ * Add path to specified image
+ */
+ String imgFullPath = VpeStyleUtil.addFullPathToImgSrc(mg_iconFolder, pageContext, true);
+ grFolderImg.setAttribute(HTML.ATTR_SRC, imgFullPath);
+ } else {
+ /*
+ * Create default arrow image
+ */
+ ComponentUtil.setImg(grFolderImg, FOLDER_IMG_PATH);
+ }
+ /*
+ * Add image to group folder div
+ */
+ grFolderImgSpan.appendChild(grFolderImg);
+
+ /*
* Adding child nodes:
* <rich:menuGroup> and <rich:menuItem> only.
*/
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesMenuItemTemplate.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesMenuItemTemplate.java 2008-10-15 16:23:34 UTC (rev 10860)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesMenuItemTemplate.java 2008-10-15 16:23:38 UTC (rev 10861)
@@ -29,11 +29,12 @@
public class RichFacesMenuItemTemplate extends VpeAbstractTemplate {
+
/*
* rich:menuItem constants
*/
- private final static String COMPONENT_NAME = "menuItem"; //$NON-NLS-1$
- private final static String STYLE_PATH = "menuItem/menuItem.css"; //$NON-NLS-1$
+ private static final String COMPONENT_NAME = "menuItem"; //$NON-NLS-1$
+ private static final String STYLE_PATH = "menuItem/menuItem.css"; //$NON-NLS-1$
private static final String SPACER_IMG_PATH = "menuItem/spacer.gif"; //$NON-NLS-1$
private static final String ICON_FACET_NAME = "icon"; //$NON-NLS-1$
private static final String ICON_DISABLED_FACET_NAME = "iconDisabled"; //$NON-NLS-1$
@@ -41,6 +42,11 @@
private static final String SPACE = " "; //$NON-NLS-1$
/*
+ * Constants for drop down mechanism.
+ */
+ private static final String MENU_CHILD_ID = "vpe-ddm-menu-li"; //$NON-NLS-1$
+
+ /*
* rich:menuItem css styles names
*/
private static final String CSS_RICH_MENU_ITEM = "rich-menu-item"; //$NON-NLS-1$
@@ -55,6 +61,7 @@
private static final String CSS_RICH_MENU_ITEM_ICON_ENABLED = "rich-menu-item-icon-enabled"; //$NON-NLS-1$
private static final String CSS_RICH_MENU_ITEM_LABEL_SELECTED = "rich-menu-item-label-selected"; //$NON-NLS-1$
private static final String CSS_RICH_MENU_ITEM_ICON_SELECTED = "rich-menu-item-icon-selected"; //$NON-NLS-1$
+ private static final String CSS_MENU_ITEM_TOP_DIV = "dr-menu-item-top-div"; //$NON-NLS-1$
/*
* rich:menuItem attributes names
@@ -128,11 +135,10 @@
itemLabelSpan.appendChild(itemLabelText);
itemMainLI.appendChild(itemTopDiv);
-
/*
* Setting attributes for the drop-down mechanism
*/
- itemMainLI.setAttribute(RichFacesDropDownMenuTemplate.MENU_CHILD_ID, EMPTY);
+ itemMainLI.setAttribute(MENU_CHILD_ID, EMPTY);
/*
* Setting css classes
@@ -156,6 +162,7 @@
}
// itemTopDiv.setAttribute(HTML.ATTR_CLASS, topDivClass);
+ itemTopDiv.setAttribute(HTML.ATTR_CLASS, CSS_MENU_ITEM_TOP_DIV);
itemMainLI.setAttribute(HTML.ATTR_CLASS, topDivClass);
itemIconImgSpan.setAttribute(HTML.ATTR_CLASS, iconImgSpanClass);
itemLabelSpan.setAttribute(HTML.ATTR_CLASS, labelSpanClass);
@@ -200,7 +207,6 @@
* Add image to span
*/
itemIconImgSpan.appendChild(itemIconImg);
-
}
/*
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/templates/vpe-templates-richfaces.xml
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/templates/vpe-templates-richfaces.xml 2008-10-15 16:23:34 UTC (rev 10860)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/templates/vpe-templates-richfaces.xml 2008-10-15 16:23:38 UTC (rev 10861)
@@ -529,10 +529,6 @@
<vpe:tag name="rich:dropDownMenu" case-sensitive="yes" >
<vpe:template class="org.jboss.tools.jsf.vpe.richfaces.template.RichFacesDropDownMenuTemplate"
children="yes" modify="no">
- <vpe:resize>
- <vpe:width width-attr="style.width" />
- <vpe:height height-attr="style.height" />
- </vpe:resize>
<vpe:dnd>
<vpe:drag start-enable="yes"/>
<vpe:drop container="no"/>
@@ -543,10 +539,6 @@
<vpe:tag name="rich:menuItem" case-sensitive="yes" >
<vpe:template class="org.jboss.tools.jsf.vpe.richfaces.template.RichFacesMenuItemTemplate"
children="yes" modify="no">
- <vpe:resize>
- <vpe:width width-attr="style.width" />
- <vpe:height height-attr="style.height" />
- </vpe:resize>
<vpe:dnd>
<vpe:drag start-enable="yes"/>
<vpe:drop container="no"/>
@@ -557,10 +549,6 @@
<vpe:tag name="rich:menuGroup" case-sensitive="yes" >
<vpe:template class="org.jboss.tools.jsf.vpe.richfaces.template.RichFacesMenuGroupTemplate"
children="yes" modify="no">
- <vpe:resize>
- <vpe:width width-attr="style.width" />
- <vpe:height height-attr="style.height" />
- </vpe:resize>
<vpe:dnd>
<vpe:drag start-enable="yes"/>
<vpe:drop container="no"/>
17 years, 2 months
JBoss Tools SVN: r10860 - in trunk/documentation/jbosstools-jdocbook-style/src/main: org/css/images and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: smukhina
Date: 2008-10-15 12:23:34 -0400 (Wed, 15 Oct 2008)
New Revision: 10860
Added:
trunk/documentation/jbosstools-jdocbook-style/src/main/com/css/images/new.png
trunk/documentation/jbosstools-jdocbook-style/src/main/com/css/images/updated.png
trunk/documentation/jbosstools-jdocbook-style/src/main/org/css/images/new.png
trunk/documentation/jbosstools-jdocbook-style/src/main/org/css/images/updated.png
Log:
https://jira.jboss.org/jira/browse/JBDS-424
Added: trunk/documentation/jbosstools-jdocbook-style/src/main/com/css/images/new.png
===================================================================
(Binary files differ)
Property changes on: trunk/documentation/jbosstools-jdocbook-style/src/main/com/css/images/new.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/documentation/jbosstools-jdocbook-style/src/main/com/css/images/updated.png
===================================================================
(Binary files differ)
Property changes on: trunk/documentation/jbosstools-jdocbook-style/src/main/com/css/images/updated.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/documentation/jbosstools-jdocbook-style/src/main/org/css/images/new.png
===================================================================
(Binary files differ)
Property changes on: trunk/documentation/jbosstools-jdocbook-style/src/main/org/css/images/new.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/documentation/jbosstools-jdocbook-style/src/main/org/css/images/updated.png
===================================================================
(Binary files differ)
Property changes on: trunk/documentation/jbosstools-jdocbook-style/src/main/org/css/images/updated.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
17 years, 2 months
JBoss Tools SVN: r10859 - in trunk: birt/docs/en/images and 12 other directories.
by jbosstools-commits@lists.jboss.org
Author: smukhina
Date: 2008-10-15 12:21:10 -0400 (Wed, 15 Oct 2008)
New Revision: 10859
Removed:
trunk/as/docs/reference/en/images/new.png
trunk/as/docs/reference/en/images/updated.png
trunk/birt/docs/en/images/new.png
trunk/birt/docs/en/images/updated.png
trunk/documentation/guides/Exadel-migration/en/images/new.png
trunk/documentation/guides/Exadel-migration/en/images/updated.png
trunk/documentation/guides/GettingStartedGuide/en/images/new.png
trunk/documentation/guides/GettingStartedGuide/en/images/updated.png
trunk/esb/docs/esb_ref_guide/en/images/new.png
trunk/esb/docs/esb_ref_guide/en/images/updated.png
trunk/hibernatetools/docs/reference/en/images/new.png
trunk/hibernatetools/docs/reference/en/images/updated.png
trunk/jbpm/docs/reference/en/images/new.png
trunk/jbpm/docs/reference/en/images/updated.png
trunk/jsf/docs/jsf_tools_ref_guide/en/images/new.png
trunk/jsf/docs/jsf_tools_ref_guide/en/images/updated.png
trunk/jsf/docs/jsf_tools_tutorial/en/images/new.png
trunk/jsf/docs/jsf_tools_tutorial/en/images/updated.png
trunk/jsf/docs/userguide/en/images/new.png
trunk/jsf/docs/userguide/en/images/updated.png
trunk/portlet/docs/reference/en/images/new.png
trunk/portlet/docs/reference/en/images/updated.png
trunk/seam/docs/reference/en/images/new.png
trunk/seam/docs/reference/en/images/updated.png
trunk/struts/docs/struts_tools_ref_guide/en/images/new.png
trunk/struts/docs/struts_tools_ref_guide/en/images/updated.png
trunk/struts/docs/struts_tools_tutorial/en/images/new.png
trunk/struts/docs/struts_tools_tutorial/en/images/updated.png
Log:
https://jira.jboss.org/jira/browse/JBDS-424
Deleted: trunk/as/docs/reference/en/images/new.png
===================================================================
(Binary files differ)
Deleted: trunk/as/docs/reference/en/images/updated.png
===================================================================
(Binary files differ)
Deleted: trunk/birt/docs/en/images/new.png
===================================================================
(Binary files differ)
Deleted: trunk/birt/docs/en/images/updated.png
===================================================================
(Binary files differ)
Deleted: trunk/documentation/guides/Exadel-migration/en/images/new.png
===================================================================
(Binary files differ)
Deleted: trunk/documentation/guides/Exadel-migration/en/images/updated.png
===================================================================
(Binary files differ)
Deleted: trunk/documentation/guides/GettingStartedGuide/en/images/new.png
===================================================================
(Binary files differ)
Deleted: trunk/documentation/guides/GettingStartedGuide/en/images/updated.png
===================================================================
(Binary files differ)
Deleted: trunk/esb/docs/esb_ref_guide/en/images/new.png
===================================================================
(Binary files differ)
Deleted: trunk/esb/docs/esb_ref_guide/en/images/updated.png
===================================================================
(Binary files differ)
Deleted: trunk/hibernatetools/docs/reference/en/images/new.png
===================================================================
(Binary files differ)
Deleted: trunk/hibernatetools/docs/reference/en/images/updated.png
===================================================================
(Binary files differ)
Deleted: trunk/jbpm/docs/reference/en/images/new.png
===================================================================
(Binary files differ)
Deleted: trunk/jbpm/docs/reference/en/images/updated.png
===================================================================
(Binary files differ)
Deleted: trunk/jsf/docs/jsf_tools_ref_guide/en/images/new.png
===================================================================
(Binary files differ)
Deleted: trunk/jsf/docs/jsf_tools_ref_guide/en/images/updated.png
===================================================================
(Binary files differ)
Deleted: trunk/jsf/docs/jsf_tools_tutorial/en/images/new.png
===================================================================
(Binary files differ)
Deleted: trunk/jsf/docs/jsf_tools_tutorial/en/images/updated.png
===================================================================
(Binary files differ)
Deleted: trunk/jsf/docs/userguide/en/images/new.png
===================================================================
(Binary files differ)
Deleted: trunk/jsf/docs/userguide/en/images/updated.png
===================================================================
(Binary files differ)
Deleted: trunk/portlet/docs/reference/en/images/new.png
===================================================================
(Binary files differ)
Deleted: trunk/portlet/docs/reference/en/images/updated.png
===================================================================
(Binary files differ)
Deleted: trunk/seam/docs/reference/en/images/new.png
===================================================================
(Binary files differ)
Deleted: trunk/seam/docs/reference/en/images/updated.png
===================================================================
(Binary files differ)
Deleted: trunk/struts/docs/struts_tools_ref_guide/en/images/new.png
===================================================================
(Binary files differ)
Deleted: trunk/struts/docs/struts_tools_ref_guide/en/images/updated.png
===================================================================
(Binary files differ)
Deleted: trunk/struts/docs/struts_tools_tutorial/en/images/new.png
===================================================================
(Binary files differ)
Deleted: trunk/struts/docs/struts_tools_tutorial/en/images/updated.png
===================================================================
(Binary files differ)
17 years, 2 months
JBoss Tools SVN: r10858 - trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template.
by jbosstools-commits@lists.jboss.org
Author: yradtsevich
Date: 2008-10-15 10:36:48 -0400 (Wed, 15 Oct 2008)
New Revision: 10858
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesComboBoxTemplate.java
Log:
Minor changes
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesComboBoxTemplate.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesComboBoxTemplate.java 2008-10-15 14:34:45 UTC (rev 10857)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesComboBoxTemplate.java 2008-10-15 14:36:48 UTC (rev 10858)
@@ -59,9 +59,6 @@
public boolean isRecreateAtAttrChange(VpePageContext pageContext,
Element sourceElement, nsIDOMDocument visualDocument,
nsIDOMElement visualNode, Object data, String name, String value) {
- // TODO Auto-generated method stub
return true;
}
-
-
}
17 years, 2 months
JBoss Tools SVN: r10857 - in trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor: util and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: yradtsevich
Date: 2008-10-15 10:34:45 -0400 (Wed, 15 Oct 2008)
New Revision: 10857
Added:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/VpeClassUtil.java
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpePanelGridCreator.java
Log:
Method getClasses extracted from VpePanelGridCreator and placed into new class VpeClassUtil.
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpePanelGridCreator.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpePanelGridCreator.java 2008-10-15 14:21:11 UTC (rev 10856)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpePanelGridCreator.java 2008-10-15 14:34:45 UTC (rev 10857)
@@ -23,6 +23,7 @@
import org.jboss.tools.vpe.editor.template.expression.VpeExpressionInfo;
import org.jboss.tools.vpe.editor.template.expression.VpeValue;
import org.jboss.tools.vpe.editor.util.HTML;
+import org.jboss.tools.vpe.editor.util.VpeClassUtil;
import org.mozilla.interfaces.nsIDOMAttr;
import org.mozilla.interfaces.nsIDOMDocument;
import org.mozilla.interfaces.nsIDOMElement;
@@ -350,9 +351,9 @@
.createElement(HTML.TAG_TBODY);
visualTable.appendChild(visualBody);
- List rowClasses = getClasses(rowClassesExpr, sourceNode,
+ List<String> rowClasses = VpeClassUtil.getClasses(rowClassesExpr, sourceNode,
pageContext);
- List columnClasses = getClasses(columnClassesExpr, sourceNode,
+ List<String> columnClasses = VpeClassUtil.getClasses(columnClassesExpr, sourceNode,
pageContext);
int rci = 0; // index of row class
@@ -421,22 +422,6 @@
return creatorInfo;
}
- private List getClasses(VpeExpression expression, Node sourceNode,
- VpePageContext pageContext) throws VpeExpressionException {
- List b = new ArrayList();
- if (expression != null && sourceNode != null) {
- String classes = expression.exec(pageContext, sourceNode)
- .stringValue();
- String[] a = classes.split(",");
- for (int i = 0; i < a.length; i++) {
- if (a[i].trim().length() > 0) {
- b.add(a[i].trim());
- }
- }
- }
- return b;
- }
-
private void makeSpecial(Node header, nsIDOMElement visualHead,
nsIDOMDocument visualDocument, int tableSize,
VpeCreatorInfo creatorInfo, String cellTag,
Added: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/VpeClassUtil.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/VpeClassUtil.java (rev 0)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/VpeClassUtil.java 2008-10-15 14:34:45 UTC (rev 10857)
@@ -0,0 +1,57 @@
+/*******************************************************************************
+ * Copyright (c) 2007-2008 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributor:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.vpe.editor.util;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.jboss.tools.vpe.editor.context.VpePageContext;
+import org.jboss.tools.vpe.editor.template.expression.VpeExpression;
+import org.jboss.tools.vpe.editor.template.expression.VpeExpressionException;
+import org.w3c.dom.Node;
+
+/**
+ * @author yradtsevich
+ *
+ */
+public class VpeClassUtil {
+ /**
+ *
+ */
+ private static final String CLASSES_DELIMITER = ","; //$NON-NLS-1$
+
+ /**
+ * Extracts class names from <code>sourceNode</code> specified by a string given
+ * by <code>expression</code>
+ *
+ * @param expression
+ * @param sourceNode
+ * @param pageContext
+ * @return names of style classes
+ * @throws VpeExpressionException
+ */
+ public static List<String> getClasses(VpeExpression expression, Node sourceNode,
+ VpePageContext pageContext) throws VpeExpressionException {
+ List<String> ret = new ArrayList<String>();
+ if (expression != null && sourceNode != null) {
+ String classes = expression.exec(pageContext, sourceNode)
+ .stringValue();
+ String[] a = classes.split(CLASSES_DELIMITER);
+ for (int i = 0; i < a.length; i++) {
+ String className = a[i].trim();
+ if (className.length() > 0) {
+ ret.add(className);
+ }
+ }
+ }
+ return ret;
+ }
+}
17 years, 2 months
JBoss Tools SVN: r10856 - trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/editor.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2008-10-15 10:21:11 -0400 (Wed, 15 Oct 2008)
New Revision: 10856
Modified:
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/editor/ObjectMultiPageEditor.java
Log:
Selection improved
Modified: trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/editor/ObjectMultiPageEditor.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/editor/ObjectMultiPageEditor.java 2008-10-15 14:13:26 UTC (rev 10855)
+++ trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/editor/ObjectMultiPageEditor.java 2008-10-15 14:21:11 UTC (rev 10856)
@@ -831,6 +831,7 @@
protected void pageChange(int newPageIndex) {
deactivateSite(false, false);
+ boolean isText = selectedPageIndex == getSourcePageIndex();
selectedPageIndex = newPageIndex;
Control control = getControl(newPageIndex);
if (control != null) {
@@ -848,7 +849,7 @@
if(postponedTextSelection.selected != null) {
Display.getDefault().asyncExec(postponedTextSelection);
}
- if(newPageIndex != getSourcePageIndex()) {
+ if(isText && newPageIndex != getSourcePageIndex()) {
synchronizeSelectionWithText();
}
activateSite();
17 years, 2 months
JBoss Tools SVN: r10855 - trunk/as/docs/reference/en/modules.
by jbosstools-commits@lists.jboss.org
Author: ochikvina
Date: 2008-10-15 10:13:26 -0400 (Wed, 15 Oct 2008)
New Revision: 10855
Modified:
trunk/as/docs/reference/en/modules/webtools.xml
Log:
https://jira.jboss.org/jira/browse/JBDS-446- updating the 'Adding Facets to a Project' section;
Modified: trunk/as/docs/reference/en/modules/webtools.xml
===================================================================
--- trunk/as/docs/reference/en/modules/webtools.xml 2008-10-15 14:12:00 UTC (rev 10854)
+++ trunk/as/docs/reference/en/modules/webtools.xml 2008-10-15 14:13:26 UTC (rev 10855)
@@ -2,10 +2,10 @@
<chapter id="webtools">
<title>Projects</title>
<para>The most popular of the projects we deal with are the J2EE ones, such as Dynamic Web
- Project, EJB Project, or EAR project. Web projects of JBoss Tools are Struts, JSF and Seam
- projects. All of them are called faceted projects. Thus, in this chapter we are going to
- tell you about facets the main benefit of which to provide proper structuring and packaging
- for any type of project.</para>
+ Project, EJB Project, or EAR project. Web projects of <property>JBoss Tools</property> are
+ Struts, JSF and Seam projects. All of them are called faceted projects. Thus, in this
+ chapter we are going to tell you about facets the main benefit of which to provide proper
+ structuring and packaging for any type of project.</para>
<section>
<title>Faceted Projects Overview</title>
@@ -33,33 +33,16 @@
<section revisionflag="changed">
<title>Adding Facets to a Project</title>
- <para>There are two ways to add facets to a project. The first way is to include facets into
- already existing project. For that you should bring up the context menu for selected
- project and click <emphasis>
- <property>Properties</property>.
- </emphasis> At this point, choose <emphasis>
- <property>Project Facets</property>
- </emphasis> from the left. It will represent a list of the facets for your project and
- give opportunity to modify it by clicking on <emphasis>
- <property>Modify Project...</property>
- </emphasis> button.</para>
+ <para>In this section we're going to consider the facets added by <property>JBoss
+ Tools</property> and show how you can configure them in a project: add new ones or
+ modify already existing configuration of the facets.</para>
- <figure>
- <title>Adding Facets to the Existing Project</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/webtools/webtools_0.png"/>
- </imageobject>
- </mediaobject>
- </figure>
-
- <para> The other way is adding necessary facets while organizing a new project. To
- demonstrate it let's create a new <property>Dynamic Web Project</property>
- selecting as usual <emphasis>
+ <para>One way to configure the facets is doing it while organizing a new project. To
+ demonstrate this let's create a new <property>Dynamic Web Project</property> by
+ selecting <emphasis>
<property>File > New > Other...</property>
</emphasis> and then <emphasis>
- <property>Web > Dynamic Web Project</property>.
- </emphasis></para>
+ <property>Web > Dynamic Web Project</property>. </emphasis></para>
<figure>
<title>New Dynamic Web Project</title>
<mediaobject>
@@ -70,37 +53,65 @@
</figure>
<para>Click <emphasis>
<property>Next</property>
- </emphasis> and you will see Dynamic Web Project page.</para>
- <figure>
- <title>Faceted Project Wizard: First Page</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/webtools/webtools_2.png"/>
- </imageobject>
- </mediaobject>
- </figure>
+ </emphasis> and you will see Dynamic Web Project page like on the figure below.</para>
+
<para> The first page of most WTP projects allows you to target a specific runtime,
representing a server's library location. It will also provide you the ability to add
this project to an EAR project, and select a pre-selected default set of facets, called
a configuration, rather than manually select each facet you might want.</para>
<para> Selecting the runtime, again, allows the project to install the proper classpaths to
the project so it knows what code to compile against.</para>
- <figure>
- <title>Faceted Project Wizard: Second Page</title>
+
+ <figure id="dyn_web_project">
+ <title>New Dynamic Web Project</title>
<mediaobject>
<imageobject>
+ <imagedata fileref="images/webtools/webtools_2.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+ <para>Click on the <emphasis>
+ <property>Modify</property>
+ </emphasis> button next to <property>Configuration</property> section in order to open
+ the wizard which allows you to modify a chosen configuration. The wizard looks as
+ follows.</para>
+
+ <figure id="project_facets">
+ <title>Project Facets Wizard</title>
+ <mediaobject>
+ <imageobject>
<imagedata fileref="images/webtools/webtools_3.png"/>
</imageobject>
</mediaobject>
</figure>
- <para> The second page of the wizard allows you to enable or disable specific facets, as
- described above. Some facets may require others, and some may conflict with others, but
- on the whole this page allows you to add any number of facets that don't
- conflict with each other. It means that the list doesn't show those facets that
- couldn't be in the same project. To view the information on limitations and
- requirements for the chosen facet right-click on the facet and press <emphasis>
- <property>Show Constraints</property>.</emphasis></para>
+ <para>Here part of the listed facets are those which are provided by WTP. Some of them are
+ added by <property>JBoss Tools</property>. They are:</para>
+ <itemizedlist>
+ <listitem>
+ <para>BIRT Charting Runtime Component</para>
+ </listitem>
+ <listitem>
+ <para>BIRT Reporting Runtime Component</para>
+ </listitem>
+ <listitem>
+ <para>JBoss ESB</para>
+ </listitem>
+ <listitem>
+ <para>JBoss Portlets</para>
+ </listitem>
+ <listitem>
+ <para>JBoss Web Services</para>
+ </listitem>
+ <listitem>
+ <para>Seam</para>
+ </listitem>
+ </itemizedlist>
+
+ <para>On this wizard page you can enable or disable any facet as well as change it version.
+ What you should note here is that some facets or facets versions may conflict with each
+ other. In case of incompatibility you'll be prompted about this in the combo
+ box underneath.</para>
<figure>
<title>Facet Constraints</title>
<mediaobject>
@@ -109,21 +120,44 @@
</imageobject>
</mediaobject>
</figure>
-
- <para>Notice that here it is also possible to change the version of any facet. If
- the chosen version isn't compatible with any other facet version, you'll be prompted
- about this in the combo box underneath.</para>
-
+ <para>When switching on the <emphasis>
+ <property>Runtimes</property>
+ </emphasis> tab on the right you'll see the currant Server Runtime.</para>
<figure>
- <title>Facet Constraints</title>
+ <title>Runtimes on the Project Facets Wizard</title>
<mediaobject>
<imageobject>
<imagedata fileref="images/webtools/webtools_5.png"/>
</imageobject>
</mediaobject>
</figure>
- <para> Further pages in the wizard are specific to either the project type, or the facets
- selected.</para>
+ <para>On this tab you can also create a new Server Runtime and make it primary by pressing <emphasis>
+ <property>Make Primary</property>
+ </emphasis> button after enabling it.</para>
+ <para>Clicking on <emphasis>
+ <property>OK</property>
+ </emphasis> will save the chosen configuration of the facets and return you to the <link
+ linkend="dyn_web_project">Dynamic Web Project wizard</link>. Further pages in the
+ wizard are specific to either the project type or the facets selected.</para>
+
+
+ <para>If you need to configure the facets for the existing project, you should bring up the
+ context menu for selected project and click <emphasis>
+ <property>Properties</property>
+ </emphasis> and then <emphasis>
+ <property>Project Facets</property>. </emphasis> This will bring up the familiar
+ <link linkend="project_facets">Project Facets wizard</link>, where you can create
+ your own custom facets configuration.</para>
+
+ <para/>
+
</section>
+ <section id="rel_resources_links">
+ <title>Relevant Resources Links</title>
+
+ <para>More on the WTP facets you can read in the <ulink
+ url="http://help.eclipse.org/ganymede/index.jsp?topic=/org.eclipse.jst.j2ee.do..."
+ >eclipse help</ulink>.</para>
+ </section>
</chapter>
17 years, 2 months
JBoss Tools SVN: r10854 - trunk/as/docs/reference/en/images/webtools.
by jbosstools-commits@lists.jboss.org
Author: ochikvina
Date: 2008-10-15 10:12:00 -0400 (Wed, 15 Oct 2008)
New Revision: 10854
Modified:
trunk/as/docs/reference/en/images/webtools/webtools_2.png
trunk/as/docs/reference/en/images/webtools/webtools_3.png
trunk/as/docs/reference/en/images/webtools/webtools_4.png
trunk/as/docs/reference/en/images/webtools/webtools_5.png
Log:
https://jira.jboss.org/jira/browse/JBDS-446 - replacing out-of-date screenshots by new ones;
Modified: trunk/as/docs/reference/en/images/webtools/webtools_2.png
===================================================================
(Binary files differ)
Modified: trunk/as/docs/reference/en/images/webtools/webtools_3.png
===================================================================
(Binary files differ)
Modified: trunk/as/docs/reference/en/images/webtools/webtools_4.png
===================================================================
(Binary files differ)
Modified: trunk/as/docs/reference/en/images/webtools/webtools_5.png
===================================================================
(Binary files differ)
17 years, 2 months