Author: koen.aers(a)jboss.com
Date: 2008-10-16 14:16:26 -0400 (Thu, 16 Oct 2008)
New Revision: 10902
Modified:
trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/editpart/ConnectionEditPart.java
trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/registry/ElementRegistry.java
Log:
creation factory based on the element
Modified:
trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/editpart/ConnectionEditPart.java
===================================================================
---
trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/editpart/ConnectionEditPart.java 2008-10-16
18:06:45 UTC (rev 10901)
+++
trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/editpart/ConnectionEditPart.java 2008-10-16
18:16:26 UTC (rev 10902)
@@ -30,9 +30,9 @@
import org.eclipse.gef.editparts.AbstractConnectionEditPart;
import org.eclipse.gef.editpolicies.ConnectionEndpointEditPolicy;
import org.eclipse.gef.requests.CreationFactory;
-import org.eclipse.gef.requests.SimpleFactory;
import org.jboss.tools.flow.common.policy.ConnectionBendpointEditPolicy;
import org.jboss.tools.flow.common.policy.ConnectionEditPolicy;
+import org.jboss.tools.flow.common.registry.ElementRegistry;
import org.jboss.tools.flow.common.wrapper.ConnectionWrapper;
import org.jboss.tools.flow.common.wrapper.DefaultConnectionWrapper;
import org.jboss.tools.flow.common.wrapper.ModelEvent;
@@ -58,7 +58,7 @@
}
protected CreationFactory getElementConnectionFactory() {
- return new SimpleFactory(getElementConnectionType());
+ return ElementRegistry.getCreationFactory(getElementConnection().getElement());
}
Modified:
trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/registry/ElementRegistry.java
===================================================================
---
trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/registry/ElementRegistry.java 2008-10-16
18:06:45 UTC (rev 10901)
+++
trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/registry/ElementRegistry.java 2008-10-16
18:16:26 UTC (rev 10902)
@@ -339,5 +339,15 @@
}
};
}
+
+ public static CreationFactory getCreationFactory(Element element) {
+ String id = null;
+ IConfigurationElement configurationElement =
+ (IConfigurationElement)element.getMetaData("configurationElement");
+ if (configurationElement != null) {
+ id = configurationElement.getAttribute("id");
+ }
+ return id == null ? null : getCreationFactory(id);
+ }
}
Show replies by date