JBoss Tools SVN: r14944 - in trunk: struts/plugins/org.jboss.tools.struts and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: dazarov
Date: 2009-04-28 08:48:32 -0400 (Tue, 28 Apr 2009)
New Revision: 14944
Modified:
trunk/common/plugins/org.jboss.tools.common.verification/plugin.properties
trunk/struts/plugins/org.jboss.tools.struts/plugin.properties
Log:
https://jira.jboss.org/jira/browse/JBIDE-4154
Modified: trunk/common/plugins/org.jboss.tools.common.verification/plugin.properties
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.verification/plugin.properties 2009-04-28 09:08:02 UTC (rev 14943)
+++ trunk/common/plugins/org.jboss.tools.common.verification/plugin.properties 2009-04-28 12:48:32 UTC (rev 14944)
@@ -1,4 +1,4 @@
providerName=JBoss, a division of Red Hat
# START NON-TRANSLATABLE
-Bundle-Name.0 = org.jboss.tools.common.verification
+Bundle-Name.0 = JBoss Tools Verification
# END NON-TRANSLATABLE
Modified: trunk/struts/plugins/org.jboss.tools.struts/plugin.properties
===================================================================
--- trunk/struts/plugins/org.jboss.tools.struts/plugin.properties 2009-04-28 09:08:02 UTC (rev 14943)
+++ trunk/struts/plugins/org.jboss.tools.struts/plugin.properties 2009-04-28 12:48:32 UTC (rev 14944)
@@ -1,2 +1,2 @@
providerName=JBoss, a division of Red Hat
-Bundle-Name.0 = org.jboss.tools.struts
\ No newline at end of file
+Bundle-Name.0 = JBoss Tools Struts
\ No newline at end of file
15 years, 8 months
JBoss Tools SVN: r14943 - in trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration: editors/freemarker and 3 other directories.
by jbosstools-commits@lists.jboss.org
Author: DartPeng
Date: 2009-04-28 05:08:02 -0400 (Tue, 28 Apr 2009)
New Revision: 14943
Modified:
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/actions/OpenEditorEditInnerContentsAction.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/freemarker/TemplateUICreator.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/groovy/ScriptUICreator.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/uitls/SmooksUIUtils.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/xsl/TemplateUICreator.java
Log:
JBIDE-4175
Synchronize the string of "Text" and "Temp Editor"
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/actions/OpenEditorEditInnerContentsAction.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/actions/OpenEditorEditInnerContentsAction.java 2009-04-28 06:36:25 UTC (rev 14942)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/actions/OpenEditorEditInnerContentsAction.java 2009-04-28 09:08:02 UTC (rev 14943)
@@ -8,6 +8,8 @@
import java.io.File;
import java.io.FileReader;
import java.io.IOException;
+import java.util.HashMap;
+import java.util.Map;
import org.eclipse.core.resources.IContainer;
import org.eclipse.core.resources.IFile;
@@ -23,6 +25,7 @@
import org.eclipse.emf.ecore.xml.type.AnyType;
import org.eclipse.emf.edit.domain.EditingDomain;
import org.eclipse.jface.action.Action;
+import org.eclipse.swt.widgets.Text;
import org.eclipse.ui.IEditorPart;
import org.eclipse.ui.IPartListener;
import org.eclipse.ui.ISharedImages;
@@ -41,6 +44,8 @@
*/
public class OpenEditorEditInnerContentsAction extends Action {
+ private static Map<Object, Map<String, OpenEditorEditInnerContentsAction>> elementTempFileMap = new HashMap<Object, Map<String, OpenEditorEditInnerContentsAction>>();
+
private AnyType model;
private int textType = SmooksUIUtils.VALUE_TYPE_TEXT;
@@ -61,7 +66,12 @@
private IFile tempFile;
- public OpenEditorEditInnerContentsAction(EditingDomain domain, AnyType model, int textType, String fileExtensionName, String editorID) {
+ private Map<String, OpenEditorEditInnerContentsAction> actionMap;
+
+ private Text relateText;
+
+ public OpenEditorEditInnerContentsAction(EditingDomain domain, AnyType model, int textType,
+ String fileExtensionName, String editorID) {
super();
this.model = model;
this.editingDomain = domain;
@@ -69,15 +79,68 @@
this.fileExtensionName = fileExtensionName;
this.editorID = editorID;
tempFileListener = new TempFileChangeListener();
- setImageDescriptor(PlatformUI.getWorkbench().getSharedImages().getImageDescriptor(ISharedImages.IMG_OBJ_FILE));
+ setImageDescriptor(PlatformUI.getWorkbench().getSharedImages().getImageDescriptor(ISharedImages.IMG_OBJ_FILE));
setDescription("Open an editor to edit inner contents");
setText("Open Editor");
+
+ actionMap = elementTempFileMap.get(model);
+ if (actionMap != null) {
+ OpenEditorEditInnerContentsAction oldAction = actionMap.get(getTypeKey());
+ if (oldAction != null) {
+ tempFile = oldAction.getTempFile();
+ // clean old listener
+ cleanOldActionListeners(oldAction);
+ if (tempFile != null) {
+ tempEditorlistener = createNewPartListener();
+ SmooksConfigurationActivator.getDefault().getWorkbench().getActiveWorkbenchWindow().getActivePage()
+ .addPartListener(tempEditorlistener);
+ ResourcesPlugin.getWorkspace().addResourceChangeListener(tempFileListener);
+ }
+ }
+ } else {
+ actionMap = new HashMap<String, OpenEditorEditInnerContentsAction>();
+ elementTempFileMap.put(model, actionMap);
+ }
+
+ actionMap.put(getTypeKey(), this);
}
public OpenEditorEditInnerContentsAction(EditingDomain domain, AnyType model, int textType, String fileExtensionName) {
this(domain, model, textType, fileExtensionName, null);
}
+ public TempFileChangeListener getTempFileListener() {
+ return tempFileListener;
+ }
+
+ public void setTempFileListener(TempFileChangeListener tempFileListener) {
+ this.tempFileListener = tempFileListener;
+ }
+
+ public IPartListener getTempEditorlistener() {
+ return tempEditorlistener;
+ }
+
+ public void setTempEditorlistener(IPartListener tempEditorlistener) {
+ this.tempEditorlistener = tempEditorlistener;
+ }
+
+ public IFile getTempFile() {
+ return tempFile;
+ }
+
+ public void setTempFile(IFile tempFile) {
+ this.tempFile = tempFile;
+ }
+
+ public Text getRelateText() {
+ return relateText;
+ }
+
+ public void setRelateText(Text relateText) {
+ this.relateText = relateText;
+ }
+
private void setContent(AnyType model, String contents, int textType) {
String editValue = null;
if (textType == SmooksUIUtils.VALUE_TYPE_TEXT && model instanceof AnyType) {
@@ -98,8 +161,89 @@
SmooksModelUtils.setCDATAToSmooksType(editingDomain, (AnyType) model, contents);
}
}
+
+ if (getRelateText() != null && contents != null) {
+ try {
+ Text relateText = getRelateText();
+ if (relateText != null) {
+ relateText.setText(contents);
+ }
+ } catch (Throwable t) {
+ t.printStackTrace();
+ }
+ }
}
+ private String getTypeKey() {
+ if (textType == SmooksUIUtils.VALUE_TYPE_TEXT) {
+ return "text";
+ }
+ if (textType == SmooksUIUtils.VALUE_TYPE_COMMENT) {
+ return "comment";
+ }
+ if (textType == SmooksUIUtils.VALUE_TYPE_CDATA) {
+ return "cdata";
+ }
+ return "";
+ }
+
+ private void cleanOldActionListeners(OpenEditorEditInnerContentsAction action) {
+ IPartListener pl = action.getTempEditorlistener();
+ IResourceChangeListener rl = action.getTempFileListener();
+ if (pl != null) {
+ SmooksConfigurationActivator.getDefault().getWorkbench().getActiveWorkbenchWindow().getActivePage()
+ .removePartListener(pl);
+ }
+ if (rl != null) {
+ ResourcesPlugin.getWorkspace().removeResourceChangeListener(rl);
+ }
+ }
+
+ private IPartListener createNewPartListener() {
+ IPartListener partListener = new IPartListener() {
+
+ public void partActivated(IWorkbenchPart part) {
+
+ }
+
+ public void partBroughtToTop(IWorkbenchPart part) {
+
+ }
+
+ public void partClosed(IWorkbenchPart part) {
+ if (tempEditor != null && part == tempEditor) {
+ SmooksConfigurationActivator.getDefault().getWorkbench().getActiveWorkbenchWindow().getActivePage()
+ .removePartListener(tempEditorlistener);
+ ResourcesPlugin.getWorkspace().removeResourceChangeListener(tempFileListener);
+ try {
+ tempFile.delete(true, new NullProgressMonitor());
+ tempFile.refreshLocal(0, null);
+ if (actionMap != null) {
+ actionMap.remove(getTypeKey());
+ }
+ if (actionMap.isEmpty()) {
+ elementTempFileMap.remove(model);
+ actionMap = null;
+ }
+ tempFile = null;
+ } catch (CoreException e) {
+// e.printStackTrace();
+ // ignore
+ }
+ }
+ }
+
+ public void partDeactivated(IWorkbenchPart part) {
+
+ }
+
+ public void partOpened(IWorkbenchPart part) {
+
+ }
+ };
+ return partListener;
+ }
+
@Override
public void run() {
IWorkbenchWindow window = SmooksConfigurationActivator.getDefault().getWorkbench().getActiveWorkbenchWindow();
@@ -111,11 +255,11 @@
} else {
tempEditor = IDE.openEditor(window.getActivePage(), tempFile);
}
- return ;
+ return;
}
if (tempEditorlistener != null) {
- SmooksConfigurationActivator.getDefault().getWorkbench().getActiveWorkbenchWindow().getActivePage().removePartListener(
- tempEditorlistener);
+ SmooksConfigurationActivator.getDefault().getWorkbench().getActiveWorkbenchWindow().getActivePage()
+ .removePartListener(tempEditorlistener);
}
if (tempFileListener != null) {
ResourcesPlugin.getWorkspace().removeResourceChangeListener(tempFileListener);
@@ -152,46 +296,14 @@
tempEditor = IDE.openEditor(window.getActivePage(), tempFile);
}
- tempEditorlistener = new IPartListener() {
-
- public void partActivated(IWorkbenchPart part) {
-
- }
-
- public void partBroughtToTop(IWorkbenchPart part) {
-
- }
-
- public void partClosed(IWorkbenchPart part) {
- if (tempEditor != null && part == tempEditor) {
- SmooksConfigurationActivator.getDefault().getWorkbench().getActiveWorkbenchWindow().getActivePage()
- .removePartListener(tempEditorlistener);
- ResourcesPlugin.getWorkspace().removeResourceChangeListener(tempFileListener);
- try {
- tempFile.delete(true, new NullProgressMonitor());
- tempFile.refreshLocal(0, null);
- tempFile = null;
- } catch (CoreException e) {
- e.printStackTrace();
- }
- }
- }
-
- public void partDeactivated(IWorkbenchPart part) {
-
- }
-
- public void partOpened(IWorkbenchPart part) {
-
- }
- };
- SmooksConfigurationActivator.getDefault().getWorkbench().getActiveWorkbenchWindow().getActivePage().addPartListener(
- tempEditorlistener);
+ tempEditorlistener = createNewPartListener();
+ SmooksConfigurationActivator.getDefault().getWorkbench().getActiveWorkbenchWindow().getActivePage()
+ .addPartListener(tempEditorlistener);
ResourcesPlugin.getWorkspace().addResourceChangeListener(tempFileListener);
}
}
} catch (Exception e) {
-
+
}
}
@@ -244,19 +356,10 @@
IResource res = delta.getResource();
switch (delta.getKind()) {
case IResourceDelta.ADDED:
- System.out.print("Resource ");
- System.out.print(res.getFullPath());
- System.out.println(" was added.");
break;
case IResourceDelta.REMOVED:
- System.out.print("Resource ");
- System.out.print(res.getFullPath());
- System.out.println(" was removed.");
break;
case IResourceDelta.CHANGED:
- System.out.print("Resource ");
- System.out.print(delta.getFullPath());
- System.out.println(" has changed.");
if (res instanceof IFile) {
if (((IFile) res).getLocation().equals(tempFile.getLocation())) {
try {
@@ -271,10 +374,8 @@
}
if ((flags & IResourceDelta.REPLACED) != 0) {
- System.out.println("--> Content Replaced");
}
if ((flags & IResourceDelta.MARKERS) != 0) {
- System.out.println("--> Marker Change");
// IMarkerDelta[] markers = delta.getMarkerDeltas();
// if interested in markers, check these deltas
}
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/freemarker/TemplateUICreator.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/freemarker/TemplateUICreator.java 2009-04-28 06:36:25 UTC (rev 14942)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/freemarker/TemplateUICreator.java 2009-04-28 09:08:02 UTC (rev 14943)
@@ -15,6 +15,7 @@
import org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain;
import org.eclipse.emf.edit.provider.IItemPropertyDescriptor;
import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Text;
import org.eclipse.ui.forms.widgets.FormToolkit;
import org.jboss.tools.smooks.configuration.actions.OpenEditorEditInnerContentsAction;
import org.jboss.tools.smooks.configuration.editors.PropertyUICreator;
@@ -26,7 +27,6 @@
* @author Dart Peng (dpeng(a)redhat.com) Date Apr 10, 2009
*/
public class TemplateUICreator extends PropertyUICreator {
-
/*
* (non-Javadoc)
*
@@ -49,13 +49,16 @@
@Override
public void createExtendUI(AdapterFactoryEditingDomain editingdomain, FormToolkit toolkit, Composite parent, Object model,
SmooksMultiFormEditor formEditor) {
- OpenEditorEditInnerContentsAction action1 = new OpenEditorEditInnerContentsAction(editingdomain,(AnyType) model, SmooksUIUtils.VALUE_TYPE_CDATA, "flt");
- OpenEditorEditInnerContentsAction action2 = new OpenEditorEditInnerContentsAction(editingdomain,(AnyType) model, SmooksUIUtils.VALUE_TYPE_COMMENT, "flt");
+ OpenEditorEditInnerContentsAction openCDATAEditorAction = new OpenEditorEditInnerContentsAction(editingdomain,(AnyType) model, SmooksUIUtils.VALUE_TYPE_CDATA, "flt");
+ OpenEditorEditInnerContentsAction openCommentEditorAction = new OpenEditorEditInnerContentsAction(editingdomain,(AnyType) model, SmooksUIUtils.VALUE_TYPE_COMMENT, "flt");
SmooksUIUtils.createFileSelectionTextFieldEditor("Text Value", parent, editingdomain, toolkit, null, model, SmooksUIUtils.VALUE_TYPE_TEXT,
null, null);
- SmooksUIUtils.createCDATAFieldEditor("Template Contents(CDATA)", editingdomain, toolkit, parent, model, action1);
- SmooksUIUtils.createCommentFieldEditor("Template Contents(Comment)", editingdomain, toolkit, parent, model, action2);
+ Text cdatatext = SmooksUIUtils.createCDATAFieldEditor("Template Contents(CDATA)", editingdomain, toolkit, parent, model, openCDATAEditorAction);
+ Text commenttext = SmooksUIUtils.createCommentFieldEditor("Template Contents(Comment)", editingdomain, toolkit, parent, model, openCommentEditorAction);
+
+ openCDATAEditorAction.setRelateText(cdatatext);
+ openCommentEditorAction.setRelateText(commenttext);
}
@Override
@@ -66,4 +69,9 @@
return super.ignoreProperty(feature);
}
+ public Text getText() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
}
\ No newline at end of file
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/groovy/ScriptUICreator.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/groovy/ScriptUICreator.java 2009-04-28 06:36:25 UTC (rev 14942)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/groovy/ScriptUICreator.java 2009-04-28 09:08:02 UTC (rev 14943)
@@ -15,6 +15,7 @@
import org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain;
import org.eclipse.emf.edit.provider.IItemPropertyDescriptor;
import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Text;
import org.eclipse.ui.forms.widgets.FormToolkit;
import org.jboss.tools.smooks.configuration.actions.OpenEditorEditInnerContentsAction;
import org.jboss.tools.smooks.configuration.editors.PropertyUICreator;
@@ -43,7 +44,8 @@
public void createExtendUI(AdapterFactoryEditingDomain editingdomain, FormToolkit toolkit, Composite parent, Object model,
SmooksMultiFormEditor formEditor) {
OpenEditorEditInnerContentsAction action2 = new OpenEditorEditInnerContentsAction(editingdomain,(AnyType) model, SmooksUIUtils.VALUE_TYPE_COMMENT, "groovy");
- SmooksUIUtils.createCommentFieldEditor("Script Contents", editingdomain, toolkit, parent, model, action2);
+ Text text = SmooksUIUtils.createCommentFieldEditor("Script Contents", editingdomain, toolkit, parent, model, action2);
+ action2.setRelateText(text);
}
@Override
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/uitls/SmooksUIUtils.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/uitls/SmooksUIUtils.java 2009-04-28 06:36:25 UTC (rev 14942)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/uitls/SmooksUIUtils.java 2009-04-28 09:08:02 UTC (rev 14943)
@@ -516,14 +516,14 @@
return null;
}
- public static void createCDATAFieldEditor(String label, AdapterFactoryEditingDomain editingdomain, FormToolkit toolkit, Composite parent,
+ public static Text createCDATAFieldEditor(String label, AdapterFactoryEditingDomain editingdomain, FormToolkit toolkit, Composite parent,
Object model,OpenEditorEditInnerContentsAction action) {
- createStringFieldEditor(label, parent, editingdomain, toolkit, null, model, true, true, false, 300, null, VALUE_TYPE_CDATA,action);
+ return createStringFieldEditor(label, parent, editingdomain, toolkit, null, model, true, true, false, 300, null, VALUE_TYPE_CDATA,action);
}
- public static void createCommentFieldEditor(String label, AdapterFactoryEditingDomain editingdomain, FormToolkit toolkit, Composite parent,
+ public static Text createCommentFieldEditor(String label, AdapterFactoryEditingDomain editingdomain, FormToolkit toolkit, Composite parent,
Object model,OpenEditorEditInnerContentsAction action) {
- createStringFieldEditor(label, parent, editingdomain, toolkit, null, model, true, true, false, 300, null, VALUE_TYPE_COMMENT,action);
+ return createStringFieldEditor(label, parent, editingdomain, toolkit, null, model, true, true, false, 300, null, VALUE_TYPE_COMMENT,action);
}
public static Composite createJavaTypeSearchFieldEditor(Composite parent, FormToolkit toolkit, final IItemPropertyDescriptor propertyDescriptor,
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/xsl/TemplateUICreator.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/xsl/TemplateUICreator.java 2009-04-28 06:36:25 UTC (rev 14942)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/xsl/TemplateUICreator.java 2009-04-28 09:08:02 UTC (rev 14943)
@@ -15,6 +15,7 @@
import org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain;
import org.eclipse.emf.edit.provider.IItemPropertyDescriptor;
import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Text;
import org.eclipse.ui.forms.widgets.FormToolkit;
import org.jboss.tools.smooks.configuration.actions.OpenEditorEditInnerContentsAction;
import org.jboss.tools.smooks.configuration.editors.PropertyUICreator;
@@ -64,12 +65,14 @@
@Override
public void createExtendUI(AdapterFactoryEditingDomain editingdomain, FormToolkit toolkit, Composite parent, Object model,
SmooksMultiFormEditor formEditor) {
- OpenEditorEditInnerContentsAction action1 = new OpenEditorEditInnerContentsAction(editingdomain,(AnyType) model, SmooksUIUtils.VALUE_TYPE_CDATA, "xsl");
- OpenEditorEditInnerContentsAction action2 = new OpenEditorEditInnerContentsAction(editingdomain,(AnyType) model, SmooksUIUtils.VALUE_TYPE_COMMENT, "xsl");
+ OpenEditorEditInnerContentsAction openCdataEditorAction = new OpenEditorEditInnerContentsAction(editingdomain,(AnyType) model, SmooksUIUtils.VALUE_TYPE_CDATA, "xsl");
+ OpenEditorEditInnerContentsAction openCommentEditorAction = new OpenEditorEditInnerContentsAction(editingdomain,(AnyType) model, SmooksUIUtils.VALUE_TYPE_COMMENT, "xsl");
SmooksUIUtils.createFileSelectionTextFieldEditor("Text Value", parent, editingdomain, toolkit, null, model, SmooksUIUtils.VALUE_TYPE_TEXT,
null, null);
- SmooksUIUtils.createCDATAFieldEditor("Template Contents (CDATA)", editingdomain, toolkit, parent, model, action1);
- SmooksUIUtils.createCommentFieldEditor("Template Contents (Comment)", editingdomain, toolkit, parent, model, action2);
+ Text text1 = SmooksUIUtils.createCDATAFieldEditor("Template Contents (CDATA)", editingdomain, toolkit, parent, model, openCdataEditorAction);
+ Text text2 = SmooksUIUtils.createCommentFieldEditor("Template Contents (Comment)", editingdomain, toolkit, parent, model, openCommentEditorAction);
+ openCdataEditorAction.setRelateText(text1);
+ openCommentEditorAction.setRelateText(text2);
}
}
\ No newline at end of file
15 years, 8 months
JBoss Tools SVN: r14942 - in trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors: xml and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: DartPeng
Date: 2009-04-28 02:36:25 -0400 (Tue, 28 Apr 2009)
New Revision: 14942
Added:
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/xml/XSDObjectAnalyzer.java
Modified:
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/SmooksActionBarContributor.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/SmooksMultiFormEditor.java
Log:
JBIDE-4240
Add 3 actions :
1.Add smooks 1.0 resource config list action
2.Add smooks 1.0 resource config list action
3.Add EDI Map 1.0 EdiMap action
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/SmooksActionBarContributor.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/SmooksActionBarContributor.java 2009-04-27 17:33:41 UTC (rev 14941)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/SmooksActionBarContributor.java 2009-04-28 06:36:25 UTC (rev 14942)
@@ -9,7 +9,10 @@
import java.util.ArrayList;
import java.util.Collection;
+import org.eclipse.emf.common.command.Command;
import org.eclipse.emf.common.ui.viewer.IViewerProvider;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.edit.command.AddCommand;
import org.eclipse.emf.edit.command.CommandParameter;
import org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain;
import org.eclipse.emf.edit.domain.EditingDomain;
@@ -51,6 +54,13 @@
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.actions.ActionFactory;
import org.jboss.tools.smooks.configuration.SmooksConfigurationActivator;
+import org.jboss.tools.smooks.model.medi.EdiMap;
+import org.jboss.tools.smooks.model.medi.MEdiFactory;
+import org.jboss.tools.smooks.model.medi.MEdiPackage;
+import org.jboss.tools.smooks.model.smooks.DocumentRoot;
+import org.jboss.tools.smooks.model.smooks.SmooksFactory;
+import org.jboss.tools.smooks.model.smooks.SmooksPackage;
+import org.jboss.tools.smooks.model.smooks.SmooksResourceListType;
/**
* This is the action bar contributor for the Smooks model editor. <!--
@@ -58,8 +68,9 @@
*
* @generated
*/
-public class SmooksActionBarContributor extends EditingDomainActionBarContributor implements
- ISelectionChangedListener {
+public class SmooksActionBarContributor extends EditingDomainActionBarContributor implements ISelectionChangedListener {
+
+ protected ISelection selection;
/**
* This keeps track of the active editor. <!-- begin-user-doc --> <!--
* end-user-doc -->
@@ -93,6 +104,33 @@
}
};
+ protected IAction addSmooks11ResourceListAction = new Action("Add Smooks Resource List") {
+
+ @Override
+ public void run() {
+ addSmooks11ResourceList();
+ }
+
+ };
+
+ protected IAction addSmooks10ResourceListAction = new Action("Add Smooks Resource List") {
+
+ @Override
+ public void run() {
+ addSmooks10ResourceList();
+ }
+
+ };
+
+ protected IAction addMap10ResourceListAction = new Action("Add MappNode") {
+
+ @Override
+ public void run() {
+ addMapNode();
+ }
+
+ };
+
/**
* This action refreshes the viewer of the current editor if the editor
* implements {@link org.eclipse.emf.common.ui.viewer.IViewerProvider}. <!--
@@ -163,11 +201,51 @@
*/
public SmooksActionBarContributor() {
super(ADDITIONS_LAST_STYLE);
-// loadResourceAction = new LoadResourceAction();
+ // loadResourceAction = new LoadResourceAction();
validateAction = new ValidateAction();
controlAction = new ControlAction();
}
+ protected void addMapNode() {
+ SmooksMultiFormEditor formEditor = (SmooksMultiFormEditor) this.getActiveEditor();
+ EObject model = formEditor.getSmooksModel();
+ if (model instanceof org.jboss.tools.smooks.model.medi.DocumentRoot) {
+ EdiMap mappingNode = MEdiFactory.eINSTANCE.createEdiMap();
+ Command command = AddCommand.create(formEditor.getEditingDomain(), model, MEdiPackage.eINSTANCE
+ .getMappingNode(), mappingNode);
+ formEditor.getEditingDomain().getCommandStack().execute(command);
+ }
+ }
+
+ protected void addSmooks10ResourceList() {
+ SmooksMultiFormEditor formEditor = (SmooksMultiFormEditor) this.getActiveEditor();
+ EObject model = formEditor.getSmooksModel();
+ if (model instanceof org.jboss.tools.smooks10.model.smooks.DocumentRoot) {
+ org.jboss.tools.smooks10.model.smooks.SmooksResourceListType resourceList = org.jboss.tools.smooks10.model.smooks.SmooksFactory.eINSTANCE
+ .createSmooksResourceListType();
+ Command command = AddCommand.create(formEditor.getEditingDomain(), model,
+ org.jboss.tools.smooks10.model.smooks.SmooksPackage.eINSTANCE.getSmooksResourceListType(),
+ resourceList);
+ formEditor.getEditingDomain().getCommandStack().execute(command);
+ }
+ }
+
+ protected void addSmooks11ResourceList() {
+ SmooksMultiFormEditor formEditor = (SmooksMultiFormEditor) this.getActiveEditor();
+ EObject model = formEditor.getSmooksModel();
+ if (model instanceof DocumentRoot) {
+ SmooksResourceListType resourceList = SmooksFactory.eINSTANCE.createSmooksResourceListType();
+ Command command = AddCommand.create(formEditor.getEditingDomain(), model, SmooksPackage.eINSTANCE
+ .getSmooksResourceListType(), resourceList);
+ formEditor.getEditingDomain().getCommandStack().execute(command);
+ }
+ }
+
+ @Override
+ public void update() {
+ super.update();
+ }
+
/**
* This adds Separators for editor additions to the tool bar. <!--
* begin-user-doc --> <!-- end-user-doc -->
@@ -208,6 +286,8 @@
createSiblingMenuManager = new MenuManager("New Sibling");
submenuManager.insertBefore("additions", createSiblingMenuManager);
+ submenuManager.insertBefore("additions", addSmooks11ResourceListAction);
+
// Force an update because Eclipse hides empty menus now.
//
submenuManager.addMenuListener(new IMenuListener() {
@@ -245,54 +325,51 @@
// Fake a selection changed event to update the menus.
//
if (selectionProvider.getSelection() != null) {
- selectionChanged(new SelectionChangedEvent(selectionProvider, selectionProvider
- .getSelection()));
+ selectionChanged(new SelectionChangedEvent(selectionProvider, selectionProvider.getSelection()));
}
}
}
-
-
@Override
public void init(IActionBars actionBars) {
super.init(actionBars);
ISharedImages sharedImages = PlatformUI.getWorkbench().getSharedImages();
- cutAction = new CutAction(){
+ cutAction = new CutAction() {
public void runWithEvent(Event event) {
Widget widget = event.widget;
- if(widget instanceof Text){
- ((Text)widget).cut();
+ if (widget instanceof Text) {
+ ((Text) widget).cut();
return;
}
super.runWithEvent(event);
}
-
- };
- cutAction.setImageDescriptor(sharedImages.getImageDescriptor(ISharedImages.IMG_TOOL_CUT));
- actionBars.setGlobalActionHandler(ActionFactory.CUT.getId(), cutAction);
- copyAction = new CopyAction(){
+ };
+ cutAction.setImageDescriptor(sharedImages.getImageDescriptor(ISharedImages.IMG_TOOL_CUT));
+ actionBars.setGlobalActionHandler(ActionFactory.CUT.getId(), cutAction);
+ copyAction = new CopyAction() {
+
public void runWithEvent(Event event) {
Widget widget = event.widget;
- if(widget instanceof Text){
- ((Text)widget).copy();
+ if (widget instanceof Text) {
+ ((Text) widget).copy();
return;
}
super.runWithEvent(event);
}
-
- };
- copyAction.setImageDescriptor(sharedImages.getImageDescriptor(ISharedImages.IMG_TOOL_COPY));
- actionBars.setGlobalActionHandler(ActionFactory.COPY.getId(), copyAction);
- pasteAction = new PasteAction(){
+ };
+ copyAction.setImageDescriptor(sharedImages.getImageDescriptor(ISharedImages.IMG_TOOL_COPY));
+ actionBars.setGlobalActionHandler(ActionFactory.COPY.getId(), copyAction);
+ pasteAction = new PasteAction() {
+
public void runWithEvent(Event event) {
Widget widget = event.widget;
- if(widget instanceof Text){
- ((Text)widget).paste();
+ if (widget instanceof Text) {
+ ((Text) widget).paste();
return;
}
super.runWithEvent(event);
@@ -303,19 +380,19 @@
super.updateSelection(selection);
return true;
}
-
-
- };
- pasteAction.setImageDescriptor(sharedImages.getImageDescriptor(ISharedImages.IMG_TOOL_PASTE));
- actionBars.setGlobalActionHandler(ActionFactory.PASTE.getId(), pasteAction);
- undoAction = new UndoAction();
- undoAction.setImageDescriptor(sharedImages.getImageDescriptor(ISharedImages.IMG_TOOL_UNDO));
- actionBars.setGlobalActionHandler(ActionFactory.UNDO.getId(), undoAction);
+ };
+ pasteAction.setImageDescriptor(sharedImages.getImageDescriptor(ISharedImages.IMG_TOOL_PASTE));
+ actionBars.setGlobalActionHandler(ActionFactory.PASTE.getId(), pasteAction);
- redoAction = new RedoAction();
- redoAction.setImageDescriptor(sharedImages.getImageDescriptor(ISharedImages.IMG_TOOL_REDO));
- actionBars.setGlobalActionHandler(ActionFactory.REDO.getId(), redoAction);
+ undoAction = new UndoAction();
+ undoAction.setImageDescriptor(sharedImages.getImageDescriptor(ISharedImages.IMG_TOOL_UNDO));
+ actionBars.setGlobalActionHandler(ActionFactory.UNDO.getId(), undoAction);
+
+ redoAction = new RedoAction();
+ redoAction.setImageDescriptor(sharedImages.getImageDescriptor(ISharedImages.IMG_TOOL_REDO));
+ actionBars.setGlobalActionHandler(ActionFactory.REDO.getId(), redoAction);
+
}
/**
@@ -341,17 +418,18 @@
// Query the new selection for appropriate new child/sibling descriptors
//
Collection<?> newChildDescriptors = null;
-// Collection<?> newSiblingDescriptors = null;
+ // Collection<?> newSiblingDescriptors = null;
ISelection selection = event.getSelection();
- if (selection instanceof IStructuredSelection
- && ((IStructuredSelection) selection).size() == 1) {
+ this.selection = selection;
+ if (selection instanceof IStructuredSelection && ((IStructuredSelection) selection).size() == 1) {
Object object = ((IStructuredSelection) selection).getFirstElement();
object = AdapterFactoryEditingDomain.unwrap(object);
EditingDomain domain = ((IEditingDomainProvider) activeEditorPart).getEditingDomain();
newChildDescriptors = domain.getNewChildDescriptors(object, null);
-// newSiblingDescriptors = domain.getNewChildDescriptors(null, object);
+ // newSiblingDescriptors = domain.getNewChildDescriptors(null,
+ // object);
}
// Generate actions for selection; populate and redraw the menus.
@@ -377,17 +455,19 @@
*
* @generated
*/
- protected Collection<IAction> generateCreateChildActions(Collection<?> descriptors,
- ISelection selection) {
+ protected Collection<IAction> generateCreateChildActions(Collection<?> descriptors, ISelection selection) {
Collection<IAction> actions = new ArrayList<IAction>();
-// if (selection != null && selection.isEmpty() && descriptors != null) {
-// CommandParameter cp = createChildParameter(SmooksPackage.Literals.SMOOKS_RESOURCE_LIST_TYPE,
-// SmooksFactory.eINSTANCE.createSmooksResourceListType());
-// CommandParameter cp2 = createChildParameter(EdiPackage.Literals.EDI_MAP,
-// EdiFactory.eINSTANCE.createEdiMap());
-// descriptors.add(cp);
-// descriptors.add(cp2);
-// }
+ // if (selection != null && selection.isEmpty() && descriptors != null)
+ // {
+ // CommandParameter cp =
+ // createChildParameter(SmooksPackage.Literals.SMOOKS_RESOURCE_LIST_TYPE,
+ // SmooksFactory.eINSTANCE.createSmooksResourceListType());
+ // CommandParameter cp2 =
+ // createChildParameter(EdiPackage.Literals.EDI_MAP,
+ // EdiFactory.eINSTANCE.createEdiMap());
+ // descriptors.add(cp);
+ // descriptors.add(cp2);
+ // }
if (descriptors != null) {
for (Object descriptor : descriptors) {
actions.add(new CreateChildAction(activeEditorPart, selection, descriptor));
@@ -408,8 +488,7 @@
*
* @generated
*/
- protected Collection<IAction> generateCreateSiblingActions(Collection<?> descriptors,
- ISelection selection) {
+ protected Collection<IAction> generateCreateSiblingActions(Collection<?> descriptors, ISelection selection) {
Collection<IAction> actions = new ArrayList<IAction>();
if (descriptors != null) {
for (Object descriptor : descriptors) {
@@ -430,8 +509,8 @@
*
* @generated
*/
- protected void populateManager(IContributionManager manager,
- Collection<? extends IAction> actions, String contributionID) {
+ protected void populateManager(IContributionManager manager, Collection<? extends IAction> actions,
+ String contributionID) {
if (actions != null) {
for (IAction action : actions) {
if (contributionID != null) {
@@ -452,8 +531,7 @@
*
* @generated
*/
- protected void depopulateManager(IContributionManager manager,
- Collection<? extends IAction> actions) {
+ protected void depopulateManager(IContributionManager manager, Collection<? extends IAction> actions) {
if (actions != null) {
IContributionItem[] items = manager.getItems();
for (int i = 0; i < items.length; i++) {
@@ -487,6 +565,20 @@
super.menuAboutToShow(menuManager);
MenuManager submenuManager = null;
+ updateRootElementAddAction();
+
+ if (addSmooks11ResourceListAction.isEnabled()) {
+ menuManager.insertBefore("edit", addSmooks11ResourceListAction);
+ }
+
+ if (addSmooks10ResourceListAction.isEnabled()) {
+ menuManager.insertBefore("edit", addSmooks10ResourceListAction);
+ }
+
+ if (addMap10ResourceListAction.isEnabled()) {
+ menuManager.insertBefore("edit", addMap10ResourceListAction);
+ }
+
submenuManager = new MenuManager("Create Child");
populateManager(submenuManager, createChildActions, null);
menuManager.insertBefore("edit", submenuManager);
@@ -494,8 +586,39 @@
submenuManager = new MenuManager("Create Sibling");
populateManager(submenuManager, createSiblingActions, null);
menuManager.insertBefore("edit", submenuManager);
+
}
+ protected void updateRootElementAddAction() {
+ addSmooks11ResourceListAction.setEnabled(false);
+ addMap10ResourceListAction.setEnabled(false);
+ addSmooks10ResourceListAction.setEnabled(false);
+
+ SmooksMultiFormEditor formEditor = (SmooksMultiFormEditor) this.getActiveEditor();
+ EObject model = formEditor.getSmooksModel();
+ if (model instanceof DocumentRoot) {
+ SmooksResourceListType resourceList = SmooksFactory.eINSTANCE.createSmooksResourceListType();
+ Command command = AddCommand.create(formEditor.getEditingDomain(), model, SmooksPackage.eINSTANCE
+ .getSmooksResourceListType(), resourceList);
+ addSmooks11ResourceListAction.setEnabled(command.canExecute());
+ }
+
+ if (model instanceof org.jboss.tools.smooks.model.medi.DocumentRoot) {
+ EdiMap mappingNode = MEdiFactory.eINSTANCE.createEdiMap();
+ Command command = AddCommand.create(formEditor.getEditingDomain(), model,
+ MEdiPackage.eINSTANCE.getEdiMap(), mappingNode);
+ addMap10ResourceListAction.setEnabled(command.canExecute());
+ }
+ if (model instanceof org.jboss.tools.smooks10.model.smooks.DocumentRoot) {
+ org.jboss.tools.smooks10.model.smooks.SmooksResourceListType resourceList = org.jboss.tools.smooks10.model.smooks.SmooksFactory.eINSTANCE
+ .createSmooksResourceListType();
+ Command command = AddCommand.create(formEditor.getEditingDomain(), model,
+ org.jboss.tools.smooks10.model.smooks.SmooksPackage.eINSTANCE.getSmooksResourceListType(),
+ resourceList);
+ addSmooks10ResourceListAction.setEnabled(command.canExecute());
+ }
+ }
+
/**
* This inserts global actions before the "additions-end" separator. <!--
* begin-user-doc --> <!-- end-user-doc -->
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/SmooksMultiFormEditor.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/SmooksMultiFormEditor.java 2009-04-27 17:33:41 UTC (rev 14941)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/SmooksMultiFormEditor.java 2009-04-28 06:36:25 UTC (rev 14942)
@@ -171,7 +171,10 @@
}
public void setSmooksModel(EObject smooksModel) {
- this.smooksModel = smooksModel;
+ if (this.smooksModel != smooksModel) {
+ this.smooksModel = smooksModel;
+ handleEMFModelChange();
+ }
}
private void initEditingDomain() {
Added: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/xml/XSDObjectAnalyzer.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/xml/XSDObjectAnalyzer.java (rev 0)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/xml/XSDObjectAnalyzer.java 2009-04-28 06:36:25 UTC (rev 14942)
@@ -0,0 +1,19 @@
+/*******************************************************************************
+ * 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.configuration.editors.xml;
+
+/**
+ * @author Dart (dpeng(a)redhat.com)
+ *
+ */
+public class XSDObjectAnalyzer {
+
+}
Property changes on: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/xml/XSDObjectAnalyzer.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
15 years, 8 months
JBoss Tools SVN: r14941 - in trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4: icons/16 and 6 other directories.
by jbosstools-commits@lists.jboss.org
Author: koen.aers(a)jboss.com
Date: 2009-04-27 13:33:41 -0400 (Mon, 27 Apr 2009)
New Revision: 14941
Added:
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/icons/16/delete.gif
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/icons/16/swimlane.gif
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/icons/16/timer.gif
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/editpart/ElementTreeEditPart.java
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/editpart/ListTreeEditPart.java
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/editpart/SwimlaneTreeEditPart.java
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/editpart/TimerTreeEditPart.java
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/handler/DeleteElementHandler.java
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/model/Timer.java
Removed:
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/editpart/ListTreeEditPart.java
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/editpart/ProcessNodeListTreeEditPart.java
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/command/AddProcessNodeCommand.java
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/editpart/EventListenerContainerListTreeEditPart.java
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/editpart/JpdlTreeEditPart.java
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/editpart/JpdlTreeEditPartFactory.java
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/editpart/ProcessTreeRootEditPart.java
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/editpart/SwimlaneListTreeEditPart.java
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/editpart/TimerListTreeEditPart.java
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/handler/AddEventListenerHandler.java
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/handler/AddSwimlaneHandler.java
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/handler/AddTimerHandler.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/Swimlane.java
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/view/DetailsPage.java
Log:
enable adding and deleting of Swimlanes and Timers on Processes
Added: trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/icons/16/delete.gif
===================================================================
(Binary files differ)
Property changes on: trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/icons/16/delete.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/icons/16/swimlane.gif
===================================================================
(Binary files differ)
Property changes on: trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/icons/16/swimlane.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/icons/16/timer.gif
===================================================================
(Binary files differ)
Property changes on: trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/icons/16/timer.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Modified: trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/plugin.xml
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/plugin.xml 2009-04-27 17:32:53 UTC (rev 14940)
+++ trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/plugin.xml 2009-04-27 17:33:41 UTC (rev 14941)
@@ -316,12 +316,6 @@
<command
categoryId="org.jboss.tools.flow.jpdl4"
defaultHandler="org.jboss.tools.flow.jpdl4.handler.AddEventListenerHandler"
- id="org.jboss.tools.flow.jpdl4.addEventListenerType"
- name="Add Event Listener Type">
- </command>
- <command
- categoryId="org.jboss.tools.flow.jpdl4"
- defaultHandler="org.jboss.tools.flow.jpdl4.handler.AddEventListenerHandler"
id="org.jboss.tools.flow.jpdl4.addEventListener"
name="Add Event Listener">
</command>
@@ -331,6 +325,12 @@
id="org.jboss.tools.flow.jpdl4.addTimer"
name="Add Timer">
</command>
+ <command
+ categoryId="org.jboss.tools.flow.jpdl4"
+ defaultHandler="org.jboss.tools.flow.jpdl4.handler.DeleteElementHandler"
+ id="org.jboss.tools.flow.jpdl4.delete"
+ name="Delete">
+ </command>
</extension>
<extension
point="org.eclipse.ui.menus">
@@ -378,6 +378,24 @@
</iterate>
</visibleWhen>
</command>
+ <separator
+ name="org.jboss.tools.flow.jpdl4.details.separator1"
+ visible="true">
+ </separator>
+ <command
+ commandId="org.jboss.tools.flow.jpdl4.delete"
+ icon="icons/16/delete.gif"
+ id="org.jboss.tools.flow.jpdl4.details.delete"
+ style="push">
+ <visibleWhen
+ checkEnabled="true">
+ <iterate>
+ <instanceof
+ value="org.jboss.tools.flow.jpdl4.editpart.ElementTreeEditPart">
+ </instanceof>
+ </iterate>
+ </visibleWhen>
+ </command>
</menuContribution>
</extension>
Modified: trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/command/AddProcessNodeCommand.java
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/command/AddProcessNodeCommand.java 2009-04-27 17:32:53 UTC (rev 14940)
+++ trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/command/AddProcessNodeCommand.java 2009-04-27 17:33:41 UTC (rev 14941)
@@ -1,11 +1,11 @@
package org.jboss.tools.flow.jpdl4.command;
-import org.jboss.tools.flow.common.command.AddElementCommand;
+import org.jboss.tools.flow.common.command.AddNodeCommand;
import org.jboss.tools.flow.common.model.Flow;
import org.jboss.tools.flow.common.model.Node;
import org.jboss.tools.flow.jpdl4.util.Jpdl4Helper;
-public class AddProcessNodeCommand extends AddElementCommand {
+public class AddProcessNodeCommand extends AddNodeCommand {
public void execute() {
if (getChild().getName() == null) {
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 2009-04-27 17:32:53 UTC (rev 14940)
+++ trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/editor/JpdlEditor.java 2009-04-27 17:33:41 UTC (rev 14941)
@@ -7,14 +7,12 @@
import org.eclipse.gef.DefaultEditDomain;
import org.eclipse.gef.commands.CommandStack;
import org.eclipse.gef.palette.PaletteRoot;
-import org.eclipse.gef.ui.parts.TreeViewer;
import org.eclipse.ui.views.properties.IPropertySheetPage;
import org.eclipse.ui.views.properties.tabbed.ITabbedPropertySheetPageContributor;
import org.jboss.tools.flow.common.editor.GenericModelEditor;
import org.jboss.tools.flow.common.registry.ElementRegistry;
import org.jboss.tools.flow.common.wrapper.Wrapper;
import org.jboss.tools.flow.jpdl4.editpart.JpdlGraphicalEditPartFactory;
-import org.jboss.tools.flow.jpdl4.editpart.JpdlTreeEditPartFactory;
import org.jboss.tools.flow.jpdl4.properties.JpdlPropertySheetPage;
import org.jboss.tools.flow.jpdl4.view.DetailsPage;
import org.jboss.tools.flow.jpdl4.view.IDetailsPage;
@@ -83,11 +81,7 @@
}
protected void initDetailsPage() {
- TreeViewer treeViewer = new TreeViewer();
- treeViewer.setEditPartFactory(new JpdlTreeEditPartFactory());
- getEditDomain().addViewer(treeViewer);
-// getSelectionSynchronizer().addViewer(treeViewer);
- detailsPage = new DetailsPage(treeViewer);
+ detailsPage = new DetailsPage(this);
getSite().getSelectionProvider().addSelectionChangedListener(detailsPage);
}
Added: trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/editpart/ElementTreeEditPart.java
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/editpart/ElementTreeEditPart.java (rev 0)
+++ trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/editpart/ElementTreeEditPart.java 2009-04-27 17:33:41 UTC (rev 14941)
@@ -0,0 +1,5 @@
+package org.jboss.tools.flow.jpdl4.editpart;
+
+public interface ElementTreeEditPart {
+
+}
Property changes on: trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/editpart/ElementTreeEditPart.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/editpart/EventListenerContainerListTreeEditPart.java
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/editpart/EventListenerContainerListTreeEditPart.java 2009-04-27 17:32:53 UTC (rev 14940)
+++ trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/editpart/EventListenerContainerListTreeEditPart.java 2009-04-27 17:33:41 UTC (rev 14941)
@@ -6,7 +6,7 @@
import org.jboss.tools.flow.jpdl4.model.Process;
import org.jboss.tools.flow.jpdl4.util.SharedImages;
-public class EventListenerContainerListTreeEditPart extends JpdlTreeEditPart implements ListTreeEditPart {
+public class EventListenerContainerListTreeEditPart extends JpdlTreeEditPart {
public EventListenerContainerListTreeEditPart(Process process) {
super(process);
Modified: trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/editpart/JpdlTreeEditPart.java
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/editpart/JpdlTreeEditPart.java 2009-04-27 17:32:53 UTC (rev 14940)
+++ trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/editpart/JpdlTreeEditPart.java 2009-04-27 17:33:41 UTC (rev 14941)
@@ -1,27 +1,45 @@
package org.jboss.tools.flow.jpdl4.editpart;
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.gef.EditPart;
import org.eclipse.gef.editparts.AbstractTreeEditPart;
import org.eclipse.ui.views.properties.IPropertySource;
-import org.jboss.tools.flow.common.model.Element;
+import org.jboss.tools.flow.common.wrapper.ModelEvent;
+import org.jboss.tools.flow.common.wrapper.ModelListener;
-public class JpdlTreeEditPart extends AbstractTreeEditPart {
+public class JpdlTreeEditPart extends AbstractTreeEditPart implements ModelListener {
- protected IPropertySource propertySource;
-
- public JpdlTreeEditPart(Element element) {
- super(element);
- if (element == null) return;
- Object object = element.getMetaData("propertySource");
- if (object != null && object instanceof IPropertySource) {
- propertySource = (IPropertySource)object;
- }
+ private IPropertySource propertySource;
+
+ public JpdlTreeEditPart(Object model) {
+ super(model);
}
@SuppressWarnings("unchecked")
public Object getAdapter(Class adapter) {
if (adapter == IPropertySource.class)
- return propertySource;
+ return getPropertySource();
return super.getAdapter(adapter);
}
+ private IPropertySource getPropertySource() {
+ if (propertySource == null) {
+ initPropertySource();
+ }
+ return propertySource;
+ }
+
+ private void initPropertySource() {
+ EditPart editPart = this;
+ while (editPart != null && propertySource != null) {
+ if (editPart.getModel() != null && editPart.getModel() instanceof IAdaptable) {
+ propertySource = (IPropertySource)((IAdaptable)editPart.getModel()).getAdapter(IPropertySource.class);
+ }
+ editPart = editPart.getParent();
+ }
+ }
+
+ public void modelChanged(ModelEvent event) {
+ }
+
}
Modified: trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/editpart/JpdlTreeEditPartFactory.java
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/editpart/JpdlTreeEditPartFactory.java 2009-04-27 17:32:53 UTC (rev 14940)
+++ trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/editpart/JpdlTreeEditPartFactory.java 2009-04-27 17:33:41 UTC (rev 14941)
@@ -2,9 +2,13 @@
import org.eclipse.gef.EditPart;
import org.eclipse.gef.EditPartFactory;
+import org.jboss.tools.flow.common.model.Element;
import org.jboss.tools.flow.common.wrapper.ConnectionWrapper;
import org.jboss.tools.flow.common.wrapper.FlowWrapper;
import org.jboss.tools.flow.common.wrapper.NodeWrapper;
+import org.jboss.tools.flow.common.wrapper.Wrapper;
+import org.jboss.tools.flow.jpdl4.model.Swimlane;
+import org.jboss.tools.flow.jpdl4.model.Timer;
public class JpdlTreeEditPartFactory implements EditPartFactory {
@@ -12,7 +16,12 @@
if (model instanceof FlowWrapper && context == null) return new ProcessTreeRootEditPart((FlowWrapper)model);
if (model instanceof NodeWrapper && context == null) return new TaskTreeRootEditPart((NodeWrapper)model);
if (model instanceof ConnectionWrapper && context == null) return new SequenceFlowTreeRootEditPart((ConnectionWrapper)model);
- if (model instanceof ProcessNodeListTreeEditPart) return (EditPart)model;
+ if (model instanceof Wrapper) {
+ Element element = ((Wrapper)model).getElement();
+ if (element instanceof Swimlane) return new SwimlaneTreeEditPart((Wrapper)model);
+ if (element instanceof Timer) return new TimerTreeEditPart((Wrapper)model);
+ return new NoDetailsTreeRootEditPart();
+ }
if (model instanceof SwimlaneListTreeEditPart) return (EditPart)model;
if (model instanceof EventListenerContainerListTreeEditPart) return (EditPart)model;
if (model instanceof TimerListTreeEditPart) return (EditPart)model;
Deleted: trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/editpart/ListTreeEditPart.java
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/editpart/ListTreeEditPart.java 2009-04-27 17:32:53 UTC (rev 14940)
+++ trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/editpart/ListTreeEditPart.java 2009-04-27 17:33:41 UTC (rev 14941)
@@ -1,5 +0,0 @@
-package org.jboss.tools.flow.jpdl4.editpart;
-
-public interface ListTreeEditPart {
-
-}
Added: trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/editpart/ListTreeEditPart.java
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/editpart/ListTreeEditPart.java (rev 0)
+++ trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/editpart/ListTreeEditPart.java 2009-04-27 17:33:41 UTC (rev 14941)
@@ -0,0 +1,5 @@
+package org.jboss.tools.flow.jpdl4.editpart;
+
+public interface ListTreeEditPart {
+
+}
Deleted: trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/editpart/ProcessNodeListTreeEditPart.java
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/editpart/ProcessNodeListTreeEditPart.java 2009-04-27 17:32:53 UTC (rev 14940)
+++ trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/editpart/ProcessNodeListTreeEditPart.java 2009-04-27 17:33:41 UTC (rev 14941)
@@ -1,26 +0,0 @@
-package org.jboss.tools.flow.jpdl4.editpart;
-
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.swt.graphics.Image;
-import org.jboss.tools.flow.jpdl4.model.Process;
-import org.jboss.tools.flow.jpdl4.util.SharedImages;
-
-public class ProcessNodeListTreeEditPart extends JpdlTreeEditPart {
-
- public ProcessNodeListTreeEditPart(Process process) {
- super(process);
- }
-
- protected Image getImage() {
- String iconPath = "icons/16/node_elements_multiple.gif";
- ImageDescriptor descriptor = ImageDescriptor.createFromURL(
- Platform.getBundle("org.jboss.tools.flow.jpdl4").getEntry(iconPath));
- return SharedImages.INSTANCE.getImage(descriptor);
- }
-
- protected String getText() {
- return "Nodes";
- }
-
-}
Modified: trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/editpart/ProcessTreeRootEditPart.java
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/editpart/ProcessTreeRootEditPart.java 2009-04-27 17:32:53 UTC (rev 14940)
+++ trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/editpart/ProcessTreeRootEditPart.java 2009-04-27 17:33:41 UTC (rev 14941)
@@ -3,9 +3,11 @@
import java.util.ArrayList;
import java.util.List;
-import org.jboss.tools.flow.jpdl4.model.Process;
-
+import org.eclipse.gef.EditPart;
+import org.jboss.tools.flow.common.model.Element;
import org.jboss.tools.flow.common.wrapper.FlowWrapper;
+import org.jboss.tools.flow.common.wrapper.ModelEvent;
+import org.jboss.tools.flow.common.wrapper.Wrapper;
public class ProcessTreeRootEditPart extends JpdlTreeEditPart {
@@ -13,24 +15,51 @@
super(flowWrapper);
}
- private Process getProcess() {
- return (Process)((FlowWrapper)getModel()).getElement();
- }
-
protected void createEditPolicies() {
}
protected List<Object> getModelChildren() {
List<Object> result = new ArrayList<Object>();
- result.add(new EventListenerContainerListTreeEditPart(null));
-// Process process = getProcess();
-// if (process.get)
+ FlowWrapper flowWrapper = (FlowWrapper)getModel();
+ if (flowWrapper == null) return null;
+ addSwimlanes(result, flowWrapper);
+ addTimers(result, flowWrapper);
return result;
-// List<Object> result = new ArrayList<Object>();
-// if (modelChildren == null) {
-// modelChildren = initModelChildren();
-// }
-// return modelChildren;
}
+ private void addSwimlanes(List<Object> list, FlowWrapper wrapper) {
+ List<Element> swimlanes = wrapper.getChildren("swimlane");
+ if (swimlanes != null && !(swimlanes.isEmpty())) {
+ list.add(new SwimlaneListTreeEditPart(swimlanes));
+ }
+ }
+
+ private void addTimers(List<Object> list, FlowWrapper wrapper) {
+ List<Element> timers = wrapper.getChildren("timer");
+ if (timers != null && !(timers.isEmpty())) {
+ list.add(new TimerListTreeEditPart(timers));
+ }
+ }
+
+ public void modelChanged(ModelEvent event) {
+ if (event.getChangeType() == Wrapper.ADD_ELEMENT) {
+ refreshChildren();
+ Object object = event.getNewValue();
+ EditPart editPart = (EditPart)getViewer().getEditPartRegistry().get(object);
+ getViewer().select(editPart);
+ } else if (event.getChangeType() == Wrapper.REMOVE_ELEMENT) {
+ refreshChildren();
+ }
+ }
+
+ public void activate() {
+ super.activate();
+ ((FlowWrapper)getModel()).addListener(this);
+ }
+
+ public void deactivate() {
+ ((FlowWrapper)getModel()).removeListener(this);
+ super.deactivate();
+ }
+
}
Modified: trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/editpart/SwimlaneListTreeEditPart.java
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/editpart/SwimlaneListTreeEditPart.java 2009-04-27 17:32:53 UTC (rev 14940)
+++ trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/editpart/SwimlaneListTreeEditPart.java 2009-04-27 17:33:41 UTC (rev 14941)
@@ -1,15 +1,17 @@
package org.jboss.tools.flow.jpdl4.editpart;
+import java.util.List;
+
import org.eclipse.core.runtime.Platform;
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.swt.graphics.Image;
-import org.jboss.tools.flow.jpdl4.model.Process;
+import org.jboss.tools.flow.common.model.Element;
import org.jboss.tools.flow.jpdl4.util.SharedImages;
-public class SwimlaneListTreeEditPart extends JpdlTreeEditPart implements ListTreeEditPart {
+public class SwimlaneListTreeEditPart extends JpdlTreeEditPart {
- public SwimlaneListTreeEditPart(Process process) {
- super(process);
+ public SwimlaneListTreeEditPart(List<Element> swimlanes) {
+ super(swimlanes);
}
protected Image getImage() {
@@ -22,5 +24,11 @@
protected String getText() {
return "Swimlanes";
}
+
+ @SuppressWarnings("unchecked")
+ protected List<Object> getModelChildren() {
+ return (List<Object>)getModel();
+ }
+
}
Added: trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/editpart/SwimlaneTreeEditPart.java
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/editpart/SwimlaneTreeEditPart.java (rev 0)
+++ trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/editpart/SwimlaneTreeEditPart.java 2009-04-27 17:33:41 UTC (rev 14941)
@@ -0,0 +1,26 @@
+package org.jboss.tools.flow.jpdl4.editpart;
+
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.swt.graphics.Image;
+import org.jboss.tools.flow.common.wrapper.Wrapper;
+import org.jboss.tools.flow.jpdl4.util.SharedImages;
+
+public class SwimlaneTreeEditPart extends JpdlTreeEditPart implements ElementTreeEditPart {
+
+ public SwimlaneTreeEditPart(Wrapper wrapper) {
+ super(wrapper);
+ }
+
+ protected Image getImage() {
+ String iconPath = "icons/16/swimlane.gif";
+ ImageDescriptor descriptor = ImageDescriptor.createFromURL(
+ Platform.getBundle("org.jboss.tools.flow.jpdl4").getEntry(iconPath));
+ return SharedImages.INSTANCE.getImage(descriptor);
+ }
+
+ protected String getText() {
+ return "swimlane";
+ }
+
+}
Property changes on: trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/editpart/SwimlaneTreeEditPart.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/editpart/TimerListTreeEditPart.java
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/editpart/TimerListTreeEditPart.java 2009-04-27 17:32:53 UTC (rev 14940)
+++ trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/editpart/TimerListTreeEditPart.java 2009-04-27 17:33:41 UTC (rev 14941)
@@ -1,15 +1,17 @@
package org.jboss.tools.flow.jpdl4.editpart;
+import java.util.List;
+
import org.eclipse.core.runtime.Platform;
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.swt.graphics.Image;
-import org.jboss.tools.flow.jpdl4.model.Process;
+import org.jboss.tools.flow.common.model.Element;
import org.jboss.tools.flow.jpdl4.util.SharedImages;
-public class TimerListTreeEditPart extends JpdlTreeEditPart implements ListTreeEditPart {
+public class TimerListTreeEditPart extends JpdlTreeEditPart {
- public TimerListTreeEditPart(Process process) {
- super(process);
+ public TimerListTreeEditPart(List<Element> timers) {
+ super(timers);
}
protected Image getImage() {
@@ -23,4 +25,9 @@
return "Timers";
}
+ @SuppressWarnings("unchecked")
+ protected List<Object> getModelChildren() {
+ return (List<Object>)getModel();
+ }
+
}
Added: trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/editpart/TimerTreeEditPart.java
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/editpart/TimerTreeEditPart.java (rev 0)
+++ trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/editpart/TimerTreeEditPart.java 2009-04-27 17:33:41 UTC (rev 14941)
@@ -0,0 +1,26 @@
+package org.jboss.tools.flow.jpdl4.editpart;
+
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.swt.graphics.Image;
+import org.jboss.tools.flow.common.wrapper.Wrapper;
+import org.jboss.tools.flow.jpdl4.util.SharedImages;
+
+public class TimerTreeEditPart extends JpdlTreeEditPart implements ElementTreeEditPart {
+
+ public TimerTreeEditPart(Wrapper wrapper) {
+ super(wrapper);
+ }
+
+ protected Image getImage() {
+ String iconPath = "icons/16/timer.gif";
+ ImageDescriptor descriptor = ImageDescriptor.createFromURL(
+ Platform.getBundle("org.jboss.tools.flow.jpdl4").getEntry(iconPath));
+ return SharedImages.INSTANCE.getImage(descriptor);
+ }
+
+ protected String getText() {
+ return "timer";
+ }
+
+}
Property changes on: trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/editpart/TimerTreeEditPart.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/handler/AddEventListenerHandler.java
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/handler/AddEventListenerHandler.java 2009-04-27 17:32:53 UTC (rev 14940)
+++ trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/handler/AddEventListenerHandler.java 2009-04-27 17:33:41 UTC (rev 14941)
@@ -4,17 +4,45 @@
import org.eclipse.core.commands.ExecutionEvent;
import org.eclipse.core.commands.ExecutionException;
import org.eclipse.core.commands.IHandler;
-import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.ui.IWorkbenchWindow;
+import org.eclipse.gef.EditPart;
+import org.eclipse.gef.commands.CommandStack;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.ui.IEditorPart;
+import org.eclipse.ui.IWorkbenchPage;
import org.eclipse.ui.handlers.HandlerUtil;
+import org.jboss.tools.flow.common.command.AddChildCommand;
+import org.jboss.tools.flow.common.wrapper.DefaultWrapper;
+import org.jboss.tools.flow.common.wrapper.FlowWrapper;
+import org.jboss.tools.flow.common.wrapper.Wrapper;
+import org.jboss.tools.flow.jpdl4.model.Swimlane;
public class AddEventListenerHandler extends AbstractHandler implements IHandler {
public Object execute(ExecutionEvent event) throws ExecutionException {
- IWorkbenchWindow window = HandlerUtil.getActiveWorkbenchWindowChecked(event);
- MessageDialog.openInformation(
- window.getShell(), "MenuEclipseArticle Plug-in",
- "Hello, Eclipse world");
+ IWorkbenchPage page = HandlerUtil.getActiveWorkbenchWindowChecked(event).getActivePage();
+ if (page == null) return null;
+ ISelection selection = page.getSelection();
+ if (!(selection instanceof IStructuredSelection)) return null;
+ IStructuredSelection structuredSelection = (IStructuredSelection)selection;
+ Object first = structuredSelection.getFirstElement();
+ if (!(first instanceof EditPart)) return null;
+ EditPart editPart = (EditPart)first;
+ Object model = editPart.getModel();
+ if (model == null || !(model instanceof FlowWrapper)) return null;
+ FlowWrapper flowWrapper = (FlowWrapper)model;
+ IEditorPart editorPart = HandlerUtil.getActiveEditor(event);
+ if (editorPart == null) return null;
+ Object object = editorPart.getAdapter(CommandStack.class);
+ if (object == null || !(object instanceof CommandStack)) return null;
+ CommandStack commandStack = (CommandStack)object;
+ AddChildCommand addChildCommand = new AddChildCommand();
+ Wrapper child = new DefaultWrapper();
+ child.setElement(new Swimlane());
+ addChildCommand.setChild(child);
+ addChildCommand.setType("eventListener");
+ addChildCommand.setParent(flowWrapper);
+ commandStack.execute(addChildCommand);
return null;
}
Modified: trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/handler/AddSwimlaneHandler.java
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/handler/AddSwimlaneHandler.java 2009-04-27 17:32:53 UTC (rev 14940)
+++ trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/handler/AddSwimlaneHandler.java 2009-04-27 17:33:41 UTC (rev 14941)
@@ -4,17 +4,45 @@
import org.eclipse.core.commands.ExecutionEvent;
import org.eclipse.core.commands.ExecutionException;
import org.eclipse.core.commands.IHandler;
-import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.ui.IWorkbenchWindow;
+import org.eclipse.gef.EditPart;
+import org.eclipse.gef.commands.CommandStack;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.ui.IEditorPart;
+import org.eclipse.ui.IWorkbenchPage;
import org.eclipse.ui.handlers.HandlerUtil;
+import org.jboss.tools.flow.common.command.AddChildCommand;
+import org.jboss.tools.flow.common.wrapper.DefaultWrapper;
+import org.jboss.tools.flow.common.wrapper.FlowWrapper;
+import org.jboss.tools.flow.common.wrapper.Wrapper;
+import org.jboss.tools.flow.jpdl4.model.Swimlane;
public class AddSwimlaneHandler extends AbstractHandler implements IHandler {
public Object execute(ExecutionEvent event) throws ExecutionException {
- IWorkbenchWindow window = HandlerUtil.getActiveWorkbenchWindowChecked(event);
- MessageDialog.openInformation(
- window.getShell(), "MenuEclipseArticle Plug-in",
- "Hello, Eclipse world");
+ IWorkbenchPage page = HandlerUtil.getActiveWorkbenchWindowChecked(event).getActivePage();
+ if (page == null) return null;
+ ISelection selection = page.getSelection();
+ if (!(selection instanceof IStructuredSelection)) return null;
+ IStructuredSelection structuredSelection = (IStructuredSelection)selection;
+ Object first = structuredSelection.getFirstElement();
+ if (!(first instanceof EditPart)) return null;
+ EditPart editPart = (EditPart)first;
+ Object model = editPart.getModel();
+ if (model == null || !(model instanceof FlowWrapper)) return null;
+ FlowWrapper flowWrapper = (FlowWrapper)model;
+ IEditorPart editorPart = HandlerUtil.getActiveEditor(event);
+ if (editorPart == null) return null;
+ Object object = editorPart.getAdapter(CommandStack.class);
+ if (object == null || !(object instanceof CommandStack)) return null;
+ CommandStack commandStack = (CommandStack)object;
+ AddChildCommand addChildCommand = new AddChildCommand();
+ Wrapper child = new DefaultWrapper();
+ child.setElement(new Swimlane());
+ addChildCommand.setChild(child);
+ addChildCommand.setType("swimlane");
+ addChildCommand.setParent(flowWrapper);
+ commandStack.execute(addChildCommand);
return null;
}
Modified: trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/handler/AddTimerHandler.java
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/handler/AddTimerHandler.java 2009-04-27 17:32:53 UTC (rev 14940)
+++ trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/handler/AddTimerHandler.java 2009-04-27 17:33:41 UTC (rev 14941)
@@ -4,17 +4,45 @@
import org.eclipse.core.commands.ExecutionEvent;
import org.eclipse.core.commands.ExecutionException;
import org.eclipse.core.commands.IHandler;
-import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.ui.IWorkbenchWindow;
+import org.eclipse.gef.EditPart;
+import org.eclipse.gef.commands.CommandStack;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.ui.IEditorPart;
+import org.eclipse.ui.IWorkbenchPage;
import org.eclipse.ui.handlers.HandlerUtil;
+import org.jboss.tools.flow.common.command.AddChildCommand;
+import org.jboss.tools.flow.common.wrapper.DefaultWrapper;
+import org.jboss.tools.flow.common.wrapper.FlowWrapper;
+import org.jboss.tools.flow.common.wrapper.Wrapper;
+import org.jboss.tools.flow.jpdl4.model.Timer;
public class AddTimerHandler extends AbstractHandler implements IHandler {
public Object execute(ExecutionEvent event) throws ExecutionException {
- IWorkbenchWindow window = HandlerUtil.getActiveWorkbenchWindowChecked(event);
- MessageDialog.openInformation(
- window.getShell(), "MenuEclipseArticle Plug-in",
- "Hello, Eclipse world");
+ IWorkbenchPage page = HandlerUtil.getActiveWorkbenchWindowChecked(event).getActivePage();
+ if (page == null) return null;
+ ISelection selection = page.getSelection();
+ if (!(selection instanceof IStructuredSelection)) return null;
+ IStructuredSelection structuredSelection = (IStructuredSelection)selection;
+ Object first = structuredSelection.getFirstElement();
+ if (!(first instanceof EditPart)) return null;
+ EditPart editPart = (EditPart)first;
+ Object model = editPart.getModel();
+ if (model == null || !(model instanceof FlowWrapper)) return null;
+ FlowWrapper flowWrapper = (FlowWrapper)model;
+ IEditorPart editorPart = HandlerUtil.getActiveEditor(event);
+ if (editorPart == null) return null;
+ Object object = editorPart.getAdapter(CommandStack.class);
+ if (object == null || !(object instanceof CommandStack)) return null;
+ CommandStack commandStack = (CommandStack)object;
+ AddChildCommand addChildCommand = new AddChildCommand();
+ Wrapper child = new DefaultWrapper();
+ child.setElement(new Timer());
+ addChildCommand.setChild(child);
+ addChildCommand.setType("timer");
+ addChildCommand.setParent(flowWrapper);
+ commandStack.execute(addChildCommand);
return null;
}
Added: trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/handler/DeleteElementHandler.java
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/handler/DeleteElementHandler.java (rev 0)
+++ trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/handler/DeleteElementHandler.java 2009-04-27 17:33:41 UTC (rev 14941)
@@ -0,0 +1,65 @@
+package org.jboss.tools.flow.jpdl4.handler;
+
+import org.eclipse.core.commands.AbstractHandler;
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.commands.IHandler;
+import org.eclipse.gef.EditPart;
+import org.eclipse.gef.RootEditPart;
+import org.eclipse.gef.commands.CommandStack;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.ui.IEditorPart;
+import org.eclipse.ui.IWorkbenchPage;
+import org.eclipse.ui.handlers.HandlerUtil;
+import org.jboss.tools.flow.common.command.DeleteChildCommand;
+import org.jboss.tools.flow.common.wrapper.Wrapper;
+import org.jboss.tools.flow.jpdl4.Logger;
+import org.jboss.tools.flow.jpdl4.model.Swimlane;
+import org.jboss.tools.flow.jpdl4.model.Timer;
+
+public class DeleteElementHandler extends AbstractHandler implements IHandler {
+
+ public Object execute(ExecutionEvent event) throws ExecutionException {
+ IWorkbenchPage page = HandlerUtil.getActiveWorkbenchWindowChecked(event).getActivePage();
+ if (page == null) return null;
+ ISelection selection = page.getSelection();
+ if (!(selection instanceof IStructuredSelection)) return null;
+ IStructuredSelection structuredSelection = (IStructuredSelection)selection;
+ Object first = structuredSelection.getFirstElement();
+ if (!(first instanceof EditPart)) return null;
+ EditPart editPart = (EditPart)first;
+ Object model = editPart.getModel();
+ if (model == null || !(model instanceof Wrapper)) return null;
+ Wrapper child = (Wrapper)model;
+ EditPart root = null;
+ while (editPart != null && !(editPart instanceof RootEditPart)) {
+ root = editPart;
+ editPart = editPart.getParent();
+ }
+ if (root == null) return null;
+ model = root.getModel();
+ if (model == null || !(model instanceof Wrapper)) return null;
+ Wrapper parent = (Wrapper)model;
+ IEditorPart editorPart = HandlerUtil.getActiveEditor(event);
+ if (editorPart == null) return null;
+ Object object = editorPart.getAdapter(CommandStack.class);
+ if (object == null || !(object instanceof CommandStack)) return null;
+ CommandStack commandStack = (CommandStack)object;
+ DeleteChildCommand deleteChildCommand = new DeleteChildCommand();
+ deleteChildCommand.setChild(child);
+ if (child.getElement() instanceof Swimlane) {
+ deleteChildCommand.setType("swimlane");
+ } else if (child.getElement() instanceof Timer) {
+ deleteChildCommand.setType("timer");
+ }
+ deleteChildCommand.setParent(parent);
+ if (deleteChildCommand.canExecute()) {
+ commandStack.execute(deleteChildCommand);
+ } else {
+ Logger.logInfo("Could not execute delete element command: " + deleteChildCommand);
+ }
+ return null;
+ }
+
+}
Property changes on: trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/handler/DeleteElementHandler.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
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 2009-04-27 17:32:53 UTC (rev 14940)
+++ trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/model/Process.java 2009-04-27 17:33:41 UTC (rev 14941)
@@ -1,7 +1,11 @@
-package org.jboss.tools.flow.jpdl4.model;
+ package org.jboss.tools.flow.jpdl4.model;
+import java.util.ArrayList;
import java.util.Iterator;
+import java.util.List;
+import org.eclipse.ui.views.properties.IPropertyDescriptor;
+import org.eclipse.ui.views.properties.IPropertySource;
import org.jboss.tools.flow.common.model.DefaultFlow;
import org.jboss.tools.flow.common.model.Node;
import org.jboss.tools.flow.jpdl4.util.Jpdl4Helper;
@@ -10,6 +14,15 @@
private Node initial = null;
+ private List<Swimlane> swimlanes = new ArrayList<Swimlane>();
+ private List<Timer> timers = new ArrayList<Timer>();
+// private List<String> eventTypes = new ArrayList<String>();
+// private Map<String, List<EventListener>> eventListeners = new HashMap<String, List<EventListener>>();
+
+ public Process() {
+ setMetaData("propertySource", new PropertySource());
+ }
+
public StartEvent getStartState() {
for (Iterator<Node> iterator = getNodes().iterator(); iterator.hasNext(); ) {
Node node = iterator.next();
@@ -32,5 +45,40 @@
Jpdl4Helper.mergeLeadingNodes(node);
super.removeNode(node);
}
-
+
+ private class PropertySource implements IPropertySource {
+
+ public Object getEditableValue() {
+ return null;
+ }
+
+ public IPropertyDescriptor[] getPropertyDescriptors() {
+ return new IPropertyDescriptor[0];
+ }
+
+ public Object getPropertyValue(Object id) {
+ if ("swimlane".equals(id)) {
+ return swimlanes;
+ } else if ("timer".equals(id)) {
+ return timers;
+ }
+ return null;
+ }
+
+ public boolean isPropertySet(Object id) {
+ if ("swimlane".equals(id)) {
+ return true;
+ } else if ("timer".equals(id)) {
+ return true;
+ }
+ return false;
+ }
+
+ public void resetPropertyValue(Object id) {
+ }
+
+ public void setPropertyValue(Object id, Object value) {
+ }
+
+ }
}
Modified: trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/model/Swimlane.java
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/model/Swimlane.java 2009-04-27 17:32:53 UTC (rev 14940)
+++ trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/model/Swimlane.java 2009-04-27 17:33:41 UTC (rev 14941)
@@ -1,7 +1,8 @@
package org.jboss.tools.flow.jpdl4.model;
-import org.jboss.tools.flow.common.model.DefaultContainer;
+import org.jboss.tools.flow.common.model.DefaultElement;
-public class Swimlane extends DefaultContainer {
+public class Swimlane extends DefaultElement {
+
}
Added: trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/model/Timer.java
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/model/Timer.java (rev 0)
+++ trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/model/Timer.java 2009-04-27 17:33:41 UTC (rev 14941)
@@ -0,0 +1,7 @@
+package org.jboss.tools.flow.jpdl4.model;
+
+import org.jboss.tools.flow.common.model.DefaultElement;
+
+public class Timer extends DefaultElement {
+
+}
Property changes on: trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/model/Timer.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/view/DetailsPage.java
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/view/DetailsPage.java 2009-04-27 17:32:53 UTC (rev 14940)
+++ trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/view/DetailsPage.java 2009-04-27 17:33:41 UTC (rev 14941)
@@ -2,6 +2,7 @@
import org.eclipse.gef.EditPart;
import org.eclipse.gef.EditPartViewer;
+import org.eclipse.gef.ui.parts.TreeViewer;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.ISelectionChangedListener;
import org.eclipse.jface.viewers.IStructuredSelection;
@@ -10,14 +11,18 @@
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.ui.part.Page;
+import org.jboss.tools.flow.jpdl4.editor.JpdlEditor;
+import org.jboss.tools.flow.jpdl4.editpart.JpdlTreeEditPartFactory;
public class DetailsPage extends Page implements IDetailsPage, ISelectionChangedListener {
private EditPartViewer viewer;
private Control control;
-
- public DetailsPage(EditPartViewer viewer) {
- this.viewer = viewer;
+
+ public DetailsPage(JpdlEditor jpdlEditor) {
+ viewer = new TreeViewer();
+ viewer.setEditPartFactory(new JpdlTreeEditPartFactory());
+ jpdlEditor.getEditDomain().addViewer(viewer);
}
public Control getControl() {
@@ -27,7 +32,7 @@
protected EditPartViewer getViewer() {
return viewer;
}
-
+
public void addSelectionChangedListener(ISelectionChangedListener listener) {
getViewer().addSelectionChangedListener(listener);
}
15 years, 8 months
JBoss Tools SVN: r14940 - in trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common: policy and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: koen.aers(a)jboss.com
Date: 2009-04-27 13:32:53 -0400 (Mon, 27 Apr 2009)
New Revision: 14940
Added:
trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/command/AddChildCommand.java
trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/command/AddNodeCommand.java
trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/command/DeleteChildCommand.java
trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/command/DeleteNodeCommand.java
Removed:
trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/command/AddElementCommand.java
trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/command/DeleteElementCommand.java
Modified:
trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/policy/ElementContainerLayoutEditPolicy.java
trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/policy/ElementEditPolicy.java
Log:
- rename AddElementCommand and DeleteElementCommand to AddNodeCommand and DeleteNodeCommand
- add AddChildCommand and DeleteChildCommand
Added: trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/command/AddChildCommand.java
===================================================================
--- trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/command/AddChildCommand.java (rev 0)
+++ trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/command/AddChildCommand.java 2009-04-27 17:32:53 UTC (rev 14940)
@@ -0,0 +1,32 @@
+package org.jboss.tools.flow.common.command;
+
+import org.eclipse.gef.commands.Command;
+import org.jboss.tools.flow.common.wrapper.Wrapper;
+
+public class AddChildCommand extends Command {
+
+ private Wrapper child;
+ private Wrapper parent;
+ private Object type;
+
+ public void execute() {
+ parent.addChild(type, child);
+ }
+
+ public void setChild(Wrapper newChild) {
+ child = newChild;
+ }
+
+ public void setType(Object newType) {
+ type = newType;
+ }
+
+ public void setParent(Wrapper newParent) {
+ parent = newParent;
+ }
+
+ public void undo() {
+ parent.removeChild(type, child);
+ }
+
+}
Property changes on: trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/command/AddChildCommand.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Deleted: trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/command/AddElementCommand.java
===================================================================
--- trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/command/AddElementCommand.java 2009-04-27 16:43:54 UTC (rev 14939)
+++ trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/command/AddElementCommand.java 2009-04-27 17:32:53 UTC (rev 14940)
@@ -1,63 +0,0 @@
-package org.jboss.tools.flow.common.command;
-
-/*
- * Copyright 2005 JBoss Inc
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-import org.eclipse.gef.commands.Command;
-import org.jboss.tools.flow.common.wrapper.ContainerWrapper;
-import org.jboss.tools.flow.common.wrapper.NodeWrapper;
-
-/**
- * A command for adding an element.
- *
- * @author <a href="mailto:kris_verlaenen@hotmail.com">Kris Verlaenen</a>
- */
-public class AddElementCommand extends Command {
-
- private NodeWrapper child;
- private ContainerWrapper parent;
-
- public void execute() {
- parent.addElement(child);
- child.setParent(parent);
- }
-
- protected ContainerWrapper getParent() {
- return parent;
- }
-
- protected NodeWrapper getChild() {
- return child;
- }
-
- public void setChild(NodeWrapper newChild) {
- child = newChild;
- }
-
- public void setParent(ContainerWrapper newParent) {
- parent = newParent;
- }
-
- public void undo() {
- parent.removeElement(child);
- child.setParent(null);
- }
-
- public boolean canExecute() {
- return parent.acceptsElement(child);
- }
-
-}
Copied: trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/command/AddNodeCommand.java (from rev 14456, trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/command/AddElementCommand.java)
===================================================================
--- trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/command/AddNodeCommand.java (rev 0)
+++ trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/command/AddNodeCommand.java 2009-04-27 17:32:53 UTC (rev 14940)
@@ -0,0 +1,63 @@
+package org.jboss.tools.flow.common.command;
+
+/*
+ * Copyright 2005 JBoss Inc
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import org.eclipse.gef.commands.Command;
+import org.jboss.tools.flow.common.wrapper.ContainerWrapper;
+import org.jboss.tools.flow.common.wrapper.NodeWrapper;
+
+/**
+ * A command for adding an element.
+ *
+ * @author <a href="mailto:kris_verlaenen@hotmail.com">Kris Verlaenen</a>
+ */
+public class AddNodeCommand extends Command {
+
+ private NodeWrapper child;
+ private ContainerWrapper parent;
+
+ public void execute() {
+ parent.addElement(child);
+ child.setParent(parent);
+ }
+
+ protected ContainerWrapper getParent() {
+ return parent;
+ }
+
+ protected NodeWrapper getChild() {
+ return child;
+ }
+
+ public void setChild(NodeWrapper newChild) {
+ child = newChild;
+ }
+
+ public void setParent(ContainerWrapper newParent) {
+ parent = newParent;
+ }
+
+ public void undo() {
+ parent.removeElement(child);
+ child.setParent(null);
+ }
+
+ public boolean canExecute() {
+ return parent.acceptsElement(child);
+ }
+
+}
Added: trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/command/DeleteChildCommand.java
===================================================================
--- trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/command/DeleteChildCommand.java (rev 0)
+++ trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/command/DeleteChildCommand.java 2009-04-27 17:32:53 UTC (rev 14940)
@@ -0,0 +1,36 @@
+package org.jboss.tools.flow.common.command;
+
+import org.eclipse.gef.commands.Command;
+import org.jboss.tools.flow.common.wrapper.Wrapper;
+
+public class DeleteChildCommand extends Command {
+
+ private Wrapper child;
+ private Wrapper parent;
+ private Object type;
+
+ public void execute() {
+ parent.removeChild(type, child);
+ }
+
+ public void setChild(Wrapper newChild) {
+ child = newChild;
+ }
+
+ public void setType(Object newType) {
+ type = newType;
+ }
+
+ public void setParent(Wrapper newParent) {
+ parent = newParent;
+ }
+
+ public void undo() {
+ parent.addChild(type, child);
+ }
+
+ public boolean canExecute() {
+ return child != null && parent != null && type != null;
+ }
+
+}
Property changes on: trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/command/DeleteChildCommand.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Deleted: trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/command/DeleteElementCommand.java
===================================================================
--- trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/command/DeleteElementCommand.java 2009-04-27 16:43:54 UTC (rev 14939)
+++ trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/command/DeleteElementCommand.java 2009-04-27 17:32:53 UTC (rev 14940)
@@ -1,130 +0,0 @@
-package org.jboss.tools.flow.common.command;
-
-/*
- * Copyright 2005 JBoss Inc
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.gef.commands.Command;
-import org.jboss.tools.flow.common.wrapper.ConnectionWrapper;
-import org.jboss.tools.flow.common.wrapper.ContainerWrapper;
-import org.jboss.tools.flow.common.wrapper.NodeWrapper;
-
-/**
- * A command for deleting an element.
- *
- * @author <a href="mailto:kris_verlaenen@hotmail.com">Kris Verlaenen</a>
- */
-public class DeleteElementCommand extends Command {
-
- private NodeWrapper child;
- private ContainerWrapper parent;
-
- private List<DeleteElementCommand> embeddedCommands;
-
- private List<NodeWrapper> incomingElementWrappers = new ArrayList<NodeWrapper>();
- private List<NodeWrapper> outgoingElementWrappers = new ArrayList<NodeWrapper>();
- private List<ConnectionWrapper> incomingConnections = new ArrayList<ConnectionWrapper>();
- private List<ConnectionWrapper> outgoingConnections = new ArrayList<ConnectionWrapper>();
-
-
- private void deleteConnections(NodeWrapper element) {
- for (ConnectionWrapper connection: element.getIncomingConnections()) {
- incomingElementWrappers.add(connection.getSource());
- incomingConnections.add(connection);
- }
- for (ConnectionWrapper connection: element.getOutgoingConnections()) {
- outgoingElementWrappers.add(connection.getTarget());
- outgoingConnections.add(connection);
- }
- for (ConnectionWrapper connection: incomingConnections) {
- connection.disconnect();
- }
- for (ConnectionWrapper connection: outgoingConnections) {
- connection.disconnect();
- }
- }
-
- private void initializeEmbeddedCommands() {
- embeddedCommands = new ArrayList<DeleteElementCommand>();
- ContainerWrapper container = (ContainerWrapper)child;
- List<NodeWrapper> children = container.getNodeWrappers();
- for (NodeWrapper w : children) {
- DeleteElementCommand c = new DeleteElementCommand();
- c.setParent(container);
- c.setChild(w);
- embeddedCommands.add(c);
- }
- }
-
- private void executeEmbeddedCommands() {
- if (embeddedCommands == null) {
- initializeEmbeddedCommands();
- }
- for (DeleteElementCommand c : embeddedCommands) {
- c.execute();
- }
- }
-
- public void execute() {
- if (child instanceof ContainerWrapper) {
- executeEmbeddedCommands();
- }
- deleteConnections(child);
- parent.removeElement(child);
- }
-
- private void restoreConnections() {
- int i = 0;
- for (ConnectionWrapper connection: incomingConnections) {
- connection.connect((NodeWrapper) incomingElementWrappers.get(i), child);
- i++;
- }
- i = 0;
- for (ConnectionWrapper connection: outgoingConnections) {
- connection.connect(child, (NodeWrapper) outgoingElementWrappers.get(i));
- i++;
- }
- incomingConnections.clear();
- incomingElementWrappers.clear();
- outgoingConnections.clear();
- outgoingElementWrappers.clear();
- }
-
- public void setChild(NodeWrapper child) {
- this.child = child;
- }
-
- public void setParent(ContainerWrapper parent) {
- this.parent = parent;
- }
-
- private void undoEmbeddedCommands() {
- for (DeleteElementCommand c : embeddedCommands) {
- c.undo();
- }
- }
-
- public void undo() {
- parent.addElement(child);
- restoreConnections();
- if (child instanceof ContainerWrapper) {
- undoEmbeddedCommands();
- }
- }
-
-}
Copied: trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/command/DeleteNodeCommand.java (from rev 14839, trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/command/DeleteElementCommand.java)
===================================================================
--- trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/command/DeleteNodeCommand.java (rev 0)
+++ trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/command/DeleteNodeCommand.java 2009-04-27 17:32:53 UTC (rev 14940)
@@ -0,0 +1,130 @@
+package org.jboss.tools.flow.common.command;
+
+/*
+ * Copyright 2005 JBoss Inc
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.gef.commands.Command;
+import org.jboss.tools.flow.common.wrapper.ConnectionWrapper;
+import org.jboss.tools.flow.common.wrapper.ContainerWrapper;
+import org.jboss.tools.flow.common.wrapper.NodeWrapper;
+
+/**
+ * A command for deleting an element.
+ *
+ * @author <a href="mailto:kris_verlaenen@hotmail.com">Kris Verlaenen</a>
+ */
+public class DeleteNodeCommand extends Command {
+
+ private NodeWrapper child;
+ private ContainerWrapper parent;
+
+ private List<DeleteNodeCommand> embeddedCommands;
+
+ private List<NodeWrapper> incomingElementWrappers = new ArrayList<NodeWrapper>();
+ private List<NodeWrapper> outgoingElementWrappers = new ArrayList<NodeWrapper>();
+ private List<ConnectionWrapper> incomingConnections = new ArrayList<ConnectionWrapper>();
+ private List<ConnectionWrapper> outgoingConnections = new ArrayList<ConnectionWrapper>();
+
+
+ private void deleteConnections(NodeWrapper element) {
+ for (ConnectionWrapper connection: element.getIncomingConnections()) {
+ incomingElementWrappers.add(connection.getSource());
+ incomingConnections.add(connection);
+ }
+ for (ConnectionWrapper connection: element.getOutgoingConnections()) {
+ outgoingElementWrappers.add(connection.getTarget());
+ outgoingConnections.add(connection);
+ }
+ for (ConnectionWrapper connection: incomingConnections) {
+ connection.disconnect();
+ }
+ for (ConnectionWrapper connection: outgoingConnections) {
+ connection.disconnect();
+ }
+ }
+
+ private void initializeEmbeddedCommands() {
+ embeddedCommands = new ArrayList<DeleteNodeCommand>();
+ ContainerWrapper container = (ContainerWrapper)child;
+ List<NodeWrapper> children = container.getNodeWrappers();
+ for (NodeWrapper w : children) {
+ DeleteNodeCommand c = new DeleteNodeCommand();
+ c.setParent(container);
+ c.setChild(w);
+ embeddedCommands.add(c);
+ }
+ }
+
+ private void executeEmbeddedCommands() {
+ if (embeddedCommands == null) {
+ initializeEmbeddedCommands();
+ }
+ for (DeleteNodeCommand c : embeddedCommands) {
+ c.execute();
+ }
+ }
+
+ public void execute() {
+ if (child instanceof ContainerWrapper) {
+ executeEmbeddedCommands();
+ }
+ deleteConnections(child);
+ parent.removeElement(child);
+ }
+
+ private void restoreConnections() {
+ int i = 0;
+ for (ConnectionWrapper connection: incomingConnections) {
+ connection.connect((NodeWrapper) incomingElementWrappers.get(i), child);
+ i++;
+ }
+ i = 0;
+ for (ConnectionWrapper connection: outgoingConnections) {
+ connection.connect(child, (NodeWrapper) outgoingElementWrappers.get(i));
+ i++;
+ }
+ incomingConnections.clear();
+ incomingElementWrappers.clear();
+ outgoingConnections.clear();
+ outgoingElementWrappers.clear();
+ }
+
+ public void setChild(NodeWrapper child) {
+ this.child = child;
+ }
+
+ public void setParent(ContainerWrapper parent) {
+ this.parent = parent;
+ }
+
+ private void undoEmbeddedCommands() {
+ for (DeleteNodeCommand c : embeddedCommands) {
+ c.undo();
+ }
+ }
+
+ public void undo() {
+ parent.addElement(child);
+ restoreConnections();
+ if (child instanceof ContainerWrapper) {
+ undoEmbeddedCommands();
+ }
+ }
+
+}
Modified: trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/policy/ElementContainerLayoutEditPolicy.java
===================================================================
--- trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/policy/ElementContainerLayoutEditPolicy.java 2009-04-27 16:43:54 UTC (rev 14939)
+++ trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/policy/ElementContainerLayoutEditPolicy.java 2009-04-27 17:32:53 UTC (rev 14940)
@@ -22,7 +22,7 @@
import org.eclipse.gef.commands.Command;
import org.eclipse.gef.editpolicies.XYLayoutEditPolicy;
import org.eclipse.gef.requests.CreateRequest;
-import org.jboss.tools.flow.common.command.AddElementCommand;
+import org.jboss.tools.flow.common.command.AddNodeCommand;
import org.jboss.tools.flow.common.command.ChangeConstraintCommand;
import org.jboss.tools.flow.common.wrapper.ContainerWrapper;
import org.jboss.tools.flow.common.wrapper.NodeWrapper;
@@ -35,7 +35,7 @@
public class ElementContainerLayoutEditPolicy extends XYLayoutEditPolicy {
protected Command getCreateCommand(CreateRequest request) {
- AddElementCommand command = new AddElementCommand();
+ AddNodeCommand command = new AddNodeCommand();
command.setParent((ContainerWrapper) getHost().getModel());
NodeWrapper element = (NodeWrapper) request.getNewObject();
element.setConstraint((Rectangle) getConstraintFor(request));
Modified: trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/policy/ElementEditPolicy.java
===================================================================
--- trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/policy/ElementEditPolicy.java 2009-04-27 16:43:54 UTC (rev 14939)
+++ trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/policy/ElementEditPolicy.java 2009-04-27 17:32:53 UTC (rev 14940)
@@ -19,7 +19,7 @@
import org.eclipse.gef.commands.Command;
import org.eclipse.gef.editpolicies.ComponentEditPolicy;
import org.eclipse.gef.requests.GroupRequest;
-import org.jboss.tools.flow.common.command.DeleteElementCommand;
+import org.jboss.tools.flow.common.command.DeleteNodeCommand;
import org.jboss.tools.flow.common.wrapper.ContainerWrapper;
import org.jboss.tools.flow.common.wrapper.NodeWrapper;
@@ -32,7 +32,7 @@
protected Command createDeleteCommand(GroupRequest deleteRequest) {
ContainerWrapper parent = (ContainerWrapper) getHost().getParent().getModel();
- DeleteElementCommand deleteCmd = new DeleteElementCommand();
+ DeleteNodeCommand deleteCmd = new DeleteNodeCommand();
deleteCmd.setParent(parent);
deleteCmd.setChild((NodeWrapper) (getHost().getModel()));
return deleteCmd;
15 years, 8 months
JBoss Tools SVN: r14939 - trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/contentassist.
by jbosstools-commits@lists.jboss.org
Author: vrubezhny
Date: 2009-04-27 12:43:54 -0400 (Mon, 27 Apr 2009)
New Revision: 14939
Modified:
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/contentassist/ExtendedJSPContentAssistProcessor.java
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/contentassist/FaceletsHtmlContentAssistProcessor.java
Log:
JBIDE-3845 Code assist for #{messages['...']} should suggest properties when user types "[".
The '[' character is added to CA auto activation characters.
Modified: trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/contentassist/ExtendedJSPContentAssistProcessor.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/contentassist/ExtendedJSPContentAssistProcessor.java 2009-04-27 15:17:48 UTC (rev 14938)
+++ trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/contentassist/ExtendedJSPContentAssistProcessor.java 2009-04-27 16:43:54 UTC (rev 14939)
@@ -167,6 +167,7 @@
StringBuffer redhatDefaultChars = new StringBuffer(new String(superAutoActivChars));
if(redhatDefaultChars.indexOf(".")<0) {
redhatDefaultChars.append('.');
+ redhatDefaultChars.append('[');
store.setDefault(JSPUIPreferenceNames.AUTO_PROPOSE_CODE, redhatDefaultChars.toString());
store.setValue(JSPUIPreferenceNames.AUTO_PROPOSE_CODE, redhatDefaultChars.toString());
}
Modified: trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/contentassist/FaceletsHtmlContentAssistProcessor.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/contentassist/FaceletsHtmlContentAssistProcessor.java 2009-04-27 15:17:48 UTC (rev 14938)
+++ trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/contentassist/FaceletsHtmlContentAssistProcessor.java 2009-04-27 16:43:54 UTC (rev 14939)
@@ -751,6 +751,7 @@
StringBuffer redhatDefaultChars = new StringBuffer(new String(superAutoActivChars));
if(redhatDefaultChars.indexOf(".")<0) {
redhatDefaultChars.append('.');
+ redhatDefaultChars.append('[');
store.setDefault(HTMLUIPreferenceNames.AUTO_PROPOSE_CODE, redhatDefaultChars.toString());
store.setValue(HTMLUIPreferenceNames.AUTO_PROPOSE_CODE, redhatDefaultChars.toString());
}
15 years, 8 months
JBoss Tools SVN: r14938 - in trunk/jst/plugins/org.jboss.tools.jst.web: src/org/jboss/tools/jst/web/tld/model and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2009-04-27 11:17:48 -0400 (Mon, 27 Apr 2009)
New Revision: 14938
Modified:
trunk/jst/plugins/org.jboss.tools.jst.web/resources/help/keys-web-menu.properties
trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/tld/model/FileSystemsTreeConstraint.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-4213
Modified: trunk/jst/plugins/org.jboss.tools.jst.web/resources/help/keys-web-menu.properties
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web/resources/help/keys-web-menu.properties 2009-04-27 15:17:11 UTC (rev 14937)
+++ trunk/jst/plugins/org.jboss.tools.jst.web/resources/help/keys-web-menu.properties 2009-04-27 15:17:48 UTC (rev 14938)
@@ -1,6 +1,6 @@
Web.Validate.menu=Report Problem
Web.CreateTag.menu=Add Tag...
-Web.SetExpanded.menu=Set Expanded
+#Web.SetExpanded.menu=Set Expanded
Web.CreateAttribute.menu=Add Attribute...
Web.CreateValidator.menu=Validator...
Web.CreateListener.menu=Listener...
Modified: trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/tld/model/FileSystemsTreeConstraint.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/tld/model/FileSystemsTreeConstraint.java 2009-04-27 15:17:11 UTC (rev 14937)
+++ trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/tld/model/FileSystemsTreeConstraint.java 2009-04-27 15:17:48 UTC (rev 14938)
@@ -28,7 +28,8 @@
String entity = object.getModelEntity().getName();
if(!entity.startsWith("File")) return false;
if(!entity.startsWith("FileTLD") &&
- !entity.startsWith("FileValidationRules")
+ !entity.startsWith("FileValidationRules") &&
+ !entity.startsWith("FileFaceletTaglib")
/// && !entity.equals("FileTiles")
) return false;
return (!"true".equals(object.getAttributeValue("expanded")));
15 years, 8 months
JBoss Tools SVN: r14937 - in trunk/jsf/plugins/org.jboss.tools.jsf: resources/meta and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2009-04-27 11:17:11 -0400 (Mon, 27 Apr 2009)
New Revision: 14937
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf/resources/help/keys-jsf-attrs.properties
trunk/jsf/plugins/org.jboss.tools.jsf/resources/meta/facelet-taglib.meta
trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/model/pv/JSFProjectTagLibs.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-4213
Modified: trunk/jsf/plugins/org.jboss.tools.jsf/resources/help/keys-jsf-attrs.properties
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf/resources/help/keys-jsf-attrs.properties 2009-04-27 14:42:09 UTC (rev 14936)
+++ trunk/jsf/plugins/org.jboss.tools.jsf/resources/help/keys-jsf-attrs.properties 2009-04-27 15:17:11 UTC (rev 14937)
@@ -8,51 +8,51 @@
JSF.xmlns_xsi=Xmlns\:xsi
JSF.xsi_schemaLocation=Xsi\:schemaLocation
JSF.action-listener=Action-Listener
-JSF.default-render-kit-id=Default-Render-Kit-ID
-JSF.navigation-handler=Navigation-Handler
-JSF.view-handler=View-Handler
-JSF.state-manager=State-Manager
-JSF.property-resolver=Property-Resolver
-JSF.variable-resolver=Variable-Resolver
-JSF.el-resolver=El-Resolver
+JSF.default-render-kit-id=Default Render Kit ID
+JSF.navigation-handler=Navigation Handler
+JSF.view-handler=View Handler
+JSF.state-manager=State Manager
+JSF.property-resolver=Property Resolver
+JSF.variable-resolver=Variable Resolver
+JSF.el-resolver=El Resolver
JSF.description=Description
-JSF.display-name=Display-Name
-JSF.small-icon=Small-Icon
-JSF.large-icon=Large-Icon
-JSF.attribute-name=Attribute-Name
-JSF.attribute-class=Attribute-Class
-JSF.default-value=Default-Value
-JSF.suggested-value=Suggested-Value
-JSF.component-type=Component-Type
-JSF.component-class=Component-Class
-JSF.converter-id=Converter-ID
-JSF.converter-for-class=Converter-for-Class
-JSF.converter-class=Converter-Class
+JSF.display-name=Display Name
+JSF.small-icon=Small Icon
+JSF.large-icon=Large Icon
+JSF.attribute-name=Attribute Name
+JSF.attribute-class=Attribute Class
+JSF.default-value=Default Value
+JSF.suggested-value=Suggested Value
+JSF.component-type=Component Type
+JSF.component-class=Component Class
+JSF.converter-id=Converter ID
+JSF.converter-for-class=Converter for Class
+JSF.converter-class=Converter Class
JSF.class_name=Class Name
-JSF.facet-name=Facet-Name
-JSF.application-factory=Application-Factory
-JSF.faces-context-factory=Faces-Context-Factory
-JSF.lifecycle-factory=Lifecycle-Factory
-JSF.render-kit-factory=Render-Kit-Factory
-JSF.value-class=Value-Class
-JSF.null-value=Null-Value
+JSF.facet-name=Facet Name
+JSF.application-factory=Application Factory
+JSF.faces-context-factory=Faces Context Factory
+JSF.lifecycle-factory=Lifecycle Factory
+JSF.render-kit-factory=Render Kit Factory
+JSF.value-class=Value Class
+JSF.null-value=Null Value
JSF.value=Value
-JSF.default-locale=Default-Locale
-JSF.managed-bean-name=Managed-Bean-Name
-JSF.managed-bean-class=Managed-Bean-Class
-JSF.managed-bean-scope=Managed-Bean-Scope
-JSF.property-name=Property-Name
-JSF.property-class=Property-Class
-JSF.value-kind=Value-Kind
-JSF.key-class=Key-Class
+JSF.default-locale=Default Locale
+JSF.managed-bean-name=Managed Bean Name
+JSF.managed-bean-class=Managed Bean Class
+JSF.managed-bean-scope=Managed Bean Scope
+JSF.property-name=Property Name
+JSF.property-class=Property Class
+JSF.value-kind=Value Kind
+JSF.key-class=Key Class
JSF.key=Key
-JSF.message-bundle=Message-Bundle
-JSF.from-action=From-Action
-JSF.from-outcome=From-Outcome
-JSF.to-view-id=To-View-ID
+JSF.message-bundle=Message Bundle
+JSF.from-action=From Action
+JSF.from-outcome=From Outcome
+JSF.to-view-id=To View ID
JSF.redirect=Redirect
-JSF.from-view-id=From-View-ID
-JSF.phase-listener=Phase-Listener
+JSF.from-view-id=From View ID
+JSF.phase-listener=Phase Listener
JSF.type=Type
JSF.shape=Shape
JSF.target=Target
@@ -62,19 +62,19 @@
JSF.title=Title
JSF.hidden=Hidden
JSF.shortcut=Shortcut
-JSF.referenced-bean-name=Referenced-Bean-Name
-JSF.referenced-bean-class=Referenced-Bean-Class
-JSF.render-kit-id=Render-Kit-ID
-JSF.render-kit-class=Render-Kit-Class
-JSF.component-family=Component-Family
-JSF.renderer-type=Renderer-Type
-JSF.renderer-class=Renderer-Class
-JSF.base-name=Base-Name
+JSF.referenced-bean-name=Referenced Bean Name
+JSF.referenced-bean-class=Referenced Bean Class
+JSF.render-kit-id=Render Kit ID
+JSF.render-kit-class=Render Kit Class
+JSF.component-family=Component Family
+JSF.renderer-type=Renderer Type
+JSF.renderer-class=Renderer Class
+JSF.base-name=Base Name
JSF.var=Var
-JSF.attribute-names=Attribute-Names
-JSF.supported-locale=Supported-Locale
-JSF.validator-id=Validator-ID
-JSF.validator-class=Validator-Class
+JSF.attribute-names=Attribute Names
+JSF.supported-locale=Supported Locale
+JSF.validator-id=Validator ID
+JSF.validator-class=Validator Class
JSF.URI=URI
JSF.path_on_disk=Path on Disk
JSF.java_src=Java Src
@@ -100,3 +100,11 @@
JSF.rename_file=Rename File
JSF.link_text=Link Text
JSF.select_items=Select Items
+JSF.function-name=Function Name
+JSF.function-class=Function Class
+JSF.function-signature=Function Signature
+JSF.handler-class=Handler Class
+JSF.source=Source
+JSF.tag-name=Tag Name
+JSF.library-class=Library Class
+JSF.uri=Namespace
Modified: trunk/jsf/plugins/org.jboss.tools.jsf/resources/meta/facelet-taglib.meta
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf/resources/meta/facelet-taglib.meta 2009-04-27 14:42:09 UTC (rev 14936)
+++ trunk/jsf/plugins/org.jboss.tools.jsf/resources/meta/facelet-taglib.meta 2009-04-27 15:17:11 UTC (rev 14937)
@@ -256,9 +256,7 @@
<Editor name="Uneditable"/>
</XModelAttribute>
<XModelAttribute PROPERTIES="save=always;category=general"
- name="source" xmlname="#text">
- <Editor name="Note2"/>
- </XModelAttribute>
+ name="source" xmlname="#text"/>
<XModelAttribute TRIM="no" name="comment" xmlname="#comment">
<Editor name="Note"/>
</XModelAttribute>
@@ -314,9 +312,28 @@
</XModelAttribute>
</XModelAttributes>
<XActionItem kind="list">
- <XActionItem HandlerClassName="%OpenJavaSource%" ICON="action.empty"
- PROPERTIES="attribute=handler-class" displayName="Open Handler"
- kind="action" name="OpenSource"/>
+ <XActionItem ICON="action.empty" displayName="New" group="1"
+ kind="list" name="CreateActions">
+ <XActionItem HandlerClassName="%DefaultReplaceUnique%" ICON="empty"
+ PROPERTIES="significanceMessageClass=%Replace%;child=declaration"
+ WizardClassName="%Default%" displayName="Component..."
+ kind="action" name="AddComponent">
+ <EntityData EntityName="FaceletTaglibComponent">
+ <AttributeData AttributeName="component-type"/>
+ <AttributeData AttributeName="renderer-type" Mandatory="no"/>
+ <AttributeData AttributeName="handler-class" Mandatory="no"/>
+ </EntityData>
+ </XActionItem>
+ <XActionItem HandlerClassName="%DefaultReplaceUnique%" ICON="empty"
+ PROPERTIES="significanceMessageClass=%Replace%;child=declaration"
+ WizardClassName="%Default%" displayName="Converter..."
+ kind="action" name="AddConverter">
+ <EntityData EntityName="FaceletTaglibConverter">
+ <AttributeData AttributeName="converter-id"/>
+ <AttributeData AttributeName="handler-class" Mandatory="no"/>
+ </EntityData>
+ </XActionItem>
+ </XActionItem>
<XActionItem ICON="action.copy" displayName="Copy" kind="list" name="CopyActions">
<XActionItem BaseActionName="Cut" HandlerClassName="%Cut%"
ICON="action.cut" displayName="Cut" kind="action" name="Cut"/>
@@ -327,14 +344,14 @@
<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" kind="list" name="Properties">
- <XActionItem HandlerClassName="%Properties%" ICON="action.empty"
- displayName="Properties..." kind="action" name="Properties"/>
- </XActionItem>
</XActionItem>
<XDependencies/>
</XModelEntity>
@@ -413,16 +430,6 @@
<XModelAttribute default="xml" name="extension" xmlname="EXTENSION">
<Editor name="Uneditable"/>
</XModelAttribute>
- <XModelAttribute PROPERTIES="category=general" name="library-class" xmlname="library-class.#text">
- <Editor name="AccessibleJava"/>
- </XModelAttribute>
- <XModelAttribute PROPERTIES="category=general"
- name="taglib namespace" xmlname="namespace.#text">
- <Editor name="AccessibleJava"/>
- </XModelAttribute>
- <XModelAttribute TRIM="no" name="comment" xmlname="#comment">
- <Editor name="Note"/>
- </XModelAttribute>
<XModelAttribute loader="ElementType" name="_lateload" visibility="false">
<Editor name="Uneditable"/>
</XModelAttribute>
@@ -438,6 +445,20 @@
<Editor name="Uneditable"/>
</XModelAttribute>
<XModelAttribute name="incorrectBody" visibility="false"/>
+ <XModelAttribute default="false" name="expanded" visibility="false">
+ <Constraint loader="List">
+ <value name="false"/>
+ <value name="true"/>
+ </Constraint>
+ <Editor name="Uneditable"/>
+ </XModelAttribute>
+ <XModelAttribute PROPERTIES="category=general" name="library-class" xmlname="library-class.#text">
+ <Editor name="AccessibleJava"/>
+ </XModelAttribute>
+ <XModelAttribute PROPERTIES="category=general" name="uri" xmlname="namespace.#text"/>
+ <XModelAttribute TRIM="no" name="comment" xmlname="#comment">
+ <Editor name="Note"/>
+ </XModelAttribute>
<XModelAttribute name="encoding">
<Constraint loader="ListString">
<value name="ISO-8859-1"/>
@@ -483,6 +504,9 @@
</XActionItem>
<XActionItem ICON="action.empty" displayName="New" group="1"
kind="list" name="CreateActions"/>
+ <XActionItem HIDE="disabled"
+ HandlerClassName="org.jboss.tools.jst.web.tld.model.handlers.ExpandTLDHandler"
+ ICON="action.empty" displayName="Set Expanded" kind="action" name="SetExpanded"/>
<XActionItem ICON="action.copy" displayName="Copy" kind="list" name="CopyActions">
<XActionItem BaseActionName="Copy" HandlerClassName="%Copy%"
ICON="action.copy" displayName="Copy" kind="action" name="Copy"/>
Modified: trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/model/pv/JSFProjectTagLibs.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/model/pv/JSFProjectTagLibs.java 2009-04-27 14:42:09 UTC (rev 14936)
+++ trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/model/pv/JSFProjectTagLibs.java 2009-04-27 15:17:11 UTC (rev 14937)
@@ -13,6 +13,9 @@
import java.util.*;
import org.eclipse.core.resources.IResource;
import org.jboss.tools.common.model.XModelObject;
+import org.jboss.tools.common.model.filesystems.FileSystemsHelper;
+import org.jboss.tools.common.model.util.EclipseResourceUtil;
+import org.jboss.tools.jst.web.model.helpers.WebAppHelper;
public class JSFProjectTagLibs extends JSFProjectResourceBundles {
private static final long serialVersionUID = 7805053632320764494L;
@@ -34,6 +37,12 @@
protected List<XModelObject> collect(Iterator<XModelObject> rs) {
List<XModelObject> list = super.collect(rs);
+
+ XModelObject faceletTaglib = getFaceletTaglibs();
+ if(faceletTaglib != null && faceletTaglib.getAttributeValue("uri") != null) {
+ list.add(faceletTaglib);
+ }
+
Iterator<XModelObject> it = list.iterator();
Set<String> set = new HashSet<String>();
while(it.hasNext()) {
@@ -48,6 +57,18 @@
return list;
}
+ private XModelObject getFaceletTaglibs() {
+ XModelObject webxml = getModel().getByPath("/web.xml");
+ XModelObject webRoot = FileSystemsHelper.getWebRoot(getModel());
+ if(webxml == null || webRoot == null) return null;
+ XModelObject cp = WebAppHelper.findWebAppContextParam(webxml, "facelets.LIBRARIES");
+ if(cp == null) return null;
+ String value = cp.getAttributeValue("param-value");
+ if(value == null || value.length() == 0) return null;
+ if(value.startsWith("/")) value = value.substring(1);
+ return webRoot.getChildByPath(value);
+ }
+
static String TLD_ENTITIES = ".FileTLD_PRO.FileTLD_1_2.FileTLD_2_0.FileTLD_2_1.";
protected boolean acceptFile(XModelObject o) {
15 years, 8 months
JBoss Tools SVN: r14936 - workspace/snjeza/seam-examples.
by jbosstools-commits@lists.jboss.org
Author: vrubezhny
Date: 2009-04-27 10:42:09 -0400 (Mon, 27 Apr 2009)
New Revision: 14936
Modified:
workspace/snjeza/seam-examples/booking.zip
workspace/snjeza/seam-examples/bookingall.zip
workspace/snjeza/seam-examples/bookingall2.zip
Log:
JBIDE-4177 Seam Booking project example errors.
A Java-like content of the <code> tag is surrounded with <![CDATA]]> to avoid errors of incompatible characters and other HTML-formatting problems.
Modified: workspace/snjeza/seam-examples/booking.zip
===================================================================
(Binary files differ)
Modified: workspace/snjeza/seam-examples/bookingall.zip
===================================================================
(Binary files differ)
Modified: workspace/snjeza/seam-examples/bookingall2.zip
===================================================================
(Binary files differ)
15 years, 8 months
JBoss Tools SVN: r14935 - trunk/seam/plugins/org.jboss.tools.seam.text.ext.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2009-04-27 08:17:15 -0400 (Mon, 27 Apr 2009)
New Revision: 14935
Modified:
trunk/seam/plugins/org.jboss.tools.seam.text.ext/plugin.xml
Log:
https://jira.jboss.org/jira/browse/JBIDE-3804
Modified: trunk/seam/plugins/org.jboss.tools.seam.text.ext/plugin.xml
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.text.ext/plugin.xml 2009-04-27 09:19:15 UTC (rev 14934)
+++ trunk/seam/plugins/org.jboss.tools.seam.text.ext/plugin.xml 2009-04-27 12:17:15 UTC (rev 14935)
@@ -53,6 +53,24 @@
</contentType>
</hyperlinkPartitioner>
+ <hyperlinkPartitioner
+ id="org.jboss.tools.common.text.ext.seam.hyperlink.JSPNavigationCaseHyperlinkPartitioner"
+ class="org.jboss.tools.jsf.text.ext.hyperlink.JSPNavigationCaseHyperlinkPartitioner">
+ <contentType id="org.eclipse.jst.jsp.core.jspsource">
+ <partitionType id="org.jboss.tools.common.text.ext.xml.XML_ATTRIBUTE_VALUE">
+ <axis path="*/[http://jboss.com/products/seam/taglib]:button/action/" />
+ <axis path="*/[http://jboss.com/products/seam/taglib]:link/action/" />
+ </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://jboss.com/products/seam/taglib]:button/action/" />
+ <axis path="*/[http://jboss.com/products/seam/taglib]:link/action/" />
+ </partitionType>
+ </contentType>
+ </hyperlinkPartitioner>
+
+
<hyperlinkPartitioner
class="org.jboss.tools.common.text.ext.hyperlink.xml.XMLElementHyperlinkPartitioner"
id="org.jboss.tools.common.text.ext.hyperlink.xml.XMLElementHyperlinkPartitioner">
15 years, 8 months