Author: koen.aers(a)jboss.com
Date: 2009-04-17 18:00:33 -0400 (Fri, 17 Apr 2009)
New Revision: 14814
Added:
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/icons/16/events_multiple.gif
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/icons/16/swimlanes_multiple.gif
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/icons/16/timers_multiple.gif
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/ListTreeEditPart.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/model/DefaultEventListenerContainer.java
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/model/EventListener.java
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/model/Swimlane.java
Modified:
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/editor/JpdlEditor.java
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/editor/JpdlSelectionSynchronizer.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
Log:
details view for process definitions
Added: trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/icons/16/events_multiple.gif
===================================================================
(Binary files differ)
Property changes on:
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/icons/16/events_multiple.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/icons/16/swimlanes_multiple.gif
===================================================================
(Binary files differ)
Property changes on:
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/icons/16/swimlanes_multiple.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/icons/16/timers_multiple.gif
===================================================================
(Binary files differ)
Property changes on:
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/icons/16/timers_multiple.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
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-17
20:36:07 UTC (rev 14813)
+++
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/editor/JpdlEditor.java 2009-04-17
22:00:33 UTC (rev 14814)
@@ -24,7 +24,7 @@
public static String ID = "org.jboss.tools.flow.jpdl4.editor";
- protected SelectionSynchronizer selectionSynchronizer;
+// protected SelectionSynchronizer selectionSynchronizer;
private DetailsPage detailsPage;
protected PaletteRoot createPalette() {
@@ -56,13 +56,13 @@
setModel(empty ? createModel() : new JpdlDeserializer().deserialize(is));
}
- public SelectionSynchronizer getSelectionSynchronizer() {
- if (selectionSynchronizer == null) {
- selectionSynchronizer = new JpdlSelectionSynchronizer();
- selectionSynchronizer.addViewer(getGraphicalViewer());
- }
- return selectionSynchronizer;
- }
+// public SelectionSynchronizer getSelectionSynchronizer() {
+// if (selectionSynchronizer == null) {
+// selectionSynchronizer = new JpdlSelectionSynchronizer();
+// selectionSynchronizer.addViewer(getGraphicalViewer());
+// }
+// return selectionSynchronizer;
+// }
public String getContributorId() {
return getSite().getId();
@@ -87,9 +87,8 @@
TreeViewer treeViewer = new TreeViewer();
treeViewer.setEditPartFactory(new JpdlTreeEditPartFactory());
getEditDomain().addViewer(treeViewer);
- getSelectionSynchronizer().addViewer(treeViewer);
+// getSelectionSynchronizer().addViewer(treeViewer);
detailsPage = new DetailsPage(treeViewer) ;
- treeViewer.setContents(((Wrapper)getModel()).getElement());
getSite().getSelectionProvider().addSelectionChangedListener(detailsPage);
}
Modified:
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/editor/JpdlSelectionSynchronizer.java
===================================================================
---
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/editor/JpdlSelectionSynchronizer.java 2009-04-17
20:36:07 UTC (rev 14813)
+++
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/editor/JpdlSelectionSynchronizer.java 2009-04-17
22:00:33 UTC (rev 14814)
@@ -5,25 +5,37 @@
import org.eclipse.gef.EditPart;
import org.eclipse.gef.EditPartViewer;
import org.eclipse.gef.GraphicalViewer;
-import org.eclipse.gef.editparts.AbstractTreeEditPart;
import org.eclipse.gef.ui.parts.SelectionSynchronizer;
+import org.eclipse.gef.ui.parts.TreeViewer;
import org.jboss.tools.flow.common.wrapper.Wrapper;
public class JpdlSelectionSynchronizer extends SelectionSynchronizer {
+ protected EditPart convert(EditPartViewer viewer, EditPart part) {
+ if (viewer instanceof GraphicalViewer) {
+ return convertToGraphicalViewerPart((GraphicalViewer)viewer, part);
+ } else if (viewer instanceof TreeViewer) {
+ return convertToTreeViewerPart((TreeViewer)viewer, part);
+ }
+ return null;
+ }
+
@SuppressWarnings("unchecked")
- protected EditPart convert(EditPartViewer viewer, EditPart part) {
- if (!(viewer instanceof GraphicalViewer)) return null;
- if (!(part instanceof AbstractTreeEditPart)) return null;
+ protected EditPart convertToGraphicalViewerPart(GraphicalViewer viewer, EditPart part)
{
Iterator<EditPart> iterator = viewer.getEditPartRegistry().values().iterator();
while (iterator.hasNext()) {
EditPart editPart = iterator.next();
- Wrapper wrapper = (Wrapper)editPart.getModel();
- if (part.getModel() == wrapper.getElement()) {
- return editPart;
+ if (editPart.getModel() instanceof Wrapper) {
+ if (part.getModel() == ((Wrapper)editPart.getModel()).getElement()) {
+ return editPart;
+ }
}
}
return null;
}
+ protected EditPart convertToTreeViewerPart(TreeViewer viewer, EditPart part) {
+ return null;
+ }
+
}
Added:
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
(rev 0)
+++
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/editpart/EventListenerContainerListTreeEditPart.java 2009-04-17
22:00:33 UTC (rev 14814)
@@ -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.jpdl4.model.Process;
+import org.jboss.tools.flow.jpdl4.util.SharedImages;
+
+public class EventListenerContainerListTreeEditPart extends JpdlTreeEditPart implements
ListTreeEditPart {
+
+ public EventListenerContainerListTreeEditPart(Process process) {
+ super(process);
+ }
+
+ protected Image getImage() {
+ String iconPath = "icons/16/events_multiple.gif";
+ ImageDescriptor descriptor = ImageDescriptor.createFromURL(
+ Platform.getBundle("org.jboss.tools.flow.jpdl4").getEntry(iconPath));
+ return SharedImages.INSTANCE.getImage(descriptor);
+ }
+
+ protected String getText() {
+ return "Event Listeners";
+ }
+
+}
Property changes on:
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/editpart/EventListenerContainerListTreeEditPart.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
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-17
20:36:07 UTC (rev 14813)
+++
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/editpart/JpdlTreeEditPartFactory.java 2009-04-17
22:00:33 UTC (rev 14814)
@@ -9,6 +9,9 @@
public EditPart createEditPart(EditPart context, Object model) {
if (model instanceof Process && context == null) return new
ProcessTreeRootEditPart((Process)model);
if (model instanceof ProcessNodeListTreeEditPart) return (EditPart)model;
+ if (model instanceof SwimlaneListTreeEditPart) return (EditPart)model;
+ if (model instanceof EventListenerContainerListTreeEditPart) return (EditPart)model;
+ if (model instanceof TimerListTreeEditPart) return (EditPart)model;
return null;
}
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-17
22:00:33 UTC (rev 14814)
@@ -0,0 +1,5 @@
+package org.jboss.tools.flow.jpdl4.editpart;
+
+public interface ListTreeEditPart {
+
+}
Property changes on:
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/editpart/ListTreeEditPart.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
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-17
20:36:07 UTC (rev 14813)
+++
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/editpart/ProcessTreeRootEditPart.java 2009-04-17
22:00:33 UTC (rev 14814)
@@ -7,6 +7,8 @@
public class ProcessTreeRootEditPart extends JpdlTreeEditPart {
+ List<Object> modelChildren;
+
public ProcessTreeRootEditPart(Process process) {
super(process);
}
@@ -14,10 +16,20 @@
protected void createEditPolicies() {
}
- protected List<Object> getModelChildren() {
+ private List<Object> initModelChildren() {
List<Object> result = new ArrayList<Object>();
+ result.add(new SwimlaneListTreeEditPart((Process)getModel()));
+ result.add(new EventListenerContainerListTreeEditPart((Process)getModel()));
+ result.add(new TimerListTreeEditPart((Process)getModel()));
result.add(new ProcessNodeListTreeEditPart((Process)getModel()));
return result;
}
+ protected List<Object> getModelChildren() {
+ if (modelChildren == null) {
+ modelChildren = initModelChildren();
+ }
+ return modelChildren;
+ }
+
}
Added:
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
(rev 0)
+++
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/editpart/SwimlaneListTreeEditPart.java 2009-04-17
22:00:33 UTC (rev 14814)
@@ -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.jpdl4.model.Process;
+import org.jboss.tools.flow.jpdl4.util.SharedImages;
+
+public class SwimlaneListTreeEditPart extends JpdlTreeEditPart implements
ListTreeEditPart {
+
+ public SwimlaneListTreeEditPart(Process process) {
+ super(process);
+ }
+
+ protected Image getImage() {
+ String iconPath = "icons/16/swimlanes_multiple.gif";
+ ImageDescriptor descriptor = ImageDescriptor.createFromURL(
+ Platform.getBundle("org.jboss.tools.flow.jpdl4").getEntry(iconPath));
+ return SharedImages.INSTANCE.getImage(descriptor);
+ }
+
+ protected String getText() {
+ return "Swimlanes";
+ }
+
+}
Property changes on:
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/editpart/SwimlaneListTreeEditPart.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added:
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
(rev 0)
+++
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/editpart/TimerListTreeEditPart.java 2009-04-17
22:00:33 UTC (rev 14814)
@@ -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.jpdl4.model.Process;
+import org.jboss.tools.flow.jpdl4.util.SharedImages;
+
+public class TimerListTreeEditPart extends JpdlTreeEditPart implements ListTreeEditPart
{
+
+ public TimerListTreeEditPart(Process process) {
+ super(process);
+ }
+
+ protected Image getImage() {
+ String iconPath = "icons/16/timers_multiple.gif";
+ ImageDescriptor descriptor = ImageDescriptor.createFromURL(
+ Platform.getBundle("org.jboss.tools.flow.jpdl4").getEntry(iconPath));
+ return SharedImages.INSTANCE.getImage(descriptor);
+ }
+
+ protected String getText() {
+ return "Timers";
+ }
+
+}
Property changes on:
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/editpart/TimerListTreeEditPart.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added:
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/model/DefaultEventListenerContainer.java
===================================================================
---
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/model/DefaultEventListenerContainer.java
(rev 0)
+++
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/model/DefaultEventListenerContainer.java 2009-04-17
22:00:33 UTC (rev 14814)
@@ -0,0 +1,27 @@
+package org.jboss.tools.flow.jpdl4.model;
+
+import java.util.ArrayList;
+import java.util.List;
+
+public class DefaultEventListenerContainer {
+
+ private String eventName;
+ private List<EventListener> eventListeners = new
ArrayList<EventListener>();
+
+ public String getEventName() {
+ return eventName;
+ }
+
+ public void setEventName(String eventName) {
+ this.eventName = eventName;
+ }
+
+ public void addEventListener(EventListener eventListener) {
+ eventListeners.add(eventListener);
+ }
+
+ public void removeEventListener(EventListener eventListener) {
+ eventListeners.remove(eventListener);
+ }
+
+}
Property changes on:
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/model/DefaultEventListenerContainer.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added:
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/model/EventListener.java
===================================================================
---
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/model/EventListener.java
(rev 0)
+++
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/model/EventListener.java 2009-04-17
22:00:33 UTC (rev 14814)
@@ -0,0 +1,5 @@
+package org.jboss.tools.flow.jpdl4.model;
+
+public class EventListener {
+
+}
Property changes on:
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/model/EventListener.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added:
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
(rev 0)
+++
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/model/Swimlane.java 2009-04-17
22:00:33 UTC (rev 14814)
@@ -0,0 +1,7 @@
+package org.jboss.tools.flow.jpdl4.model;
+
+import org.jboss.tools.flow.common.model.DefaultContainer;
+
+public class Swimlane extends DefaultContainer {
+
+}
Property changes on:
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/model/Swimlane.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Show replies by date