Author: koen.aers(a)jboss.com
Date: 2008-07-30 06:08:26 -0400 (Wed, 30 Jul 2008)
New Revision: 9422
Removed:
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4.graph/src/org/jboss/tools/flow/jpdl4/graph/wrapper/TransitionWrapperFactory.java
Modified:
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4.graph/src/org/jboss/tools/flow/jpdl4/graph/editor/JpdlPaletteFactory.java
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4.graph/src/org/jboss/tools/flow/jpdl4/graph/editpart/TransitionEditPart.java
Log:
refactor PaletteFactory, ditch ConnectionFactory
Modified:
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4.graph/src/org/jboss/tools/flow/jpdl4/graph/editor/JpdlPaletteFactory.java
===================================================================
---
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4.graph/src/org/jboss/tools/flow/jpdl4/graph/editor/JpdlPaletteFactory.java 2008-07-30
10:08:06 UTC (rev 9421)
+++
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4.graph/src/org/jboss/tools/flow/jpdl4/graph/editor/JpdlPaletteFactory.java 2008-07-30
10:08:26 UTC (rev 9422)
@@ -7,24 +7,18 @@
import org.eclipse.gef.palette.ConnectionCreationToolEntry;
import org.eclipse.gef.palette.PaletteEntry;
import org.eclipse.gef.palette.ToolEntry;
-import org.eclipse.gef.requests.CreationFactory;
import org.eclipse.gef.requests.SimpleFactory;
import org.eclipse.jface.resource.ImageDescriptor;
import org.jboss.tools.flow.editor.PaletteFactory;
-import org.jboss.tools.flow.editor.core.AbstractConnectionWrapper;
import org.jboss.tools.flow.jpdl4.graph.Activator;
import org.jboss.tools.flow.jpdl4.graph.wrapper.EndStateWrapper;
import org.jboss.tools.flow.jpdl4.graph.wrapper.StartStateWrapper;
import org.jboss.tools.flow.jpdl4.graph.wrapper.StateWrapper;
import org.jboss.tools.flow.jpdl4.graph.wrapper.SuperStateWrapper;
-import org.jboss.tools.flow.jpdl4.graph.wrapper.TransitionWrapperFactory;
+import org.jboss.tools.flow.jpdl4.graph.wrapper.TransitionWrapper;
public class JpdlPaletteFactory extends PaletteFactory {
- public JpdlPaletteFactory() {
- super(new TransitionWrapperFactory());
- }
-
protected List<PaletteEntry> createComponentEntries() {
List<PaletteEntry> entries = new ArrayList<PaletteEntry>();
@@ -71,14 +65,15 @@
ToolEntry tool = new ConnectionCreationToolEntry(
"Transition",
"Creating a new Transition",
- new CreationFactory() {
- public Object getNewObject() {
- return connectionFactory.createElementConnection();
- }
- public Object getObjectType() {
- return AbstractConnectionWrapper.class;
- }
- },
+ new SimpleFactory(TransitionWrapper.class),
+// new CreationFactory() {
+// public Object getNewObject() {
+// return new TransitionWrapper();
+// }
+// public Object getObjectType() {
+// return AbstractConnectionWrapper.class;
+// }
+// },
ImageDescriptor.createFromURL(Activator.getDefault().getBundle().getEntry("icons/transition.gif")),
ImageDescriptor.createFromURL(Activator.getDefault().getBundle().getEntry("icons/transition.gif"))
);
Modified:
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4.graph/src/org/jboss/tools/flow/jpdl4/graph/editpart/TransitionEditPart.java
===================================================================
---
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4.graph/src/org/jboss/tools/flow/jpdl4/graph/editpart/TransitionEditPart.java 2008-07-30
10:08:06 UTC (rev 9421)
+++
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4.graph/src/org/jboss/tools/flow/jpdl4/graph/editpart/TransitionEditPart.java 2008-07-30
10:08:26 UTC (rev 9422)
@@ -1,13 +1,12 @@
package org.jboss.tools.flow.jpdl4.graph.editpart;
-import org.jboss.tools.flow.editor.core.ConnectionFactory;
import org.jboss.tools.flow.editor.editpart.ConnectionEditPart;
-import org.jboss.tools.flow.jpdl4.graph.wrapper.TransitionWrapperFactory;
+import org.jboss.tools.flow.jpdl4.graph.wrapper.TransitionWrapper;
public class TransitionEditPart extends ConnectionEditPart {
- protected ConnectionFactory getElementConnectionFactory() {
- return new TransitionWrapperFactory();
- }
+ protected Class<?> getElementConnectionType() {
+ return TransitionWrapper.class;
+ }
}
Deleted:
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4.graph/src/org/jboss/tools/flow/jpdl4/graph/wrapper/TransitionWrapperFactory.java
===================================================================
---
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4.graph/src/org/jboss/tools/flow/jpdl4/graph/wrapper/TransitionWrapperFactory.java 2008-07-30
10:08:06 UTC (rev 9421)
+++
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4.graph/src/org/jboss/tools/flow/jpdl4/graph/wrapper/TransitionWrapperFactory.java 2008-07-30
10:08:26 UTC (rev 9422)
@@ -1,12 +0,0 @@
-package org.jboss.tools.flow.jpdl4.graph.wrapper;
-
-import org.jboss.tools.flow.editor.core.AbstractConnectionWrapper;
-import org.jboss.tools.flow.editor.core.ConnectionFactory;
-
-public class TransitionWrapperFactory implements ConnectionFactory {
-
- public AbstractConnectionWrapper createElementConnection() {
- return new TransitionWrapper();
- }
-
-}
Show replies by date