Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoratikhomirov2007-04-18 13:03:13 -0400
committeratikhomirov2007-04-18 13:03:13 -0400
commitc1dfa267d35d8e3f9d32c98cafa5a5431bc29456 (patch)
tree02ba84dba74a382d1bfe6812f56449c838572d12
parentb311cb0afe6cff36a6a2e0056b3614e2ec99afbf (diff)
downloadorg.eclipse.gmf-tooling-c1dfa267d35d8e3f9d32c98cafa5a5431bc29456.tar.gz
org.eclipse.gmf-tooling-c1dfa267d35d8e3f9d32c98cafa5a5431bc29456.tar.xz
org.eclipse.gmf-tooling-c1dfa267d35d8e3f9d32c98cafa5a5431bc29456.zip
no reason to generate empty edithelper advices unless we do generate some meaningful code within. Those willing to get empty classes generated can specify advice class name in the model
-rw-r--r--plugins/org.eclipse.gmf.codegen/src/org/eclipse/gmf/codegen/gmfgen/impl/SpecializationTypeImpl.java6
-rw-r--r--plugins/org.eclipse.gmf.codegen/src/org/eclipse/gmf/codegen/util/Generator.java3
-rw-r--r--plugins/org.eclipse.gmf.codegen/templates/xpt/diagram/providers/extensions.xpt4
3 files changed, 6 insertions, 7 deletions
diff --git a/plugins/org.eclipse.gmf.codegen/src/org/eclipse/gmf/codegen/gmfgen/impl/SpecializationTypeImpl.java b/plugins/org.eclipse.gmf.codegen/src/org/eclipse/gmf/codegen/gmfgen/impl/SpecializationTypeImpl.java
index 85c2b4d47..d30b3a576 100644
--- a/plugins/org.eclipse.gmf.codegen/src/org/eclipse/gmf/codegen/gmfgen/impl/SpecializationTypeImpl.java
+++ b/plugins/org.eclipse.gmf.codegen/src/org/eclipse/gmf/codegen/gmfgen/impl/SpecializationTypeImpl.java
@@ -127,12 +127,8 @@ public class SpecializationTypeImpl extends ElementTypeImpl implements Specializ
* <!-- end-user-doc -->
* @generated
*/
- public String getEditHelperAdviceClassNameGen() {
- return editHelperAdviceClassName;
- }
-
public String getEditHelperAdviceClassName() {
- return GenCommonBaseImpl.getValidClassName(getEditHelperAdviceClassNameGen(), getDiagramElement(), EDIT_HELPER_ADVICE_SUFFIX);
+ return editHelperAdviceClassName;
}
/**
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 6b00c8bd2..b3a495515 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
@@ -344,6 +344,9 @@ public class Generator extends GeneratorBase implements Runnable {
}
private void generateEditHelperAdvice(SpecializationType genType) throws UnexpectedBehaviourException, InterruptedException {
+ if (!genType.eIsSet(GMFGenPackage.eINSTANCE.getSpecializationType_EditHelperAdviceClassName())) {
+ return;
+ }
internalGenerateJavaClass(
myEmitters.getEditHelperAdviceEmitter(),
myDiagram.getEditHelpersPackageName(),
diff --git a/plugins/org.eclipse.gmf.codegen/templates/xpt/diagram/providers/extensions.xpt b/plugins/org.eclipse.gmf.codegen/templates/xpt/diagram/providers/extensions.xpt
index 909d695da..2e5191325 100644
--- a/plugins/org.eclipse.gmf.codegen/templates/xpt/diagram/providers/extensions.xpt
+++ b/plugins/org.eclipse.gmf.codegen/templates/xpt/diagram/providers/extensions.xpt
@@ -130,8 +130,8 @@
«IF null != displayName-»
name="%metatype.name.«diagramElement.getUniqueIdentifier()»"
«ENDIF-»
- kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType"
- edithelperadvice="«getEditHelperAdviceQualifiedClassName()»">
+ kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType"«IF editHelperAdviceClassName != null»
+ edithelperadvice="«getEditHelperAdviceQualifiedClassName()»"«ENDIF»>
<specializes id="«null == metamodelType ? "org.eclipse.gmf.runtime.emf.type.core.null" : metamodelType.uniqueIdentifier»"/>
<param name="semanticHint" value="«diagramElement.visualID»"/>
</specializationType>

Back to the top