Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/org.eclipse.gmf.codegen/templates/xpt/diagram/edithelpers/BaseEditHelper.xpt')
-rw-r--r--plugins/org.eclipse.gmf.codegen/templates/xpt/diagram/edithelpers/BaseEditHelper.xpt35
1 files changed, 31 insertions, 4 deletions
diff --git a/plugins/org.eclipse.gmf.codegen/templates/xpt/diagram/edithelpers/BaseEditHelper.xpt b/plugins/org.eclipse.gmf.codegen/templates/xpt/diagram/edithelpers/BaseEditHelper.xpt
index f0317ad9a..fe5b0b3f7 100644
--- a/plugins/org.eclipse.gmf.codegen/templates/xpt/diagram/edithelpers/BaseEditHelper.xpt
+++ b/plugins/org.eclipse.gmf.codegen/templates/xpt/diagram/edithelpers/BaseEditHelper.xpt
@@ -19,15 +19,16 @@ package «editHelpersPackageName»;
«EXPAND xpt::Common::generatedClassComment»
public class «baseEditHelperClassName» extends org.eclipse.gmf.runtime.emf.type.core.edithelper.AbstractEditHelper {
- «EXPAND xpt::Common::generatedMemberComment»
- public static final String EDIT_POLICY_COMMAND = "edit policy command"; //$NON-NLS-1$
+ «EXPAND attributes-»
+
+ «EXPAND getEditHelperAdvice-»
«EXPAND xpt::Common::generatedMemberComment»
protected org.eclipse.gmf.runtime.common.core.command.ICommand getInsteadCommand(
org.eclipse.gmf.runtime.emf.type.core.requests.IEditCommandRequest req) {
org.eclipse.gmf.runtime.common.core.command.ICommand epCommand =
- (org.eclipse.gmf.runtime.common.core.command.ICommand) req.getParameter(EDIT_POLICY_COMMAND);
- req.setParameter(EDIT_POLICY_COMMAND, null);
+ (org.eclipse.gmf.runtime.common.core.command.ICommand) req.getParameter(«EXPAND editPolicyCommand»);
+ req.setParameter(«EXPAND editPolicyCommand», null);
org.eclipse.gmf.runtime.common.core.command.ICommand ehCommand = super.getInsteadCommand(req);
if (epCommand == null) {
return ehCommand;
@@ -69,4 +70,30 @@ public class «baseEditHelperClassName» extends org.eclipse.gmf.runtime.emf.type.
}
«ENDDEFINE»
+«DEFINE attributes FOR gmfgen::GenDiagram-»
+ «EXPAND xpt::Common::generatedMemberComment»
+ public static final String «EXPAND editPolicyCommand» = "edit policy command"; //$NON-NLS-1$
+
+ «EXPAND xpt::Common::generatedMemberComment»
+ public static final String «EXPAND contextElementType» = "context element type"; //$NON-NLS-1$
+«ENDDEFINE»
+
+«DEFINE editPolicyCommand FOR gmfgen::GenDiagram»EDIT_POLICY_COMMAND«ENDDEFINE»
+
+«DEFINE contextElementType FOR gmfgen::GenDiagram»CONTEXT_ELEMENT_TYPE«ENDDEFINE»
+
+«DEFINE editPolicyCommandConstant FOR gmfgen::GenDiagram»«getBaseEditHelperQualifiedClassName()».«EXPAND editPolicyCommand»«ENDDEFINE»
+
+«DEFINE contextElementTypeConstant FOR gmfgen::GenDiagram»«getBaseEditHelperQualifiedClassName()».«EXPAND contextElementType»«ENDDEFINE»
+
+«DEFINE getEditHelperAdvice FOR gmfgen::GenDiagram-»
+ «EXPAND xpt::Common::generatedMemberComment»
+ protected org.eclipse.gmf.runtime.emf.type.core.edithelper.IEditHelperAdvice[] getEditHelperAdvice(org.eclipse.gmf.runtime.emf.type.core.requests.IEditCommandRequest req) {
+ if (req.getParameter(«EXPAND contextElementType») instanceof org.eclipse.gmf.runtime.emf.type.core.IElementType) {
+ return org.eclipse.gmf.runtime.emf.type.core.ElementTypeRegistry.getInstance().getEditHelperAdvice((org.eclipse.gmf.runtime.emf.type.core.IElementType) req.getParameter(«EXPAND contextElementType»));
+ }
+ return super.getEditHelperAdvice(req);
+ }
+«ENDDEFINE»
+
«DEFINE additions FOR gmfgen::GenDiagram»«ENDDEFINE»

Back to the top