Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoratikhomirov2009-09-25 13:32:59 -0400
committeratikhomirov2009-09-25 13:32:59 -0400
commitf7d218a6a65c00f39af94716ff156e233e8399d7 (patch)
treebadfca0d2f1ce5dffb3ec7aefb9a9a96f9ef3b31
parent509365e29967e78d6631e2b396e8ef23f46a4df9 (diff)
downloadorg.eclipse.gmf-tooling-f7d218a6a65c00f39af94716ff156e233e8399d7.tar.gz
org.eclipse.gmf-tooling-f7d218a6a65c00f39af94716ff156e233e8399d7.tar.xz
org.eclipse.gmf-tooling-f7d218a6a65c00f39af94716ff156e233e8399d7.zip
[283717] explicitly generate boilerplate code for custom property tabsv20090929-1734
[254734] resolve issues with use of qualified and non-qualified class names for custom tab and filter.
-rw-r--r--plugins/org.eclipse.gmf.codegen/models/gmfgen.ecore20
-rw-r--r--plugins/org.eclipse.gmf.codegen/models/gmfgen.emf1
-rw-r--r--plugins/org.eclipse.gmf.codegen/models/gmfgen.genmodel1
-rw-r--r--plugins/org.eclipse.gmf.codegen/src/org/eclipse/gmf/codegen/gmfgen/CustomTabFilter.java3
-rw-r--r--plugins/org.eclipse.gmf.codegen/src/org/eclipse/gmf/codegen/gmfgen/GMFGenPackage.java22
-rw-r--r--plugins/org.eclipse.gmf.codegen/src/org/eclipse/gmf/codegen/gmfgen/GenCustomPropertyTab.java31
-rw-r--r--plugins/org.eclipse.gmf.codegen/src/org/eclipse/gmf/codegen/gmfgen/impl/CustomTabFilterImpl.java6
-rw-r--r--plugins/org.eclipse.gmf.codegen/src/org/eclipse/gmf/codegen/gmfgen/impl/GMFGenPackageImpl.java32
-rw-r--r--plugins/org.eclipse.gmf.codegen/src/org/eclipse/gmf/codegen/gmfgen/impl/GenCustomPropertyTabImpl.java60
-rw-r--r--plugins/org.eclipse.gmf.codegen/src/org/eclipse/gmf/codegen/util/Generator.java8
10 files changed, 157 insertions, 27 deletions
diff --git a/plugins/org.eclipse.gmf.codegen/models/gmfgen.ecore b/plugins/org.eclipse.gmf.codegen/models/gmfgen.ecore
index 1213b3cbd..e7045c272 100644
--- a/plugins/org.eclipse.gmf.codegen/models/gmfgen.ecore
+++ b/plugins/org.eclipse.gmf.codegen/models/gmfgen.ecore
@@ -2055,9 +2055,15 @@
<eClassifiers xsi:type="ecore:EClass" name="GenCustomPropertyTab" eSuperTypes="#//GenPropertyTab">
<eOperations name="getQualifiedClassName" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="className" lowerBound="1"
- eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
+ eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="documentation" value="For custom tabs without generated boilerplate code should be qualified class name. If not, property sheet's package name will be used for qualified names"/>
+ </eAnnotations>
+ </eStructuralFeatures>
<eStructuralFeatures xsi:type="ecore:EReference" name="filter" eType="#//GenPropertyTabFilter"
containment="true" eOpposite="#//GenPropertyTabFilter/tab"/>
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="generateBoilerplate" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EBoolean"
+ defaultValueLiteral="true"/>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="GenPropertyTabFilter" abstract="true"
interface="true">
@@ -2081,7 +2087,11 @@
<eClassifiers xsi:type="ecore:EClass" name="CustomTabFilter" eSuperTypes="#//GenPropertyTabFilter">
<eOperations name="getQualifiedClassName" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="className" lowerBound="1"
- eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
+ eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="documentation" value="Qualified class name of a tab filter, implementation of org.eclipse.jface.viewers.IFilter. If class name is not qualified, it's prefixed with editor's package name for legacy reasons"/>
+ </eAnnotations>
+ </eStructuralFeatures>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="GenContributionItem" abstract="true"
interface="true">
@@ -2130,7 +2140,11 @@
<details key="documentation" value="Action that is generated along with diagram action, i.e. there's a template that provides its implementation"/>
</eAnnotations>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="qualifiedClassName" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="name" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="name" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="documentation" value="Human-readble name"/>
+ </eAnnotations>
+ </eStructuralFeatures>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="LoadResourceAction" eSuperTypes="#//GenAction"/>
<eClassifiers xsi:type="ecore:EClass" name="InitDiagramAction" eSuperTypes="#//GenAction"/>
diff --git a/plugins/org.eclipse.gmf.codegen/models/gmfgen.emf b/plugins/org.eclipse.gmf.codegen/models/gmfgen.emf
index 1866585bc..98ec1ae84 100644
--- a/plugins/org.eclipse.gmf.codegen/models/gmfgen.emf
+++ b/plugins/org.eclipse.gmf.codegen/models/gmfgen.emf
@@ -1430,6 +1430,7 @@ enum GeneratedType {
}
class CustomTabFilter extends GenPropertyTabFilter {
+ @genmodel(documentation="Qualified class name of a tab filter, implementation of org.eclipse.jface.viewers.IFilter. If class name is not qualified, it's prefixed with editor's package name for legacy reasons")
attr String[1] className;
op String getQualifiedClassName();
}
diff --git a/plugins/org.eclipse.gmf.codegen/models/gmfgen.genmodel b/plugins/org.eclipse.gmf.codegen/models/gmfgen.genmodel
index 757fff7d9..53a7a2c22 100644
--- a/plugins/org.eclipse.gmf.codegen/models/gmfgen.genmodel
+++ b/plugins/org.eclipse.gmf.codegen/models/gmfgen.genmodel
@@ -923,6 +923,7 @@
<genClasses ecoreClass="gmfgen.ecore#//GenCustomPropertyTab" labelFeature="#//gmfgen/GenPropertyTab/label">
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute gmfgen.ecore#//GenCustomPropertyTab/className"/>
<genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference gmfgen.ecore#//GenCustomPropertyTab/filter"/>
+ <genFeatures createChild="false" ecoreFeature="ecore:EAttribute gmfgen.ecore#//GenCustomPropertyTab/generateBoilerplate"/>
<genOperations ecoreOperation="gmfgen.ecore#//GenCustomPropertyTab/getQualifiedClassName"/>
</genClasses>
<genClasses ecoreClass="gmfgen.ecore#//GenPropertyTabFilter">
diff --git a/plugins/org.eclipse.gmf.codegen/src/org/eclipse/gmf/codegen/gmfgen/CustomTabFilter.java b/plugins/org.eclipse.gmf.codegen/src/org/eclipse/gmf/codegen/gmfgen/CustomTabFilter.java
index c55a7fed7..1e3c2158e 100644
--- a/plugins/org.eclipse.gmf.codegen/src/org/eclipse/gmf/codegen/gmfgen/CustomTabFilter.java
+++ b/plugins/org.eclipse.gmf.codegen/src/org/eclipse/gmf/codegen/gmfgen/CustomTabFilter.java
@@ -32,6 +32,9 @@ public interface CustomTabFilter extends GenPropertyTabFilter {
* there really should be more of a description here...
* </p>
* <!-- end-user-doc -->
+ * <!-- begin-model-doc -->
+ * Qualified class name of a tab filter, implementation of org.eclipse.jface.viewers.IFilter. If class name is not qualified, it's prefixed with editor's package name for legacy reasons
+ * <!-- end-model-doc -->
* @return the value of the '<em>Class Name</em>' attribute.
* @see #setClassName(String)
* @see org.eclipse.gmf.codegen.gmfgen.GMFGenPackage#getCustomTabFilter_ClassName()
diff --git a/plugins/org.eclipse.gmf.codegen/src/org/eclipse/gmf/codegen/gmfgen/GMFGenPackage.java b/plugins/org.eclipse.gmf.codegen/src/org/eclipse/gmf/codegen/gmfgen/GMFGenPackage.java
index 7bfeb98f6..b9543e337 100644
--- a/plugins/org.eclipse.gmf.codegen/src/org/eclipse/gmf/codegen/gmfgen/GMFGenPackage.java
+++ b/plugins/org.eclipse.gmf.codegen/src/org/eclipse/gmf/codegen/gmfgen/GMFGenPackage.java
@@ -9427,13 +9427,22 @@ public interface GMFGenPackage extends EPackage {
int GEN_CUSTOM_PROPERTY_TAB__FILTER = GEN_PROPERTY_TAB_FEATURE_COUNT + 1;
/**
+ * The feature id for the '<em><b>Generate Boilerplate</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int GEN_CUSTOM_PROPERTY_TAB__GENERATE_BOILERPLATE = GEN_PROPERTY_TAB_FEATURE_COUNT + 2;
+
+ /**
* The number of structural features of the '<em>Gen Custom Property Tab</em>' class.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
- int GEN_CUSTOM_PROPERTY_TAB_FEATURE_COUNT = GEN_PROPERTY_TAB_FEATURE_COUNT + 2;
+ int GEN_CUSTOM_PROPERTY_TAB_FEATURE_COUNT = GEN_PROPERTY_TAB_FEATURE_COUNT + 3;
/**
* The meta object id for the '{@link org.eclipse.gmf.codegen.gmfgen.GenPropertyTabFilter <em>Gen Property Tab Filter</em>}' class.
@@ -16577,6 +16586,17 @@ public interface GMFGenPackage extends EPackage {
EReference getGenCustomPropertyTab_Filter();
/**
+ * Returns the meta object for the attribute '{@link org.eclipse.gmf.codegen.gmfgen.GenCustomPropertyTab#isGenerateBoilerplate <em>Generate Boilerplate</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for the attribute '<em>Generate Boilerplate</em>'.
+ * @see org.eclipse.gmf.codegen.gmfgen.GenCustomPropertyTab#isGenerateBoilerplate()
+ * @see #getGenCustomPropertyTab()
+ * @generated
+ */
+ EAttribute getGenCustomPropertyTab_GenerateBoilerplate();
+
+ /**
* Returns the meta object for class '{@link org.eclipse.gmf.codegen.gmfgen.GenPropertyTabFilter <em>Gen Property Tab Filter</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
diff --git a/plugins/org.eclipse.gmf.codegen/src/org/eclipse/gmf/codegen/gmfgen/GenCustomPropertyTab.java b/plugins/org.eclipse.gmf.codegen/src/org/eclipse/gmf/codegen/gmfgen/GenCustomPropertyTab.java
index ae0c92565..d9be0662b 100644
--- a/plugins/org.eclipse.gmf.codegen/src/org/eclipse/gmf/codegen/gmfgen/GenCustomPropertyTab.java
+++ b/plugins/org.eclipse.gmf.codegen/src/org/eclipse/gmf/codegen/gmfgen/GenCustomPropertyTab.java
@@ -17,6 +17,7 @@ package org.eclipse.gmf.codegen.gmfgen;
* <ul>
* <li>{@link org.eclipse.gmf.codegen.gmfgen.GenCustomPropertyTab#getClassName <em>Class Name</em>}</li>
* <li>{@link org.eclipse.gmf.codegen.gmfgen.GenCustomPropertyTab#getFilter <em>Filter</em>}</li>
+ * <li>{@link org.eclipse.gmf.codegen.gmfgen.GenCustomPropertyTab#isGenerateBoilerplate <em>Generate Boilerplate</em>}</li>
* </ul>
* </p>
*
@@ -33,6 +34,9 @@ public interface GenCustomPropertyTab extends GenPropertyTab {
* there really should be more of a description here...
* </p>
* <!-- end-user-doc -->
+ * <!-- begin-model-doc -->
+ * For custom tabs without generated boilerplate code should be qualified class name. If not, property sheet's package name will be used for qualified names
+ * <!-- end-model-doc -->
* @return the value of the '<em>Class Name</em>' attribute.
* @see #setClassName(String)
* @see org.eclipse.gmf.codegen.gmfgen.GMFGenPackage#getGenCustomPropertyTab_ClassName()
@@ -80,6 +84,33 @@ public interface GenCustomPropertyTab extends GenPropertyTab {
void setFilter(GenPropertyTabFilter value);
/**
+ * Returns the value of the '<em><b>Generate Boilerplate</b></em>' attribute.
+ * The default value is <code>"true"</code>.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Generate Boilerplate</em>' attribute isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Generate Boilerplate</em>' attribute.
+ * @see #setGenerateBoilerplate(boolean)
+ * @see org.eclipse.gmf.codegen.gmfgen.GMFGenPackage#getGenCustomPropertyTab_GenerateBoilerplate()
+ * @model default="true"
+ * @generated
+ */
+ boolean isGenerateBoilerplate();
+
+ /**
+ * Sets the value of the '{@link org.eclipse.gmf.codegen.gmfgen.GenCustomPropertyTab#isGenerateBoilerplate <em>Generate Boilerplate</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param value the new value of the '<em>Generate Boilerplate</em>' attribute.
+ * @see #isGenerateBoilerplate()
+ * @generated
+ */
+ void setGenerateBoilerplate(boolean value);
+
+ /**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @model kind="operation"
diff --git a/plugins/org.eclipse.gmf.codegen/src/org/eclipse/gmf/codegen/gmfgen/impl/CustomTabFilterImpl.java b/plugins/org.eclipse.gmf.codegen/src/org/eclipse/gmf/codegen/gmfgen/impl/CustomTabFilterImpl.java
index 48fc30d75..1e68e7c32 100644
--- a/plugins/org.eclipse.gmf.codegen/src/org/eclipse/gmf/codegen/gmfgen/impl/CustomTabFilterImpl.java
+++ b/plugins/org.eclipse.gmf.codegen/src/org/eclipse/gmf/codegen/gmfgen/impl/CustomTabFilterImpl.java
@@ -107,7 +107,11 @@ public class CustomTabFilterImpl extends EObjectImpl implements CustomTabFilter
* @generated NOT
*/
public String getQualifiedClassName() {
- return getTab().getSheet().getEditorGen().getEditor().getPackageName() + '.' + getClassName();
+ String s = getClassName();
+ if (s != null && s.indexOf('.') != -1) {
+ return s;
+ }
+ return getTab().getSheet().getEditorGen().getEditor().getPackageName() + '.' + s;
}
/**
diff --git a/plugins/org.eclipse.gmf.codegen/src/org/eclipse/gmf/codegen/gmfgen/impl/GMFGenPackageImpl.java b/plugins/org.eclipse.gmf.codegen/src/org/eclipse/gmf/codegen/gmfgen/impl/GMFGenPackageImpl.java
index ce2173c0b..4a1698c6f 100644
--- a/plugins/org.eclipse.gmf.codegen/src/org/eclipse/gmf/codegen/gmfgen/impl/GMFGenPackageImpl.java
+++ b/plugins/org.eclipse.gmf.codegen/src/org/eclipse/gmf/codegen/gmfgen/impl/GMFGenPackageImpl.java
@@ -1144,20 +1144,10 @@ public class GMFGenPackageImpl extends EPackageImpl implements GMFGenPackage {
private static boolean isInited = false;
/**
- * Creates, registers, and initializes the <b>Package</b> for this
- * model, and for any others upon which it depends. Simple
- * dependencies are satisfied by calling this method on all
- * dependent packages before doing anything else. This method drives
- * initialization for interdependent packages directly, in parallel
- * with this package, itself.
- * <p>Of this package and its interdependencies, all packages which
- * have not yet been registered by their URI values are first created
- * and registered. The packages are then initialized in two steps:
- * meta-model objects for all of the packages are created before any
- * are initialized, since one package's meta-model objects may refer to
- * those of another.
- * <p>Invocation of this method will not affect any packages that have
- * already been initialized.
+ * Creates, registers, and initializes the <b>Package</b> for this model, and for any others upon which it depends.
+ *
+ * <p>This method is used to initialize {@link GMFGenPackage#eINSTANCE} when that field is accessed.
+ * Clients should not invoke it directly. Instead, they should simply access that field to obtain the package.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #eNS_URI
@@ -1167,7 +1157,7 @@ public class GMFGenPackageImpl extends EPackageImpl implements GMFGenPackage {
if (isInited) return (GMFGenPackage)EPackage.Registry.INSTANCE.getEPackage(GMFGenPackage.eNS_URI);
// Obtain or create and register package
- GMFGenPackageImpl theGMFGenPackage = (GMFGenPackageImpl)(EPackage.Registry.INSTANCE.getEPackage(eNS_URI) instanceof GMFGenPackageImpl ? EPackage.Registry.INSTANCE.getEPackage(eNS_URI) : new GMFGenPackageImpl());
+ GMFGenPackageImpl theGMFGenPackage = (GMFGenPackageImpl)(EPackage.Registry.INSTANCE.get(eNS_URI) instanceof GMFGenPackageImpl ? EPackage.Registry.INSTANCE.get(eNS_URI) : new GMFGenPackageImpl());
isInited = true;
@@ -1183,6 +1173,9 @@ public class GMFGenPackageImpl extends EPackageImpl implements GMFGenPackage {
// Mark meta-data to indicate it can't be changed
theGMFGenPackage.freeze();
+
+ // Update the registry and return the package
+ EPackage.Registry.INSTANCE.put(GMFGenPackage.eNS_URI, theGMFGenPackage);
return theGMFGenPackage;
}
@@ -6273,6 +6266,15 @@ public class GMFGenPackageImpl extends EPackageImpl implements GMFGenPackage {
* <!-- end-user-doc -->
* @generated
*/
+ public EAttribute getGenCustomPropertyTab_GenerateBoilerplate() {
+ return (EAttribute)getGenCustomPropertyTab().getEStructuralFeatures().get(2);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
public EClass getGenPropertyTabFilter() {
if (genPropertyTabFilterEClass == null) {
genPropertyTabFilterEClass = (EClass)EPackage.Registry.INSTANCE.getEPackage(GMFGenPackage.eNS_URI).getEClassifiers().get(127);
diff --git a/plugins/org.eclipse.gmf.codegen/src/org/eclipse/gmf/codegen/gmfgen/impl/GenCustomPropertyTabImpl.java b/plugins/org.eclipse.gmf.codegen/src/org/eclipse/gmf/codegen/gmfgen/impl/GenCustomPropertyTabImpl.java
index b61a659b8..0f02448e2 100644
--- a/plugins/org.eclipse.gmf.codegen/src/org/eclipse/gmf/codegen/gmfgen/impl/GenCustomPropertyTabImpl.java
+++ b/plugins/org.eclipse.gmf.codegen/src/org/eclipse/gmf/codegen/gmfgen/impl/GenCustomPropertyTabImpl.java
@@ -27,6 +27,7 @@ import org.eclipse.gmf.codegen.gmfgen.GenPropertyTabFilter;
* <ul>
* <li>{@link org.eclipse.gmf.codegen.gmfgen.impl.GenCustomPropertyTabImpl#getClassName <em>Class Name</em>}</li>
* <li>{@link org.eclipse.gmf.codegen.gmfgen.impl.GenCustomPropertyTabImpl#getFilter <em>Filter</em>}</li>
+ * <li>{@link org.eclipse.gmf.codegen.gmfgen.impl.GenCustomPropertyTabImpl#isGenerateBoilerplate <em>Generate Boilerplate</em>}</li>
* </ul>
* </p>
*
@@ -64,6 +65,26 @@ public class GenCustomPropertyTabImpl extends GenPropertyTabImpl implements GenC
protected GenPropertyTabFilter filter;
/**
+ * The default value of the '{@link #isGenerateBoilerplate() <em>Generate Boilerplate</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #isGenerateBoilerplate()
+ * @generated
+ * @ordered
+ */
+ protected static final boolean GENERATE_BOILERPLATE_EDEFAULT = true;
+
+ /**
+ * The cached value of the '{@link #isGenerateBoilerplate() <em>Generate Boilerplate</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #isGenerateBoilerplate()
+ * @generated
+ * @ordered
+ */
+ protected boolean generateBoilerplate = GENERATE_BOILERPLATE_EDEFAULT;
+
+ /**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
@@ -157,10 +178,35 @@ public class GenCustomPropertyTabImpl extends GenPropertyTabImpl implements GenC
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
+ * @generated
+ */
+ public boolean isGenerateBoilerplate() {
+ return generateBoilerplate;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setGenerateBoilerplate(boolean newGenerateBoilerplate) {
+ boolean oldGenerateBoilerplate = generateBoilerplate;
+ generateBoilerplate = newGenerateBoilerplate;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET, GMFGenPackage.GEN_CUSTOM_PROPERTY_TAB__GENERATE_BOILERPLATE, oldGenerateBoilerplate, generateBoilerplate));
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
* @generated NOT
*/
public String getQualifiedClassName() {
- return getSheet().getPackageName() + '.' + getClassName();
+ String simpleName = getClassName();
+ if (simpleName.indexOf('.') != -1) {
+ return simpleName; // not so simple name
+ }
+ return getSheet().getPackageName() + '.' + simpleName;
}
/**
@@ -205,6 +251,8 @@ public class GenCustomPropertyTabImpl extends GenPropertyTabImpl implements GenC
return getClassName();
case GMFGenPackage.GEN_CUSTOM_PROPERTY_TAB__FILTER:
return getFilter();
+ case GMFGenPackage.GEN_CUSTOM_PROPERTY_TAB__GENERATE_BOILERPLATE:
+ return isGenerateBoilerplate();
}
return super.eGet(featureID, resolve, coreType);
}
@@ -223,6 +271,9 @@ public class GenCustomPropertyTabImpl extends GenPropertyTabImpl implements GenC
case GMFGenPackage.GEN_CUSTOM_PROPERTY_TAB__FILTER:
setFilter((GenPropertyTabFilter)newValue);
return;
+ case GMFGenPackage.GEN_CUSTOM_PROPERTY_TAB__GENERATE_BOILERPLATE:
+ setGenerateBoilerplate((Boolean)newValue);
+ return;
}
super.eSet(featureID, newValue);
}
@@ -241,6 +292,9 @@ public class GenCustomPropertyTabImpl extends GenPropertyTabImpl implements GenC
case GMFGenPackage.GEN_CUSTOM_PROPERTY_TAB__FILTER:
setFilter((GenPropertyTabFilter)null);
return;
+ case GMFGenPackage.GEN_CUSTOM_PROPERTY_TAB__GENERATE_BOILERPLATE:
+ setGenerateBoilerplate(GENERATE_BOILERPLATE_EDEFAULT);
+ return;
}
super.eUnset(featureID);
}
@@ -257,6 +311,8 @@ public class GenCustomPropertyTabImpl extends GenPropertyTabImpl implements GenC
return CLASS_NAME_EDEFAULT == null ? className != null : !CLASS_NAME_EDEFAULT.equals(className);
case GMFGenPackage.GEN_CUSTOM_PROPERTY_TAB__FILTER:
return filter != null;
+ case GMFGenPackage.GEN_CUSTOM_PROPERTY_TAB__GENERATE_BOILERPLATE:
+ return generateBoilerplate != GENERATE_BOILERPLATE_EDEFAULT;
}
return super.eIsSet(featureID);
}
@@ -273,6 +329,8 @@ public class GenCustomPropertyTabImpl extends GenPropertyTabImpl implements GenC
StringBuffer result = new StringBuffer(super.toString());
result.append(" (className: ");
result.append(className);
+ result.append(", generateBoilerplate: ");
+ result.append(generateBoilerplate);
result.append(')');
return result.toString();
}
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 b49e07d13..7e9700b32 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
@@ -796,12 +796,8 @@ public class Generator extends GeneratorBase implements Runnable {
myEditorGen.getPropertySheet());
}
for (GenPropertyTab tab : myEditorGen.getPropertySheet().getTabs()) {
- if (tab instanceof GenCustomPropertyTab) {
- // XXX isGenerateBoolerplate??? Bug 283717
- internalGenerateJavaClass(
- myEmitters.getPropertySectionEmitter(),
- ((GenCustomPropertyTab) tab).getQualifiedClassName(),
- tab);
+ if (tab instanceof GenCustomPropertyTab && ((GenCustomPropertyTab) tab).isGenerateBoilerplate()) {
+ internalGenerateJavaClass(myEmitters.getPropertySectionEmitter(), ((GenCustomPropertyTab) tab).getQualifiedClassName(), tab);
}
}
}

Back to the top