Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormgolubev2013-11-27 11:12:07 -0500
committermgolubev2013-11-27 11:17:25 -0500
commit626089c3f017634fd6d9bad62eb9658176c3dcac (patch)
tree4fc544d15fd1415a7811b0011698a3d4fc168e28
parent804679a44acc787f2a615db4bacc2f6ae48aa976 (diff)
downloadorg.eclipse.gmf-tooling-626089c3f017634fd6d9bad62eb9658176c3dcac.tar.gz
org.eclipse.gmf-tooling-626089c3f017634fd6d9bad62eb9658176c3dcac.tar.xz
org.eclipse.gmf-tooling-626089c3f017634fd6d9bad62eb9658176c3dcac.zip
[368521] - separate modeling-assistant code from editpart code
with respect to comments on https://git.eclipse.org/r/#/c/18665/ (+ taipan sample regenerated with changes) Change-Id: Iaa50405810674905cf7cfc5993a147141f0d4258
-rw-r--r--examples/org.eclipse.gmf.examples.taipan.gmf.editor/plugin.xml29
-rw-r--r--examples/org.eclipse.gmf.examples.taipan.gmf.editor/src/org/eclipse/gmf/examples/taipan/gmf/editor/edit/parts/PortEditPart.java77
-rw-r--r--examples/org.eclipse.gmf.examples.taipan.gmf.editor/src/org/eclipse/gmf/examples/taipan/gmf/editor/edit/parts/ShipEditPart.java54
-rw-r--r--examples/org.eclipse.gmf.examples.taipan.gmf.editor/src/org/eclipse/gmf/examples/taipan/gmf/editor/edit/parts/ShipLargeCargoEditPart.java24
-rw-r--r--examples/org.eclipse.gmf.examples.taipan.gmf.editor/src/org/eclipse/gmf/examples/taipan/gmf/editor/edit/parts/ShipSmallCargoEditPart.java21
-rw-r--r--examples/org.eclipse.gmf.examples.taipan.gmf.editor/src/org/eclipse/gmf/examples/taipan/gmf/editor/edit/parts/WarshipEditPart.java70
-rw-r--r--examples/org.eclipse.gmf.examples.taipan.gmf.editor/src/org/eclipse/gmf/examples/taipan/gmf/editor/edit/parts/WarshipLargeCargoEditPart.java24
-rw-r--r--examples/org.eclipse.gmf.examples.taipan.gmf.editor/src/org/eclipse/gmf/examples/taipan/gmf/editor/edit/parts/WarshipSmallCargoEditPart.java21
-rw-r--r--examples/org.eclipse.gmf.examples.taipan.gmf.editor/src/org/eclipse/gmf/examples/taipan/gmf/editor/part/TaiPanDiagramEditor.java37
-rw-r--r--examples/org.eclipse.gmf.examples.taipan.gmf.editor/src/org/eclipse/gmf/examples/taipan/gmf/editor/part/TaiPanDiagramEditorPlugin.java39
-rw-r--r--examples/org.eclipse.gmf.examples.taipan.gmf.editor/src/org/eclipse/gmf/examples/taipan/gmf/editor/part/TaiPanElementChooserDialog.java316
-rw-r--r--examples/org.eclipse.gmf.examples.taipan.gmf.editor/src/org/eclipse/gmf/examples/taipan/gmf/editor/providers/TaiPanModelingAssistantProvider.java123
-rw-r--r--examples/org.eclipse.gmf.examples.taipan.gmf.editor/src/org/eclipse/gmf/examples/taipan/gmf/editor/providers/TaiPanViewProvider.java10
-rw-r--r--examples/org.eclipse.gmf.examples.taipan.gmf.editor/src/org/eclipse/gmf/examples/taipan/gmf/editor/providers/assistants/TaiPanModelingAssistantProviderOfAquatoryEditPart.java39
-rw-r--r--examples/org.eclipse.gmf.examples.taipan.gmf.editor/src/org/eclipse/gmf/examples/taipan/gmf/editor/providers/assistants/TaiPanModelingAssistantProviderOfEmptyBoxEditPart.java21
-rw-r--r--examples/org.eclipse.gmf.examples.taipan.gmf.editor/src/org/eclipse/gmf/examples/taipan/gmf/editor/providers/assistants/TaiPanModelingAssistantProviderOfLargeItemEditPart.java21
-rw-r--r--examples/org.eclipse.gmf.examples.taipan.gmf.editor/src/org/eclipse/gmf/examples/taipan/gmf/editor/providers/assistants/TaiPanModelingAssistantProviderOfPortEditPart.java155
-rw-r--r--examples/org.eclipse.gmf.examples.taipan.gmf.editor/src/org/eclipse/gmf/examples/taipan/gmf/editor/providers/assistants/TaiPanModelingAssistantProviderOfShipEditPart.java141
-rw-r--r--examples/org.eclipse.gmf.examples.taipan.gmf.editor/src/org/eclipse/gmf/examples/taipan/gmf/editor/providers/assistants/TaiPanModelingAssistantProviderOfSmallItemsEditPart.java21
-rw-r--r--examples/org.eclipse.gmf.examples.taipan.gmf.editor/src/org/eclipse/gmf/examples/taipan/gmf/editor/providers/assistants/TaiPanModelingAssistantProviderOfWarshipEditPart.java158
-rw-r--r--plugins/org.eclipse.gmf.codegen/META-INF/MANIFEST.MF2
-rw-r--r--plugins/org.eclipse.gmf.codegen/pom.xml2
-rw-r--r--plugins/org.eclipse.gmf.codegen/src/org/eclipse/gmf/codegen/util/CodegenEmitters.java59
-rw-r--r--plugins/org.eclipse.gmf.codegen/src/org/eclipse/gmf/codegen/util/Generator.java9
-rw-r--r--plugins/org.eclipse.gmf.codegen/templates/diagram/editparts/ChildNodeLabelEditPart.xpt14
-rw-r--r--plugins/org.eclipse.gmf.codegen/templates/diagram/editparts/NodeEditPart.xpt14
-rw-r--r--plugins/org.eclipse.gmf.codegen/templates/impl/diagram/editparts/NodeEditPart.xpt72
-rw-r--r--plugins/org.eclipse.gmf.codegen/templates/xpt/providers/ModelingAssistantProvider.xpt135
-rw-r--r--plugins/org.eclipse.gmf.codegen/templates/xpt/providers/extensions.xpt40
29 files changed, 876 insertions, 872 deletions
diff --git a/examples/org.eclipse.gmf.examples.taipan.gmf.editor/plugin.xml b/examples/org.eclipse.gmf.examples.taipan.gmf.editor/plugin.xml
index 189450a64..dc08b22ae 100644
--- a/examples/org.eclipse.gmf.examples.taipan.gmf.editor/plugin.xml
+++ b/examples/org.eclipse.gmf.examples.taipan.gmf.editor/plugin.xml
@@ -292,17 +292,42 @@ Contributors:
<extension point="org.eclipse.gmf.runtime.emf.ui.modelingAssistantProviders" id="modelassist-provider">
<?gmfgen generated="true"?>
- <modelingAssistantProvider class="org.eclipse.gmf.examples.taipan.gmf.editor.providers.TaiPanModelingAssistantProvider">
+ <modelingAssistantProvider class="org.eclipse.gmf.examples.taipan.gmf.editor.providers.assistants.TaiPanModelingAssistantProviderOfAquatoryEditPart">
<Priority name="Lowest"/>
<object class="org.eclipse.gmf.examples.taipan.gmf.editor.edit.parts.AquatoryEditPart" id="Aquatory_1000"/>
+ <context elements="Aquatory_1000"/>
+ </modelingAssistantProvider>
+ <modelingAssistantProvider class="org.eclipse.gmf.examples.taipan.gmf.editor.providers.assistants.TaiPanModelingAssistantProviderOfPortEditPart">
+ <Priority name="Lowest"/>
<object class="org.eclipse.gmf.examples.taipan.gmf.editor.edit.parts.PortEditPart" id="Port_2001"/>
+ <context elements="Port_2001"/>
+ </modelingAssistantProvider>
+ <modelingAssistantProvider class="org.eclipse.gmf.examples.taipan.gmf.editor.providers.assistants.TaiPanModelingAssistantProviderOfShipEditPart">
+ <Priority name="Lowest"/>
<object class="org.eclipse.gmf.examples.taipan.gmf.editor.edit.parts.ShipEditPart" id="Ship_2002"/>
+ <context elements="Ship_2002"/>
+ </modelingAssistantProvider>
+ <modelingAssistantProvider class="org.eclipse.gmf.examples.taipan.gmf.editor.providers.assistants.TaiPanModelingAssistantProviderOfWarshipEditPart">
+ <Priority name="Lowest"/>
<object class="org.eclipse.gmf.examples.taipan.gmf.editor.edit.parts.WarshipEditPart" id="Warship_2003"/>
+ <context elements="Warship_2003"/>
+ </modelingAssistantProvider>
+ <modelingAssistantProvider class="org.eclipse.gmf.examples.taipan.gmf.editor.providers.assistants.TaiPanModelingAssistantProviderOfSmallItemsEditPart">
+ <Priority name="Lowest"/>
<object class="org.eclipse.gmf.examples.taipan.gmf.editor.edit.parts.SmallItemsEditPart" id="SmallItems_3001"/>
+ <context elements="SmallItems_3001"/>
+ </modelingAssistantProvider>
+ <modelingAssistantProvider class="org.eclipse.gmf.examples.taipan.gmf.editor.providers.assistants.TaiPanModelingAssistantProviderOfLargeItemEditPart">
+ <Priority name="Lowest"/>
<object class="org.eclipse.gmf.examples.taipan.gmf.editor.edit.parts.LargeItemEditPart" id="LargeItem_3002"/>
+ <context elements="LargeItem_3002"/>
+ </modelingAssistantProvider>
+ <modelingAssistantProvider class="org.eclipse.gmf.examples.taipan.gmf.editor.providers.assistants.TaiPanModelingAssistantProviderOfEmptyBoxEditPart">
+ <Priority name="Lowest"/>
<object class="org.eclipse.gmf.examples.taipan.gmf.editor.edit.parts.EmptyBoxEditPart" id="EmptyBox_3003"/>
- <context elements="Aquatory_1000,Port_2001,Ship_2002,Warship_2003,SmallItems_3001,LargeItem_3002,EmptyBox_3003"/>
+ <context elements="EmptyBox_3003"/>
</modelingAssistantProvider>
+
</extension>
<extension point="org.eclipse.gmf.runtime.common.ui.services.iconProviders" id="icon-provider">
diff --git a/examples/org.eclipse.gmf.examples.taipan.gmf.editor/src/org/eclipse/gmf/examples/taipan/gmf/editor/edit/parts/PortEditPart.java b/examples/org.eclipse.gmf.examples.taipan.gmf.editor/src/org/eclipse/gmf/examples/taipan/gmf/editor/edit/parts/PortEditPart.java
index 26fbde712..25af0a92e 100644
--- a/examples/org.eclipse.gmf.examples.taipan.gmf.editor/src/org/eclipse/gmf/examples/taipan/gmf/editor/edit/parts/PortEditPart.java
+++ b/examples/org.eclipse.gmf.examples.taipan.gmf.editor/src/org/eclipse/gmf/examples/taipan/gmf/editor/edit/parts/PortEditPart.java
@@ -256,83 +256,6 @@ public class PortEditPart extends AbstractBorderedShapeEditPart {
/**
* @generated
*/
- public List<IElementType> getMARelTypesOnSource() {
- ArrayList<IElementType> types = new ArrayList<IElementType>(3);
- types.add(TaiPanElementTypes.Route_4002);
- types.add(TaiPanElementTypes.Route_4003);
- types.add(TaiPanElementTypes.PortRegister_4007);
- return types;
- }
-
- /**
- * @generated
- */
- public List<IElementType> getMARelTypesOnSourceAndTarget(IGraphicalEditPart targetEditPart) {
- LinkedList<IElementType> types = new LinkedList<IElementType>();
- if (targetEditPart instanceof org.eclipse.gmf.examples.taipan.gmf.editor.edit.parts.PortEditPart) {
- types.add(TaiPanElementTypes.Route_4002);
- }
- if (targetEditPart instanceof org.eclipse.gmf.examples.taipan.gmf.editor.edit.parts.PortEditPart) {
- types.add(TaiPanElementTypes.Route_4003);
- }
- if (targetEditPart instanceof ShipEditPart) {
- types.add(TaiPanElementTypes.PortRegister_4007);
- }
- if (targetEditPart instanceof WarshipEditPart) {
- types.add(TaiPanElementTypes.PortRegister_4007);
- }
- return types;
- }
-
- /**
- * @generated
- */
- public List<IElementType> getMATypesForTarget(IElementType relationshipType) {
- LinkedList<IElementType> types = new LinkedList<IElementType>();
- if (relationshipType == TaiPanElementTypes.Route_4002) {
- types.add(TaiPanElementTypes.Port_2001);
- } else if (relationshipType == TaiPanElementTypes.Route_4003) {
- types.add(TaiPanElementTypes.Port_2001);
- } else if (relationshipType == TaiPanElementTypes.PortRegister_4007) {
- types.add(TaiPanElementTypes.Ship_2002);
- types.add(TaiPanElementTypes.Warship_2003);
- }
- return types;
- }
-
- /**
- * @generated
- */
- public List<IElementType> getMARelTypesOnTarget() {
- ArrayList<IElementType> types = new ArrayList<IElementType>(4);
- types.add(TaiPanElementTypes.ShipDestination_4001);
- types.add(TaiPanElementTypes.Route_4002);
- types.add(TaiPanElementTypes.Route_4003);
- types.add(TaiPanElementTypes.BesiegePortOrder_4005);
- return types;
- }
-
- /**
- * @generated
- */
- public List<IElementType> getMATypesForSource(IElementType relationshipType) {
- LinkedList<IElementType> types = new LinkedList<IElementType>();
- if (relationshipType == TaiPanElementTypes.ShipDestination_4001) {
- types.add(TaiPanElementTypes.Ship_2002);
- types.add(TaiPanElementTypes.Warship_2003);
- } else if (relationshipType == TaiPanElementTypes.Route_4002) {
- types.add(TaiPanElementTypes.Port_2001);
- } else if (relationshipType == TaiPanElementTypes.Route_4003) {
- types.add(TaiPanElementTypes.Port_2001);
- } else if (relationshipType == TaiPanElementTypes.BesiegePortOrder_4005) {
- types.add(TaiPanElementTypes.Warship_2003);
- }
- return types;
- }
-
- /**
- * @generated
- */
protected void handleNotificationEvent(Notification event) {
if (event.getNotifier() == getModel() && EcorePackage.eINSTANCE.getEModelElement_EAnnotations().equals(event.getFeature())) {
handleMajorSemanticChange();
diff --git a/examples/org.eclipse.gmf.examples.taipan.gmf.editor/src/org/eclipse/gmf/examples/taipan/gmf/editor/edit/parts/ShipEditPart.java b/examples/org.eclipse.gmf.examples.taipan.gmf.editor/src/org/eclipse/gmf/examples/taipan/gmf/editor/edit/parts/ShipEditPart.java
index b7940ee01..d98951a94 100644
--- a/examples/org.eclipse.gmf.examples.taipan.gmf.editor/src/org/eclipse/gmf/examples/taipan/gmf/editor/edit/parts/ShipEditPart.java
+++ b/examples/org.eclipse.gmf.examples.taipan.gmf.editor/src/org/eclipse/gmf/examples/taipan/gmf/editor/edit/parts/ShipEditPart.java
@@ -270,60 +270,6 @@ public class ShipEditPart extends ShapeNodeEditPart {
/**
* @generated
*/
- public List<IElementType> getMARelTypesOnSource() {
- ArrayList<IElementType> types = new ArrayList<IElementType>(1);
- types.add(TaiPanElementTypes.ShipDestination_4001);
- return types;
- }
-
- /**
- * @generated
- */
- public List<IElementType> getMARelTypesOnSourceAndTarget(IGraphicalEditPart targetEditPart) {
- LinkedList<IElementType> types = new LinkedList<IElementType>();
- if (targetEditPart instanceof PortEditPart) {
- types.add(TaiPanElementTypes.ShipDestination_4001);
- }
- return types;
- }
-
- /**
- * @generated
- */
- public List<IElementType> getMATypesForTarget(IElementType relationshipType) {
- LinkedList<IElementType> types = new LinkedList<IElementType>();
- if (relationshipType == TaiPanElementTypes.ShipDestination_4001) {
- types.add(TaiPanElementTypes.Port_2001);
- }
- return types;
- }
-
- /**
- * @generated
- */
- public List<IElementType> getMARelTypesOnTarget() {
- ArrayList<IElementType> types = new ArrayList<IElementType>(2);
- types.add(TaiPanElementTypes.EscortShipsOrder_4006);
- types.add(TaiPanElementTypes.PortRegister_4007);
- return types;
- }
-
- /**
- * @generated
- */
- public List<IElementType> getMATypesForSource(IElementType relationshipType) {
- LinkedList<IElementType> types = new LinkedList<IElementType>();
- if (relationshipType == TaiPanElementTypes.EscortShipsOrder_4006) {
- types.add(TaiPanElementTypes.Warship_2003);
- } else if (relationshipType == TaiPanElementTypes.PortRegister_4007) {
- types.add(TaiPanElementTypes.Port_2001);
- }
- return types;
- }
-
- /**
- * @generated
- */
public EditPart getTargetEditPart(Request request) {
if (request instanceof CreateViewAndElementRequest) {
CreateElementRequestAdapter adapter = ((CreateViewAndElementRequest) request).getViewAndElementDescriptor().getCreateElementRequestAdapter();
diff --git a/examples/org.eclipse.gmf.examples.taipan.gmf.editor/src/org/eclipse/gmf/examples/taipan/gmf/editor/edit/parts/ShipLargeCargoEditPart.java b/examples/org.eclipse.gmf.examples.taipan.gmf.editor/src/org/eclipse/gmf/examples/taipan/gmf/editor/edit/parts/ShipLargeCargoEditPart.java
index c9810c431..86451603f 100644
--- a/examples/org.eclipse.gmf.examples.taipan.gmf.editor/src/org/eclipse/gmf/examples/taipan/gmf/editor/edit/parts/ShipLargeCargoEditPart.java
+++ b/examples/org.eclipse.gmf.examples.taipan.gmf.editor/src/org/eclipse/gmf/examples/taipan/gmf/editor/edit/parts/ShipLargeCargoEditPart.java
@@ -12,16 +12,22 @@
package org.eclipse.gmf.examples.taipan.gmf.editor.edit.parts;
import org.eclipse.draw2d.IFigure;
+import org.eclipse.gef.EditPart;
+import org.eclipse.gef.Request;
import org.eclipse.gmf.examples.taipan.gmf.editor.edit.policies.ShipLargeCargoCanonicalEditPolicy;
import org.eclipse.gmf.examples.taipan.gmf.editor.edit.policies.ShipLargeCargoItemSemanticEditPolicy;
import org.eclipse.gmf.examples.taipan.gmf.editor.part.Messages;
import org.eclipse.gmf.examples.taipan.gmf.editor.part.TaiPanVisualIDRegistry;
+import org.eclipse.gmf.examples.taipan.gmf.editor.providers.TaiPanElementTypes;
+import org.eclipse.gmf.runtime.diagram.core.edithelpers.CreateElementRequestAdapter;
import org.eclipse.gmf.runtime.diagram.ui.editparts.ShapeCompartmentEditPart;
import org.eclipse.gmf.runtime.diagram.ui.editpolicies.CreationEditPolicy;
import org.eclipse.gmf.runtime.diagram.ui.editpolicies.DragDropEditPolicy;
import org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles;
import org.eclipse.gmf.runtime.diagram.ui.figures.ResizableCompartmentFigure;
+import org.eclipse.gmf.runtime.diagram.ui.requests.CreateViewAndElementRequest;
import org.eclipse.gmf.runtime.draw2d.ui.figures.ConstrainedToolbarLayout;
+import org.eclipse.gmf.runtime.emf.type.core.IElementType;
import org.eclipse.gmf.runtime.notation.View;
import org.eclipse.gmf.tooling.runtime.edit.policies.reparent.CreationEditPolicyWithCustomReparent;
@@ -78,4 +84,22 @@ public class ShipLargeCargoEditPart extends ShapeCompartmentEditPart {
}
}
+ /**
+ * @generated
+ */
+ public EditPart getTargetEditPart(Request request) {
+ if (request instanceof CreateViewAndElementRequest) {
+ CreateElementRequestAdapter adapter = ((CreateViewAndElementRequest) request).getViewAndElementDescriptor().getCreateElementRequestAdapter();
+ IElementType type = (IElementType) adapter.getAdapter(IElementType.class);
+ if (type == TaiPanElementTypes.LargeItem_3002) {
+ return this;
+ }
+ if (type == TaiPanElementTypes.EmptyBox_3003) {
+ return this;
+ }
+ return getParent().getTargetEditPart(request);
+ }
+ return super.getTargetEditPart(request);
+ }
+
}
diff --git a/examples/org.eclipse.gmf.examples.taipan.gmf.editor/src/org/eclipse/gmf/examples/taipan/gmf/editor/edit/parts/ShipSmallCargoEditPart.java b/examples/org.eclipse.gmf.examples.taipan.gmf.editor/src/org/eclipse/gmf/examples/taipan/gmf/editor/edit/parts/ShipSmallCargoEditPart.java
index 6c72e4d79..f6aeb3b97 100644
--- a/examples/org.eclipse.gmf.examples.taipan.gmf.editor/src/org/eclipse/gmf/examples/taipan/gmf/editor/edit/parts/ShipSmallCargoEditPart.java
+++ b/examples/org.eclipse.gmf.examples.taipan.gmf.editor/src/org/eclipse/gmf/examples/taipan/gmf/editor/edit/parts/ShipSmallCargoEditPart.java
@@ -13,18 +13,24 @@ package org.eclipse.gmf.examples.taipan.gmf.editor.edit.parts;
import org.eclipse.draw2d.IFigure;
import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.gef.EditPart;
import org.eclipse.gef.EditPolicy;
+import org.eclipse.gef.Request;
import org.eclipse.gmf.examples.taipan.gmf.editor.edit.policies.ShipSmallCargoCanonicalEditPolicy;
import org.eclipse.gmf.examples.taipan.gmf.editor.edit.policies.ShipSmallCargoItemSemanticEditPolicy;
import org.eclipse.gmf.examples.taipan.gmf.editor.part.Messages;
import org.eclipse.gmf.examples.taipan.gmf.editor.part.TaiPanVisualIDRegistry;
+import org.eclipse.gmf.examples.taipan.gmf.editor.providers.TaiPanElementTypes;
+import org.eclipse.gmf.runtime.diagram.core.edithelpers.CreateElementRequestAdapter;
import org.eclipse.gmf.runtime.diagram.ui.editparts.ListCompartmentEditPart;
import org.eclipse.gmf.runtime.diagram.ui.editpolicies.CreationEditPolicy;
import org.eclipse.gmf.runtime.diagram.ui.editpolicies.DragDropEditPolicy;
import org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles;
import org.eclipse.gmf.runtime.diagram.ui.editpolicies.ResizableCompartmentEditPolicy;
import org.eclipse.gmf.runtime.diagram.ui.figures.ResizableCompartmentFigure;
+import org.eclipse.gmf.runtime.diagram.ui.requests.CreateViewAndElementRequest;
import org.eclipse.gmf.runtime.draw2d.ui.figures.ConstrainedToolbarLayout;
+import org.eclipse.gmf.runtime.emf.type.core.IElementType;
import org.eclipse.gmf.runtime.notation.View;
import org.eclipse.gmf.tooling.runtime.edit.policies.reparent.CreationEditPolicyWithCustomReparent;
@@ -89,4 +95,19 @@ public class ShipSmallCargoEditPart extends ListCompartmentEditPart {
}
}
+ /**
+ * @generated
+ */
+ public EditPart getTargetEditPart(Request request) {
+ if (request instanceof CreateViewAndElementRequest) {
+ CreateElementRequestAdapter adapter = ((CreateViewAndElementRequest) request).getViewAndElementDescriptor().getCreateElementRequestAdapter();
+ IElementType type = (IElementType) adapter.getAdapter(IElementType.class);
+ if (type == TaiPanElementTypes.SmallItems_3001) {
+ return this;
+ }
+ return getParent().getTargetEditPart(request);
+ }
+ return super.getTargetEditPart(request);
+ }
+
}
diff --git a/examples/org.eclipse.gmf.examples.taipan.gmf.editor/src/org/eclipse/gmf/examples/taipan/gmf/editor/edit/parts/WarshipEditPart.java b/examples/org.eclipse.gmf.examples.taipan.gmf.editor/src/org/eclipse/gmf/examples/taipan/gmf/editor/edit/parts/WarshipEditPart.java
index 438acaaba..4c14bd4dc 100644
--- a/examples/org.eclipse.gmf.examples.taipan.gmf.editor/src/org/eclipse/gmf/examples/taipan/gmf/editor/edit/parts/WarshipEditPart.java
+++ b/examples/org.eclipse.gmf.examples.taipan.gmf.editor/src/org/eclipse/gmf/examples/taipan/gmf/editor/edit/parts/WarshipEditPart.java
@@ -272,76 +272,6 @@ public class WarshipEditPart extends ShapeNodeEditPart {
/**
* @generated
*/
- public List<IElementType> getMARelTypesOnSource() {
- ArrayList<IElementType> types = new ArrayList<IElementType>(3);
- types.add(TaiPanElementTypes.ShipDestination_4001);
- types.add(TaiPanElementTypes.BesiegePortOrder_4005);
- types.add(TaiPanElementTypes.EscortShipsOrder_4006);
- return types;
- }
-
- /**
- * @generated
- */
- public List<IElementType> getMARelTypesOnSourceAndTarget(IGraphicalEditPart targetEditPart) {
- LinkedList<IElementType> types = new LinkedList<IElementType>();
- if (targetEditPart instanceof PortEditPart) {
- types.add(TaiPanElementTypes.ShipDestination_4001);
- }
- if (targetEditPart instanceof PortEditPart) {
- types.add(TaiPanElementTypes.BesiegePortOrder_4005);
- }
- if (targetEditPart instanceof ShipEditPart) {
- types.add(TaiPanElementTypes.EscortShipsOrder_4006);
- }
- if (targetEditPart instanceof org.eclipse.gmf.examples.taipan.gmf.editor.edit.parts.WarshipEditPart) {
- types.add(TaiPanElementTypes.EscortShipsOrder_4006);
- }
- return types;
- }
-
- /**
- * @generated
- */
- public List<IElementType> getMATypesForTarget(IElementType relationshipType) {
- LinkedList<IElementType> types = new LinkedList<IElementType>();
- if (relationshipType == TaiPanElementTypes.ShipDestination_4001) {
- types.add(TaiPanElementTypes.Port_2001);
- } else if (relationshipType == TaiPanElementTypes.BesiegePortOrder_4005) {
- types.add(TaiPanElementTypes.Port_2001);
- } else if (relationshipType == TaiPanElementTypes.EscortShipsOrder_4006) {
- types.add(TaiPanElementTypes.Ship_2002);
- types.add(TaiPanElementTypes.Warship_2003);
- }
- return types;
- }
-
- /**
- * @generated
- */
- public List<IElementType> getMARelTypesOnTarget() {
- ArrayList<IElementType> types = new ArrayList<IElementType>(2);
- types.add(TaiPanElementTypes.EscortShipsOrder_4006);
- types.add(TaiPanElementTypes.PortRegister_4007);
- return types;
- }
-
- /**
- * @generated
- */
- public List<IElementType> getMATypesForSource(IElementType relationshipType) {
- LinkedList<IElementType> types = new LinkedList<IElementType>();
- if (relationshipType == TaiPanElementTypes.EscortShipsOrder_4006) {
- types.add(TaiPanElementTypes.Warship_2003);
- } else if (relationshipType == TaiPanElementTypes.PortRegister_4007) {
- types.add(TaiPanElementTypes.Port_2001);
- }
- return types;
- }
-
- /**
- * @generated
- */
public EditPart getTargetEditPart(Request request) {
if (request instanceof CreateViewAndElementRequest) {
CreateElementRequestAdapter adapter = ((CreateViewAndElementRequest) request).getViewAndElementDescriptor().getCreateElementRequestAdapter();
diff --git a/examples/org.eclipse.gmf.examples.taipan.gmf.editor/src/org/eclipse/gmf/examples/taipan/gmf/editor/edit/parts/WarshipLargeCargoEditPart.java b/examples/org.eclipse.gmf.examples.taipan.gmf.editor/src/org/eclipse/gmf/examples/taipan/gmf/editor/edit/parts/WarshipLargeCargoEditPart.java
index 09bdb87f4..23c0772d6 100644
--- a/examples/org.eclipse.gmf.examples.taipan.gmf.editor/src/org/eclipse/gmf/examples/taipan/gmf/editor/edit/parts/WarshipLargeCargoEditPart.java
+++ b/examples/org.eclipse.gmf.examples.taipan.gmf.editor/src/org/eclipse/gmf/examples/taipan/gmf/editor/edit/parts/WarshipLargeCargoEditPart.java
@@ -12,15 +12,21 @@
package org.eclipse.gmf.examples.taipan.gmf.editor.edit.parts;
import org.eclipse.draw2d.IFigure;
+import org.eclipse.gef.EditPart;
+import org.eclipse.gef.Request;
import org.eclipse.gmf.examples.taipan.gmf.editor.edit.policies.WarshipLargeCargoCanonicalEditPolicy;
import org.eclipse.gmf.examples.taipan.gmf.editor.edit.policies.WarshipLargeCargoItemSemanticEditPolicy;
import org.eclipse.gmf.examples.taipan.gmf.editor.part.Messages;
import org.eclipse.gmf.examples.taipan.gmf.editor.part.TaiPanVisualIDRegistry;
+import org.eclipse.gmf.examples.taipan.gmf.editor.providers.TaiPanElementTypes;
+import org.eclipse.gmf.runtime.diagram.core.edithelpers.CreateElementRequestAdapter;
import org.eclipse.gmf.runtime.diagram.ui.editparts.ShapeCompartmentEditPart;
import org.eclipse.gmf.runtime.diagram.ui.editpolicies.DragDropEditPolicy;
import org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles;
import org.eclipse.gmf.runtime.diagram.ui.figures.ResizableCompartmentFigure;
+import org.eclipse.gmf.runtime.diagram.ui.requests.CreateViewAndElementRequest;
import org.eclipse.gmf.runtime.draw2d.ui.figures.ConstrainedToolbarLayout;
+import org.eclipse.gmf.runtime.emf.type.core.IElementType;
import org.eclipse.gmf.runtime.notation.View;
import org.eclipse.gmf.tooling.runtime.edit.policies.reparent.CreationEditPolicyWithCustomReparent;
@@ -77,4 +83,22 @@ public class WarshipLargeCargoEditPart extends ShapeCompartmentEditPart {
}
}
+ /**
+ * @generated
+ */
+ public EditPart getTargetEditPart(Request request) {
+ if (request instanceof CreateViewAndElementRequest) {
+ CreateElementRequestAdapter adapter = ((CreateViewAndElementRequest) request).getViewAndElementDescriptor().getCreateElementRequestAdapter();
+ IElementType type = (IElementType) adapter.getAdapter(IElementType.class);
+ if (type == TaiPanElementTypes.LargeItem_3002) {
+ return this;
+ }
+ if (type == TaiPanElementTypes.EmptyBox_3003) {
+ return this;
+ }
+ return getParent().getTargetEditPart(request);
+ }
+ return super.getTargetEditPart(request);
+ }
+
}
diff --git a/examples/org.eclipse.gmf.examples.taipan.gmf.editor/src/org/eclipse/gmf/examples/taipan/gmf/editor/edit/parts/WarshipSmallCargoEditPart.java b/examples/org.eclipse.gmf.examples.taipan.gmf.editor/src/org/eclipse/gmf/examples/taipan/gmf/editor/edit/parts/WarshipSmallCargoEditPart.java
index d6122ba80..4e1dc1d72 100644
--- a/examples/org.eclipse.gmf.examples.taipan.gmf.editor/src/org/eclipse/gmf/examples/taipan/gmf/editor/edit/parts/WarshipSmallCargoEditPart.java
+++ b/examples/org.eclipse.gmf.examples.taipan.gmf.editor/src/org/eclipse/gmf/examples/taipan/gmf/editor/edit/parts/WarshipSmallCargoEditPart.java
@@ -13,18 +13,24 @@ package org.eclipse.gmf.examples.taipan.gmf.editor.edit.parts;
import org.eclipse.draw2d.IFigure;
import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.gef.EditPart;
import org.eclipse.gef.EditPolicy;
+import org.eclipse.gef.Request;
import org.eclipse.gmf.examples.taipan.gmf.editor.edit.policies.WarshipSmallCargoCanonicalEditPolicy;
import org.eclipse.gmf.examples.taipan.gmf.editor.edit.policies.WarshipSmallCargoItemSemanticEditPolicy;
import org.eclipse.gmf.examples.taipan.gmf.editor.part.Messages;
import org.eclipse.gmf.examples.taipan.gmf.editor.part.TaiPanVisualIDRegistry;
+import org.eclipse.gmf.examples.taipan.gmf.editor.providers.TaiPanElementTypes;
+import org.eclipse.gmf.runtime.diagram.core.edithelpers.CreateElementRequestAdapter;
import org.eclipse.gmf.runtime.diagram.ui.editparts.ListCompartmentEditPart;
import org.eclipse.gmf.runtime.diagram.ui.editpolicies.CreationEditPolicy;
import org.eclipse.gmf.runtime.diagram.ui.editpolicies.DragDropEditPolicy;
import org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles;
import org.eclipse.gmf.runtime.diagram.ui.editpolicies.ResizableCompartmentEditPolicy;
import org.eclipse.gmf.runtime.diagram.ui.figures.ResizableCompartmentFigure;
+import org.eclipse.gmf.runtime.diagram.ui.requests.CreateViewAndElementRequest;
import org.eclipse.gmf.runtime.draw2d.ui.figures.ConstrainedToolbarLayout;
+import org.eclipse.gmf.runtime.emf.type.core.IElementType;
import org.eclipse.gmf.runtime.notation.View;
import org.eclipse.gmf.tooling.runtime.edit.policies.reparent.CreationEditPolicyWithCustomReparent;
@@ -89,4 +95,19 @@ public class WarshipSmallCargoEditPart extends ListCompartmentEditPart {
}
}
+ /**
+ * @generated
+ */
+ public EditPart getTargetEditPart(Request request) {
+ if (request instanceof CreateViewAndElementRequest) {
+ CreateElementRequestAdapter adapter = ((CreateViewAndElementRequest) request).getViewAndElementDescriptor().getCreateElementRequestAdapter();
+ IElementType type = (IElementType) adapter.getAdapter(IElementType.class);
+ if (type == TaiPanElementTypes.SmallItems_3001) {
+ return this;
+ }
+ return getParent().getTargetEditPart(request);
+ }
+ return super.getTargetEditPart(request);
+ }
+
}
diff --git a/examples/org.eclipse.gmf.examples.taipan.gmf.editor/src/org/eclipse/gmf/examples/taipan/gmf/editor/part/TaiPanDiagramEditor.java b/examples/org.eclipse.gmf.examples.taipan.gmf.editor/src/org/eclipse/gmf/examples/taipan/gmf/editor/part/TaiPanDiagramEditor.java
index 93a263ee3..c3b2f0479 100644
--- a/examples/org.eclipse.gmf.examples.taipan.gmf.editor/src/org/eclipse/gmf/examples/taipan/gmf/editor/part/TaiPanDiagramEditor.java
+++ b/examples/org.eclipse.gmf.examples.taipan.gmf.editor/src/org/eclipse/gmf/examples/taipan/gmf/editor/part/TaiPanDiagramEditor.java
@@ -44,6 +44,7 @@ import org.eclipse.gmf.runtime.diagram.ui.resources.editor.document.IDiagramDocu
import org.eclipse.gmf.runtime.diagram.ui.resources.editor.document.IDocument;
import org.eclipse.gmf.runtime.diagram.ui.resources.editor.document.IDocumentProvider;
import org.eclipse.gmf.runtime.diagram.ui.resources.editor.parts.DiagramDocumentEditor;
+import org.eclipse.gmf.tooling.runtime.part.LastClickPositionProvider;
import org.eclipse.jface.dialogs.ErrorDialog;
import org.eclipse.jface.dialogs.IMessageProvider;
import org.eclipse.jface.dialogs.MessageDialog;
@@ -80,6 +81,11 @@ public class TaiPanDiagramEditor extends DiagramDocumentEditor implements IGotoM
public static final String CONTEXT_ID = "org.eclipse.gmf.examples.taipan.gmf.editor.ui.diagramContext"; //$NON-NLS-1$
/**
+ * @generated
+ */
+ private LastClickPositionProvider myLastClickPositionProvider;
+
+ /**
* @generated
*/
public TaiPanDiagramEditor() {
@@ -273,6 +279,37 @@ public class TaiPanDiagramEditor extends DiagramDocumentEditor implements IGotoM
}
});
+ startupLastClickPositionProvider();
+ }
+
+ /**
+ * @generated
+ */
+ protected void startupLastClickPositionProvider() {
+ if (myLastClickPositionProvider == null) {
+ myLastClickPositionProvider = new LastClickPositionProvider(this);
+ myLastClickPositionProvider.attachToService();
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void shutDownLastClickPositionProvider() {
+ if (myLastClickPositionProvider != null) {
+ myLastClickPositionProvider.detachFromService();
+ myLastClickPositionProvider.dispose();
+ myLastClickPositionProvider = null;
+ }
+ }
+
+ /**
+ * @generated
+ */
+ @Override
+ public void dispose() {
+ shutDownLastClickPositionProvider();
+ super.dispose();
}
/**
diff --git a/examples/org.eclipse.gmf.examples.taipan.gmf.editor/src/org/eclipse/gmf/examples/taipan/gmf/editor/part/TaiPanDiagramEditorPlugin.java b/examples/org.eclipse.gmf.examples.taipan.gmf.editor/src/org/eclipse/gmf/examples/taipan/gmf/editor/part/TaiPanDiagramEditorPlugin.java
index e925beb5d..de2c18844 100644
--- a/examples/org.eclipse.gmf.examples.taipan.gmf.editor/src/org/eclipse/gmf/examples/taipan/gmf/editor/part/TaiPanDiagramEditorPlugin.java
+++ b/examples/org.eclipse.gmf.examples.taipan.gmf.editor/src/org/eclipse/gmf/examples/taipan/gmf/editor/part/TaiPanDiagramEditorPlugin.java
@@ -30,6 +30,7 @@ import org.eclipse.gmf.examples.taipan.gmf.editor.expressions.TaiPanOCLFactory;
import org.eclipse.gmf.examples.taipan.gmf.editor.providers.ElementInitializers;
import org.eclipse.gmf.examples.taipan.provider.TaiPanItemProviderAdapterFactory;
import org.eclipse.gmf.runtime.diagram.core.preferences.PreferencesHint;
+import org.eclipse.gmf.tooling.runtime.LogHelper;
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.swt.graphics.Image;
import org.eclipse.ui.plugin.AbstractUIPlugin;
@@ -46,6 +47,11 @@ public class TaiPanDiagramEditorPlugin extends AbstractUIPlugin {
public static final String ID = "org.eclipse.gmf.examples.taipan.gmf.editor"; //$NON-NLS-1$
/**
+ * @generated
+ */
+ private LogHelper myLogHelper;
+
+ /**
* @generated
*/
public static final PreferencesHint DIAGRAM_PREFERENCES_HINT = new PreferencesHint(ID);
@@ -92,6 +98,7 @@ public class TaiPanDiagramEditorPlugin extends AbstractUIPlugin {
public void start(BundleContext context) throws Exception {
super.start(context);
instance = this;
+ myLogHelper = new LogHelper(this);
PreferencesHint.registerPreferenceStore(DIAGRAM_PREFERENCES_HINT, getPreferenceStore());
adapterFactory = createAdapterFactory();
}
@@ -264,50 +271,34 @@ public class TaiPanDiagramEditorPlugin extends AbstractUIPlugin {
* @generated
*/
public void logError(String error) {
- logError(error, null);
+ getLogHelper().logError(error, null);
}
/**
* @generated
*/
public void logError(String error, Throwable throwable) {
- if (error == null && throwable != null) {
- error = throwable.getMessage();
- }
- getLog().log(new Status(IStatus.ERROR, TaiPanDiagramEditorPlugin.ID, IStatus.OK, error, throwable));
- debug(error, throwable);
+ getLogHelper().logError(error, throwable);
}
/**
* @generated
*/
public void logInfo(String message) {
- logInfo(message, null);
+ getLogHelper().logInfo(message, null);
}
/**
* @generated
*/
public void logInfo(String message, Throwable throwable) {
- if (message == null && throwable != null) {
- message = throwable.getMessage();
- }
- getLog().log(new Status(IStatus.INFO, TaiPanDiagramEditorPlugin.ID, IStatus.OK, message, throwable));
- debug(message, throwable);
+ getLogHelper().logInfo(message, throwable);
}
/**
- * @generated
- */
- private void debug(String message, Throwable throwable) {
- if (!isDebugging()) {
- return;
- }
- if (message != null) {
- System.err.println(message);
- }
- if (throwable != null) {
- throwable.printStackTrace();
- }
+ * @generated
+ */
+ public LogHelper getLogHelper() {
+ return myLogHelper;
}
}
diff --git a/examples/org.eclipse.gmf.examples.taipan.gmf.editor/src/org/eclipse/gmf/examples/taipan/gmf/editor/part/TaiPanElementChooserDialog.java b/examples/org.eclipse.gmf.examples.taipan.gmf.editor/src/org/eclipse/gmf/examples/taipan/gmf/editor/part/TaiPanElementChooserDialog.java
index 37f9305dc..ba9653dd2 100644
--- a/examples/org.eclipse.gmf.examples.taipan.gmf.editor/src/org/eclipse/gmf/examples/taipan/gmf/editor/part/TaiPanElementChooserDialog.java
+++ b/examples/org.eclipse.gmf.examples.taipan.gmf.editor/src/org/eclipse/gmf/examples/taipan/gmf/editor/part/TaiPanElementChooserDialog.java
@@ -19,6 +19,7 @@ import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.Path;
+import org.eclipse.emf.common.notify.AdapterFactory;
import org.eclipse.emf.common.util.URI;
import org.eclipse.emf.common.util.WrappedException;
import org.eclipse.emf.ecore.EObject;
@@ -30,12 +31,14 @@ import org.eclipse.emf.edit.provider.IWrapperItemProvider;
import org.eclipse.emf.edit.ui.provider.AdapterFactoryContentProvider;
import org.eclipse.emf.edit.ui.provider.AdapterFactoryLabelProvider;
import org.eclipse.emf.transaction.TransactionalEditingDomain;
+import org.eclipse.gmf.runtime.diagram.core.preferences.PreferencesHint;
import org.eclipse.gmf.runtime.diagram.core.services.ViewService;
import org.eclipse.gmf.runtime.diagram.core.util.ViewUtil;
import org.eclipse.gmf.runtime.emf.core.GMFEditingDomainFactory;
import org.eclipse.gmf.runtime.emf.core.util.EObjectAdapter;
import org.eclipse.gmf.runtime.notation.Node;
import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.gmf.tooling.runtime.part.DefaultElementChooserDialog;
import org.eclipse.jface.dialogs.Dialog;
import org.eclipse.jface.dialogs.IDialogConstants;
import org.eclipse.jface.viewers.ILabelProvider;
@@ -53,320 +56,95 @@ import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Shell;
+import org.eclipse.ui.model.BaseWorkbenchContentProvider;
import org.eclipse.ui.model.WorkbenchContentProvider;
import org.eclipse.ui.model.WorkbenchLabelProvider;
/**
* @generated
*/
-public class TaiPanElementChooserDialog extends Dialog {
-
- /**
- * @generated
- */
- private TreeViewer myTreeViewer;
-
- /**
- * @generated
- */
- private URI mySelectedModelElementURI;
-
- /**
- * @generated
- */
- private View myView;
-
- /**
- * @generated
- */
- private TransactionalEditingDomain myEditingDomain = GMFEditingDomainFactory.INSTANCE.createEditingDomain();
+public class TaiPanElementChooserDialog extends DefaultElementChooserDialog {
/**
* @generated
*/
public TaiPanElementChooserDialog(Shell parentShell, View view) {
- super(parentShell);
- setShellStyle(getShellStyle() | SWT.RESIZE);
- myView = view;
- }
-
- /**
- * @generated
- */
- protected Control createDialogArea(Composite parent) {
- Composite composite = (Composite) super.createDialogArea(parent);
- getShell().setText(Messages.TaiPanElementChooserDialog_SelectModelElementTitle);
- createModelBrowser(composite);
- return composite;
- }
-
- /**
- * @generated
- */
- protected Control createButtonBar(Composite parent) {
- Control buttonBar = super.createButtonBar(parent);
- setOkButtonEnabled(false);
- return buttonBar;
- }
-
- /**
- * @generated
- */
- private void createModelBrowser(Composite composite) {
- myTreeViewer = new TreeViewer(composite, SWT.SINGLE | SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER);
- GridData layoutData = new GridData(GridData.FILL_BOTH);
- layoutData.heightHint = 300;
- layoutData.widthHint = 300;
- myTreeViewer.getTree().setLayoutData(layoutData);
- myTreeViewer.setContentProvider(new ModelElementsTreeContentProvider());
- myTreeViewer.setLabelProvider(new ModelElementsTreeLabelProvider());
- myTreeViewer.setInput(ResourcesPlugin.getWorkspace().getRoot());
- myTreeViewer.addFilter(new ModelFilesFilter());
- myTreeViewer.addSelectionChangedListener(new OkButtonEnabler());
- }
-
- /**
- * @generated
- */
- private void setOkButtonEnabled(boolean enabled) {
- getButton(IDialogConstants.OK_ID).setEnabled(enabled);
- }
-
- /**
- * @generated
- */
- private boolean isValidModelFile(IFile file) {
- String fileExtension = file.getFullPath().getFileExtension();
- return "taipan".equals(fileExtension); //$NON-NLS-1$
- }
-
- /**
- * @generated
- */
- public URI getSelectedModelElementURI() {
- return mySelectedModelElementURI;
+ this(parentShell, view, false);
}
/**
- * @generated
- */
- public int open() {
- int result = super.open();
- for (Resource resource : myEditingDomain.getResourceSet().getResources()) {
- resource.unload();
- }
- myEditingDomain.dispose();
- return result;
+ * @generated
+ */
+ public TaiPanElementChooserDialog(Shell parentShell, View view, boolean allowMultiSelection) {
+ super(parentShell, view, new TaiPanElementChooserDialogContextImpl(allowMultiSelection));
}
/**
- * @generated
- */
- private class ModelElementsTreeContentProvider implements ITreeContentProvider {
+ * @generated
+ */
+ private static class TaiPanElementChooserDialogContextImpl implements DefaultElementChooserDialog.Context {
/**
- * @generated
- */
- private ITreeContentProvider myWorkbenchContentProvider = new WorkbenchContentProvider();
+ * @generated
+ */
+ private static final String[] FILE_EXTENSIONS = new String[] { "taipan" };
/**
- * @generated
- */
- private AdapterFactoryContentProvider myAdapterFctoryContentProvier = new AdapterFactoryContentProvider(TaiPanDiagramEditorPlugin.getInstance().getItemProvidersAdapterFactory());
+ * @generated
+ */
+ private final boolean myAllowMultiSelection;
/**
- * @generated
- */
- public Object[] getChildren(Object parentElement) {
- Object[] result = myWorkbenchContentProvider.getChildren(parentElement);
- if (result != null && result.length > 0) {
- return result;
- }
- if (parentElement instanceof IFile) {
- IFile modelFile = (IFile) parentElement;
- IPath resourcePath = modelFile.getFullPath();
- ResourceSet resourceSet = myEditingDomain.getResourceSet();
- try {
- Resource modelResource = resourceSet.getResource(URI.createPlatformResourceURI(resourcePath.toString(), true), true);
- return myAdapterFctoryContentProvier.getChildren(modelResource);
- } catch (WrappedException e) {
- TaiPanDiagramEditorPlugin.getInstance().logError("Unable to load resource: " + resourcePath.toString(), e); //$NON-NLS-1$
- }
- return Collections.EMPTY_LIST.toArray();
- }
- return myAdapterFctoryContentProvier.getChildren(parentElement);
+ * @generated
+ */
+ private TaiPanElementChooserDialogContextImpl(boolean allowMultiSelection) {
+ myAllowMultiSelection = allowMultiSelection;
}
/**
- * @generated
- */
- public Object getParent(Object element) {
- Object parent = myWorkbenchContentProvider.getParent(element);
- if (parent != null) {
- return parent;
- }
- if (element instanceof EObject) {
- EObject eObject = (EObject) element;
- if (eObject.eContainer() == null && eObject.eResource().getURI().isFile()) {
- String path = eObject.eResource().getURI().path();
- return ResourcesPlugin.getWorkspace().getRoot().getFileForLocation(new Path(path));
- }
- return myAdapterFctoryContentProvier.getParent(eObject);
- }
- return null;
- }
+ * @generated
+ */
- /**
- * @generated
- */
- public boolean hasChildren(Object element) {
- if (element instanceof IFile) {
- return isValidModelFile((IFile) element);
- }
- return myWorkbenchContentProvider.hasChildren(element) || myAdapterFctoryContentProvier.hasChildren(element);
+ public AdapterFactory getAdapterFactory() {
+ return TaiPanDiagramEditorPlugin.getInstance().getItemProvidersAdapterFactory();
}
/**
- * @generated
- */
- public Object[] getElements(Object inputElement) {
- Object[] elements = myWorkbenchContentProvider.getElements(inputElement);
- return elements;
- }
+ * @generated
+ */
- /**
- * @generated
- */
- public void dispose() {
- myWorkbenchContentProvider.dispose();
- myAdapterFctoryContentProvier.dispose();
+ public PreferencesHint getPreferenceHint() {
+ return TaiPanDiagramEditorPlugin.DIAGRAM_PREFERENCES_HINT;
}
/**
- * @generated
- */
- public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
- myWorkbenchContentProvider.inputChanged(viewer, oldInput, newInput);
- myAdapterFctoryContentProvier.inputChanged(viewer, oldInput, newInput);
- }
+ * @generated
+ */
- }
-
- /**
- * @generated
- */
- private class ModelElementsTreeLabelProvider implements ILabelProvider {
-
- /**
- * @generated
- */
- private WorkbenchLabelProvider myWorkbenchLabelProvider = new WorkbenchLabelProvider();
-
- /**
- * @generated
- */
- private AdapterFactoryLabelProvider myAdapterFactoryLabelProvider = new AdapterFactoryLabelProvider(TaiPanDiagramEditorPlugin.getInstance().getItemProvidersAdapterFactory());
-
- /**
- * @generated
- */
- public Image getImage(Object element) {
- Image result = myWorkbenchLabelProvider.getImage(element);
- return result != null ? result : myAdapterFactoryLabelProvider.getImage(element);
+ public String[] getFileExtesions() {
+ return FILE_EXTENSIONS.clone();
}
/**
- * @generated
- */
- public String getText(Object element) {
- String result = myWorkbenchLabelProvider.getText(element);
- return result != null && result.length() > 0 ? result : myAdapterFactoryLabelProvider.getText(element);
- }
+ * @generated
+ */
- /**
- * @generated
- */
- public void addListener(ILabelProviderListener listener) {
- myWorkbenchLabelProvider.addListener(listener);
- myAdapterFactoryLabelProvider.addListener(listener);
- }
-
- /**
- * @generated
- */
- public void dispose() {
- myWorkbenchLabelProvider.dispose();
- myAdapterFactoryLabelProvider.dispose();
+ public String getDialogTitle() {
+ return Messages.TaiPanElementChooserDialog_SelectModelElementTitle;
}
/**
- * @generated
- */
- public boolean isLabelProperty(Object element, String property) {
- return myWorkbenchLabelProvider.isLabelProperty(element, property) || myAdapterFactoryLabelProvider.isLabelProperty(element, property);
- }
-
- /**
- * @generated
- */
- public void removeListener(ILabelProviderListener listener) {
- myWorkbenchLabelProvider.removeListener(listener);
- myAdapterFactoryLabelProvider.removeListener(listener);
- }
-
- }
-
- /**
- * @generated
- */
- private class ModelFilesFilter extends ViewerFilter {
-
- /**
- * @generated
- */
- public boolean select(Viewer viewer, Object parentElement, Object element) {
- if (element instanceof IContainer) {
- return true;
- }
- if (element instanceof IFile) {
- IFile file = (IFile) element;
- return isValidModelFile(file);
- }
- return true;
+ * @generated
+ */
+ public ITreeContentProvider getTreeContentProvider() {
+ return new BaseWorkbenchContentProvider();
}
- }
-
- /**
- * @generated
- */
- private class OkButtonEnabler implements ISelectionChangedListener {
-
/**
- * @generated
- */
- public void selectionChanged(SelectionChangedEvent event) {
- if (event.getSelection() instanceof IStructuredSelection) {
- IStructuredSelection selection = (IStructuredSelection) event.getSelection();
- if (selection.size() == 1) {
- Object selectedElement = selection.getFirstElement();
- if (selectedElement instanceof IWrapperItemProvider) {
- selectedElement = ((IWrapperItemProvider) selectedElement).getValue();
- }
- if (selectedElement instanceof FeatureMap.Entry) {
- selectedElement = ((FeatureMap.Entry) selectedElement).getValue();
- }
- if (selectedElement instanceof EObject) {
- EObject selectedModelElement = (EObject) selectedElement;
- setOkButtonEnabled(ViewService.getInstance().provides(Node.class, new EObjectAdapter(selectedModelElement), myView, null, ViewUtil.APPEND, true,
- TaiPanDiagramEditorPlugin.DIAGRAM_PREFERENCES_HINT));
- mySelectedModelElementURI = EcoreUtil.getURI(selectedModelElement);
- return;
- }
- }
- }
- mySelectedModelElementURI = null;
- setOkButtonEnabled(false);
+ * @generated
+ */
+ public boolean allowMultiSelection() {
+ return myAllowMultiSelection;
}
}
diff --git a/examples/org.eclipse.gmf.examples.taipan.gmf.editor/src/org/eclipse/gmf/examples/taipan/gmf/editor/providers/TaiPanModelingAssistantProvider.java b/examples/org.eclipse.gmf.examples.taipan.gmf.editor/src/org/eclipse/gmf/examples/taipan/gmf/editor/providers/TaiPanModelingAssistantProvider.java
index 9a6171b7c..2150f4e63 100644
--- a/examples/org.eclipse.gmf.examples.taipan.gmf.editor/src/org/eclipse/gmf/examples/taipan/gmf/editor/providers/TaiPanModelingAssistantProvider.java
+++ b/examples/org.eclipse.gmf.examples.taipan.gmf.editor/src/org/eclipse/gmf/examples/taipan/gmf/editor/providers/TaiPanModelingAssistantProvider.java
@@ -48,129 +48,6 @@ public class TaiPanModelingAssistantProvider extends ModelingAssistantProvider {
/**
* @generated
*/
- public List getTypesForPopupBar(IAdaptable host) {
- IGraphicalEditPart editPart = (IGraphicalEditPart) host.getAdapter(IGraphicalEditPart.class);
- if (editPart instanceof AquatoryEditPart) {
- ArrayList<IElementType> types = new ArrayList<IElementType>(3);
- types.add(TaiPanElementTypes.Port_2001);
- types.add(TaiPanElementTypes.Ship_2002);
- types.add(TaiPanElementTypes.Warship_2003);
- return types;
- }
- if (editPart instanceof ShipEditPart) {
- ArrayList<IElementType> types = new ArrayList<IElementType>(1);
- types.add(TaiPanElementTypes.SmallItems_3001);
- return types;
- }
- if (editPart instanceof WarshipEditPart) {
- ArrayList<IElementType> types = new ArrayList<IElementType>(1);
- types.add(TaiPanElementTypes.SmallItems_3001);
- return types;
- }
- if (editPart instanceof ShipLargeCargoEditPart) {
- ArrayList<IElementType> types = new ArrayList<IElementType>(2);
- types.add(TaiPanElementTypes.LargeItem_3002);
- types.add(TaiPanElementTypes.EmptyBox_3003);
- return types;
- }
- if (editPart instanceof WarshipLargeCargoEditPart) {
- ArrayList<IElementType> types = new ArrayList<IElementType>(2);
- types.add(TaiPanElementTypes.LargeItem_3002);
- types.add(TaiPanElementTypes.EmptyBox_3003);
- return types;
- }
- return Collections.EMPTY_LIST;
- }
-
- /**
- * @generated
- */
- public List getRelTypesOnSource(IAdaptable source) {
- IGraphicalEditPart sourceEditPart = (IGraphicalEditPart) source.getAdapter(IGraphicalEditPart.class);
- if (sourceEditPart instanceof PortEditPart) {
- return ((PortEditPart) sourceEditPart).getMARelTypesOnSource();
- }
- if (sourceEditPart instanceof ShipEditPart) {
- return ((ShipEditPart) sourceEditPart).getMARelTypesOnSource();
- }
- if (sourceEditPart instanceof WarshipEditPart) {
- return ((WarshipEditPart) sourceEditPart).getMARelTypesOnSource();
- }
- return Collections.EMPTY_LIST;
- }
-
- /**
- * @generated
- */
- public List getRelTypesOnTarget(IAdaptable target) {
- IGraphicalEditPart targetEditPart = (IGraphicalEditPart) target.getAdapter(IGraphicalEditPart.class);
- if (targetEditPart instanceof PortEditPart) {
- return ((PortEditPart) targetEditPart).getMARelTypesOnTarget();
- }
- if (targetEditPart instanceof ShipEditPart) {
- return ((ShipEditPart) targetEditPart).getMARelTypesOnTarget();
- }
- if (targetEditPart instanceof WarshipEditPart) {
- return ((WarshipEditPart) targetEditPart).getMARelTypesOnTarget();
- }
- return Collections.EMPTY_LIST;
- }
-
- /**
- * @generated
- */
- public List getRelTypesOnSourceAndTarget(IAdaptable source, IAdaptable target) {
- IGraphicalEditPart sourceEditPart = (IGraphicalEditPart) source.getAdapter(IGraphicalEditPart.class);
- IGraphicalEditPart targetEditPart = (IGraphicalEditPart) target.getAdapter(IGraphicalEditPart.class);
- if (sourceEditPart instanceof PortEditPart) {
- return ((PortEditPart) sourceEditPart).getMARelTypesOnSourceAndTarget(targetEditPart);
- }
- if (sourceEditPart instanceof ShipEditPart) {
- return ((ShipEditPart) sourceEditPart).getMARelTypesOnSourceAndTarget(targetEditPart);
- }
- if (sourceEditPart instanceof WarshipEditPart) {
- return ((WarshipEditPart) sourceEditPart).getMARelTypesOnSourceAndTarget(targetEditPart);
- }
- return Collections.EMPTY_LIST;
- }
-
- /**
- * @generated
- */
- public List getTypesForSource(IAdaptable target, IElementType relationshipType) {
- IGraphicalEditPart targetEditPart = (IGraphicalEditPart) target.getAdapter(IGraphicalEditPart.class);
- if (targetEditPart instanceof PortEditPart) {
- return ((PortEditPart) targetEditPart).getMATypesForSource(relationshipType);
- }
- if (targetEditPart instanceof ShipEditPart) {
- return ((ShipEditPart) targetEditPart).getMATypesForSource(relationshipType);
- }
- if (targetEditPart instanceof WarshipEditPart) {
- return ((WarshipEditPart) targetEditPart).getMATypesForSource(relationshipType);
- }
- return Collections.EMPTY_LIST;
- }
-
- /**
- * @generated
- */
- public List getTypesForTarget(IAdaptable source, IElementType relationshipType) {
- IGraphicalEditPart sourceEditPart = (IGraphicalEditPart) source.getAdapter(IGraphicalEditPart.class);
- if (sourceEditPart instanceof PortEditPart) {
- return ((PortEditPart) sourceEditPart).getMATypesForTarget(relationshipType);
- }
- if (sourceEditPart instanceof ShipEditPart) {
- return ((ShipEditPart) sourceEditPart).getMATypesForTarget(relationshipType);
- }
- if (sourceEditPart instanceof WarshipEditPart) {
- return ((WarshipEditPart) sourceEditPart).getMATypesForTarget(relationshipType);
- }
- return Collections.EMPTY_LIST;
- }
-
- /**
- * @generated
- */
public EObject selectExistingElementForSource(IAdaptable target, IElementType relationshipType) {
return selectExistingElement(target, getTypesForSource(target, relationshipType));
}
diff --git a/examples/org.eclipse.gmf.examples.taipan.gmf.editor/src/org/eclipse/gmf/examples/taipan/gmf/editor/providers/TaiPanViewProvider.java b/examples/org.eclipse.gmf.examples.taipan.gmf.editor/src/org/eclipse/gmf/examples/taipan/gmf/editor/providers/TaiPanViewProvider.java
index ace191e6b..477ce410d 100644
--- a/examples/org.eclipse.gmf.examples.taipan.gmf.editor/src/org/eclipse/gmf/examples/taipan/gmf/editor/providers/TaiPanViewProvider.java
+++ b/examples/org.eclipse.gmf.examples.taipan.gmf.editor/src/org/eclipse/gmf/examples/taipan/gmf/editor/providers/TaiPanViewProvider.java
@@ -112,11 +112,11 @@ public class TaiPanViewProvider extends AbstractProvider implements IViewProvide
*/
protected boolean provides(CreateViewForKindOperation op) {
/*
- if (op.getViewKind() == Node.class)
- return getNodeViewClass(op.getSemanticAdapter(), op.getContainerView(), op.getSemanticHint()) != null;
- if (op.getViewKind() == Edge.class)
- return getEdgeViewClass(op.getSemanticAdapter(), op.getContainerView(), op.getSemanticHint()) != null;
- */
+ if (op.getViewKind() == Node.class)
+ return getNodeViewClass(op.getSemanticAdapter(), op.getContainerView(), op.getSemanticHint()) != null;
+ if (op.getViewKind() == Edge.class)
+ return getEdgeViewClass(op.getSemanticAdapter(), op.getContainerView(), op.getSemanticHint()) != null;
+ */
return true;
}
diff --git a/examples/org.eclipse.gmf.examples.taipan.gmf.editor/src/org/eclipse/gmf/examples/taipan/gmf/editor/providers/assistants/TaiPanModelingAssistantProviderOfAquatoryEditPart.java b/examples/org.eclipse.gmf.examples.taipan.gmf.editor/src/org/eclipse/gmf/examples/taipan/gmf/editor/providers/assistants/TaiPanModelingAssistantProviderOfAquatoryEditPart.java
new file mode 100644
index 000000000..f57b5e830
--- /dev/null
+++ b/examples/org.eclipse.gmf.examples.taipan.gmf.editor/src/org/eclipse/gmf/examples/taipan/gmf/editor/providers/assistants/TaiPanModelingAssistantProviderOfAquatoryEditPart.java
@@ -0,0 +1,39 @@
+/*
+ * Copyright (c) 2006, 2007 Borland Software Corporation
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Dmitry Stadnik (Borland) - initial API and implementation
+ */
+package org.eclipse.gmf.examples.taipan.gmf.editor.providers.assistants;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.gmf.examples.taipan.gmf.editor.providers.TaiPanElementTypes;
+import org.eclipse.gmf.examples.taipan.gmf.editor.providers.TaiPanModelingAssistantProvider;
+import org.eclipse.gmf.runtime.emf.type.core.IElementType;
+
+/**
+ * @generated
+ */
+public class TaiPanModelingAssistantProviderOfAquatoryEditPart extends TaiPanModelingAssistantProvider {
+
+ /**
+ * @generated
+ */
+ @Override
+ public List<IElementType> getTypesForPopupBar(IAdaptable host) {
+ List<IElementType> types = new ArrayList<IElementType>(3);
+ types.add(TaiPanElementTypes.Port_2001);
+ types.add(TaiPanElementTypes.Ship_2002);
+ types.add(TaiPanElementTypes.Warship_2003);
+ return types;
+ }
+
+}
diff --git a/examples/org.eclipse.gmf.examples.taipan.gmf.editor/src/org/eclipse/gmf/examples/taipan/gmf/editor/providers/assistants/TaiPanModelingAssistantProviderOfEmptyBoxEditPart.java b/examples/org.eclipse.gmf.examples.taipan.gmf.editor/src/org/eclipse/gmf/examples/taipan/gmf/editor/providers/assistants/TaiPanModelingAssistantProviderOfEmptyBoxEditPart.java
new file mode 100644
index 000000000..4c1fbef23
--- /dev/null
+++ b/examples/org.eclipse.gmf.examples.taipan.gmf.editor/src/org/eclipse/gmf/examples/taipan/gmf/editor/providers/assistants/TaiPanModelingAssistantProviderOfEmptyBoxEditPart.java
@@ -0,0 +1,21 @@
+/*
+ * Copyright (c) 2006, 2007 Borland Software Corporation
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Dmitry Stadnik (Borland) - initial API and implementation
+ */
+package org.eclipse.gmf.examples.taipan.gmf.editor.providers.assistants;
+
+import org.eclipse.gmf.examples.taipan.gmf.editor.providers.TaiPanModelingAssistantProvider;
+
+/**
+ * @generated
+ */
+public class TaiPanModelingAssistantProviderOfEmptyBoxEditPart extends TaiPanModelingAssistantProvider {
+
+}
diff --git a/examples/org.eclipse.gmf.examples.taipan.gmf.editor/src/org/eclipse/gmf/examples/taipan/gmf/editor/providers/assistants/TaiPanModelingAssistantProviderOfLargeItemEditPart.java b/examples/org.eclipse.gmf.examples.taipan.gmf.editor/src/org/eclipse/gmf/examples/taipan/gmf/editor/providers/assistants/TaiPanModelingAssistantProviderOfLargeItemEditPart.java
new file mode 100644
index 000000000..a03761656
--- /dev/null
+++ b/examples/org.eclipse.gmf.examples.taipan.gmf.editor/src/org/eclipse/gmf/examples/taipan/gmf/editor/providers/assistants/TaiPanModelingAssistantProviderOfLargeItemEditPart.java
@@ -0,0 +1,21 @@
+/*
+ * Copyright (c) 2006, 2007 Borland Software Corporation
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Dmitry Stadnik (Borland) - initial API and implementation
+ */
+package org.eclipse.gmf.examples.taipan.gmf.editor.providers.assistants;
+
+import org.eclipse.gmf.examples.taipan.gmf.editor.providers.TaiPanModelingAssistantProvider;
+
+/**
+ * @generated
+ */
+public class TaiPanModelingAssistantProviderOfLargeItemEditPart extends TaiPanModelingAssistantProvider {
+
+}
diff --git a/examples/org.eclipse.gmf.examples.taipan.gmf.editor/src/org/eclipse/gmf/examples/taipan/gmf/editor/providers/assistants/TaiPanModelingAssistantProviderOfPortEditPart.java b/examples/org.eclipse.gmf.examples.taipan.gmf.editor/src/org/eclipse/gmf/examples/taipan/gmf/editor/providers/assistants/TaiPanModelingAssistantProviderOfPortEditPart.java
new file mode 100644
index 000000000..195002fa6
--- /dev/null
+++ b/examples/org.eclipse.gmf.examples.taipan.gmf.editor/src/org/eclipse/gmf/examples/taipan/gmf/editor/providers/assistants/TaiPanModelingAssistantProviderOfPortEditPart.java
@@ -0,0 +1,155 @@
+/*
+ * Copyright (c) 2006, 2007 Borland Software Corporation
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Dmitry Stadnik (Borland) - initial API and implementation
+ */
+package org.eclipse.gmf.examples.taipan.gmf.editor.providers.assistants;
+
+import java.util.ArrayList;
+import java.util.LinkedList;
+import java.util.List;
+
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.gmf.examples.taipan.gmf.editor.edit.parts.PortEditPart;
+import org.eclipse.gmf.examples.taipan.gmf.editor.edit.parts.ShipEditPart;
+import org.eclipse.gmf.examples.taipan.gmf.editor.edit.parts.WarshipEditPart;
+import org.eclipse.gmf.examples.taipan.gmf.editor.providers.TaiPanElementTypes;
+import org.eclipse.gmf.examples.taipan.gmf.editor.providers.TaiPanModelingAssistantProvider;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
+import org.eclipse.gmf.runtime.emf.type.core.IElementType;
+
+/**
+ * @generated
+ */
+public class TaiPanModelingAssistantProviderOfPortEditPart extends TaiPanModelingAssistantProvider {
+
+ /**
+ * @generated
+ */
+ @Override
+ public List<IElementType> getRelTypesOnSource(IAdaptable source) {
+ IGraphicalEditPart sourceEditPart = (IGraphicalEditPart) source.getAdapter(IGraphicalEditPart.class);
+ return doGetRelTypesOnSource((PortEditPart) sourceEditPart);
+ }
+
+ /**
+ * @generated
+ */
+ public List<IElementType> doGetRelTypesOnSource(PortEditPart source) {
+ List<IElementType> types = new ArrayList<IElementType>(3);
+ types.add(TaiPanElementTypes.Route_4002);
+ types.add(TaiPanElementTypes.Route_4003);
+ types.add(TaiPanElementTypes.PortRegister_4007);
+ return types;
+ }
+
+ /**
+ * @generated
+ */
+ @Override
+ public List<IElementType> getRelTypesOnSourceAndTarget(IAdaptable source, IAdaptable target) {
+ IGraphicalEditPart sourceEditPart = (IGraphicalEditPart) source.getAdapter(IGraphicalEditPart.class);
+ IGraphicalEditPart targetEditPart = (IGraphicalEditPart) target.getAdapter(IGraphicalEditPart.class);
+ return doGetRelTypesOnSourceAndTarget((PortEditPart) sourceEditPart, targetEditPart);
+ }
+
+ /**
+ * @generated
+ */
+ public List<IElementType> doGetRelTypesOnSourceAndTarget(PortEditPart source, IGraphicalEditPart targetEditPart) {
+ List<IElementType> types = new LinkedList<IElementType>();
+ if (targetEditPart instanceof PortEditPart) {
+ types.add(TaiPanElementTypes.Route_4002);
+ }
+ if (targetEditPart instanceof PortEditPart) {
+ types.add(TaiPanElementTypes.Route_4003);
+ }
+ if (targetEditPart instanceof ShipEditPart) {
+ types.add(TaiPanElementTypes.PortRegister_4007);
+ }
+ if (targetEditPart instanceof WarshipEditPart) {
+ types.add(TaiPanElementTypes.PortRegister_4007);
+ }
+ return types;
+ }
+
+ /**
+ * @generated
+ */
+ @Override
+ public List<IElementType> getTypesForTarget(IAdaptable source, IElementType relationshipType) {
+ IGraphicalEditPart sourceEditPart = (IGraphicalEditPart) source.getAdapter(IGraphicalEditPart.class);
+ return doGetTypesForTarget((PortEditPart) sourceEditPart, relationshipType);
+ }
+
+ /**
+ * @generated
+ */
+ public List<IElementType> doGetTypesForTarget(PortEditPart source, IElementType relationshipType) {
+ List<IElementType> types = new ArrayList<IElementType>();
+ if (relationshipType == TaiPanElementTypes.Route_4002) {
+ types.add(TaiPanElementTypes.Port_2001);
+ } else if (relationshipType == TaiPanElementTypes.Route_4003) {
+ types.add(TaiPanElementTypes.Port_2001);
+ } else if (relationshipType == TaiPanElementTypes.PortRegister_4007) {
+ types.add(TaiPanElementTypes.Ship_2002);
+ types.add(TaiPanElementTypes.Warship_2003);
+ }
+ return types;
+ }
+
+ /**
+ * @generated
+ */
+ @Override
+ public List<IElementType> getRelTypesOnTarget(IAdaptable target) {
+ IGraphicalEditPart targetEditPart = (IGraphicalEditPart) target.getAdapter(IGraphicalEditPart.class);
+ return doGetRelTypesOnTarget((PortEditPart) targetEditPart);
+ }
+
+ /**
+ * @generated
+ */
+ public List<IElementType> doGetRelTypesOnTarget(PortEditPart target) {
+ List<IElementType> types = new ArrayList<IElementType>(4);
+ types.add(TaiPanElementTypes.ShipDestination_4001);
+ types.add(TaiPanElementTypes.Route_4002);
+ types.add(TaiPanElementTypes.Route_4003);
+ types.add(TaiPanElementTypes.BesiegePortOrder_4005);
+ return types;
+ }
+
+ /**
+ * @generated
+ */
+ @Override
+ public List<IElementType> getTypesForSource(IAdaptable target, IElementType relationshipType) {
+ IGraphicalEditPart targetEditPart = (IGraphicalEditPart) target.getAdapter(IGraphicalEditPart.class);
+ return doGetTypesForSource((PortEditPart) targetEditPart, relationshipType);
+ }
+
+ /**
+ * @generated
+ */
+ public List<IElementType> doGetTypesForSource(PortEditPart target, IElementType relationshipType) {
+ List<IElementType> types = new ArrayList<IElementType>();
+ if (relationshipType == TaiPanElementTypes.ShipDestination_4001) {
+ types.add(TaiPanElementTypes.Ship_2002);
+ types.add(TaiPanElementTypes.Warship_2003);
+ } else if (relationshipType == TaiPanElementTypes.Route_4002) {
+ types.add(TaiPanElementTypes.Port_2001);
+ } else if (relationshipType == TaiPanElementTypes.Route_4003) {
+ types.add(TaiPanElementTypes.Port_2001);
+ } else if (relationshipType == TaiPanElementTypes.BesiegePortOrder_4005) {
+ types.add(TaiPanElementTypes.Warship_2003);
+ }
+ return types;
+ }
+
+}
diff --git a/examples/org.eclipse.gmf.examples.taipan.gmf.editor/src/org/eclipse/gmf/examples/taipan/gmf/editor/providers/assistants/TaiPanModelingAssistantProviderOfShipEditPart.java b/examples/org.eclipse.gmf.examples.taipan.gmf.editor/src/org/eclipse/gmf/examples/taipan/gmf/editor/providers/assistants/TaiPanModelingAssistantProviderOfShipEditPart.java
new file mode 100644
index 000000000..3b2c69737
--- /dev/null
+++ b/examples/org.eclipse.gmf.examples.taipan.gmf.editor/src/org/eclipse/gmf/examples/taipan/gmf/editor/providers/assistants/TaiPanModelingAssistantProviderOfShipEditPart.java
@@ -0,0 +1,141 @@
+/*
+ * Copyright (c) 2006, 2007 Borland Software Corporation
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Dmitry Stadnik (Borland) - initial API and implementation
+ */
+package org.eclipse.gmf.examples.taipan.gmf.editor.providers.assistants;
+
+import java.util.ArrayList;
+import java.util.LinkedList;
+import java.util.List;
+
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.gmf.examples.taipan.gmf.editor.edit.parts.PortEditPart;
+import org.eclipse.gmf.examples.taipan.gmf.editor.edit.parts.ShipEditPart;
+import org.eclipse.gmf.examples.taipan.gmf.editor.providers.TaiPanElementTypes;
+import org.eclipse.gmf.examples.taipan.gmf.editor.providers.TaiPanModelingAssistantProvider;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
+import org.eclipse.gmf.runtime.emf.type.core.IElementType;
+
+/**
+ * @generated
+ */
+public class TaiPanModelingAssistantProviderOfShipEditPart extends TaiPanModelingAssistantProvider {
+
+ /**
+ * @generated
+ */
+ @Override
+ public List<IElementType> getTypesForPopupBar(IAdaptable host) {
+ List<IElementType> types = new ArrayList<IElementType>(1);
+ types.add(TaiPanElementTypes.SmallItems_3001);
+ return types;
+ }
+
+ /**
+ * @generated
+ */
+ @Override
+ public List<IElementType> getRelTypesOnSource(IAdaptable source) {
+ IGraphicalEditPart sourceEditPart = (IGraphicalEditPart) source.getAdapter(IGraphicalEditPart.class);
+ return doGetRelTypesOnSource((ShipEditPart) sourceEditPart);
+ }
+
+ /**
+ * @generated
+ */
+ public List<IElementType> doGetRelTypesOnSource(ShipEditPart source) {
+ List<IElementType> types = new ArrayList<IElementType>(1);
+ types.add(TaiPanElementTypes.ShipDestination_4001);
+ return types;
+ }
+
+ /**
+ * @generated
+ */
+ @Override
+ public List<IElementType> getRelTypesOnSourceAndTarget(IAdaptable source, IAdaptable target) {
+ IGraphicalEditPart sourceEditPart = (IGraphicalEditPart) source.getAdapter(IGraphicalEditPart.class);
+ IGraphicalEditPart targetEditPart = (IGraphicalEditPart) target.getAdapter(IGraphicalEditPart.class);
+ return doGetRelTypesOnSourceAndTarget((ShipEditPart) sourceEditPart, targetEditPart);
+ }
+
+ /**
+ * @generated
+ */
+ public List<IElementType> doGetRelTypesOnSourceAndTarget(ShipEditPart source, IGraphicalEditPart targetEditPart) {
+ List<IElementType> types = new LinkedList<IElementType>();
+ if (targetEditPart instanceof PortEditPart) {
+ types.add(TaiPanElementTypes.ShipDestination_4001);
+ }
+ return types;
+ }
+
+ /**
+ * @generated
+ */
+ @Override
+ public List<IElementType> getTypesForTarget(IAdaptable source, IElementType relationshipType) {
+ IGraphicalEditPart sourceEditPart = (IGraphicalEditPart) source.getAdapter(IGraphicalEditPart.class);
+ return doGetTypesForTarget((ShipEditPart) sourceEditPart, relationshipType);
+ }
+
+ /**
+ * @generated
+ */
+ public List<IElementType> doGetTypesForTarget(ShipEditPart source, IElementType relationshipType) {
+ List<IElementType> types = new ArrayList<IElementType>();
+ if (relationshipType == TaiPanElementTypes.ShipDestination_4001) {
+ types.add(TaiPanElementTypes.Port_2001);
+ }
+ return types;
+ }
+
+ /**
+ * @generated
+ */
+ @Override
+ public List<IElementType> getRelTypesOnTarget(IAdaptable target) {
+ IGraphicalEditPart targetEditPart = (IGraphicalEditPart) target.getAdapter(IGraphicalEditPart.class);
+ return doGetRelTypesOnTarget((ShipEditPart) targetEditPart);
+ }
+
+ /**
+ * @generated
+ */
+ public List<IElementType> doGetRelTypesOnTarget(ShipEditPart target) {
+ List<IElementType> types = new ArrayList<IElementType>(2);
+ types.add(TaiPanElementTypes.EscortShipsOrder_4006);
+ types.add(TaiPanElementTypes.PortRegister_4007);
+ return types;
+ }
+
+ /**
+ * @generated
+ */
+ @Override
+ public List<IElementType> getTypesForSource(IAdaptable target, IElementType relationshipType) {
+ IGraphicalEditPart targetEditPart = (IGraphicalEditPart) target.getAdapter(IGraphicalEditPart.class);
+ return doGetTypesForSource((ShipEditPart) targetEditPart, relationshipType);
+ }
+
+ /**
+ * @generated
+ */
+ public List<IElementType> doGetTypesForSource(ShipEditPart target, IElementType relationshipType) {
+ List<IElementType> types = new ArrayList<IElementType>();
+ if (relationshipType == TaiPanElementTypes.EscortShipsOrder_4006) {
+ types.add(TaiPanElementTypes.Warship_2003);
+ } else if (relationshipType == TaiPanElementTypes.PortRegister_4007) {
+ types.add(TaiPanElementTypes.Port_2001);
+ }
+ return types;
+ }
+
+}
diff --git a/examples/org.eclipse.gmf.examples.taipan.gmf.editor/src/org/eclipse/gmf/examples/taipan/gmf/editor/providers/assistants/TaiPanModelingAssistantProviderOfSmallItemsEditPart.java b/examples/org.eclipse.gmf.examples.taipan.gmf.editor/src/org/eclipse/gmf/examples/taipan/gmf/editor/providers/assistants/TaiPanModelingAssistantProviderOfSmallItemsEditPart.java
new file mode 100644
index 000000000..c4f4ca98d
--- /dev/null
+++ b/examples/org.eclipse.gmf.examples.taipan.gmf.editor/src/org/eclipse/gmf/examples/taipan/gmf/editor/providers/assistants/TaiPanModelingAssistantProviderOfSmallItemsEditPart.java
@@ -0,0 +1,21 @@
+/*
+ * Copyright (c) 2006, 2007 Borland Software Corporation
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Dmitry Stadnik (Borland) - initial API and implementation
+ */
+package org.eclipse.gmf.examples.taipan.gmf.editor.providers.assistants;
+
+import org.eclipse.gmf.examples.taipan.gmf.editor.providers.TaiPanModelingAssistantProvider;
+
+/**
+ * @generated
+ */
+public class TaiPanModelingAssistantProviderOfSmallItemsEditPart extends TaiPanModelingAssistantProvider {
+
+}
diff --git a/examples/org.eclipse.gmf.examples.taipan.gmf.editor/src/org/eclipse/gmf/examples/taipan/gmf/editor/providers/assistants/TaiPanModelingAssistantProviderOfWarshipEditPart.java b/examples/org.eclipse.gmf.examples.taipan.gmf.editor/src/org/eclipse/gmf/examples/taipan/gmf/editor/providers/assistants/TaiPanModelingAssistantProviderOfWarshipEditPart.java
new file mode 100644
index 000000000..1b05d41d6
--- /dev/null
+++ b/examples/org.eclipse.gmf.examples.taipan.gmf.editor/src/org/eclipse/gmf/examples/taipan/gmf/editor/providers/assistants/TaiPanModelingAssistantProviderOfWarshipEditPart.java
@@ -0,0 +1,158 @@
+/*
+ * Copyright (c) 2006, 2007 Borland Software Corporation
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Dmitry Stadnik (Borland) - initial API and implementation
+ */
+package org.eclipse.gmf.examples.taipan.gmf.editor.providers.assistants;
+
+import java.util.ArrayList;
+import java.util.LinkedList;
+import java.util.List;
+
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.gmf.examples.taipan.gmf.editor.edit.parts.PortEditPart;
+import org.eclipse.gmf.examples.taipan.gmf.editor.edit.parts.ShipEditPart;
+import org.eclipse.gmf.examples.taipan.gmf.editor.edit.parts.WarshipEditPart;
+import org.eclipse.gmf.examples.taipan.gmf.editor.providers.TaiPanElementTypes;
+import org.eclipse.gmf.examples.taipan.gmf.editor.providers.TaiPanModelingAssistantProvider;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
+import org.eclipse.gmf.runtime.emf.type.core.IElementType;
+
+/**
+ * @generated
+ */
+public class TaiPanModelingAssistantProviderOfWarshipEditPart extends TaiPanModelingAssistantProvider {
+
+ /**
+ * @generated
+ */
+ @Override
+ public List<IElementType> getTypesForPopupBar(IAdaptable host) {
+ List<IElementType> types = new ArrayList<IElementType>(1);
+ types.add(TaiPanElementTypes.SmallItems_3001);
+ return types;
+ }
+
+ /**
+ * @generated
+ */
+ @Override
+ public List<IElementType> getRelTypesOnSource(IAdaptable source) {
+ IGraphicalEditPart sourceEditPart = (IGraphicalEditPart) source.getAdapter(IGraphicalEditPart.class);
+ return doGetRelTypesOnSource((WarshipEditPart) sourceEditPart);
+ }
+
+ /**
+ * @generated
+ */
+ public List<IElementType> doGetRelTypesOnSource(WarshipEditPart source) {
+ List<IElementType> types = new ArrayList<IElementType>(3);
+ types.add(TaiPanElementTypes.ShipDestination_4001);
+ types.add(TaiPanElementTypes.BesiegePortOrder_4005);
+ types.add(TaiPanElementTypes.EscortShipsOrder_4006);
+ return types;
+ }
+
+ /**
+ * @generated
+ */
+ @Override
+ public List<IElementType> getRelTypesOnSourceAndTarget(IAdaptable source, IAdaptable target) {
+ IGraphicalEditPart sourceEditPart = (IGraphicalEditPart) source.getAdapter(IGraphicalEditPart.class);
+ IGraphicalEditPart targetEditPart = (IGraphicalEditPart) target.getAdapter(IGraphicalEditPart.class);
+ return doGetRelTypesOnSourceAndTarget((WarshipEditPart) sourceEditPart, targetEditPart);
+ }
+
+ /**
+ * @generated
+ */
+ public List<IElementType> doGetRelTypesOnSourceAndTarget(WarshipEditPart source, IGraphicalEditPart targetEditPart) {
+ List<IElementType> types = new LinkedList<IElementType>();
+ if (targetEditPart instanceof PortEditPart) {
+ types.add(TaiPanElementTypes.ShipDestination_4001);
+ }
+ if (targetEditPart instanceof PortEditPart) {
+ types.add(TaiPanElementTypes.BesiegePortOrder_4005);
+ }
+ if (targetEditPart instanceof ShipEditPart) {
+ types.add(TaiPanElementTypes.EscortShipsOrder_4006);
+ }
+ if (targetEditPart instanceof WarshipEditPart) {
+ types.add(TaiPanElementTypes.EscortShipsOrder_4006);
+ }
+ return types;
+ }
+
+ /**
+ * @generated
+ */
+ @Override
+ public List<IElementType> getTypesForTarget(IAdaptable source, IElementType relationshipType) {
+ IGraphicalEditPart sourceEditPart = (IGraphicalEditPart) source.getAdapter(IGraphicalEditPart.class);
+ return doGetTypesForTarget((WarshipEditPart) sourceEditPart, relationshipType);
+ }
+
+ /**
+ * @generated
+ */
+ public List<IElementType> doGetTypesForTarget(WarshipEditPart source, IElementType relationshipType) {
+ List<IElementType> types = new ArrayList<IElementType>();
+ if (relationshipType == TaiPanElementTypes.ShipDestination_4001) {
+ types.add(TaiPanElementTypes.Port_2001);
+ } else if (relationshipType == TaiPanElementTypes.BesiegePortOrder_4005) {
+ types.add(TaiPanElementTypes.Port_2001);
+ } else if (relationshipType == TaiPanElementTypes.EscortShipsOrder_4006) {
+ types.add(TaiPanElementTypes.Ship_2002);
+ types.add(TaiPanElementTypes.Warship_2003);
+ }
+ return types;
+ }
+
+ /**
+ * @generated
+ */
+ @Override
+ public List<IElementType> getRelTypesOnTarget(IAdaptable target) {
+ IGraphicalEditPart targetEditPart = (IGraphicalEditPart) target.getAdapter(IGraphicalEditPart.class);
+ return doGetRelTypesOnTarget((WarshipEditPart) targetEditPart);
+ }
+
+ /**
+ * @generated
+ */
+ public List<IElementType> doGetRelTypesOnTarget(WarshipEditPart target) {
+ List<IElementType> types = new ArrayList<IElementType>(2);
+ types.add(TaiPanElementTypes.EscortShipsOrder_4006);
+ types.add(TaiPanElementTypes.PortRegister_4007);
+ return types;
+ }
+
+ /**
+ * @generated
+ */
+ @Override
+ public List<IElementType> getTypesForSource(IAdaptable target, IElementType relationshipType) {
+ IGraphicalEditPart targetEditPart = (IGraphicalEditPart) target.getAdapter(IGraphicalEditPart.class);
+ return doGetTypesForSource((WarshipEditPart) targetEditPart, relationshipType);
+ }
+
+ /**
+ * @generated
+ */
+ public List<IElementType> doGetTypesForSource(WarshipEditPart target, IElementType relationshipType) {
+ List<IElementType> types = new ArrayList<IElementType>();
+ if (relationshipType == TaiPanElementTypes.EscortShipsOrder_4006) {
+ types.add(TaiPanElementTypes.Warship_2003);
+ } else if (relationshipType == TaiPanElementTypes.PortRegister_4007) {
+ types.add(TaiPanElementTypes.Port_2001);
+ }
+ return types;
+ }
+
+}
diff --git a/plugins/org.eclipse.gmf.codegen/META-INF/MANIFEST.MF b/plugins/org.eclipse.gmf.codegen/META-INF/MANIFEST.MF
index 7fc4bdeba..b9960d8fc 100644
--- a/plugins/org.eclipse.gmf.codegen/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.gmf.codegen/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-SymbolicName: org.eclipse.gmf.codegen; singleton:=true
-Bundle-Version: 2.9.0.qualifier
+Bundle-Version: 2.10.0.qualifier
Bundle-Vendor: %providerName
Bundle-Localization: plugin
Export-Package: org.eclipse.gmf.codegen.gmfgen,
diff --git a/plugins/org.eclipse.gmf.codegen/pom.xml b/plugins/org.eclipse.gmf.codegen/pom.xml
index 8f23c18f0..90b489ee4 100644
--- a/plugins/org.eclipse.gmf.codegen/pom.xml
+++ b/plugins/org.eclipse.gmf.codegen/pom.xml
@@ -13,7 +13,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>org.eclipse.gmf-tooling.plugins</groupId>
<artifactId>org.eclipse.gmf.codegen</artifactId>
- <version>2.9.0-SNAPSHOT</version>
+ <version>2.10.0-SNAPSHOT</version>
<packaging>eclipse-plugin</packaging>
<parent>
diff --git a/plugins/org.eclipse.gmf.codegen/src/org/eclipse/gmf/codegen/util/CodegenEmitters.java b/plugins/org.eclipse.gmf.codegen/src/org/eclipse/gmf/codegen/util/CodegenEmitters.java
index 9de6f9c3a..c6b211959 100644
--- a/plugins/org.eclipse.gmf.codegen/src/org/eclipse/gmf/codegen/util/CodegenEmitters.java
+++ b/plugins/org.eclipse.gmf.codegen/src/org/eclipse/gmf/codegen/util/CodegenEmitters.java
@@ -60,9 +60,9 @@ public class CodegenEmitters {
urls.add(getTemplatesBundle().getEntry("/templates-dynmodel/")); //$NON-NLS-1$
}
urls.add(getTemplatesBundle().getEntry("/templates/")); //$NON-NLS-1$
-
+
urls.add(Platform.getBundle("org.eclipse.gmf.graphdef.codegen").getEntry("/templates/")); //$NON-NLS-1$ //$NON-NLS-2$
-
+
myLocations = urls.toArray(new URL[urls.size()]);
myResourceManager = new BundleResourceManager(myLocations);
}
@@ -305,6 +305,20 @@ public class CodegenEmitters {
return getPrimaryEmitter("xpt::providers::ModelingAssistantProvider"); //$NON-NLS-1$
}
+ /**
+ * @since 2.10
+ */
+ public TextEmitter getNodeEditPartModelingAssistantProviderEmitter() {
+ return getPrimaryEmitter("xpt::providers::EditPartModelingAssistantProvider"); //$NON-NLS-1$
+ }
+
+ /**
+ * @since 2.10
+ */
+ public String getNodeEditPartModelingAssistantProviderClassName(Object input) throws UnexpectedBehaviourException {
+ return getQualifiedClassName("xpt::providers::EditPartModelingAssistantProvider", input); //$NON-NLS-1$
+ }
+
public TextEmitter getIconProviderEmitter() throws UnexpectedBehaviourException {
return getPrimaryEmitter("xpt::providers::IconProvider"); //$NON-NLS-1$
}
@@ -642,7 +656,7 @@ public class CodegenEmitters {
String definition = templateName + PATH_SEPARATOR + "qualifiedClassName"; //$NON-NLS-1$
return newXpandEmitter(definition);
}
-
+
/**
* Returns emitter for qualified class name definition for specified <strong>primary template</strong>.
* That is, in contrast to {@link CodegenEmitters#getQualifiedClassNameEmitter(String)} expects the name
@@ -655,8 +669,8 @@ public class CodegenEmitters {
protected TextEmitter getQualifiedClassNameEmitterForPrimaryTemplate(String templateName) throws UnexpectedBehaviourException {
String[] parts = templateName.split(PATH_SEPARATOR);
StringBuilder withoutLastSegment = new StringBuilder();
- for (int i = 0; i < parts.length - 1; i++){
- if (withoutLastSegment.length() > 0){
+ for (int i = 0; i < parts.length - 1; i++) {
+ if (withoutLastSegment.length() > 0) {
withoutLastSegment.append(PATH_SEPARATOR);
}
withoutLastSegment.append(parts[i]);
@@ -665,6 +679,24 @@ public class CodegenEmitters {
}
/**
+ * Returns emitter for class name definition in the specified template.
+ * Definition should be named 'className'.
+ */
+ private TextEmitter getClassNameEmitter(String templateName) throws UnexpectedBehaviourException {
+ String definition = templateName + PATH_SEPARATOR + "className"; //$NON-NLS-1$
+ return newXpandEmitter(definition);
+ }
+
+ /**
+ * Returns emitter for package name definition in the specified template.
+ * Definition should be named 'packageName'.
+ */
+ private TextEmitter getPackageNameEmitter(String templateName) throws UnexpectedBehaviourException {
+ String definition = templateName + PATH_SEPARATOR + "packageName"; //$NON-NLS-1$
+ return newXpandEmitter(definition);
+ }
+
+ /**
* Returns text generated by emitter.
*/
private String getText(TextEmitter emitter, Object... input) throws UnexpectedBehaviourException {
@@ -685,6 +717,22 @@ public class CodegenEmitters {
return getText(emitter, input);
}
+ /**
+ * Returns class name defined in template.
+ */
+ private String getClassName(String templateName, Object... input) throws UnexpectedBehaviourException {
+ TextEmitter emitter = getClassNameEmitter(templateName);
+ return getText(emitter, input);
+ }
+
+ /**
+ * Returns package name defined in template.
+ */
+ private String getPackageName(String templateName, Object... input) throws UnexpectedBehaviourException {
+ TextEmitter emitter = getPackageNameEmitter(templateName);
+ return getText(emitter, input);
+ }
+
private BinaryEmitter newGIFEmitter(String relativePath) throws UnexpectedBehaviourException {
return new GIFEmitter(checkTemplateLocation(relativePath));
}
@@ -708,4 +756,5 @@ public class CodegenEmitters {
protected TextEmitter newXpandEmitter(String definition) {
return new XpandTextEmitter(myResourceManager, definition, myGlobals);
}
+
}
diff --git a/plugins/org.eclipse.gmf.codegen/src/org/eclipse/gmf/codegen/util/Generator.java b/plugins/org.eclipse.gmf.codegen/src/org/eclipse/gmf/codegen/util/Generator.java
index fda34627c..95756e02c 100644
--- a/plugins/org.eclipse.gmf.codegen/src/org/eclipse/gmf/codegen/util/Generator.java
+++ b/plugins/org.eclipse.gmf.codegen/src/org/eclipse/gmf/codegen/util/Generator.java
@@ -45,6 +45,7 @@ import org.eclipse.gmf.codegen.gmfgen.GenChildLabelNode;
import org.eclipse.gmf.codegen.gmfgen.GenChildNode;
import org.eclipse.gmf.codegen.gmfgen.GenCommonBase;
import org.eclipse.gmf.codegen.gmfgen.GenCompartment;
+import org.eclipse.gmf.codegen.gmfgen.GenContainerBase;
import org.eclipse.gmf.codegen.gmfgen.GenContributionItem;
import org.eclipse.gmf.codegen.gmfgen.GenContributionManager;
import org.eclipse.gmf.codegen.gmfgen.GenCustomAction;
@@ -320,6 +321,7 @@ public class Generator extends GeneratorBase implements Runnable {
generateDiagramItemSemanticEditPolicy();
generateEditSupport(myDiagram);
generateDiagramEditPart();
+ generateEditPartModelingAssistantProvider(myDiagram);
}
private void generateNode(GenNode node) throws UnexpectedBehaviourException, InterruptedException {
@@ -329,6 +331,7 @@ public class Generator extends GeneratorBase implements Runnable {
}
generateEditSupport(node);
generateNodeEditPart(node);
+ generateEditPartModelingAssistantProvider(node);
generateBehaviours(node);
if (node.needsCanonicalEditPolicy()) {
generateChildContainerCanonicalEditPolicy(node);
@@ -368,6 +371,7 @@ public class Generator extends GeneratorBase implements Runnable {
generateEditSupport(child);
generateBehaviours(child);
generateChildNodeLabelEditPart(child);
+ generateEditPartModelingAssistantProvider(child);
}
// commands
@@ -442,6 +446,10 @@ public class Generator extends GeneratorBase implements Runnable {
doGenerateJavaClass(myEmitters.getNodeEditPartEmitter(), node.getEditPartQualifiedClassName(), node);
}
+ private void generateEditPartModelingAssistantProvider(GenContainerBase container) throws UnexpectedBehaviourException, InterruptedException {
+ doGenerateJavaClass(myEmitters.getNodeEditPartModelingAssistantProviderEmitter(), myEmitters.getNodeEditPartModelingAssistantProviderClassName(container), container);
+ }
+
private void generateNodeLabelEditPart(GenNodeLabel label) throws UnexpectedBehaviourException, InterruptedException {
doGenerateJavaClass(myEmitters.getNodeLabelEditPartEmitter(), label.getEditPartQualifiedClassName(), label);
}
@@ -1181,4 +1189,5 @@ public class Generator extends GeneratorBase implements Runnable {
private static boolean needsGraphicalNodeEditPolicy(GenNode node) {
return node.getModelFacet() != null && !node.getReorientedIncomingLinks().isEmpty();
}
+
}
diff --git a/plugins/org.eclipse.gmf.codegen/templates/diagram/editparts/ChildNodeLabelEditPart.xpt b/plugins/org.eclipse.gmf.codegen/templates/diagram/editparts/ChildNodeLabelEditPart.xpt
index 7ed67924d..ae0c9de8d 100644
--- a/plugins/org.eclipse.gmf.codegen/templates/diagram/editparts/ChildNodeLabelEditPart.xpt
+++ b/plugins/org.eclipse.gmf.codegen/templates/diagram/editparts/ChildNodeLabelEditPart.xpt
@@ -34,20 +34,6 @@ public class «editPartClassName» «EXPAND extendsList» «EXPAND implementsLis
«EXPAND xpt::diagram::editparts::Common::notationalListeners-»
-«IF getAssistantOutgoingLinks(self)->size() > 0-»
- «EXPAND impl::diagram::editparts::NodeEditPart::getMARelTypesOnSource-»
-
- «EXPAND impl::diagram::editparts::NodeEditPart::getMARelTypesOnSourceAndTarget-»
-
- «EXPAND impl::diagram::editparts::NodeEditPart::getMATypesForTarget-»
-«ENDIF-»
-
-«IF getAssistantIncomingLinks(self)->size() > 0-»
- «EXPAND impl::diagram::editparts::NodeEditPart::getMARelTypesOnTarget-»
-
- «EXPAND impl::diagram::editparts::NodeEditPart::getMATypesForSource-»
-«ENDIF-»
-
«EXPAND handleNotificationEvent-»
«EXPAND xpt::diagram::editparts::Common::labelFigure FOR viewmap-»
diff --git a/plugins/org.eclipse.gmf.codegen/templates/diagram/editparts/NodeEditPart.xpt b/plugins/org.eclipse.gmf.codegen/templates/diagram/editparts/NodeEditPart.xpt
index 7ec30ea94..806c3c452 100644
--- a/plugins/org.eclipse.gmf.codegen/templates/diagram/editparts/NodeEditPart.xpt
+++ b/plugins/org.eclipse.gmf.codegen/templates/diagram/editparts/NodeEditPart.xpt
@@ -66,20 +66,6 @@ public class «editPartClassName» «EXPAND extendsList» «EXPAND implementsLis
«EXPAND impl::diagram::editparts::NodeEditPart::getPrimaryChildEditPart-»
-«IF getAssistantOutgoingLinks(self)->size() > 0-»
- «EXPAND impl::diagram::editparts::NodeEditPart::getMARelTypesOnSource-»
-
- «EXPAND impl::diagram::editparts::NodeEditPart::getMARelTypesOnSourceAndTarget-»
-
- «EXPAND impl::diagram::editparts::NodeEditPart::getMATypesForTarget-»
-«ENDIF-»
-
-«IF getAssistantIncomingLinks(self)->size() > 0-»
- «EXPAND impl::diagram::editparts::NodeEditPart::getMARelTypesOnTarget-»
-
- «EXPAND impl::diagram::editparts::NodeEditPart::getMATypesForSource-»
-«ENDIF-»
-
«IF hasChildrenInListCompartments(self)-»
«EXPAND impl::diagram::editparts::NodeEditPart::getTargetEditPartMethod-»
«ENDIF-»
diff --git a/plugins/org.eclipse.gmf.codegen/templates/impl/diagram/editparts/NodeEditPart.xpt b/plugins/org.eclipse.gmf.codegen/templates/impl/diagram/editparts/NodeEditPart.xpt
index f210b79f9..a24564ad7 100644
--- a/plugins/org.eclipse.gmf.codegen/templates/impl/diagram/editparts/NodeEditPart.xpt
+++ b/plugins/org.eclipse.gmf.codegen/templates/impl/diagram/editparts/NodeEditPart.xpt
@@ -550,78 +550,6 @@ new org.eclipse.gmf.runtime.diagram.ui.editpolicies.BorderItemSelectionEditPolic
«ENDIF-»
«ENDDEFINE»
-// pre: getAssistantOutgoingLinks(this).size() > 0
-«DEFINE getMARelTypesOnSource FOR gmfgen::GenNode-»
- «EXPAND xpt::Common::generatedMemberComment»
- public «EXPAND CodeStyle::G('java.util.List', 'org.eclipse.gmf.runtime.emf.type.core.IElementType')» getMARelTypesOnSource() {
- «EXPAND CodeStyle::newGenericInstance('types', 'java.util.ArrayList', 'org.eclipse.gmf.runtime.emf.type.core.IElementType')»(«getAssistantOutgoingLinks(self)->size()»);
- «FOREACH getAssistantOutgoingLinks(self) AS link-»
- types.add(«EXPAND xpt::providers::ElementTypes::accessElementType FOR link»);
- «ENDFOREACH-»
- return types;
- }
-«ENDDEFINE»
-
-// pre: getAssistantIncomingLinks(this).size() > 0
-«DEFINE getMARelTypesOnTarget FOR gmfgen::GenNode-»
- «EXPAND xpt::Common::generatedMemberComment»
- public «EXPAND CodeStyle::G('java.util.List', 'org.eclipse.gmf.runtime.emf.type.core.IElementType')» getMARelTypesOnTarget() {
- «EXPAND CodeStyle::newGenericInstance('types', 'java.util.ArrayList', 'org.eclipse.gmf.runtime.emf.type.core.IElementType')»(«getAssistantIncomingLinks(self)->size()»);
- «FOREACH getAssistantIncomingLinks(self) AS link-»
- types.add(«EXPAND xpt::providers::ElementTypes::accessElementType FOR link»);
- «ENDFOREACH-»
- return types;
- }
-«ENDDEFINE»
-
-// pre: getAssistantOutgoingLinks(this).size() > 0
-«DEFINE getMARelTypesOnSourceAndTarget FOR gmfgen::GenNode-»
- «EXPAND xpt::Common::generatedMemberComment»
- public «EXPAND CodeStyle::G('java.util.List', 'org.eclipse.gmf.runtime.emf.type.core.IElementType')» getMARelTypesOnSourceAndTarget(org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart targetEditPart) {
- «EXPAND CodeStyle::newGenericInstance('types', 'java.util.LinkedList', 'org.eclipse.gmf.runtime.emf.type.core.IElementType')»();
- «FOREACH getAssistantOutgoingLinks(self) AS link-»
- «FOREACH selectGenNodes(link.targets) AS target-»
- if (targetEditPart instanceof «target.getEditPartQualifiedClassName()») {
- types.add(«EXPAND xpt::providers::ElementTypes::accessElementType FOR link»);
- }
- «ENDFOREACH-»
- «ENDFOREACH-»
- return types;
- }
-«ENDDEFINE»
-
-// pre: getAssistantIncomingLinks(this).size() > 0
-«DEFINE getMATypesForSource FOR gmfgen::GenNode-»
- «EXPAND xpt::Common::generatedMemberComment»
- public «EXPAND CodeStyle::G('java.util.List', 'org.eclipse.gmf.runtime.emf.type.core.IElementType')» getMATypesForSource(org.eclipse.gmf.runtime.emf.type.core.IElementType relationshipType) {
- «EXPAND CodeStyle::newGenericInstance('types', 'java.util.LinkedList', 'org.eclipse.gmf.runtime.emf.type.core.IElementType')»();
- «FOREACH getAssistantIncomingLinks(self) AS link SEPARATOR ' else '-»
- if (relationshipType == «EXPAND xpt::providers::ElementTypes::accessElementType FOR link») {
- «FOREACH selectGenNodes(link.sources) AS source-»
- types.add(«EXPAND xpt::providers::ElementTypes::accessElementType FOR source»);
- «ENDFOREACH-»
- }
- «ENDFOREACH-»
- return types;
- }
-«ENDDEFINE»
-
-// pre: getAssistantOutgoingLinks(this).size() > 0
-«DEFINE getMATypesForTarget FOR gmfgen::GenNode-»
- «EXPAND xpt::Common::generatedMemberComment»
- public «EXPAND CodeStyle::G('java.util.List', 'org.eclipse.gmf.runtime.emf.type.core.IElementType')» getMATypesForTarget(org.eclipse.gmf.runtime.emf.type.core.IElementType relationshipType) {
- «EXPAND CodeStyle::newGenericInstance('types', 'java.util.LinkedList', 'org.eclipse.gmf.runtime.emf.type.core.IElementType')»();
- «FOREACH getAssistantOutgoingLinks(self) AS link SEPARATOR ' else '-»
- if (relationshipType == «EXPAND xpt::providers::ElementTypes::accessElementType FOR link») {
- «FOREACH selectGenNodes(link.targets) AS target-»
- types.add(«EXPAND xpt::providers::ElementTypes::accessElementType FOR target»);
- «ENDFOREACH-»
- }
- «ENDFOREACH-»
- return types;
- }
-«ENDDEFINE»
-
«DEFINE handleNotificationEventBody FOR gmfgen::GenTopLevelNode-»
if (event.getNotifier() == getModel() && org.eclipse.emf.ecore.EcorePackage.eINSTANCE.getEModelElement_EAnnotations().equals(event.getFeature())) {
handleMajorSemanticChange();
diff --git a/plugins/org.eclipse.gmf.codegen/templates/xpt/providers/ModelingAssistantProvider.xpt b/plugins/org.eclipse.gmf.codegen/templates/xpt/providers/ModelingAssistantProvider.xpt
index 9cd68cbc4..20c32f7d8 100644
--- a/plugins/org.eclipse.gmf.codegen/templates/xpt/providers/ModelingAssistantProvider.xpt
+++ b/plugins/org.eclipse.gmf.codegen/templates/xpt/providers/ModelingAssistantProvider.xpt
@@ -13,28 +13,20 @@
«IMPORT 'http://www.eclipse.org/gmf/2009/GenModel'»
-«EXTENSION xpt::diagram::editparts::Utils»
«EXTENSION xpt::providers::i18n»
+«DEFINE className FOR gmfgen::GenDiagram»«modelingAssistantProviderClassName»«ENDDEFINE»
+
+«DEFINE packageName FOR gmfgen::GenDiagram»«providersPackageName»«ENDDEFINE»
+
+«DEFINE qualifiedClassName FOR gmfgen::GenDiagram»«EXPAND packageName».«EXPAND className»«ENDDEFINE»
+
«DEFINE ModelingAssistantProvider FOR gmfgen::GenDiagram-»
«EXPAND xpt::Common::copyright FOR editorGen-»
package «providersPackageName»;
«EXPAND xpt::Common::generatedClassComment»
-public class «modelingAssistantProviderClassName»
- extends org.eclipse.gmf.runtime.emf.ui.services.modelingassistant.ModelingAssistantProvider {
-
- «EXPAND getTypesForPopupBar-»
-
- «EXPAND getRelTypesOnSource-»
-
- «EXPAND getRelTypesOnTarget-»
-
- «EXPAND getRelTypesOnSourceAndTarget-»
-
- «EXPAND getTypesForSource-»
-
- «EXPAND getTypesForTarget-»
+public class «modelingAssistantProviderClassName» «EXPAND extendsList» {
«EXPAND selectExistingElementForSource-»
@@ -45,121 +37,12 @@ public class «modelingAssistantProviderClassName»
«EXPAND isApplicableElement-»
«EXPAND selectElement-»
+
«EXPAND additions-»
}
«ENDDEFINE»
-«DEFINE getTypesForPopupBar FOR gmfgen::GenDiagram-»
- «EXPAND xpt::Common::generatedMemberComment»
- public java.util.List getTypesForPopupBar(org.eclipse.core.runtime.IAdaptable host) {
- org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart editPart =
- (org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart) host.getAdapter(
- org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart.class);
- «FOREACH getAllContainers() AS container-»
- «IF container.getAssistantNodes()->size() > 0-»
- if (editPart instanceof «container.getEditPartQualifiedClassName()») {
- «EXPAND CodeStyle::newGenericInstance('types', 'java.util.ArrayList', 'org.eclipse.gmf.runtime.emf.type.core.IElementType')»(«container.getAssistantNodes()->size()»);
- «FOREACH container.getAssistantNodes()->asSequence() AS node-»
- types.add(«EXPAND xpt::providers::ElementTypes::accessElementType FOR node»);
- «ENDFOREACH-»
- return types;
- }
- «ENDIF-»
- «ENDFOREACH-»
- return java.util.Collections.EMPTY_LIST;
- }
-«ENDDEFINE»
-
-«DEFINE getRelTypesOnSource FOR gmfgen::GenDiagram-»
- «EXPAND xpt::Common::generatedMemberComment»
- public java.util.List getRelTypesOnSource(org.eclipse.core.runtime.IAdaptable source) {
- org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart sourceEditPart =
- (org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart) source.getAdapter(
- org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart.class);
- «FOREACH getAllNodes() AS source-»
- «IF getAssistantOutgoingLinks(source)->size() > 0-»
- if (sourceEditPart instanceof «source.getEditPartQualifiedClassName()») {
- return ((«source.getEditPartQualifiedClassName()») sourceEditPart).getMARelTypesOnSource();
- }
- «ENDIF-»
- «ENDFOREACH-»
- return java.util.Collections.EMPTY_LIST;
- }
-«ENDDEFINE»
-
-«DEFINE getRelTypesOnTarget FOR gmfgen::GenDiagram-»
- «EXPAND xpt::Common::generatedMemberComment»
- public java.util.List getRelTypesOnTarget(org.eclipse.core.runtime.IAdaptable target) {
- org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart targetEditPart =
- (org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart) target.getAdapter(
- org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart.class);
- «FOREACH getAllNodes() AS target-»
- «IF getAssistantIncomingLinks(target)->size() > 0-»
- if (targetEditPart instanceof «target.getEditPartQualifiedClassName()») {
- return ((«target.getEditPartQualifiedClassName()») targetEditPart).getMARelTypesOnTarget();
- }
- «ENDIF-»
- «ENDFOREACH-»
- return java.util.Collections.EMPTY_LIST;
- }
-«ENDDEFINE»
-
-«DEFINE getRelTypesOnSourceAndTarget FOR gmfgen::GenDiagram-»
- «EXPAND xpt::Common::generatedMemberComment»
- public java.util.List getRelTypesOnSourceAndTarget(
- org.eclipse.core.runtime.IAdaptable source, org.eclipse.core.runtime.IAdaptable target) {
- org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart sourceEditPart =
- (org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart) source.getAdapter(
- org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart.class);
- org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart targetEditPart =
- (org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart) target.getAdapter(
- org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart.class);
- «FOREACH getAllNodes() AS source-»
- «IF getAssistantOutgoingLinks(source)->size() > 0-»
- if (sourceEditPart instanceof «source.getEditPartQualifiedClassName()») {
- return ((«source.getEditPartQualifiedClassName()») sourceEditPart).getMARelTypesOnSourceAndTarget(targetEditPart);
- }
- «ENDIF-»
- «ENDFOREACH-»
- return java.util.Collections.EMPTY_LIST;
- }
-«ENDDEFINE»
-
-«DEFINE getTypesForSource FOR gmfgen::GenDiagram-»
- «EXPAND xpt::Common::generatedMemberComment»
- public java.util.List getTypesForSource(org.eclipse.core.runtime.IAdaptable target,
- org.eclipse.gmf.runtime.emf.type.core.IElementType relationshipType) {
- org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart targetEditPart =
- (org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart) target.getAdapter(
- org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart.class);
- «FOREACH getAllNodes() AS target-»
- «IF getAssistantIncomingLinks(target)->size() > 0-»
- if (targetEditPart instanceof «target.getEditPartQualifiedClassName()») {
- return ((«target.getEditPartQualifiedClassName()») targetEditPart).getMATypesForSource(relationshipType);
- }
- «ENDIF-»
- «ENDFOREACH-»
- return java.util.Collections.EMPTY_LIST;
- }
-«ENDDEFINE»
-
-«DEFINE getTypesForTarget FOR gmfgen::GenDiagram-»
- «EXPAND xpt::Common::generatedMemberComment»
- public java.util.List getTypesForTarget(org.eclipse.core.runtime.IAdaptable source,
- org.eclipse.gmf.runtime.emf.type.core.IElementType relationshipType) {
- org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart sourceEditPart =
- (org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart) source.getAdapter(
- org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart.class);
- «FOREACH getAllNodes() AS source-»
- «IF getAssistantOutgoingLinks(source)->size() > 0-»
- if (sourceEditPart instanceof «source.getEditPartQualifiedClassName()») {
- return ((«source.getEditPartQualifiedClassName()») sourceEditPart).getMATypesForTarget(relationshipType);
- }
- «ENDIF-»
- «ENDFOREACH-»
- return java.util.Collections.EMPTY_LIST;
- }
-«ENDDEFINE»
+«DEFINE extendsList FOR gmfgen::GenDiagram»extends org.eclipse.gmf.runtime.emf.ui.services.modelingassistant.ModelingAssistantProvider«ENDDEFINE»
«DEFINE selectExistingElementForSource FOR gmfgen::GenDiagram-»
«EXPAND xpt::Common::generatedMemberComment»
diff --git a/plugins/org.eclipse.gmf.codegen/templates/xpt/providers/extensions.xpt b/plugins/org.eclipse.gmf.codegen/templates/xpt/providers/extensions.xpt
index b6241b594..ebb0d3067 100644
--- a/plugins/org.eclipse.gmf.codegen/templates/xpt/providers/extensions.xpt
+++ b/plugins/org.eclipse.gmf.codegen/templates/xpt/providers/extensions.xpt
@@ -1,4 +1,4 @@
-/*
+/*
* Copyright (c) 2007, 2010 Borland Software Corporation and others
*
* All rights reserved. This program and the accompanying materials
@@ -56,20 +56,7 @@
</editpartProvider>
</extension>
- <extension point="org.eclipse.gmf.runtime.emf.ui.modelingAssistantProviders" id="modelassist-provider">
- «EXPAND xpt::Common::xmlGeneratedTag»
- <modelingAssistantProvider class="«getModelingAssistantProviderQualifiedClassName()»">
- <Priority name="«modelingAssistantProviderPriority»"/>
- <object class="«getEditPartQualifiedClassName()»" id="«getUniqueIdentifier()»"/>
-«FOREACH topLevelNodes AS n-»
- <object class="«n.getEditPartQualifiedClassName()»" id="«n.getUniqueIdentifier()»"/>
-«ENDFOREACH-»
-«FOREACH childNodes AS n-»
- <object class="«n.getEditPartQualifiedClassName()»" id="«n.getUniqueIdentifier()»"/>
-«ENDFOREACH-»
- <context elements="«getUniqueIdentifier()»,«FOREACH topLevelNodes AS n SEPARATOR ','»«n.getUniqueIdentifier()»«ENDFOREACH»,«FOREACH childNodes AS n SEPARATOR ','»«n.getUniqueIdentifier()»«ENDFOREACH»"/>
- </modelingAssistantProvider>
- </extension>
+ «EXPAND modelingAssistantProvider»
<extension point="org.eclipse.gmf.runtime.common.ui.services.iconProviders" id="icon-provider">
«EXPAND xpt::Common::xmlGeneratedTag»
@@ -183,6 +170,28 @@
</specializationType>
«ENDDEFINE»
+«DEFINE modelingAssistantProvider FOR gmfgen::GenDiagram»
+ <extension point="org.eclipse.gmf.runtime.emf.ui.modelingAssistantProviders" id="modelassist-provider">
+ «EXPAND xpt::Common::xmlGeneratedTag»
+ <modelingAssistantProvider class="«EXPAND modelingAssistantProviderQualifiedClassName FOR self»">
+ <Priority name="«self.modelingAssistantProviderPriority»"/>
+ <object class="«getEditPartQualifiedClassName()»" id="«self.getUniqueIdentifier()»"/>
+ <context elements="«self.getUniqueIdentifier()»"/>
+ </modelingAssistantProvider>
+ «FOREACH self.getAllNodes() AS n-»
+ <modelingAssistantProvider class="«EXPAND modelingAssistantProviderQualifiedClassName FOR n»">
+ <Priority name="«n.getDiagram().modelingAssistantProviderPriority»"/>
+ <object class="«n.getEditPartQualifiedClassName()»" id="«n.getUniqueIdentifier()»"/>
+ <context elements="«n.getUniqueIdentifier()»"/>
+ </modelingAssistantProvider>
+ «ENDFOREACH»
+ </extension>
+«ENDDEFINE»
+
+«DEFINE modelingAssistantProviderQualifiedClassName FOR gmfgen::GenContainerBase»«REM»NO-OP, all specific subclasses should be handled«ENDREM»«ENDDEFINE»
+«DEFINE modelingAssistantProviderQualifiedClassName FOR gmfgen::GenDiagram»«EXPAND xpt::providers::EditPartModelingAssistantProvider::qualifiedClassName»«ENDDEFINE»
+«DEFINE modelingAssistantProviderQualifiedClassName FOR gmfgen::GenNode»«EXPAND xpt::providers::EditPartModelingAssistantProvider::qualifiedClassName»«ENDDEFINE»
+
«DEFINE i18n FOR gmfgen::GenDiagram-»
# Providers
@@ -192,3 +201,4 @@
«DEFINE internal_i18n FOR gmfgen::ElementType-»
«IF null <> displayName and not definedExternally»metatype.name.«diagramElement.getUniqueIdentifier()»=«displayName»«ENDIF»
«ENDDEFINE»
+

Back to the top