diff options
26 files changed, 2723 insertions, 830 deletions
diff --git a/features/org.eclipse.emf.codegen.ecore.ui-feature/feature.xml b/features/org.eclipse.emf.codegen.ecore.ui-feature/feature.xml index 9377a78ae..73d8240e6 100644 --- a/features/org.eclipse.emf.codegen.ecore.ui-feature/feature.xml +++ b/features/org.eclipse.emf.codegen.ecore.ui-feature/feature.xml @@ -2,7 +2,7 @@ <feature id="org.eclipse.emf.codegen.ecore.ui" label="%featureName" - version="2.9.0.qualifier" + version="2.10.0.qualifier" provider-name="%providerName" license-feature="org.eclipse.emf.license" license-feature-version="2.7.0.qualifier"> diff --git a/features/org.eclipse.emf.common.ui-feature/feature.xml b/features/org.eclipse.emf.common.ui-feature/feature.xml index 2bf44460a..d0106fae1 100644 --- a/features/org.eclipse.emf.common.ui-feature/feature.xml +++ b/features/org.eclipse.emf.common.ui-feature/feature.xml @@ -2,7 +2,7 @@ <feature id="org.eclipse.emf.common.ui" label="%featureName" - version="2.8.0.qualifier" + version="2.9.0.qualifier" provider-name="%providerName" license-feature="org.eclipse.emf.license" license-feature-version="2.7.0.qualifier"> diff --git a/plugins/org.eclipse.emf.codegen.ecore.ui/META-INF/MANIFEST.MF b/plugins/org.eclipse.emf.codegen.ecore.ui/META-INF/MANIFEST.MF index 19ccd9942..890fc7c11 100644 --- a/plugins/org.eclipse.emf.codegen.ecore.ui/META-INF/MANIFEST.MF +++ b/plugins/org.eclipse.emf.codegen.ecore.ui/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: %pluginName Bundle-SymbolicName: org.eclipse.emf.codegen.ecore.ui; singleton:=true -Bundle-Version: 2.9.0.qualifier +Bundle-Version: 2.10.0.qualifier Bundle-ClassPath: . Bundle-Activator: org.eclipse.emf.codegen.ecore.genmodel.provider.GenModelEditPlugin$Implementation Bundle-Vendor: %providerName diff --git a/plugins/org.eclipse.emf.codegen.ecore.ui/plugin.properties b/plugins/org.eclipse.emf.codegen.ecore.ui/plugin.properties index 7c7b86fd4..4001dffd2 100644 --- a/plugins/org.eclipse.emf.codegen.ecore.ui/plugin.properties +++ b/plugins/org.eclipse.emf.codegen.ecore.ui/plugin.properties @@ -439,3 +439,6 @@ _UI_GenModel_decoration_description = The style of validation decorations to sup _UI_GenDecoration_None_literal = None _UI_GenDecoration_Manual_literal = Manual _UI_GenDecoration_Live_literal = Live + +_UI_GenModel_styleProviders_feature = Style Providers +_UI_GenModel_styleProviders_description = Whether item providers should provide support for specifying styled labels diff --git a/plugins/org.eclipse.emf.codegen.ecore.ui/src/org/eclipse/emf/codegen/ecore/genmodel/provider/GenModelItemProvider.java b/plugins/org.eclipse.emf.codegen.ecore.ui/src/org/eclipse/emf/codegen/ecore/genmodel/provider/GenModelItemProvider.java index 387eea21c..3a941f0a7 100644 --- a/plugins/org.eclipse.emf.codegen.ecore.ui/src/org/eclipse/emf/codegen/ecore/genmodel/provider/GenModelItemProvider.java +++ b/plugins/org.eclipse.emf.codegen.ecore.ui/src/org/eclipse/emf/codegen/ecore/genmodel/provider/GenModelItemProvider.java @@ -152,6 +152,7 @@ public class GenModelItemProvider addImportOrganizingPropertyDescriptor(object); addPluginKeyPropertyDescriptor(object); addDecorationPropertyDescriptor(object); + addStyleProvidersPropertyDescriptor(object); } return itemPropertyDescriptors; } @@ -1928,6 +1929,30 @@ public class GenModelItemProvider } /** + * This adds a property descriptor for the Style Providers feature. + * <!-- begin-user-doc --> + * @since 2.10 + * <!-- end-user-doc --> + * @generated + */ + protected void addStyleProvidersPropertyDescriptor(Object object) + { + itemPropertyDescriptors.add + (createItemPropertyDescriptor + (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), + getResourceLocator(), + getString("_UI_GenModel_styleProviders_feature"), + getString("_UI_GenModel_styleProviders_description"), + GenModelPackage.Literals.GEN_MODEL__STYLE_PROVIDERS, + true, + false, + false, + ItemPropertyDescriptor.BOOLEAN_VALUE_IMAGE, + getString("_UI_EditPropertyCategory"), + null)); + } + + /** * This specifies how to implement {@link #getChildren} and is used to deduce an appropriate feature for an * {@link org.eclipse.emf.edit.command.AddCommand}, {@link org.eclipse.emf.edit.command.RemoveCommand} or * {@link org.eclipse.emf.edit.command.MoveCommand} in {@link #createCommand}. @@ -2074,6 +2099,7 @@ public class GenModelItemProvider case GenModelPackage.GEN_MODEL__IMPORT_ORGANIZING: case GenModelPackage.GEN_MODEL__PLUGIN_KEY: case GenModelPackage.GEN_MODEL__DECORATION: + case GenModelPackage.GEN_MODEL__STYLE_PROVIDERS: fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true)); return; case GenModelPackage.GEN_MODEL__GEN_PACKAGES: diff --git a/plugins/org.eclipse.emf.codegen.ecore/model/GenModel.ecore b/plugins/org.eclipse.emf.codegen.ecore/model/GenModel.ecore index 4f48849f2..ec3e99daa 100644 --- a/plugins/org.eclipse.emf.codegen.ecore/model/GenModel.ecore +++ b/plugins/org.eclipse.emf.codegen.ecore/model/GenModel.ecore @@ -128,6 +128,7 @@ <eStructuralFeatures xsi:type="ecore:EAttribute" name="importOrganizing" eType="ecore:EDataType ../../org.eclipse.emf.ecore/model/Ecore.ecore#//EBoolean"/> <eStructuralFeatures xsi:type="ecore:EAttribute" name="pluginKey" eType="ecore:EDataType ../../org.eclipse.emf.ecore/model/Ecore.ecore#//EString"/> <eStructuralFeatures xsi:type="ecore:EAttribute" name="decoration" eType="#//GenDecoration"/> + <eStructuralFeatures xsi:type="ecore:EAttribute" name="styleProviders" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EBoolean"/> </eClassifiers> <eClassifiers xsi:type="ecore:EClass" name="GenPackage" eSuperTypes="#//GenBase"> <eStructuralFeatures xsi:type="ecore:EAttribute" name="prefix" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/> diff --git a/plugins/org.eclipse.emf.codegen.ecore/model/GenModel.genmodel b/plugins/org.eclipse.emf.codegen.ecore/model/GenModel.genmodel index 6b09b0a83..f6b647892 100644 --- a/plugins/org.eclipse.emf.codegen.ecore/model/GenModel.genmodel +++ b/plugins/org.eclipse.emf.codegen.ecore/model/GenModel.genmodel @@ -222,6 +222,8 @@ ecoreFeature="ecore:EAttribute GenModel.ecore#//GenModel/pluginKey"/> <genFeatures createChild="false" propertyCategory="Editor" propertyDescription="The style of validation decorations to support" ecoreFeature="ecore:EAttribute GenModel.ecore#//GenModel/decoration"/> + <genFeatures createChild="false" propertyCategory="Edit" propertyDescription="Whether item providers should provide support for specifying styled labels" + ecoreFeature="ecore:EAttribute GenModel.ecore#//GenModel/styleProviders"/> </genClasses> <genClasses image="false" ecoreClass="GenModel.ecore#//GenPackage"> <genFeatures createChild="false" propertyCategory="All" propertyDescription="The prefix for names of several packaged-related classes, including package, factory, switch, and adapter factory" diff --git a/plugins/org.eclipse.emf.codegen.ecore/src/org/eclipse/emf/codegen/ecore/genmodel/GenModel.java b/plugins/org.eclipse.emf.codegen.ecore/src/org/eclipse/emf/codegen/ecore/genmodel/GenModel.java index 8071f42c2..b082352ad 100644 --- a/plugins/org.eclipse.emf.codegen.ecore/src/org/eclipse/emf/codegen/ecore/genmodel/GenModel.java +++ b/plugins/org.eclipse.emf.codegen.ecore/src/org/eclipse/emf/codegen/ecore/genmodel/GenModel.java @@ -125,6 +125,7 @@ import org.eclipse.jdt.core.formatter.CodeFormatter; * <li>{@link org.eclipse.emf.codegen.ecore.genmodel.GenModel#isImportOrganizing <em>Import Organizing</em>}</li> * <li>{@link org.eclipse.emf.codegen.ecore.genmodel.GenModel#getPluginKey <em>Plugin Key</em>}</li> * <li>{@link org.eclipse.emf.codegen.ecore.genmodel.GenModel#getDecoration <em>Decoration</em>}</li> + * <li>{@link org.eclipse.emf.codegen.ecore.genmodel.GenModel#isStyleProviders <em>Style Providers</em>}</li> * </ul> * </p> * @@ -2213,6 +2214,30 @@ public interface GenModel extends GenBase */ void setDecoration(GenDecoration value); + /** + * Returns the value of the '<em><b>Style Providers</b></em>' attribute. + * <!-- begin-user-doc --> + * @since 2.10 + * <!-- end-user-doc --> + * @return the value of the '<em>Style Providers</em>' attribute. + * @see #setStyleProviders(boolean) + * @see org.eclipse.emf.codegen.ecore.genmodel.GenModelPackage#getGenModel_StyleProviders() + * @model + * @generated + */ + boolean isStyleProviders(); + + /** + * Sets the value of the '{@link org.eclipse.emf.codegen.ecore.genmodel.GenModel#isStyleProviders <em>Style Providers</em>}' attribute. + * <!-- begin-user-doc --> + * @since 2.10 + * <!-- end-user-doc --> + * @param value the new value of the '<em>Style Providers</em>' attribute. + * @see #isStyleProviders() + * @generated + */ + void setStyleProviders(boolean value); + EList<GenPackage> getStaticGenPackages(); void initialize(Collection<? extends EPackage> ePackages); diff --git a/plugins/org.eclipse.emf.codegen.ecore/src/org/eclipse/emf/codegen/ecore/genmodel/GenModelPackage.java b/plugins/org.eclipse.emf.codegen.ecore/src/org/eclipse/emf/codegen/ecore/genmodel/GenModelPackage.java index 9224dff9d..c2c5b8522 100644 --- a/plugins/org.eclipse.emf.codegen.ecore/src/org/eclipse/emf/codegen/ecore/genmodel/GenModelPackage.java +++ b/plugins/org.eclipse.emf.codegen.ecore/src/org/eclipse/emf/codegen/ecore/genmodel/GenModelPackage.java @@ -874,13 +874,23 @@ public interface GenModelPackage extends EPackage int GEN_MODEL__DECORATION = GEN_BASE_FEATURE_COUNT + 82; /** + * The feature id for the '<em><b>Style Providers</b></em>' attribute. + * <!-- begin-user-doc --> + * @since 2.10 + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int GEN_MODEL__STYLE_PROVIDERS = GEN_BASE_FEATURE_COUNT + 83; + + /** * The number of structural features of the '<em>Gen Model</em>' class. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated * @ordered */ - int GEN_MODEL_FEATURE_COUNT = GEN_BASE_FEATURE_COUNT + 83; + int GEN_MODEL_FEATURE_COUNT = GEN_BASE_FEATURE_COUNT + 84; /** * The meta object id for the '{@link org.eclipse.emf.codegen.ecore.genmodel.impl.GenPackageImpl <em>Gen Package</em>}' class. @@ -2896,6 +2906,18 @@ public interface GenModelPackage extends EPackage EAttribute getGenModel_Decoration(); /** + * Returns the meta object for the attribute '{@link org.eclipse.emf.codegen.ecore.genmodel.GenModel#isStyleProviders <em>Style Providers</em>}'. + * <!-- begin-user-doc --> + * @since 2.10 + * <!-- end-user-doc --> + * @return the meta object for the attribute '<em>Style Providers</em>'. + * @see org.eclipse.emf.codegen.ecore.genmodel.GenModel#isStyleProviders() + * @see #getGenModel() + * @generated + */ + EAttribute getGenModel_StyleProviders(); + + /** * Returns the meta object for class '{@link org.eclipse.emf.codegen.ecore.genmodel.GenPackage <em>Gen Package</em>}'. * <!-- begin-user-doc --> * <!-- end-user-doc --> @@ -4551,6 +4573,15 @@ public interface GenModelPackage extends EPackage EAttribute GEN_MODEL__DECORATION = eINSTANCE.getGenModel_Decoration(); /** + * The meta object literal for the '<em><b>Style Providers</b></em>' attribute feature. + * <!-- begin-user-doc --> + * @since 2.10 + * <!-- end-user-doc --> + * @generated + */ + EAttribute GEN_MODEL__STYLE_PROVIDERS = eINSTANCE.getGenModel_StyleProviders(); + + /** * The meta object literal for the '{@link org.eclipse.emf.codegen.ecore.genmodel.impl.GenPackageImpl <em>Gen Package</em>}' class. * <!-- begin-user-doc --> * <!-- end-user-doc --> diff --git a/plugins/org.eclipse.emf.codegen.ecore/src/org/eclipse/emf/codegen/ecore/genmodel/impl/GenModelImpl.java b/plugins/org.eclipse.emf.codegen.ecore/src/org/eclipse/emf/codegen/ecore/genmodel/impl/GenModelImpl.java index 85aab1fdd..0e3b6407f 100644 --- a/plugins/org.eclipse.emf.codegen.ecore/src/org/eclipse/emf/codegen/ecore/genmodel/impl/GenModelImpl.java +++ b/plugins/org.eclipse.emf.codegen.ecore/src/org/eclipse/emf/codegen/ecore/genmodel/impl/GenModelImpl.java @@ -208,6 +208,7 @@ import org.eclipse.emf.ecore.xml.type.XMLTypePackage; * <li>{@link org.eclipse.emf.codegen.ecore.genmodel.impl.GenModelImpl#isImportOrganizing <em>Import Organizing</em>}</li> * <li>{@link org.eclipse.emf.codegen.ecore.genmodel.impl.GenModelImpl#getPluginKey <em>Plugin Key</em>}</li> * <li>{@link org.eclipse.emf.codegen.ecore.genmodel.impl.GenModelImpl#getDecoration <em>Decoration</em>}</li> + * <li>{@link org.eclipse.emf.codegen.ecore.genmodel.impl.GenModelImpl#isStyleProviders <em>Style Providers</em>}</li> * </ul> * </p> * @@ -1821,6 +1822,28 @@ public class GenModelImpl extends GenBaseImpl implements GenModel */ protected GenDecoration decoration = DECORATION_EDEFAULT; + /** + * The default value of the '{@link #isStyleProviders() <em>Style Providers</em>}' attribute. + * <!-- begin-user-doc --> + * @since 2.10 + * <!-- end-user-doc --> + * @see #isStyleProviders() + * @generated + * @ordered + */ + protected static final boolean STYLE_PROVIDERS_EDEFAULT = false; + + /** + * The cached value of the '{@link #isStyleProviders() <em>Style Providers</em>}' attribute. + * <!-- begin-user-doc --> + * @since 2.10 + * <!-- end-user-doc --> + * @see #isStyleProviders() + * @generated + * @ordered + */ + protected boolean styleProviders = STYLE_PROVIDERS_EDEFAULT; + protected boolean validateModel = false; /** @@ -6483,6 +6506,31 @@ public class GenModelImpl extends GenBaseImpl implements GenModel /** * <!-- begin-user-doc --> + * @since 2.10 + * <!-- end-user-doc --> + * @generated + */ + public boolean isStyleProviders() + { + return styleProviders; + } + + /** + * <!-- begin-user-doc --> + * @since 2.10 + * <!-- end-user-doc --> + * @generated + */ + public void setStyleProviders(boolean newStyleProviders) + { + boolean oldStyleProviders = styleProviders; + styleProviders = newStyleProviders; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, GenModelPackage.GEN_MODEL__STYLE_PROVIDERS, oldStyleProviders, styleProviders)); + } + + /** + * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @@ -6690,6 +6738,8 @@ public class GenModelImpl extends GenBaseImpl implements GenModel return getPluginKey(); case GenModelPackage.GEN_MODEL__DECORATION: return getDecoration(); + case GenModelPackage.GEN_MODEL__STYLE_PROVIDERS: + return isStyleProviders(); } return super.eGet(featureID, resolve, coreType); } @@ -6963,6 +7013,9 @@ public class GenModelImpl extends GenBaseImpl implements GenModel case GenModelPackage.GEN_MODEL__DECORATION: setDecoration((GenDecoration)newValue); return; + case GenModelPackage.GEN_MODEL__STYLE_PROVIDERS: + setStyleProviders((Boolean)newValue); + return; } super.eSet(featureID, newValue); } @@ -7226,6 +7279,9 @@ public class GenModelImpl extends GenBaseImpl implements GenModel case GenModelPackage.GEN_MODEL__DECORATION: setDecoration(DECORATION_EDEFAULT); return; + case GenModelPackage.GEN_MODEL__STYLE_PROVIDERS: + setStyleProviders(STYLE_PROVIDERS_EDEFAULT); + return; } super.eUnset(featureID); } @@ -7406,6 +7462,8 @@ public class GenModelImpl extends GenBaseImpl implements GenModel return PLUGIN_KEY_EDEFAULT == null ? pluginKey != null : !PLUGIN_KEY_EDEFAULT.equals(pluginKey); case GenModelPackage.GEN_MODEL__DECORATION: return decoration != DECORATION_EDEFAULT; + case GenModelPackage.GEN_MODEL__STYLE_PROVIDERS: + return styleProviders != STYLE_PROVIDERS_EDEFAULT; } return super.eIsSet(featureID); } @@ -7577,6 +7635,8 @@ public class GenModelImpl extends GenBaseImpl implements GenModel result.append(pluginKey); result.append(", decoration: "); result.append(decoration); + result.append(", styleProviders: "); + result.append(styleProviders); result.append(')'); return result.toString(); } @@ -8892,6 +8952,7 @@ public class GenModelImpl extends GenBaseImpl implements GenModel } setDecoration(oldGenModelVersion.getDecoration()); + setStyleProviders(oldGenModelVersion.isStyleProviders()); } public boolean reconcile() diff --git a/plugins/org.eclipse.emf.codegen.ecore/src/org/eclipse/emf/codegen/ecore/genmodel/impl/GenModelPackageImpl.java b/plugins/org.eclipse.emf.codegen.ecore/src/org/eclipse/emf/codegen/ecore/genmodel/impl/GenModelPackageImpl.java index 58768fd9d..812fd1f75 100644 --- a/plugins/org.eclipse.emf.codegen.ecore/src/org/eclipse/emf/codegen/ecore/genmodel/impl/GenModelPackageImpl.java +++ b/plugins/org.eclipse.emf.codegen.ecore/src/org/eclipse/emf/codegen/ecore/genmodel/impl/GenModelPackageImpl.java @@ -1129,6 +1129,17 @@ public class GenModelPackageImpl extends EPackageImpl implements GenModelPackage /** * <!-- begin-user-doc --> + * @since 2.10 + * <!-- end-user-doc --> + * @generated + */ + public EAttribute getGenModel_StyleProviders() + { + return (EAttribute)genModelEClass.getEStructuralFeatures().get(83); + } + + /** + * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @@ -2131,6 +2142,7 @@ public class GenModelPackageImpl extends EPackageImpl implements GenModelPackage createEAttribute(genModelEClass, GEN_MODEL__IMPORT_ORGANIZING); createEAttribute(genModelEClass, GEN_MODEL__PLUGIN_KEY); createEAttribute(genModelEClass, GEN_MODEL__DECORATION); + createEAttribute(genModelEClass, GEN_MODEL__STYLE_PROVIDERS); genPackageEClass = createEClass(GEN_PACKAGE); createEAttribute(genPackageEClass, GEN_PACKAGE__PREFIX); @@ -2368,6 +2380,7 @@ public class GenModelPackageImpl extends EPackageImpl implements GenModelPackage initEAttribute(getGenModel_ImportOrganizing(), theEcorePackage.getEBoolean(), "importOrganizing", null, 0, 1, GenModel.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEAttribute(getGenModel_PluginKey(), theEcorePackage.getEString(), "pluginKey", null, 0, 1, GenModel.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEAttribute(getGenModel_Decoration(), this.getGenDecoration(), "decoration", null, 0, 1, GenModel.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEAttribute(getGenModel_StyleProviders(), ecorePackage.getEBoolean(), "styleProviders", null, 0, 1, GenModel.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEClass(genPackageEClass, GenPackage.class, "GenPackage", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); initEAttribute(getGenPackage_Prefix(), ecorePackage.getEString(), "prefix", null, 0, 1, GenPackage.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); diff --git a/plugins/org.eclipse.emf.codegen.ecore/src/org/eclipse/emf/codegen/ecore/genmodel/impl/GenPackageImpl.java b/plugins/org.eclipse.emf.codegen.ecore/src/org/eclipse/emf/codegen/ecore/genmodel/impl/GenPackageImpl.java index 56969b87a..6795ac5c9 100644 --- a/plugins/org.eclipse.emf.codegen.ecore/src/org/eclipse/emf/codegen/ecore/genmodel/impl/GenPackageImpl.java +++ b/plugins/org.eclipse.emf.codegen.ecore/src/org/eclipse/emf/codegen/ecore/genmodel/impl/GenPackageImpl.java @@ -4520,6 +4520,10 @@ public class GenPackageImpl extends GenBaseImpl implements GenPackage { result.add("org.eclipse.emf.edit.provider.IItemFontProvider"); } + if (getGenModel().isStyleProviders()) + { + result.add("org.eclipse.emf.edit.provider.IItemStyledLabelProvider"); + } return result; } diff --git a/plugins/org.eclipse.emf.codegen.ecore/src/org/eclipse/emf/codegen/ecore/templates/edit/ItemProvider.java b/plugins/org.eclipse.emf.codegen.ecore/src/org/eclipse/emf/codegen/ecore/templates/edit/ItemProvider.java index 0a6604d1c..ecb8557fa 100644 --- a/plugins/org.eclipse.emf.codegen.ecore/src/org/eclipse/emf/codegen/ecore/templates/edit/ItemProvider.java +++ b/plugins/org.eclipse.emf.codegen.ecore/src/org/eclipse/emf/codegen/ecore/templates/edit/ItemProvider.java @@ -99,141 +99,206 @@ public class ItemProvider protected final String TEXT_82 = NL + "\t/**" + NL + "\t * This returns the label text for the adapted class." + NL + "\t * <!-- begin-user-doc -->" + NL + "\t * <!-- end-user-doc -->" + NL + "\t * @generated" + NL + "\t */"; protected final String TEXT_83 = NL + "\t@Override"; protected final String TEXT_84 = NL + "\tpublic String getText(Object object)" + NL + "\t{"; - protected final String TEXT_85 = NL + "\t\t"; - protected final String TEXT_86 = "<?, ?>"; - protected final String TEXT_87 = " "; - protected final String TEXT_88 = " = ("; - protected final String TEXT_89 = "<?, ?>"; - protected final String TEXT_90 = ")object;"; - protected final String TEXT_91 = NL + "\t\treturn \"\" + "; - protected final String TEXT_92 = ".getKey() + \" -> \" + "; - protected final String TEXT_93 = ".getValue();"; - protected final String TEXT_94 = NL + "\t\tString key = crop(\"\" + "; - protected final String TEXT_95 = ".getKey());"; - protected final String TEXT_96 = NL + "\t\tString key = \"\" + "; - protected final String TEXT_97 = ".getKey();"; - protected final String TEXT_98 = NL + "\t\tString value = crop(\"\" + "; - protected final String TEXT_99 = ".getValue());"; - protected final String TEXT_100 = NL + "\t\tString value = \"\" + "; - protected final String TEXT_101 = ".getValue();"; - protected final String TEXT_102 = NL + "\t\treturn key + \" -> \" + value;"; - protected final String TEXT_103 = NL + "\t\t"; - protected final String TEXT_104 = " "; - protected final String TEXT_105 = " = ("; - protected final String TEXT_106 = ")object;" + NL + "\t\treturn getString(\"_UI_"; - protected final String TEXT_107 = "_type\") + \" \" + "; - protected final String TEXT_108 = "."; - protected final String TEXT_109 = "();"; - protected final String TEXT_110 = NL + "\t\tString label = crop((("; - protected final String TEXT_111 = ")object)."; - protected final String TEXT_112 = "());"; - protected final String TEXT_113 = NL + "\t\tString label = (("; - protected final String TEXT_114 = ")object)."; - protected final String TEXT_115 = "();"; - protected final String TEXT_116 = NL + "\t\t"; - protected final String TEXT_117 = " labelValue = (("; - protected final String TEXT_118 = ")object).eGet("; - protected final String TEXT_119 = ");"; - protected final String TEXT_120 = NL + "\t\t"; - protected final String TEXT_121 = " labelValue = (("; - protected final String TEXT_122 = ")object)."; - protected final String TEXT_123 = "();"; - protected final String TEXT_124 = NL + "\t\tString label = labelValue == null ? null : labelValue.toString();"; - protected final String TEXT_125 = NL + "\t\treturn label == null || label.length() == 0 ?" + NL + "\t\t\tgetString(\"_UI_"; - protected final String TEXT_126 = "_type\") :"; - protected final String TEXT_127 = NL + "\t\t\tgetString(\"_UI_"; - protected final String TEXT_128 = "_type\") + \" \" + label;"; - protected final String TEXT_129 = NL + "\t\treturn getString(\"_UI_"; - protected final String TEXT_130 = "_type\");"; - protected final String TEXT_131 = NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * This handles model notifications by calling {@link #updateChildren} to update any cached" + NL + "\t * children and by creating a viewer notification, which it passes to {@link #fireNotifyChanged}." + NL + "\t * <!-- begin-user-doc -->" + NL + "\t * <!-- end-user-doc -->" + NL + "\t * @generated" + NL + "\t */"; - protected final String TEXT_132 = NL + "\t@Override"; - protected final String TEXT_133 = NL + "\tpublic void notifyChanged(Notification notification)" + NL + "\t{" + NL + "\t\tupdateChildren(notification);"; - protected final String TEXT_134 = NL + NL + "\t\tswitch (notification.getFeatureID("; - protected final String TEXT_135 = ".class))" + NL + "\t\t{"; - protected final String TEXT_136 = NL + "\t\t\tcase "; - protected final String TEXT_137 = ":"; - protected final String TEXT_138 = NL + "\t\t\t\tfireNotifyChanged(new "; - protected final String TEXT_139 = "(notification, notification.getNotifier(), false, true));" + NL + "\t\t\t\treturn;"; - protected final String TEXT_140 = NL + "\t\t\tcase "; - protected final String TEXT_141 = ":"; - protected final String TEXT_142 = NL + "\t\t\t\tfireNotifyChanged(new "; - protected final String TEXT_143 = "(notification, notification.getNotifier(), true, false));" + NL + "\t\t\t\treturn;"; - protected final String TEXT_144 = NL + "\t\t\tcase "; - protected final String TEXT_145 = ":"; - protected final String TEXT_146 = NL + "\t\t\t\tfireNotifyChanged(new "; - protected final String TEXT_147 = "(notification, notification.getNotifier(), true, true));" + NL + "\t\t\t\treturn;"; - protected final String TEXT_148 = NL + "\t\t}"; - protected final String TEXT_149 = NL + "\t\tsuper.notifyChanged(notification);" + NL + "\t}" + NL; - protected final String TEXT_150 = NL + "\t/**" + NL + "\t * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s describing the children" + NL + "\t * that can be created under this object." + NL + "\t * <!-- begin-user-doc -->" + NL + "\t * <!-- end-user-doc -->" + NL + "\t * @generated" + NL + "\t */"; - protected final String TEXT_151 = NL + "\t@Override"; - protected final String TEXT_152 = NL + "\tprotected void collectNewChildDescriptors("; - protected final String TEXT_153 = " newChildDescriptors, Object object)" + NL + "\t{" + NL + "\t\tsuper.collectNewChildDescriptors(newChildDescriptors, object);"; - protected final String TEXT_154 = NL + NL + "\t\tnewChildDescriptors.add" + NL + "\t\t\t(createChildParameter" + NL + "\t\t\t\t("; - protected final String TEXT_155 = "," + NL + "\t\t\t\t "; - protected final String TEXT_156 = ".createEntry" + NL + "\t\t\t\t\t("; - protected final String TEXT_157 = ","; - protected final String TEXT_158 = NL + "\t\t\t\t\t "; - protected final String TEXT_159 = ".create("; - protected final String TEXT_160 = "))));"; - protected final String TEXT_161 = NL + "\t\t\t\t\t "; - protected final String TEXT_162 = ".create"; - protected final String TEXT_163 = "())));"; - protected final String TEXT_164 = NL + NL + "\t\tnewChildDescriptors.add" + NL + "\t\t\t(createChildParameter" + NL + "\t\t\t\t("; - protected final String TEXT_165 = "," + NL + "\t\t\t\t "; - protected final String TEXT_166 = ".createEntry" + NL + "\t\t\t\t\t("; - protected final String TEXT_167 = ","; - protected final String TEXT_168 = NL + "\t\t\t\t\t "; - protected final String TEXT_169 = ")));"; - protected final String TEXT_170 = NL + "\t\t\t\t\t "; - protected final String TEXT_171 = ")));"; - protected final String TEXT_172 = NL + "\t\t\t\t\t "; - protected final String TEXT_173 = ".createFromString("; - protected final String TEXT_174 = ", "; - protected final String TEXT_175 = "))));"; - protected final String TEXT_176 = " // TODO: ensure this is a valid literal value"; - protected final String TEXT_177 = NL + NL + "\t\tnewChildDescriptors.add" + NL + "\t\t\t(createChildParameter" + NL + "\t\t\t\t("; - protected final String TEXT_178 = ","; - protected final String TEXT_179 = NL + "\t\t\t\t "; - protected final String TEXT_180 = ".create("; - protected final String TEXT_181 = ")));"; - protected final String TEXT_182 = NL + "\t\t\t\t "; - protected final String TEXT_183 = ".create"; - protected final String TEXT_184 = "()));"; - protected final String TEXT_185 = NL + NL + "\t\tnewChildDescriptors.add" + NL + "\t\t\t(createChildParameter" + NL + "\t\t\t\t("; - protected final String TEXT_186 = ","; - protected final String TEXT_187 = NL + "\t\t\t\t "; - protected final String TEXT_188 = "));"; - protected final String TEXT_189 = NL + "\t\t\t\t "; - protected final String TEXT_190 = "));"; - protected final String TEXT_191 = NL + "\t\t\t\t "; - protected final String TEXT_192 = ".createFromString("; - protected final String TEXT_193 = ", "; - protected final String TEXT_194 = ")));"; - protected final String TEXT_195 = " // TODO: ensure this is a valid literal value"; - protected final String TEXT_196 = NL + "\t}" + NL; - protected final String TEXT_197 = NL + "\t/**" + NL + "\t * This returns the label text for {@link org.eclipse.emf.edit.command.CreateChildCommand}." + NL + "\t * <!-- begin-user-doc -->" + NL + "\t * <!-- end-user-doc -->" + NL + "\t * @generated" + NL + "\t */"; - protected final String TEXT_198 = NL + "\t@Override"; - protected final String TEXT_199 = NL + "\tpublic String getCreateChildText(Object owner, Object feature, Object child, "; - protected final String TEXT_200 = " selection)" + NL + "\t{" + NL + "\t\tObject childFeature = feature;" + NL + "\t\tObject childObject = child;" + NL; - protected final String TEXT_201 = NL + "\t\tif (childFeature instanceof "; - protected final String TEXT_202 = " && "; - protected final String TEXT_203 = ".isFeatureMap((EStructuralFeature)childFeature))" + NL + "\t\t{" + NL + "\t\t\t"; - protected final String TEXT_204 = ".Entry entry = (FeatureMap.Entry)childObject;" + NL + "\t\t\tchildFeature = entry.getEStructuralFeature();" + NL + "\t\t\tchildObject = entry.getValue();" + NL + "\t\t}" + NL; - protected final String TEXT_205 = NL + "\t\tboolean qualify ="; - protected final String TEXT_206 = NL + "\t\t\tchildFeature == "; - protected final String TEXT_207 = NL + NL + "\t\tif (qualify)" + NL + "\t\t{" + NL + "\t\t\treturn getString" + NL + "\t\t\t\t(\"_UI_CreateChild_text2\","; - protected final String TEXT_208 = NL + "\t\t\t\t new Object[] { getTypeText(childObject), getFeatureText(childFeature), getTypeText(owner) });" + NL + "\t\t}" + NL + "\t\treturn super.getCreateChildText(owner, feature, child, selection);" + NL + "\t}" + NL; - protected final String TEXT_209 = NL + "\t/**" + NL + "\t * Return the resource locator for this item provider's resources." + NL + "\t * <!-- begin-user-doc -->" + NL + "\t * <!-- end-user-doc -->" + NL + "\t * @generated" + NL + "\t */"; - protected final String TEXT_210 = NL + "\t@Override"; - protected final String TEXT_211 = NL + "\tpublic "; - protected final String TEXT_212 = " getResourceLocator()" + NL + "\t{"; - protected final String TEXT_213 = NL + "\t\treturn (("; - protected final String TEXT_214 = ")adapterFactory).getResourceLocator();"; - protected final String TEXT_215 = NL + "\t\treturn "; - protected final String TEXT_216 = ".INSTANCE;"; - protected final String TEXT_217 = NL + "\t}" + NL; - protected final String TEXT_218 = NL + "}"; - protected final String TEXT_219 = NL; + protected final String TEXT_85 = NL + "\t\treturn (("; + protected final String TEXT_86 = ")getStyledText(object)).getString();"; + protected final String TEXT_87 = NL + "\t\t"; + protected final String TEXT_88 = "<?, ?>"; + protected final String TEXT_89 = " "; + protected final String TEXT_90 = " = ("; + protected final String TEXT_91 = "<?, ?>"; + protected final String TEXT_92 = ")object;"; + protected final String TEXT_93 = NL + "\t\treturn \"\" + "; + protected final String TEXT_94 = ".getKey() + \" -> \" + "; + protected final String TEXT_95 = ".getValue();"; + protected final String TEXT_96 = NL + "\t\tString key = crop(\"\" + "; + protected final String TEXT_97 = ".getKey());"; + protected final String TEXT_98 = NL + "\t\tString key = \"\" + "; + protected final String TEXT_99 = ".getKey();"; + protected final String TEXT_100 = NL + "\t\tString value = crop(\"\" + "; + protected final String TEXT_101 = ".getValue());"; + protected final String TEXT_102 = NL + "\t\tString value = \"\" + "; + protected final String TEXT_103 = ".getValue();"; + protected final String TEXT_104 = NL + "\t\treturn key + \" -> \" + value;"; + protected final String TEXT_105 = NL + "\t\t"; + protected final String TEXT_106 = " "; + protected final String TEXT_107 = " = ("; + protected final String TEXT_108 = ")object;" + NL + "\t\treturn getString(\"_UI_"; + protected final String TEXT_109 = "_type\") + \" \" + "; + protected final String TEXT_110 = "."; + protected final String TEXT_111 = "();"; + protected final String TEXT_112 = NL + "\t\tString label = crop((("; + protected final String TEXT_113 = ")object)."; + protected final String TEXT_114 = "());"; + protected final String TEXT_115 = NL + "\t\tString label = (("; + protected final String TEXT_116 = ")object)."; + protected final String TEXT_117 = "();"; + protected final String TEXT_118 = NL + "\t\t"; + protected final String TEXT_119 = " labelValue = (("; + protected final String TEXT_120 = ")object).eGet("; + protected final String TEXT_121 = ");"; + protected final String TEXT_122 = NL + "\t\t"; + protected final String TEXT_123 = " labelValue = (("; + protected final String TEXT_124 = ")object)."; + protected final String TEXT_125 = "();"; + protected final String TEXT_126 = NL + "\t\tString label = labelValue == null ? null : labelValue.toString();"; + protected final String TEXT_127 = NL + "\t\treturn label == null || label.length() == 0 ?" + NL + "\t\t\tgetString(\"_UI_"; + protected final String TEXT_128 = "_type\") :"; + protected final String TEXT_129 = NL + "\t\t\tgetString(\"_UI_"; + protected final String TEXT_130 = "_type\") + \" \" + label;"; + protected final String TEXT_131 = NL + "\t\treturn getString(\"_UI_"; + protected final String TEXT_132 = "_type\");"; + protected final String TEXT_133 = NL + "\t}" + NL + "\t"; + protected final String TEXT_134 = NL + "\t/**" + NL + "\t * This returns the label styled text for the adapted class." + NL + "\t * <!-- begin-user-doc -->" + NL + "\t * <!-- end-user-doc -->" + NL + "\t * @generated" + NL + "\t */"; + protected final String TEXT_135 = NL + "\t@Override"; + protected final String TEXT_136 = NL + "\tpublic Object getStyledText(Object object)" + NL + "\t{"; + protected final String TEXT_137 = NL + "\t\t"; + protected final String TEXT_138 = "<?, ?>"; + protected final String TEXT_139 = " "; + protected final String TEXT_140 = " = ("; + protected final String TEXT_141 = "<?, ?>"; + protected final String TEXT_142 = ")object;"; + protected final String TEXT_143 = NL + "\t\treturn new "; + protected final String TEXT_144 = "(\"\" + "; + protected final String TEXT_145 = ".getKey()).append(\" -> \", "; + protected final String TEXT_146 = ".QUALIFIER_STYLER).append(\"\" + "; + protected final String TEXT_147 = ".getValue());"; + protected final String TEXT_148 = NL + "\t\tString key = crop(\"\" + "; + protected final String TEXT_149 = ".getKey());"; + protected final String TEXT_150 = NL + "\t\tString key = \"\" + "; + protected final String TEXT_151 = ".getKey();"; + protected final String TEXT_152 = NL + "\t\tString value = crop(\"\" + "; + protected final String TEXT_153 = ".getValue());"; + protected final String TEXT_154 = NL + "\t\tString value = \"\" + "; + protected final String TEXT_155 = ".getValue();"; + protected final String TEXT_156 = NL + "\t\treturn new "; + protected final String TEXT_157 = "(key).append(\" -> \", "; + protected final String TEXT_158 = ".QUALIFIER_STYLER).append(value);"; + protected final String TEXT_159 = NL + "\t\t"; + protected final String TEXT_160 = " "; + protected final String TEXT_161 = " = ("; + protected final String TEXT_162 = ")object;" + NL + "\t\treturn new "; + protected final String TEXT_163 = "(getString(\"_UI_"; + protected final String TEXT_164 = "_type\", "; + protected final String TEXT_165 = ".QUALIFIER_STYLER).append(\" \").append("; + protected final String TEXT_166 = "."; + protected final String TEXT_167 = "());"; + protected final String TEXT_168 = NL + "\t\tString label = crop((("; + protected final String TEXT_169 = ")object)."; + protected final String TEXT_170 = "());"; + protected final String TEXT_171 = NL + "\t\tString label = (("; + protected final String TEXT_172 = ")object)."; + protected final String TEXT_173 = "();"; + protected final String TEXT_174 = NL + "\t\t"; + protected final String TEXT_175 = " labelValue = (("; + protected final String TEXT_176 = ")object).eGet("; + protected final String TEXT_177 = ");"; + protected final String TEXT_178 = NL + "\t\t"; + protected final String TEXT_179 = " labelValue = (("; + protected final String TEXT_180 = ")object)."; + protected final String TEXT_181 = "();"; + protected final String TEXT_182 = NL + "\t\tString label = labelValue == null ? null : labelValue.toString();"; + protected final String TEXT_183 = NL + " \t"; + protected final String TEXT_184 = " styledLabel = new "; + protected final String TEXT_185 = "();" + NL + "\t\tif (label == null || label.length() == 0) " + NL + "\t\t{" + NL + "\t\t\tstyledLabel.append(getString(\"_UI_"; + protected final String TEXT_186 = "_type\"), "; + protected final String TEXT_187 = ".QUALIFIER_STYLER); "; + protected final String TEXT_188 = NL + "\t\t} else {" + NL + "\t\t\tstyledLabel.append(getString(\"_UI_"; + protected final String TEXT_189 = "_type\"), "; + protected final String TEXT_190 = ".QUALIFIER_STYLER).append(\" \" + label);"; + protected final String TEXT_191 = NL + "\t\t}" + NL + "\t\treturn styledLabel;"; + protected final String TEXT_192 = NL + "\t\treturn new "; + protected final String TEXT_193 = "(getString(\"_UI_"; + protected final String TEXT_194 = "_type\"));"; + protected final String TEXT_195 = NL + "\t}\t"; + protected final String TEXT_196 = NL + NL + "\t/**" + NL + "\t * This handles model notifications by calling {@link #updateChildren} to update any cached" + NL + "\t * children and by creating a viewer notification, which it passes to {@link #fireNotifyChanged}." + NL + "\t * <!-- begin-user-doc -->" + NL + "\t * <!-- end-user-doc -->" + NL + "\t * @generated" + NL + "\t */"; + protected final String TEXT_197 = NL + "\t@Override"; + protected final String TEXT_198 = NL + "\tpublic void notifyChanged(Notification notification)" + NL + "\t{" + NL + "\t\tupdateChildren(notification);"; + protected final String TEXT_199 = NL + NL + "\t\tswitch (notification.getFeatureID("; + protected final String TEXT_200 = ".class))" + NL + "\t\t{"; + protected final String TEXT_201 = NL + "\t\t\tcase "; + protected final String TEXT_202 = ":"; + protected final String TEXT_203 = NL + "\t\t\t\tfireNotifyChanged(new "; + protected final String TEXT_204 = "(notification, notification.getNotifier(), false, true));" + NL + "\t\t\t\treturn;"; + protected final String TEXT_205 = NL + "\t\t\tcase "; + protected final String TEXT_206 = ":"; + protected final String TEXT_207 = NL + "\t\t\t\tfireNotifyChanged(new "; + protected final String TEXT_208 = "(notification, notification.getNotifier(), true, false));" + NL + "\t\t\t\treturn;"; + protected final String TEXT_209 = NL + "\t\t\tcase "; + protected final String TEXT_210 = ":"; + protected final String TEXT_211 = NL + "\t\t\t\tfireNotifyChanged(new "; + protected final String TEXT_212 = "(notification, notification.getNotifier(), true, true));" + NL + "\t\t\t\treturn;"; + protected final String TEXT_213 = NL + "\t\t}"; + protected final String TEXT_214 = NL + "\t\tsuper.notifyChanged(notification);" + NL + "\t}" + NL; + protected final String TEXT_215 = NL + "\t/**" + NL + "\t * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s describing the children" + NL + "\t * that can be created under this object." + NL + "\t * <!-- begin-user-doc -->" + NL + "\t * <!-- end-user-doc -->" + NL + "\t * @generated" + NL + "\t */"; + protected final String TEXT_216 = NL + "\t@Override"; + protected final String TEXT_217 = NL + "\tprotected void collectNewChildDescriptors("; + protected final String TEXT_218 = " newChildDescriptors, Object object)" + NL + "\t{" + NL + "\t\tsuper.collectNewChildDescriptors(newChildDescriptors, object);"; + protected final String TEXT_219 = NL + NL + "\t\tnewChildDescriptors.add" + NL + "\t\t\t(createChildParameter" + NL + "\t\t\t\t("; + protected final String TEXT_220 = "," + NL + "\t\t\t\t "; + protected final String TEXT_221 = ".createEntry" + NL + "\t\t\t\t\t("; + protected final String TEXT_222 = ","; + protected final String TEXT_223 = NL + "\t\t\t\t\t "; + protected final String TEXT_224 = ".create("; + protected final String TEXT_225 = "))));"; + protected final String TEXT_226 = NL + "\t\t\t\t\t "; + protected final String TEXT_227 = ".create"; + protected final String TEXT_228 = "())));"; + protected final String TEXT_229 = NL + NL + "\t\tnewChildDescriptors.add" + NL + "\t\t\t(createChildParameter" + NL + "\t\t\t\t("; + protected final String TEXT_230 = "," + NL + "\t\t\t\t "; + protected final String TEXT_231 = ".createEntry" + NL + "\t\t\t\t\t("; + protected final String TEXT_232 = ","; + protected final String TEXT_233 = NL + "\t\t\t\t\t "; + protected final String TEXT_234 = ")));"; + protected final String TEXT_235 = NL + "\t\t\t\t\t "; + protected final String TEXT_236 = ")));"; + protected final String TEXT_237 = NL + "\t\t\t\t\t "; + protected final String TEXT_238 = ".createFromString("; + protected final String TEXT_239 = ", "; + protected final String TEXT_240 = "))));"; + protected final String TEXT_241 = " // TODO: ensure this is a valid literal value"; + protected final String TEXT_242 = NL + NL + "\t\tnewChildDescriptors.add" + NL + "\t\t\t(createChildParameter" + NL + "\t\t\t\t("; + protected final String TEXT_243 = ","; + protected final String TEXT_244 = NL + "\t\t\t\t "; + protected final String TEXT_245 = ".create("; + protected final String TEXT_246 = ")));"; + protected final String TEXT_247 = NL + "\t\t\t\t "; + protected final String TEXT_248 = ".create"; + protected final String TEXT_249 = "()));"; + protected final String TEXT_250 = NL + NL + "\t\tnewChildDescriptors.add" + NL + "\t\t\t(createChildParameter" + NL + "\t\t\t\t("; + protected final String TEXT_251 = ","; + protected final String TEXT_252 = NL + "\t\t\t\t "; + protected final String TEXT_253 = "));"; + protected final String TEXT_254 = NL + "\t\t\t\t "; + protected final String TEXT_255 = "));"; + protected final String TEXT_256 = NL + "\t\t\t\t "; + protected final String TEXT_257 = ".createFromString("; + protected final String TEXT_258 = ", "; + protected final String TEXT_259 = ")));"; + protected final String TEXT_260 = " // TODO: ensure this is a valid literal value"; + protected final String TEXT_261 = NL + "\t}" + NL; + protected final String TEXT_262 = NL + "\t/**" + NL + "\t * This returns the label text for {@link org.eclipse.emf.edit.command.CreateChildCommand}." + NL + "\t * <!-- begin-user-doc -->" + NL + "\t * <!-- end-user-doc -->" + NL + "\t * @generated" + NL + "\t */"; + protected final String TEXT_263 = NL + "\t@Override"; + protected final String TEXT_264 = NL + "\tpublic String getCreateChildText(Object owner, Object feature, Object child, "; + protected final String TEXT_265 = " selection)" + NL + "\t{" + NL + "\t\tObject childFeature = feature;" + NL + "\t\tObject childObject = child;" + NL; + protected final String TEXT_266 = NL + "\t\tif (childFeature instanceof "; + protected final String TEXT_267 = " && "; + protected final String TEXT_268 = ".isFeatureMap((EStructuralFeature)childFeature))" + NL + "\t\t{" + NL + "\t\t\t"; + protected final String TEXT_269 = ".Entry entry = (FeatureMap.Entry)childObject;" + NL + "\t\t\tchildFeature = entry.getEStructuralFeature();" + NL + "\t\t\tchildObject = entry.getValue();" + NL + "\t\t}" + NL; + protected final String TEXT_270 = NL + "\t\tboolean qualify ="; + protected final String TEXT_271 = NL + "\t\t\tchildFeature == "; + protected final String TEXT_272 = NL + NL + "\t\tif (qualify)" + NL + "\t\t{" + NL + "\t\t\treturn getString" + NL + "\t\t\t\t(\"_UI_CreateChild_text2\","; + protected final String TEXT_273 = NL + "\t\t\t\t new Object[] { getTypeText(childObject), getFeatureText(childFeature), getTypeText(owner) });" + NL + "\t\t}" + NL + "\t\treturn super.getCreateChildText(owner, feature, child, selection);" + NL + "\t}" + NL; + protected final String TEXT_274 = NL + "\t/**" + NL + "\t * Return the resource locator for this item provider's resources." + NL + "\t * <!-- begin-user-doc -->" + NL + "\t * <!-- end-user-doc -->" + NL + "\t * @generated" + NL + "\t */"; + protected final String TEXT_275 = NL + "\t@Override"; + protected final String TEXT_276 = NL + "\tpublic "; + protected final String TEXT_277 = " getResourceLocator()" + NL + "\t{"; + protected final String TEXT_278 = NL + "\t\treturn (("; + protected final String TEXT_279 = ")adapterFactory).getResourceLocator();"; + protected final String TEXT_280 = NL + "\t\treturn "; + protected final String TEXT_281 = ".INSTANCE;"; + protected final String TEXT_282 = NL + "\t}" + NL; + protected final String TEXT_283 = NL + "}"; + protected final String TEXT_284 = NL; public String generate(Object argument) { @@ -446,334 +511,494 @@ public class ItemProvider stringBuffer.append(TEXT_83); } stringBuffer.append(TEXT_84); - if (genClass.isMapEntry()) { + if (genModel.isStyleProviders()) { stringBuffer.append(TEXT_85); - stringBuffer.append(genClass.getImportedInterfaceName()); - if (genModel.useGenerics()) { + stringBuffer.append(genModel.getImportedName("org.eclipse.emf.edit.provider.StyledString")); stringBuffer.append(TEXT_86); - } + } else { + if (genClass.isMapEntry()) { stringBuffer.append(TEXT_87); - stringBuffer.append(genClass.getSafeUncapName()); - stringBuffer.append(TEXT_88); stringBuffer.append(genClass.getImportedInterfaceName()); if (genModel.useGenerics()) { - stringBuffer.append(TEXT_89); + stringBuffer.append(TEXT_88); } + stringBuffer.append(TEXT_89); + stringBuffer.append(genClass.getSafeUncapName()); stringBuffer.append(TEXT_90); - if (!genClass.getMapEntryKeyFeature().isPropertyMultiLine() && !genClass.getMapEntryValueFeature().isPropertyMultiLine()) { + stringBuffer.append(genClass.getImportedInterfaceName()); + if (genModel.useGenerics()) { stringBuffer.append(TEXT_91); - stringBuffer.append(genClass.getSafeUncapName()); + } stringBuffer.append(TEXT_92); - stringBuffer.append(genClass.getSafeUncapName()); + if (!genClass.getMapEntryKeyFeature().isPropertyMultiLine() && !genClass.getMapEntryValueFeature().isPropertyMultiLine()) { stringBuffer.append(TEXT_93); - stringBuffer.append(genModel.getNonNLS()); - stringBuffer.append(genModel.getNonNLS(2)); - } else { - if (genClass.getMapEntryKeyFeature().isPropertyMultiLine()) { + stringBuffer.append(genClass.getSafeUncapName()); stringBuffer.append(TEXT_94); stringBuffer.append(genClass.getSafeUncapName()); stringBuffer.append(TEXT_95); stringBuffer.append(genModel.getNonNLS()); + stringBuffer.append(genModel.getNonNLS(2)); } else { + if (genClass.getMapEntryKeyFeature().isPropertyMultiLine()) { stringBuffer.append(TEXT_96); stringBuffer.append(genClass.getSafeUncapName()); stringBuffer.append(TEXT_97); stringBuffer.append(genModel.getNonNLS()); - } - if (genClass.getMapEntryValueFeature().isPropertyMultiLine()) { + } else { stringBuffer.append(TEXT_98); stringBuffer.append(genClass.getSafeUncapName()); stringBuffer.append(TEXT_99); stringBuffer.append(genModel.getNonNLS()); - } else { + } + if (genClass.getMapEntryValueFeature().isPropertyMultiLine()) { stringBuffer.append(TEXT_100); stringBuffer.append(genClass.getSafeUncapName()); stringBuffer.append(TEXT_101); stringBuffer.append(genModel.getNonNLS()); - } + } else { stringBuffer.append(TEXT_102); + stringBuffer.append(genClass.getSafeUncapName()); + stringBuffer.append(TEXT_103); + stringBuffer.append(genModel.getNonNLS()); + } + stringBuffer.append(TEXT_104); stringBuffer.append(genModel.getNonNLS()); } } else if (genClass.getLabelFeature() != null) { GenFeature labelFeature = genClass.getLabelFeature(); if (labelFeature.isPrimitiveType() && !labelFeature.getGenClass().isDynamic() && !labelFeature.isSuppressedGetVisibility()) { - stringBuffer.append(TEXT_103); + stringBuffer.append(TEXT_105); stringBuffer.append(genClass.getImportedInterfaceName()); stringBuffer.append(genClass.getInterfaceWildTypeArguments()); - stringBuffer.append(TEXT_104); + stringBuffer.append(TEXT_106); stringBuffer.append(genClass.getSafeUncapName()); - stringBuffer.append(TEXT_105); + stringBuffer.append(TEXT_107); stringBuffer.append(genClass.getImportedInterfaceName()); stringBuffer.append(genClass.getInterfaceWildTypeArguments()); - stringBuffer.append(TEXT_106); + stringBuffer.append(TEXT_108); stringBuffer.append(genClass.getName()); - stringBuffer.append(TEXT_107); + stringBuffer.append(TEXT_109); stringBuffer.append(genClass.getSafeUncapName()); - stringBuffer.append(TEXT_108); + stringBuffer.append(TEXT_110); stringBuffer.append(genClass.getLabelFeature().getGetAccessor()); - stringBuffer.append(TEXT_109); + stringBuffer.append(TEXT_111); stringBuffer.append(genModel.getNonNLS()); stringBuffer.append(genModel.getNonNLS(2)); } else { if (labelFeature.isStringType() && !labelFeature.getGenClass().isDynamic() && !labelFeature.isSuppressedGetVisibility()) { if (labelFeature.isPropertyMultiLine()) { - stringBuffer.append(TEXT_110); + stringBuffer.append(TEXT_112); stringBuffer.append(genClass.getImportedInterfaceName()); stringBuffer.append(genClass.getInterfaceWildTypeArguments()); - stringBuffer.append(TEXT_111); + stringBuffer.append(TEXT_113); stringBuffer.append(labelFeature.getGetAccessor()); - stringBuffer.append(TEXT_112); + stringBuffer.append(TEXT_114); } else { - stringBuffer.append(TEXT_113); + stringBuffer.append(TEXT_115); stringBuffer.append(genClass.getImportedInterfaceName()); stringBuffer.append(genClass.getInterfaceWildTypeArguments()); - stringBuffer.append(TEXT_114); + stringBuffer.append(TEXT_116); stringBuffer.append(labelFeature.getGetAccessor()); - stringBuffer.append(TEXT_115); + stringBuffer.append(TEXT_117); } } else { if (labelFeature.isSuppressedGetVisibility() || labelFeature.getGenClass().isDynamic()) { - stringBuffer.append(TEXT_116); + stringBuffer.append(TEXT_118); stringBuffer.append(genModel.getImportedName("java.lang.Object")); - stringBuffer.append(TEXT_117); + stringBuffer.append(TEXT_119); stringBuffer.append(genModel.getImportedName("org.eclipse.emf.ecore.EObject")); - stringBuffer.append(TEXT_118); + stringBuffer.append(TEXT_120); stringBuffer.append(labelFeature.getQualifiedFeatureAccessor()); - stringBuffer.append(TEXT_119); + stringBuffer.append(TEXT_121); } else { - stringBuffer.append(TEXT_120); + stringBuffer.append(TEXT_122); stringBuffer.append(labelFeature.getRawImportedType()); - stringBuffer.append(TEXT_121); + stringBuffer.append(TEXT_123); stringBuffer.append(genClass.getImportedInterfaceName()); stringBuffer.append(genClass.getInterfaceWildTypeArguments()); - stringBuffer.append(TEXT_122); - stringBuffer.append(labelFeature.getGetAccessor()); - stringBuffer.append(TEXT_123); - } stringBuffer.append(TEXT_124); - } + stringBuffer.append(labelFeature.getGetAccessor()); stringBuffer.append(TEXT_125); - stringBuffer.append(genClass.getName()); + } stringBuffer.append(TEXT_126); - stringBuffer.append(genModel.getNonNLS()); + } stringBuffer.append(TEXT_127); stringBuffer.append(genClass.getName()); stringBuffer.append(TEXT_128); stringBuffer.append(genModel.getNonNLS()); - stringBuffer.append(genModel.getNonNLS(2)); - } - } else { stringBuffer.append(TEXT_129); stringBuffer.append(genClass.getName()); stringBuffer.append(TEXT_130); stringBuffer.append(genModel.getNonNLS()); + stringBuffer.append(genModel.getNonNLS(2)); } - //ItemProvider/getText.override.javajetinc + } else { stringBuffer.append(TEXT_131); - if (genModel.useClassOverrideAnnotation()) { + stringBuffer.append(genClass.getName()); stringBuffer.append(TEXT_132); + stringBuffer.append(genModel.getNonNLS()); + } } + //ItemProvider/getText.override.javajetinc stringBuffer.append(TEXT_133); - if (!genClass.getLabelNotifyFeatures().isEmpty() || !genClass.getContentNotifyFeatures().isEmpty() || !genClass.getLabelAndContentNotifyFeatures().isEmpty()) { + if (genModel.isStyleProviders()) { stringBuffer.append(TEXT_134); - stringBuffer.append(genClass.getRawImportedInterfaceName()); + if (genModel.useClassOverrideAnnotation()) { stringBuffer.append(TEXT_135); + } + stringBuffer.append(TEXT_136); + if (genClass.isMapEntry()) { + stringBuffer.append(TEXT_137); + stringBuffer.append(genClass.getImportedInterfaceName()); + if (genModel.useGenerics()) { + stringBuffer.append(TEXT_138); + } + stringBuffer.append(TEXT_139); + stringBuffer.append(genClass.getSafeUncapName()); + stringBuffer.append(TEXT_140); + stringBuffer.append(genClass.getImportedInterfaceName()); + if (genModel.useGenerics()) { + stringBuffer.append(TEXT_141); + } + stringBuffer.append(TEXT_142); + if (!genClass.getMapEntryKeyFeature().isPropertyMultiLine() && !genClass.getMapEntryValueFeature().isPropertyMultiLine()) { + stringBuffer.append(TEXT_143); + stringBuffer.append(genModel.getImportedName("org.eclipse.emf.edit.provider.StyledString")); + stringBuffer.append(TEXT_144); + stringBuffer.append(genClass.getSafeUncapName()); + stringBuffer.append(TEXT_145); + stringBuffer.append(genModel.getImportedName("org.eclipse.emf.edit.provider.StyledString$Style")); + stringBuffer.append(TEXT_146); + stringBuffer.append(genClass.getSafeUncapName()); + stringBuffer.append(TEXT_147); + stringBuffer.append(genModel.getNonNLS()); + stringBuffer.append(genModel.getNonNLS(2)); + } else { + if (genClass.getMapEntryKeyFeature().isPropertyMultiLine()) { + stringBuffer.append(TEXT_148); + stringBuffer.append(genClass.getSafeUncapName()); + stringBuffer.append(TEXT_149); + stringBuffer.append(genModel.getNonNLS()); + } else { + stringBuffer.append(TEXT_150); + stringBuffer.append(genClass.getSafeUncapName()); + stringBuffer.append(TEXT_151); + stringBuffer.append(genModel.getNonNLS()); + } + if (genClass.getMapEntryValueFeature().isPropertyMultiLine()) { + stringBuffer.append(TEXT_152); + stringBuffer.append(genClass.getSafeUncapName()); + stringBuffer.append(TEXT_153); + stringBuffer.append(genModel.getNonNLS()); + } else { + stringBuffer.append(TEXT_154); + stringBuffer.append(genClass.getSafeUncapName()); + stringBuffer.append(TEXT_155); + stringBuffer.append(genModel.getNonNLS()); + } + stringBuffer.append(TEXT_156); + stringBuffer.append(genModel.getImportedName("org.eclipse.emf.edit.provider.StyledString")); + stringBuffer.append(TEXT_157); + stringBuffer.append(genModel.getImportedName("org.eclipse.emf.edit.provider.StyledString$Style")); + stringBuffer.append(TEXT_158); + stringBuffer.append(genModel.getNonNLS()); + } + } else if (genClass.getLabelFeature() != null) { GenFeature labelFeature = genClass.getLabelFeature(); + if (labelFeature.isPrimitiveType() && !labelFeature.getGenClass().isDynamic() && !labelFeature.isSuppressedGetVisibility()) { + stringBuffer.append(TEXT_159); + stringBuffer.append(genClass.getImportedInterfaceName()); + stringBuffer.append(genClass.getInterfaceWildTypeArguments()); + stringBuffer.append(TEXT_160); + stringBuffer.append(genClass.getSafeUncapName()); + stringBuffer.append(TEXT_161); + stringBuffer.append(genClass.getImportedInterfaceName()); + stringBuffer.append(genClass.getInterfaceWildTypeArguments()); + stringBuffer.append(TEXT_162); + stringBuffer.append(genModel.getImportedName("org.eclipse.emf.edit.provider.StyledString")); + stringBuffer.append(TEXT_163); + stringBuffer.append(genClass.getName()); + stringBuffer.append(TEXT_164); + stringBuffer.append(genModel.getImportedName("org.eclipse.emf.edit.provider.StyledString$Style")); + stringBuffer.append(TEXT_165); + stringBuffer.append(genClass.getSafeUncapName()); + stringBuffer.append(TEXT_166); + stringBuffer.append(genClass.getLabelFeature().getGetAccessor()); + stringBuffer.append(TEXT_167); + stringBuffer.append(genModel.getNonNLS()); + stringBuffer.append(genModel.getNonNLS(2)); + } else { + if (labelFeature.isStringType() && !labelFeature.getGenClass().isDynamic() && !labelFeature.isSuppressedGetVisibility()) { + if (labelFeature.isPropertyMultiLine()) { + stringBuffer.append(TEXT_168); + stringBuffer.append(genClass.getImportedInterfaceName()); + stringBuffer.append(genClass.getInterfaceWildTypeArguments()); + stringBuffer.append(TEXT_169); + stringBuffer.append(labelFeature.getGetAccessor()); + stringBuffer.append(TEXT_170); + } else { + stringBuffer.append(TEXT_171); + stringBuffer.append(genClass.getImportedInterfaceName()); + stringBuffer.append(genClass.getInterfaceWildTypeArguments()); + stringBuffer.append(TEXT_172); + stringBuffer.append(labelFeature.getGetAccessor()); + stringBuffer.append(TEXT_173); + } + } else { + if (labelFeature.isSuppressedGetVisibility() || labelFeature.getGenClass().isDynamic()) { + stringBuffer.append(TEXT_174); + stringBuffer.append(genModel.getImportedName("java.lang.Object")); + stringBuffer.append(TEXT_175); + stringBuffer.append(genModel.getImportedName("org.eclipse.emf.ecore.EObject")); + stringBuffer.append(TEXT_176); + stringBuffer.append(labelFeature.getQualifiedFeatureAccessor()); + stringBuffer.append(TEXT_177); + } else { + stringBuffer.append(TEXT_178); + stringBuffer.append(labelFeature.getRawImportedType()); + stringBuffer.append(TEXT_179); + stringBuffer.append(genClass.getImportedInterfaceName()); + stringBuffer.append(genClass.getInterfaceWildTypeArguments()); + stringBuffer.append(TEXT_180); + stringBuffer.append(labelFeature.getGetAccessor()); + stringBuffer.append(TEXT_181); + } + stringBuffer.append(TEXT_182); + } + stringBuffer.append(TEXT_183); + stringBuffer.append(genModel.getImportedName("org.eclipse.emf.edit.provider.StyledString")); + stringBuffer.append(TEXT_184); + stringBuffer.append(genModel.getImportedName("org.eclipse.emf.edit.provider.StyledString")); + stringBuffer.append(TEXT_185); + stringBuffer.append(genClass.getName()); + stringBuffer.append(TEXT_186); + stringBuffer.append(genModel.getImportedName("org.eclipse.emf.edit.provider.StyledString$Style")); + stringBuffer.append(TEXT_187); + stringBuffer.append(genModel.getNonNLS()); + stringBuffer.append(TEXT_188); + stringBuffer.append(genClass.getName()); + stringBuffer.append(TEXT_189); + stringBuffer.append(genModel.getImportedName("org.eclipse.emf.edit.provider.StyledString$Style")); + stringBuffer.append(TEXT_190); + stringBuffer.append(genModel.getNonNLS()); + stringBuffer.append(genModel.getNonNLS(2)); + stringBuffer.append(TEXT_191); + } + } else { + stringBuffer.append(TEXT_192); + stringBuffer.append(genModel.getImportedName("org.eclipse.emf.edit.provider.StyledString")); + stringBuffer.append(TEXT_193); + stringBuffer.append(genClass.getName()); + stringBuffer.append(TEXT_194); + stringBuffer.append(genModel.getNonNLS()); + } + //ItemProvider/getStyledText.override.javajetinc + stringBuffer.append(TEXT_195); + } + stringBuffer.append(TEXT_196); + if (genModel.useClassOverrideAnnotation()) { + stringBuffer.append(TEXT_197); + } + stringBuffer.append(TEXT_198); + if (!genClass.getLabelNotifyFeatures().isEmpty() || !genClass.getContentNotifyFeatures().isEmpty() || !genClass.getLabelAndContentNotifyFeatures().isEmpty()) { + stringBuffer.append(TEXT_199); + stringBuffer.append(genClass.getRawImportedInterfaceName()); + stringBuffer.append(TEXT_200); if (!genClass.getLabelNotifyFeatures().isEmpty()) { for (GenFeature genFeature : genClass.getLabelNotifyFeatures()) { - stringBuffer.append(TEXT_136); + stringBuffer.append(TEXT_201); stringBuffer.append(genClass.getQualifiedFeatureID(genFeature)); - stringBuffer.append(TEXT_137); + stringBuffer.append(TEXT_202); } - stringBuffer.append(TEXT_138); + stringBuffer.append(TEXT_203); stringBuffer.append(genModel.getImportedName("org.eclipse.emf.edit.provider.ViewerNotification")); - stringBuffer.append(TEXT_139); + stringBuffer.append(TEXT_204); } if (!genClass.getContentNotifyFeatures().isEmpty()) { for (GenFeature genFeature : genClass.getContentNotifyFeatures()) { - stringBuffer.append(TEXT_140); + stringBuffer.append(TEXT_205); stringBuffer.append(genClass.getQualifiedFeatureID(genFeature)); - stringBuffer.append(TEXT_141); + stringBuffer.append(TEXT_206); } - stringBuffer.append(TEXT_142); + stringBuffer.append(TEXT_207); stringBuffer.append(genModel.getImportedName("org.eclipse.emf.edit.provider.ViewerNotification")); - stringBuffer.append(TEXT_143); + stringBuffer.append(TEXT_208); } if (!genClass.getLabelAndContentNotifyFeatures().isEmpty()) { for (GenFeature genFeature : genClass.getLabelAndContentNotifyFeatures()) { - stringBuffer.append(TEXT_144); + stringBuffer.append(TEXT_209); stringBuffer.append(genClass.getQualifiedFeatureID(genFeature)); - stringBuffer.append(TEXT_145); + stringBuffer.append(TEXT_210); } - stringBuffer.append(TEXT_146); + stringBuffer.append(TEXT_211); stringBuffer.append(genModel.getImportedName("org.eclipse.emf.edit.provider.ViewerNotification")); - stringBuffer.append(TEXT_147); + stringBuffer.append(TEXT_212); } - stringBuffer.append(TEXT_148); + stringBuffer.append(TEXT_213); } - stringBuffer.append(TEXT_149); + stringBuffer.append(TEXT_214); if (genModel.isCreationCommands()) { - stringBuffer.append(TEXT_150); + stringBuffer.append(TEXT_215); if (genModel.useClassOverrideAnnotation()) { - stringBuffer.append(TEXT_151); + stringBuffer.append(TEXT_216); } - stringBuffer.append(TEXT_152); + stringBuffer.append(TEXT_217); stringBuffer.append(genModel.getImportedName(genModel.useGenerics() ? "java.util.Collection<java.lang.Object>" : "java.util.Collection")); - stringBuffer.append(TEXT_153); + stringBuffer.append(TEXT_218); for (GenClass.ChildCreationData childCreationData : genClass.getChildCreationData()) { GenFeature createFeature = childCreationData.createFeature; GenFeature delegatedFeature = childCreationData.delegatedFeature; GenClassifier createClassifier = childCreationData.createClassifier; if (createFeature.isFeatureMapType()) { if (delegatedFeature.isReferenceType()) { GenClass createClass = (GenClass)createClassifier; - stringBuffer.append(TEXT_154); + stringBuffer.append(TEXT_219); stringBuffer.append(createFeature.getQualifiedFeatureAccessor()); - stringBuffer.append(TEXT_155); + stringBuffer.append(TEXT_220); stringBuffer.append(genModel.getImportedName("org.eclipse.emf.ecore.util.FeatureMapUtil")); - stringBuffer.append(TEXT_156); + stringBuffer.append(TEXT_221); stringBuffer.append(delegatedFeature.getQualifiedFeatureAccessor()); - stringBuffer.append(TEXT_157); + stringBuffer.append(TEXT_222); if (createClass.isMapEntry()) { - stringBuffer.append(TEXT_158); + stringBuffer.append(TEXT_223); stringBuffer.append(createClass.getGenPackage().getQualifiedEFactoryInstanceAccessor()); - stringBuffer.append(TEXT_159); + stringBuffer.append(TEXT_224); stringBuffer.append(createClass.getQualifiedClassifierAccessor()); - stringBuffer.append(TEXT_160); + stringBuffer.append(TEXT_225); } else { - stringBuffer.append(TEXT_161); + stringBuffer.append(TEXT_226); stringBuffer.append(createClass.getGenPackage().getQualifiedFactoryInstanceAccessor()); - stringBuffer.append(TEXT_162); + stringBuffer.append(TEXT_227); stringBuffer.append(createClass.getName()); - stringBuffer.append(TEXT_163); + stringBuffer.append(TEXT_228); } //ItemProvider/newChildDescriptorsReferenceDelegatedFeature.override.javajetinc } else { GenDataType createDataType = (GenDataType)createClassifier; - stringBuffer.append(TEXT_164); + stringBuffer.append(TEXT_229); stringBuffer.append(createFeature.getQualifiedFeatureAccessor()); - stringBuffer.append(TEXT_165); + stringBuffer.append(TEXT_230); stringBuffer.append(genModel.getImportedName("org.eclipse.emf.ecore.util.FeatureMapUtil")); - stringBuffer.append(TEXT_166); + stringBuffer.append(TEXT_231); stringBuffer.append(delegatedFeature.getQualifiedFeatureAccessor()); - stringBuffer.append(TEXT_167); + stringBuffer.append(TEXT_232); if (delegatedFeature.isEnumBasedType()) { - stringBuffer.append(TEXT_168); + stringBuffer.append(TEXT_233); stringBuffer.append(delegatedFeature.getTypeGenEnum().getStaticValue(delegatedFeature.getEcoreFeature().getDefaultValueLiteral())); - stringBuffer.append(TEXT_169); + stringBuffer.append(TEXT_234); } else if (delegatedFeature.isStringBasedType()) { - stringBuffer.append(TEXT_170); + stringBuffer.append(TEXT_235); stringBuffer.append(delegatedFeature.getCreateChildValueLiteral()); - stringBuffer.append(TEXT_171); + stringBuffer.append(TEXT_236); stringBuffer.append(genModel.getNonNLS()); } else { String literal = delegatedFeature.getCreateChildValueLiteral(); - stringBuffer.append(TEXT_172); + stringBuffer.append(TEXT_237); stringBuffer.append(createDataType.getGenPackage().getQualifiedEFactoryInstanceAccessor()); - stringBuffer.append(TEXT_173); + stringBuffer.append(TEXT_238); stringBuffer.append(createDataType.getQualifiedClassifierAccessor()); - stringBuffer.append(TEXT_174); + stringBuffer.append(TEXT_239); stringBuffer.append(literal); - stringBuffer.append(TEXT_175); + stringBuffer.append(TEXT_240); if (literal != null) { stringBuffer.append(genModel.getNonNLS()); } else { - stringBuffer.append(TEXT_176); + stringBuffer.append(TEXT_241); } } //ItemProvider/newChildDescriptorsAttributeDelegatedFeature.override.javajetinc } } else if (createFeature.isReferenceType()) { GenClass createClass = (GenClass)createClassifier; - stringBuffer.append(TEXT_177); + stringBuffer.append(TEXT_242); stringBuffer.append(createFeature.getQualifiedFeatureAccessor()); - stringBuffer.append(TEXT_178); + stringBuffer.append(TEXT_243); if (createClass.isMapEntry()) { - stringBuffer.append(TEXT_179); + stringBuffer.append(TEXT_244); stringBuffer.append(createClass.getGenPackage().getQualifiedEFactoryInstanceAccessor()); - stringBuffer.append(TEXT_180); + stringBuffer.append(TEXT_245); stringBuffer.append(createClass.getQualifiedClassifierAccessor()); - stringBuffer.append(TEXT_181); + stringBuffer.append(TEXT_246); } else { - stringBuffer.append(TEXT_182); + stringBuffer.append(TEXT_247); stringBuffer.append(createClass.getGenPackage().getQualifiedFactoryInstanceAccessor()); - stringBuffer.append(TEXT_183); + stringBuffer.append(TEXT_248); stringBuffer.append(createClass.getName()); - stringBuffer.append(TEXT_184); + stringBuffer.append(TEXT_249); } //ItemProvider/newChildDescriptorsReferenceFeature.override.javajetinc } else { GenDataType createDataType = (GenDataType)createClassifier; - stringBuffer.append(TEXT_185); + stringBuffer.append(TEXT_250); stringBuffer.append(createFeature.getQualifiedFeatureAccessor()); - stringBuffer.append(TEXT_186); + stringBuffer.append(TEXT_251); if (createFeature.isEnumBasedType()) { - stringBuffer.append(TEXT_187); + stringBuffer.append(TEXT_252); stringBuffer.append(createFeature.getTypeGenEnum().getStaticValue(createFeature.getEcoreFeature().getDefaultValueLiteral())); - stringBuffer.append(TEXT_188); + stringBuffer.append(TEXT_253); } else if (createFeature.isStringBasedType()) { - stringBuffer.append(TEXT_189); + stringBuffer.append(TEXT_254); stringBuffer.append(createFeature.getCreateChildValueLiteral()); - stringBuffer.append(TEXT_190); + stringBuffer.append(TEXT_255); stringBuffer.append(genModel.getNonNLS()); } else { String literal = createFeature.getCreateChildValueLiteral(); - stringBuffer.append(TEXT_191); + stringBuffer.append(TEXT_256); stringBuffer.append(createDataType.getGenPackage().getQualifiedEFactoryInstanceAccessor()); - stringBuffer.append(TEXT_192); + stringBuffer.append(TEXT_257); stringBuffer.append(createDataType.getQualifiedClassifierAccessor()); - stringBuffer.append(TEXT_193); + stringBuffer.append(TEXT_258); stringBuffer.append(literal); - stringBuffer.append(TEXT_194); + stringBuffer.append(TEXT_259); if (literal != null) { stringBuffer.append(genModel.getNonNLS()); } else { - stringBuffer.append(TEXT_195); + stringBuffer.append(TEXT_260); } } //ItemProvider/newChildDescriptorsAttributeFeature.override.javajetinc } } - stringBuffer.append(TEXT_196); + stringBuffer.append(TEXT_261); if (!genClass.getSharedClassCreateChildFeatures().isEmpty()) { - stringBuffer.append(TEXT_197); + stringBuffer.append(TEXT_262); if (genModel.useClassOverrideAnnotation()) { - stringBuffer.append(TEXT_198); + stringBuffer.append(TEXT_263); } - stringBuffer.append(TEXT_199); + stringBuffer.append(TEXT_264); stringBuffer.append(genModel.getImportedName(genModel.useGenerics() ? "java.util.Collection<?>" : "java.util.Collection")); - stringBuffer.append(TEXT_200); + stringBuffer.append(TEXT_265); if (genClass.hasFeatureMapCreateChildFeatures()) { - stringBuffer.append(TEXT_201); + stringBuffer.append(TEXT_266); stringBuffer.append(genModel.getImportedName("org.eclipse.emf.ecore.EStructuralFeature")); - stringBuffer.append(TEXT_202); + stringBuffer.append(TEXT_267); stringBuffer.append(genModel.getImportedName("org.eclipse.emf.ecore.util.FeatureMapUtil")); - stringBuffer.append(TEXT_203); + stringBuffer.append(TEXT_268); stringBuffer.append(genModel.getImportedName("org.eclipse.emf.ecore.util.FeatureMap")); - stringBuffer.append(TEXT_204); + stringBuffer.append(TEXT_269); } - stringBuffer.append(TEXT_205); + stringBuffer.append(TEXT_270); for (Iterator<GenFeature> i = genClass.getSharedClassCreateChildFeatures().iterator(); i.hasNext();) { GenFeature createFeature = i.next(); - stringBuffer.append(TEXT_206); + stringBuffer.append(TEXT_271); stringBuffer.append(createFeature.getQualifiedFeatureAccessor()); stringBuffer.append(i.hasNext() ? " ||" : ";"); } - stringBuffer.append(TEXT_207); + stringBuffer.append(TEXT_272); stringBuffer.append(genModel.getNonNLS()); - stringBuffer.append(TEXT_208); + stringBuffer.append(TEXT_273); } } if (genClass.getProviderExtendsGenClass() == null || genClass.getProviderExtendsGenClass().getGenPackage() != genPackage && (!genPackage.isExtensibleProviderFactory() || genClass.getProviderExtendsGenClass().getGenPackage().isExtensibleProviderFactory() != genPackage.isExtensibleProviderFactory())) { - stringBuffer.append(TEXT_209); + stringBuffer.append(TEXT_274); if (genModel.useClassOverrideAnnotation()) { - stringBuffer.append(TEXT_210); + stringBuffer.append(TEXT_275); } - stringBuffer.append(TEXT_211); + stringBuffer.append(TEXT_276); stringBuffer.append(genModel.getImportedName("org.eclipse.emf.common.util.ResourceLocator")); - stringBuffer.append(TEXT_212); + stringBuffer.append(TEXT_277); if (genPackage.isExtensibleProviderFactory()) { - stringBuffer.append(TEXT_213); + stringBuffer.append(TEXT_278); stringBuffer.append(genModel.getImportedName("org.eclipse.emf.edit.provider.IChildCreationExtender")); - stringBuffer.append(TEXT_214); + stringBuffer.append(TEXT_279); } else { - stringBuffer.append(TEXT_215); + stringBuffer.append(TEXT_280); stringBuffer.append(genPackage.getImportedEditPluginClassName()); - stringBuffer.append(TEXT_216); + stringBuffer.append(TEXT_281); } - stringBuffer.append(TEXT_217); + stringBuffer.append(TEXT_282); } - stringBuffer.append(TEXT_218); + stringBuffer.append(TEXT_283); genModel.emitSortedImports(); - stringBuffer.append(TEXT_219); + stringBuffer.append(TEXT_284); return stringBuffer.toString(); } } diff --git a/plugins/org.eclipse.emf.codegen.ecore/src/org/eclipse/emf/codegen/ecore/templates/editor/Editor.java b/plugins/org.eclipse.emf.codegen.ecore/src/org/eclipse/emf/codegen/ecore/templates/editor/Editor.java index d1c7a97f5..bb017ce72 100644 --- a/plugins/org.eclipse.emf.codegen.ecore/src/org/eclipse/emf/codegen/ecore/templates/editor/Editor.java +++ b/plugins/org.eclipse.emf.codegen.ecore/src/org/eclipse/emf/codegen/ecore/templates/editor/Editor.java @@ -208,282 +208,310 @@ public class Editor protected final String TEXT_191 = "new "; protected final String TEXT_192 = "("; protected final String TEXT_193 = "new "; - protected final String TEXT_194 = "(adapterFactory"; - protected final String TEXT_195 = ", selectionViewer"; - protected final String TEXT_196 = ")"; - protected final String TEXT_197 = ", new "; - protected final String TEXT_198 = "(editingDomain"; - protected final String TEXT_199 = ".getResourceSet()"; - protected final String TEXT_200 = ", selectionViewer"; - protected final String TEXT_201 = ", "; - protected final String TEXT_202 = ".getPlugin().getDialogSettings()"; - protected final String TEXT_203 = "))"; - protected final String TEXT_204 = ");" + NL + "\t\t\t\tselectionViewer.setInput(editingDomain.getResourceSet());" + NL + "\t\t\t\tselectionViewer.setSelection(new StructuredSelection(editingDomain.getResourceSet().getResources().get(0)), true);" + NL + "\t\t\t\tviewerPane.setTitle(editingDomain.getResourceSet());" + NL + "" + NL + "\t\t\t\tnew AdapterFactoryTreeEditor(selectionViewer.getTree(), adapterFactory);"; - protected final String TEXT_205 = NL + "\t\t\t\tnew "; - protected final String TEXT_206 = "(selectionViewer, new "; - protected final String TEXT_207 = ".EditingDomainLocationListener(editingDomain, selectionViewer));"; - protected final String TEXT_208 = NL + NL + "\t\t\t\tcreateContextMenuFor(selectionViewer);" + NL + "\t\t\t\tint pageIndex = addPage(viewerPane.getControl());" + NL + "\t\t\t\tsetPageText(pageIndex, getString(\"_UI_SelectionPage_label\"));"; - protected final String TEXT_209 = NL + "\t\t\t}" + NL + "" + NL + "\t\t\t// Create a page for the parent tree view." + NL + "\t\t\t//" + NL + "\t\t\t{" + NL + "\t\t\t\tViewerPane viewerPane =" + NL + "\t\t\t\t\tnew ViewerPane(getSite().getPage(), "; - protected final String TEXT_210 = ".this)" + NL + "\t\t\t\t\t{"; - protected final String TEXT_211 = NL + "\t\t\t\t\t\t@Override"; - protected final String TEXT_212 = NL + "\t\t\t\t\t\tpublic Viewer createViewer(Composite composite)" + NL + "\t\t\t\t\t\t{" + NL + "\t\t\t\t\t\t\tTree tree = new Tree(composite, SWT.MULTI);" + NL + "\t\t\t\t\t\t\tTreeViewer newTreeViewer = new TreeViewer(tree);" + NL + "\t\t\t\t\t\t\treturn newTreeViewer;" + NL + "\t\t\t\t\t\t}"; - protected final String TEXT_213 = NL + "\t\t\t\t\t\t@Override"; - protected final String TEXT_214 = NL + "\t\t\t\t\t\tpublic void requestActivation()" + NL + "\t\t\t\t\t\t{" + NL + "\t\t\t\t\t\t\tsuper.requestActivation();" + NL + "\t\t\t\t\t\t\tsetCurrentViewerPane(this);" + NL + "\t\t\t\t\t\t}" + NL + "\t\t\t\t\t};" + NL + "\t\t\t\tviewerPane.createControl(getContainer());" + NL + "" + NL + "\t\t\t\tparentViewer = (TreeViewer)viewerPane.getViewer();" + NL + "\t\t\t\tparentViewer.setAutoExpandLevel(30);" + NL + "\t\t\t\tparentViewer.setContentProvider(new ReverseAdapterFactoryContentProvider(adapterFactory));" + NL + "\t\t\t\tparentViewer.setLabelProvider(new "; - protected final String TEXT_215 = "(adapterFactory"; - protected final String TEXT_216 = ", parentViewer"; - protected final String TEXT_217 = "));" + NL + "" + NL + "\t\t\t\tcreateContextMenuFor(parentViewer);" + NL + "\t\t\t\tint pageIndex = addPage(viewerPane.getControl());" + NL + "\t\t\t\tsetPageText(pageIndex, getString(\"_UI_ParentPage_label\"));"; - protected final String TEXT_218 = NL + "\t\t\t}" + NL + "" + NL + "\t\t\t// This is the page for the list viewer" + NL + "\t\t\t//" + NL + "\t\t\t{" + NL + "\t\t\t\tViewerPane viewerPane =" + NL + "\t\t\t\t\tnew ViewerPane(getSite().getPage(), "; - protected final String TEXT_219 = ".this)" + NL + "\t\t\t\t\t{"; - protected final String TEXT_220 = NL + "\t\t\t\t\t\t@Override"; - protected final String TEXT_221 = NL + "\t\t\t\t\t\tpublic Viewer createViewer(Composite composite)" + NL + "\t\t\t\t\t\t{" + NL + "\t\t\t\t\t\t\treturn new ListViewer(composite);" + NL + "\t\t\t\t\t\t}"; - protected final String TEXT_222 = NL + "\t\t\t\t\t\t@Override"; - protected final String TEXT_223 = NL + "\t\t\t\t\t\tpublic void requestActivation()" + NL + "\t\t\t\t\t\t{" + NL + "\t\t\t\t\t\t\tsuper.requestActivation();" + NL + "\t\t\t\t\t\t\tsetCurrentViewerPane(this);" + NL + "\t\t\t\t\t\t}" + NL + "\t\t\t\t\t};" + NL + "\t\t\t\tviewerPane.createControl(getContainer());" + NL + "\t\t\t\tlistViewer = (ListViewer)viewerPane.getViewer();" + NL + "\t\t\t\tlistViewer.setContentProvider(new AdapterFactoryContentProvider(adapterFactory));" + NL + "\t\t\t\tlistViewer.setLabelProvider(new "; - protected final String TEXT_224 = "(adapterFactory"; - protected final String TEXT_225 = ", listViewer"; - protected final String TEXT_226 = "));" + NL + "" + NL + "\t\t\t\tcreateContextMenuFor(listViewer);" + NL + "\t\t\t\tint pageIndex = addPage(viewerPane.getControl());" + NL + "\t\t\t\tsetPageText(pageIndex, getString(\"_UI_ListPage_label\"));"; - protected final String TEXT_227 = NL + "\t\t\t}" + NL + "" + NL + "\t\t\t// This is the page for the tree viewer" + NL + "\t\t\t//" + NL + "\t\t\t{" + NL + "\t\t\t\tViewerPane viewerPane =" + NL + "\t\t\t\t\tnew ViewerPane(getSite().getPage(), "; - protected final String TEXT_228 = ".this)" + NL + "\t\t\t\t\t{"; - protected final String TEXT_229 = NL + "\t\t\t\t\t\t@Override"; - protected final String TEXT_230 = NL + "\t\t\t\t\t\tpublic Viewer createViewer(Composite composite)" + NL + "\t\t\t\t\t\t{" + NL + "\t\t\t\t\t\t\treturn new TreeViewer(composite);" + NL + "\t\t\t\t\t\t}"; - protected final String TEXT_231 = NL + "\t\t\t\t\t\t@Override"; - protected final String TEXT_232 = NL + "\t\t\t\t\t\tpublic void requestActivation()" + NL + "\t\t\t\t\t\t{" + NL + "\t\t\t\t\t\t\tsuper.requestActivation();" + NL + "\t\t\t\t\t\t\tsetCurrentViewerPane(this);" + NL + "\t\t\t\t\t\t}" + NL + "\t\t\t\t\t};" + NL + "\t\t\t\tviewerPane.createControl(getContainer());" + NL + "\t\t\t\ttreeViewer = (TreeViewer)viewerPane.getViewer();" + NL + "\t\t\t\ttreeViewer.setContentProvider(new AdapterFactoryContentProvider(adapterFactory));" + NL + "\t\t\t\ttreeViewer.setLabelProvider("; - protected final String TEXT_233 = "new "; - protected final String TEXT_234 = "("; - protected final String TEXT_235 = "new "; - protected final String TEXT_236 = "(adapterFactory"; - protected final String TEXT_237 = ", treeViewer"; + protected final String TEXT_194 = "("; + protected final String TEXT_195 = "new "; + protected final String TEXT_196 = "(adapterFactory"; + protected final String TEXT_197 = ", selectionViewer"; + protected final String TEXT_198 = ")"; + protected final String TEXT_199 = ", new "; + protected final String TEXT_200 = "(editingDomain"; + protected final String TEXT_201 = ".getResourceSet()"; + protected final String TEXT_202 = ", selectionViewer"; + protected final String TEXT_203 = ", "; + protected final String TEXT_204 = ".getPlugin().getDialogSettings()"; + protected final String TEXT_205 = "))"; + protected final String TEXT_206 = ")"; + protected final String TEXT_207 = ");" + NL + "\t\t\t\tselectionViewer.setInput(editingDomain.getResourceSet());" + NL + "\t\t\t\tselectionViewer.setSelection(new StructuredSelection(editingDomain.getResourceSet().getResources().get(0)), true);" + NL + "\t\t\t\tviewerPane.setTitle(editingDomain.getResourceSet());" + NL + "" + NL + "\t\t\t\tnew AdapterFactoryTreeEditor(selectionViewer.getTree(), adapterFactory);"; + protected final String TEXT_208 = NL + "\t\t\t\tnew "; + protected final String TEXT_209 = "(selectionViewer, new "; + protected final String TEXT_210 = ".EditingDomainLocationListener(editingDomain, selectionViewer));"; + protected final String TEXT_211 = NL + NL + "\t\t\t\tcreateContextMenuFor(selectionViewer);" + NL + "\t\t\t\tint pageIndex = addPage(viewerPane.getControl());" + NL + "\t\t\t\tsetPageText(pageIndex, getString(\"_UI_SelectionPage_label\"));"; + protected final String TEXT_212 = NL + "\t\t\t}" + NL + "" + NL + "\t\t\t// Create a page for the parent tree view." + NL + "\t\t\t//" + NL + "\t\t\t{" + NL + "\t\t\t\tViewerPane viewerPane =" + NL + "\t\t\t\t\tnew ViewerPane(getSite().getPage(), "; + protected final String TEXT_213 = ".this)" + NL + "\t\t\t\t\t{"; + protected final String TEXT_214 = NL + "\t\t\t\t\t\t@Override"; + protected final String TEXT_215 = NL + "\t\t\t\t\t\tpublic Viewer createViewer(Composite composite)" + NL + "\t\t\t\t\t\t{" + NL + "\t\t\t\t\t\t\tTree tree = new Tree(composite, SWT.MULTI);" + NL + "\t\t\t\t\t\t\tTreeViewer newTreeViewer = new TreeViewer(tree);" + NL + "\t\t\t\t\t\t\treturn newTreeViewer;" + NL + "\t\t\t\t\t\t}"; + protected final String TEXT_216 = NL + "\t\t\t\t\t\t@Override"; + protected final String TEXT_217 = NL + "\t\t\t\t\t\tpublic void requestActivation()" + NL + "\t\t\t\t\t\t{" + NL + "\t\t\t\t\t\t\tsuper.requestActivation();" + NL + "\t\t\t\t\t\t\tsetCurrentViewerPane(this);" + NL + "\t\t\t\t\t\t}" + NL + "\t\t\t\t\t};" + NL + "\t\t\t\tviewerPane.createControl(getContainer());" + NL + "" + NL + "\t\t\t\tparentViewer = (TreeViewer)viewerPane.getViewer();" + NL + "\t\t\t\tparentViewer.setAutoExpandLevel(30);" + NL + "\t\t\t\tparentViewer.setContentProvider(new ReverseAdapterFactoryContentProvider(adapterFactory));" + NL + "\t\t\t\tparentViewer.setLabelProvider("; + protected final String TEXT_218 = "new "; + protected final String TEXT_219 = "("; + protected final String TEXT_220 = "new "; + protected final String TEXT_221 = "(adapterFactory"; + protected final String TEXT_222 = ", parentViewer"; + protected final String TEXT_223 = ")"; + protected final String TEXT_224 = ")"; + protected final String TEXT_225 = ");" + NL + "" + NL + "\t\t\t\tcreateContextMenuFor(parentViewer);" + NL + "\t\t\t\tint pageIndex = addPage(viewerPane.getControl());" + NL + "\t\t\t\tsetPageText(pageIndex, getString(\"_UI_ParentPage_label\"));"; + protected final String TEXT_226 = NL + "\t\t\t}" + NL + "" + NL + "\t\t\t// This is the page for the list viewer" + NL + "\t\t\t//" + NL + "\t\t\t{" + NL + "\t\t\t\tViewerPane viewerPane =" + NL + "\t\t\t\t\tnew ViewerPane(getSite().getPage(), "; + protected final String TEXT_227 = ".this)" + NL + "\t\t\t\t\t{"; + protected final String TEXT_228 = NL + "\t\t\t\t\t\t@Override"; + protected final String TEXT_229 = NL + "\t\t\t\t\t\tpublic Viewer createViewer(Composite composite)" + NL + "\t\t\t\t\t\t{" + NL + "\t\t\t\t\t\t\treturn new ListViewer(composite);" + NL + "\t\t\t\t\t\t}"; + protected final String TEXT_230 = NL + "\t\t\t\t\t\t@Override"; + protected final String TEXT_231 = NL + "\t\t\t\t\t\tpublic void requestActivation()" + NL + "\t\t\t\t\t\t{" + NL + "\t\t\t\t\t\t\tsuper.requestActivation();" + NL + "\t\t\t\t\t\t\tsetCurrentViewerPane(this);" + NL + "\t\t\t\t\t\t}" + NL + "\t\t\t\t\t};" + NL + "\t\t\t\tviewerPane.createControl(getContainer());" + NL + "\t\t\t\tlistViewer = (ListViewer)viewerPane.getViewer();" + NL + "\t\t\t\tlistViewer.setContentProvider(new AdapterFactoryContentProvider(adapterFactory));" + NL + "\t\t\t\tlistViewer.setLabelProvider("; + protected final String TEXT_232 = "new "; + protected final String TEXT_233 = "("; + protected final String TEXT_234 = "new "; + protected final String TEXT_235 = "(adapterFactory"; + protected final String TEXT_236 = ", listViewer"; + protected final String TEXT_237 = ")"; protected final String TEXT_238 = ")"; - protected final String TEXT_239 = ", new "; - protected final String TEXT_240 = "(editingDomain"; - protected final String TEXT_241 = ".getResourceSet()"; - protected final String TEXT_242 = ", treeViewer))"; - protected final String TEXT_243 = ");" + NL + "" + NL + "\t\t\t\tnew AdapterFactoryTreeEditor(treeViewer.getTree(), adapterFactory);"; - protected final String TEXT_244 = NL + "\t\t\t\tnew "; - protected final String TEXT_245 = "(treeViewer, new "; - protected final String TEXT_246 = ".EditingDomainLocationListener(editingDomain, treeViewer));"; - protected final String TEXT_247 = NL + NL + "\t\t\t\tcreateContextMenuFor(treeViewer);" + NL + "\t\t\t\tint pageIndex = addPage(viewerPane.getControl());" + NL + "\t\t\t\tsetPageText(pageIndex, getString(\"_UI_TreePage_label\"));"; - protected final String TEXT_248 = NL + "\t\t\t}" + NL + "" + NL + "\t\t\t// This is the page for the table viewer." + NL + "\t\t\t//" + NL + "\t\t\t{" + NL + "\t\t\t\tViewerPane viewerPane =" + NL + "\t\t\t\t\tnew ViewerPane(getSite().getPage(), "; - protected final String TEXT_249 = ".this)" + NL + "\t\t\t\t\t{"; - protected final String TEXT_250 = NL + "\t\t\t\t\t\t@Override"; - protected final String TEXT_251 = NL + "\t\t\t\t\t\tpublic Viewer createViewer(Composite composite)" + NL + "\t\t\t\t\t\t{" + NL + "\t\t\t\t\t\t\treturn new TableViewer(composite);" + NL + "\t\t\t\t\t\t}"; - protected final String TEXT_252 = NL + "\t\t\t\t\t\t@Override"; - protected final String TEXT_253 = NL + "\t\t\t\t\t\tpublic void requestActivation()" + NL + "\t\t\t\t\t\t{" + NL + "\t\t\t\t\t\t\tsuper.requestActivation();" + NL + "\t\t\t\t\t\t\tsetCurrentViewerPane(this);" + NL + "\t\t\t\t\t\t}" + NL + "\t\t\t\t\t};" + NL + "\t\t\t\tviewerPane.createControl(getContainer());" + NL + "\t\t\t\ttableViewer = (TableViewer)viewerPane.getViewer();" + NL + "" + NL + "\t\t\t\tTable table = tableViewer.getTable();" + NL + "\t\t\t\tTableLayout layout = new TableLayout();" + NL + "\t\t\t\ttable.setLayout(layout);" + NL + "\t\t\t\ttable.setHeaderVisible(true);" + NL + "\t\t\t\ttable.setLinesVisible(true);" + NL + "" + NL + "\t\t\t\tTableColumn objectColumn = new TableColumn(table, SWT.NONE);" + NL + "\t\t\t\tlayout.addColumnData(new ColumnWeightData(3, 100, true));" + NL + "\t\t\t\tobjectColumn.setText(getString(\"_UI_ObjectColumn_label\"));"; - protected final String TEXT_254 = NL + "\t\t\t\tobjectColumn.setResizable(true);" + NL + "" + NL + "\t\t\t\tTableColumn selfColumn = new TableColumn(table, SWT.NONE);" + NL + "\t\t\t\tlayout.addColumnData(new ColumnWeightData(2, 100, true));" + NL + "\t\t\t\tselfColumn.setText(getString(\"_UI_SelfColumn_label\"));"; - protected final String TEXT_255 = NL + "\t\t\t\tselfColumn.setResizable(true);" + NL + "" + NL + "\t\t\t\ttableViewer.setColumnProperties(new String [] {\"a\", \"b\"});"; - protected final String TEXT_256 = NL + "\t\t\t\ttableViewer.setContentProvider(new AdapterFactoryContentProvider(adapterFactory));" + NL + "\t\t\t\ttableViewer.setLabelProvider("; - protected final String TEXT_257 = "new "; - protected final String TEXT_258 = "("; - protected final String TEXT_259 = "new "; - protected final String TEXT_260 = "(adapterFactory"; - protected final String TEXT_261 = ", tableViewer"; - protected final String TEXT_262 = ")"; - protected final String TEXT_263 = ", new "; - protected final String TEXT_264 = "(editingDomain"; - protected final String TEXT_265 = ".getResourceSet()"; - protected final String TEXT_266 = ", tableViewer"; - protected final String TEXT_267 = ", "; - protected final String TEXT_268 = ".getPlugin().getDialogSettings()"; - protected final String TEXT_269 = "))"; - protected final String TEXT_270 = ");" + NL; - protected final String TEXT_271 = NL + "\t\t\t\tnew "; - protected final String TEXT_272 = "(tableViewer, new "; - protected final String TEXT_273 = ".EditingDomainLocationListener(editingDomain, tableViewer));" + NL; - protected final String TEXT_274 = NL + "\t\t\t\tcreateContextMenuFor(tableViewer);" + NL + "\t\t\t\tint pageIndex = addPage(viewerPane.getControl());" + NL + "\t\t\t\tsetPageText(pageIndex, getString(\"_UI_TablePage_label\"));"; - protected final String TEXT_275 = NL + "\t\t\t}" + NL + "" + NL + "\t\t\t// This is the page for the table tree viewer." + NL + "\t\t\t//" + NL + "\t\t\t{" + NL + "\t\t\t\tViewerPane viewerPane =" + NL + "\t\t\t\t\tnew ViewerPane(getSite().getPage(), "; - protected final String TEXT_276 = ".this)" + NL + "\t\t\t\t\t{"; - protected final String TEXT_277 = NL + "\t\t\t\t\t\t@Override"; - protected final String TEXT_278 = NL + "\t\t\t\t\t\tpublic Viewer createViewer(Composite composite)" + NL + "\t\t\t\t\t\t{" + NL + "\t\t\t\t\t\t\treturn new TreeViewer(composite);" + NL + "\t\t\t\t\t\t}"; - protected final String TEXT_279 = NL + "\t\t\t\t\t\t@Override"; - protected final String TEXT_280 = NL + "\t\t\t\t\t\tpublic void requestActivation()" + NL + "\t\t\t\t\t\t{" + NL + "\t\t\t\t\t\t\tsuper.requestActivation();" + NL + "\t\t\t\t\t\t\tsetCurrentViewerPane(this);" + NL + "\t\t\t\t\t\t}" + NL + "\t\t\t\t\t};" + NL + "\t\t\t\tviewerPane.createControl(getContainer());" + NL + "" + NL + "\t\t\t\ttreeViewerWithColumns = (TreeViewer)viewerPane.getViewer();" + NL + "" + NL + "\t\t\t\tTree tree = treeViewerWithColumns.getTree();" + NL + "\t\t\t\ttree.setLayoutData(new FillLayout());" + NL + "\t\t\t\ttree.setHeaderVisible(true);" + NL + "\t\t\t\ttree.setLinesVisible(true);" + NL + "" + NL + "\t\t\t\tTreeColumn objectColumn = new TreeColumn(tree, SWT.NONE);" + NL + "\t\t\t\tobjectColumn.setText(getString(\"_UI_ObjectColumn_label\"));"; - protected final String TEXT_281 = NL + "\t\t\t\tobjectColumn.setResizable(true);" + NL + "\t\t\t\tobjectColumn.setWidth(250);" + NL + "" + NL + "\t\t\t\tTreeColumn selfColumn = new TreeColumn(tree, SWT.NONE);" + NL + "\t\t\t\tselfColumn.setText(getString(\"_UI_SelfColumn_label\"));"; - protected final String TEXT_282 = NL + "\t\t\t\tselfColumn.setResizable(true);" + NL + "\t\t\t\tselfColumn.setWidth(200);" + NL + "" + NL + "\t\t\t\ttreeViewerWithColumns.setColumnProperties(new String [] {\"a\", \"b\"});"; - protected final String TEXT_283 = NL + "\t\t\t\ttreeViewerWithColumns.setContentProvider(new AdapterFactoryContentProvider(adapterFactory));" + NL + "\t\t\t\ttreeViewerWithColumns.setLabelProvider("; - protected final String TEXT_284 = "new "; - protected final String TEXT_285 = "("; - protected final String TEXT_286 = "new "; - protected final String TEXT_287 = "(adapterFactory"; - protected final String TEXT_288 = ", treeViewerWithColumns"; - protected final String TEXT_289 = ")"; - protected final String TEXT_290 = ", new "; - protected final String TEXT_291 = "(editingDomain"; - protected final String TEXT_292 = ".getResourceSet()"; - protected final String TEXT_293 = ", treeViewerWithColumns"; - protected final String TEXT_294 = ", "; - protected final String TEXT_295 = ".getPlugin().getDialogSettings()"; - protected final String TEXT_296 = "))"; - protected final String TEXT_297 = ");" + NL; - protected final String TEXT_298 = NL + "\t\t\t\tnew "; - protected final String TEXT_299 = "(treeViewerWithColumns, new "; - protected final String TEXT_300 = ".EditingDomainLocationListener(editingDomain, treeViewerWithColumns));" + NL; - protected final String TEXT_301 = NL + "\t\t\t\tcreateContextMenuFor(treeViewerWithColumns);" + NL + "\t\t\t\tint pageIndex = addPage(viewerPane.getControl());" + NL + "\t\t\t\tsetPageText(pageIndex, getString(\"_UI_TreeWithColumnsPage_label\"));"; - protected final String TEXT_302 = NL + "\t\t\t}"; - protected final String TEXT_303 = NL + "\t\t\tTree tree = new Tree(getContainer(), SWT.MULTI);" + NL + "\t\t\tselectionViewer = new TreeViewer(tree);" + NL + "\t\t\tsetCurrentViewer(selectionViewer);" + NL + "" + NL + "\t\t\tselectionViewer.setContentProvider(new AdapterFactoryContentProvider(adapterFactory));" + NL + "\t\t\tselectionViewer.setLabelProvider("; - protected final String TEXT_304 = "new "; - protected final String TEXT_305 = "("; - protected final String TEXT_306 = "new "; - protected final String TEXT_307 = "(adapterFactory"; - protected final String TEXT_308 = ", selectionViewer"; - protected final String TEXT_309 = ")"; - protected final String TEXT_310 = ", new "; - protected final String TEXT_311 = "(editingDomain"; - protected final String TEXT_312 = ".getResourceSet()"; - protected final String TEXT_313 = ", selectionViewer"; - protected final String TEXT_314 = ", "; - protected final String TEXT_315 = ".getPlugin().getDialogSettings()"; - protected final String TEXT_316 = "))"; - protected final String TEXT_317 = ");" + NL + "\t\t\tselectionViewer.setInput(editingDomain.getResourceSet());" + NL + "\t\t\tselectionViewer.setSelection(new StructuredSelection(editingDomain.getResourceSet().getResources().get(0)), true);" + NL + "" + NL + "\t\t\tnew AdapterFactoryTreeEditor(selectionViewer.getTree(), adapterFactory);"; - protected final String TEXT_318 = NL + "\t\t\tnew "; - protected final String TEXT_319 = "(selectionViewer, new "; - protected final String TEXT_320 = ".EditingDomainLocationListener(editingDomain, selectionViewer));"; - protected final String TEXT_321 = NL + NL + "\t\t\tcreateContextMenuFor(selectionViewer);" + NL + "\t\t\tint pageIndex = addPage(tree);" + NL + "\t\t\tsetPageText(pageIndex, getString(\"_UI_SelectionPage_label\"));"; - protected final String TEXT_322 = NL + NL + "\t\t\tgetSite().getShell().getDisplay().asyncExec" + NL + "\t\t\t\t(new Runnable()" + NL + "\t\t\t\t {" + NL + "\t\t\t\t\t public void run()" + NL + "\t\t\t\t\t {" + NL + "\t\t\t\t\t\t setActivePage(0);" + NL + "\t\t\t\t\t }" + NL + "\t\t\t\t });" + NL + "\t\t}" + NL + "" + NL + "\t\t// Ensures that this editor will only display the page's tab" + NL + "\t\t// area if there are more than one page" + NL + "\t\t//" + NL + "\t\tgetContainer().addControlListener" + NL + "\t\t\t(new ControlAdapter()" + NL + "\t\t\t {" + NL + "\t\t\t\tboolean guard = false;"; - protected final String TEXT_323 = NL + "\t\t\t\t@Override"; - protected final String TEXT_324 = NL + "\t\t\t\tpublic void controlResized(ControlEvent event)" + NL + "\t\t\t\t{" + NL + "\t\t\t\t\tif (!guard)" + NL + "\t\t\t\t\t{" + NL + "\t\t\t\t\t\tguard = true;" + NL + "\t\t\t\t\t\thideTabs();" + NL + "\t\t\t\t\t\tguard = false;" + NL + "\t\t\t\t\t}" + NL + "\t\t\t\t}" + NL + "\t\t\t });" + NL + "" + NL + "\t\tgetSite().getShell().getDisplay().asyncExec" + NL + "\t\t\t(new Runnable()" + NL + "\t\t\t {" + NL + "\t\t\t\t public void run()" + NL + "\t\t\t\t {" + NL + "\t\t\t\t\t updateProblemIndication();" + NL + "\t\t\t\t }" + NL + "\t\t\t });" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * If there is just one page in the multi-page editor part," + NL + "\t * this hides the single tab at the bottom." + NL + "\t * <!-- begin-user-doc -->" + NL + "\t * <!-- end-user-doc -->" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void hideTabs()" + NL + "\t{" + NL + "\t\tif (getPageCount() <= 1)" + NL + "\t\t{" + NL + "\t\t\tsetPageText(0, \"\");"; - protected final String TEXT_325 = NL + "\t\t\tif (getContainer() instanceof CTabFolder)" + NL + "\t\t\t{" + NL + "\t\t\t\t((CTabFolder)getContainer()).setTabHeight(1);" + NL + "\t\t\t\tPoint point = getContainer().getSize();" + NL + "\t\t\t\tgetContainer().setSize(point.x, point.y + 6);" + NL + "\t\t\t}" + NL + "\t\t}" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * If there is more than one page in the multi-page editor part," + NL + "\t * this shows the tabs at the bottom." + NL + "\t * <!-- begin-user-doc -->" + NL + "\t * <!-- end-user-doc -->" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void showTabs()" + NL + "\t{" + NL + "\t\tif (getPageCount() > 1)" + NL + "\t\t{" + NL + "\t\t\tsetPageText(0, getString(\"_UI_SelectionPage_label\"));"; - protected final String TEXT_326 = NL + "\t\t\tif (getContainer() instanceof CTabFolder)" + NL + "\t\t\t{" + NL + "\t\t\t\t((CTabFolder)getContainer()).setTabHeight(SWT.DEFAULT);" + NL + "\t\t\t\tPoint point = getContainer().getSize();" + NL + "\t\t\t\tgetContainer().setSize(point.x, point.y - 6);" + NL + "\t\t\t}" + NL + "\t\t}" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * This is used to track the active viewer." + NL + "\t * <!-- begin-user-doc -->" + NL + "\t * <!-- end-user-doc -->" + NL + "\t * @generated" + NL + "\t */"; - protected final String TEXT_327 = NL + "\t@Override"; - protected final String TEXT_328 = NL + "\tprotected void pageChange(int pageIndex)" + NL + "\t{" + NL + "\t\tsuper.pageChange(pageIndex);" + NL + "" + NL + "\t\tif (contentOutlinePage != null)" + NL + "\t\t{" + NL + "\t\t\thandleContentOutlineSelection(contentOutlinePage.getSelection());" + NL + "\t\t}" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * This is how the framework determines which interfaces we implement." + NL + "\t * <!-- begin-user-doc -->" + NL + "\t * <!-- end-user-doc -->" + NL + "\t * @generated" + NL + "\t */"; - protected final String TEXT_329 = NL + "\t@SuppressWarnings(\""; - protected final String TEXT_330 = "rawtypes"; - protected final String TEXT_331 = "unchecked"; - protected final String TEXT_332 = "\")"; - protected final String TEXT_333 = NL + "\t@Override"; - protected final String TEXT_334 = NL + "\tpublic Object getAdapter(Class key)" + NL + "\t{" + NL + "\t\tif (key.equals(IContentOutlinePage.class))" + NL + "\t\t{" + NL + "\t\t\treturn showOutlineView() ? getContentOutlinePage() : null;" + NL + "\t\t}" + NL + "\t\telse if (key.equals(IPropertySheetPage.class))" + NL + "\t\t{" + NL + "\t\t\treturn getPropertySheetPage();" + NL + "\t\t}"; - protected final String TEXT_335 = NL + "\t\telse if (key.equals(IGotoMarker.class))" + NL + "\t\t{" + NL + "\t\t\treturn this;" + NL + "\t\t}"; - protected final String TEXT_336 = NL + "\t\telse" + NL + "\t\t{" + NL + "\t\t\treturn super.getAdapter(key);" + NL + "\t\t}" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * This accesses a cached version of the content outliner." + NL + "\t * <!-- begin-user-doc -->" + NL + "\t * <!-- end-user-doc -->" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic IContentOutlinePage getContentOutlinePage()" + NL + "\t{" + NL + "\t\tif (contentOutlinePage == null)" + NL + "\t\t{" + NL + "\t\t\t// The content outline is just a tree." + NL + "\t\t\t//" + NL + "\t\t\tclass MyContentOutlinePage extends ContentOutlinePage" + NL + "\t\t\t{"; - protected final String TEXT_337 = NL + "\t\t\t\t@Override"; - protected final String TEXT_338 = NL + "\t\t\t\tpublic void createControl(Composite parent)" + NL + "\t\t\t\t{" + NL + "\t\t\t\t\tsuper.createControl(parent);" + NL + "\t\t\t\t\tcontentOutlineViewer = getTreeViewer();" + NL + "\t\t\t\t\tcontentOutlineViewer.addSelectionChangedListener(this);" + NL + "" + NL + "\t\t\t\t\t// Set up the tree viewer." + NL + "\t\t\t\t\t//" + NL + "\t\t\t\t\tcontentOutlineViewer.setContentProvider(new AdapterFactoryContentProvider(adapterFactory));" + NL + "\t\t\t\t\tcontentOutlineViewer.setLabelProvider("; - protected final String TEXT_339 = "new "; - protected final String TEXT_340 = "("; - protected final String TEXT_341 = "new "; - protected final String TEXT_342 = "(adapterFactory"; - protected final String TEXT_343 = ", contentOutlineViewer"; - protected final String TEXT_344 = ")"; - protected final String TEXT_345 = ", new "; - protected final String TEXT_346 = "(editingDomain"; - protected final String TEXT_347 = ".getResourceSet()"; - protected final String TEXT_348 = ", contentOutlineViewer"; - protected final String TEXT_349 = ", "; - protected final String TEXT_350 = ".getPlugin().getDialogSettings()"; - protected final String TEXT_351 = "))"; - protected final String TEXT_352 = ");" + NL + "\t\t\t\t\tcontentOutlineViewer.setInput(editingDomain.getResourceSet());" + NL; - protected final String TEXT_353 = NL + "\t\t\t\t\tnew "; - protected final String TEXT_354 = "(contentOutlineViewer, new "; - protected final String TEXT_355 = ".EditingDomainLocationListener(editingDomain, contentOutlineViewer));" + NL; - protected final String TEXT_356 = NL + "\t\t\t\t\t// Make sure our popups work." + NL + "\t\t\t\t\t//" + NL + "\t\t\t\t\tcreateContextMenuFor(contentOutlineViewer);" + NL + "" + NL + "\t\t\t\t\tif (!editingDomain.getResourceSet().getResources().isEmpty())" + NL + "\t\t\t\t\t{" + NL + "\t\t\t\t\t // Select the root object in the view." + NL + "\t\t\t\t\t //" + NL + "\t\t\t\t\t contentOutlineViewer.setSelection(new StructuredSelection(editingDomain.getResourceSet().getResources().get(0)), true);" + NL + "\t\t\t\t\t}" + NL + "\t\t\t\t}" + NL; - protected final String TEXT_357 = NL + "\t\t\t\t@Override"; - protected final String TEXT_358 = NL + "\t\t\t\tpublic void makeContributions(IMenuManager menuManager, IToolBarManager toolBarManager, IStatusLineManager statusLineManager)" + NL + "\t\t\t\t{" + NL + "\t\t\t\t\tsuper.makeContributions(menuManager, toolBarManager, statusLineManager);" + NL + "\t\t\t\t\tcontentOutlineStatusLineManager = statusLineManager;" + NL + "\t\t\t\t}" + NL; - protected final String TEXT_359 = NL + "\t\t\t\t@Override"; - protected final String TEXT_360 = NL + "\t\t\t\tpublic void setActionBars(IActionBars actionBars)" + NL + "\t\t\t\t{" + NL + "\t\t\t\t\tsuper.setActionBars(actionBars);" + NL + "\t\t\t\t\tgetActionBarContributor().shareGlobalActions(this, actionBars);" + NL + "\t\t\t\t}" + NL + "\t\t\t}" + NL + "" + NL + "\t\t\tcontentOutlinePage = new MyContentOutlinePage();" + NL + "" + NL + "\t\t\t// Listen to selection so that we can handle it is a special way." + NL + "\t\t\t//" + NL + "\t\t\tcontentOutlinePage.addSelectionChangedListener" + NL + "\t\t\t\t(new ISelectionChangedListener()" + NL + "\t\t\t\t {" + NL + "\t\t\t\t\t // This ensures that we handle selections correctly." + NL + "\t\t\t\t\t //" + NL + "\t\t\t\t\t public void selectionChanged(SelectionChangedEvent event)" + NL + "\t\t\t\t\t {" + NL + "\t\t\t\t\t\t handleContentOutlineSelection(event.getSelection());" + NL + "\t\t\t\t\t }" + NL + "\t\t\t\t });" + NL + "\t\t}" + NL + "" + NL + "\t\treturn contentOutlinePage;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * This accesses a cached version of the property sheet." + NL + "\t * <!-- begin-user-doc -->" + NL + "\t * <!-- end-user-doc -->" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic IPropertySheetPage getPropertySheetPage()" + NL + "\t{" + NL + "\t\tPropertySheetPage propertySheetPage =" + NL + "\t\t\tnew ExtendedPropertySheetPage(editingDomain"; - protected final String TEXT_361 = ", ExtendedPropertySheetPage.Decoration.MANUAL"; - protected final String TEXT_362 = ", ExtendedPropertySheetPage.Decoration.LIVE, "; - protected final String TEXT_363 = ".getPlugin().getDialogSettings()"; - protected final String TEXT_364 = ")" + NL + "\t\t\t{"; - protected final String TEXT_365 = NL + "\t\t\t\t@Override"; - protected final String TEXT_366 = NL + "\t\t\t\tpublic void setSelectionToViewer("; - protected final String TEXT_367 = " selection)" + NL + "\t\t\t\t{" + NL + "\t\t\t\t\t"; - protected final String TEXT_368 = ".this.setSelectionToViewer(selection);" + NL + "\t\t\t\t\t"; - protected final String TEXT_369 = ".this.setFocus();" + NL + "\t\t\t\t}" + NL; - protected final String TEXT_370 = NL + "\t\t\t\t@Override"; - protected final String TEXT_371 = NL + "\t\t\t\tpublic void setActionBars(IActionBars actionBars)" + NL + "\t\t\t\t{" + NL + "\t\t\t\t\tsuper.setActionBars(actionBars);" + NL + "\t\t\t\t\tgetActionBarContributor().shareGlobalActions(this, actionBars);" + NL + "\t\t\t\t}" + NL + "\t\t\t};" + NL + "\t\tpropertySheetPage.setPropertySourceProvider(new AdapterFactoryContentProvider(adapterFactory));" + NL + "\t\tpropertySheetPages.add(propertySheetPage);" + NL + "" + NL + "\t\treturn propertySheetPage;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * This deals with how we want selection in the outliner to affect the other views." + NL + "\t * <!-- begin-user-doc -->" + NL + "\t * <!-- end-user-doc -->" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void handleContentOutlineSelection(ISelection selection)" + NL + "\t{"; - protected final String TEXT_372 = NL + "\t\tif (currentViewerPane != null && !selection.isEmpty() && selection instanceof IStructuredSelection)"; - protected final String TEXT_373 = NL + "\t\tif (selectionViewer != null && !selection.isEmpty() && selection instanceof IStructuredSelection)"; - protected final String TEXT_374 = NL + "\t\t{" + NL + "\t\t\tIterator"; - protected final String TEXT_375 = "<?>"; - protected final String TEXT_376 = " selectedElements = ((IStructuredSelection)selection).iterator();" + NL + "\t\t\tif (selectedElements.hasNext())" + NL + "\t\t\t{" + NL + "\t\t\t\t// Get the first selected element." + NL + "\t\t\t\t//" + NL + "\t\t\t\tObject selectedElement = selectedElements.next();" + NL; - protected final String TEXT_377 = NL + "\t\t\t\t// If it's the selection viewer, then we want it to select the same selection as this selection." + NL + "\t\t\t\t//" + NL + "\t\t\t\tif (currentViewerPane.getViewer() == selectionViewer)" + NL + "\t\t\t\t{" + NL + "\t\t\t\t\t"; - protected final String TEXT_378 = " selectionList = new "; - protected final String TEXT_379 = "();" + NL + "\t\t\t\t\tselectionList.add(selectedElement);" + NL + "\t\t\t\t\twhile (selectedElements.hasNext())" + NL + "\t\t\t\t\t{" + NL + "\t\t\t\t\t\tselectionList.add(selectedElements.next());" + NL + "\t\t\t\t\t}" + NL + "" + NL + "\t\t\t\t\t// Set the selection to the widget." + NL + "\t\t\t\t\t//" + NL + "\t\t\t\t\tselectionViewer.setSelection(new StructuredSelection(selectionList));" + NL + "\t\t\t\t}" + NL + "\t\t\t\telse" + NL + "\t\t\t\t{" + NL + "\t\t\t\t\t// Set the input to the widget." + NL + "\t\t\t\t\t//" + NL + "\t\t\t\t\tif (currentViewerPane.getViewer().getInput() != selectedElement)" + NL + "\t\t\t\t\t{" + NL + "\t\t\t\t\t\tcurrentViewerPane.getViewer().setInput(selectedElement);" + NL + "\t\t\t\t\t\tcurrentViewerPane.setTitle(selectedElement);" + NL + "\t\t\t\t\t}" + NL + "\t\t\t\t}"; - protected final String TEXT_380 = NL + "\t\t\t\t"; - protected final String TEXT_381 = " selectionList = new "; - protected final String TEXT_382 = "();" + NL + "\t\t\t\tselectionList.add(selectedElement);" + NL + "\t\t\t\twhile (selectedElements.hasNext())" + NL + "\t\t\t\t{" + NL + "\t\t\t\t\tselectionList.add(selectedElements.next());" + NL + "\t\t\t\t}" + NL + "" + NL + "\t\t\t\t// Set the selection to the widget." + NL + "\t\t\t\t//" + NL + "\t\t\t\tselectionViewer.setSelection(new StructuredSelection(selectionList));"; - protected final String TEXT_383 = NL + "\t\t\t}" + NL + "\t\t}" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * This is for implementing {@link IEditorPart} and simply tests the command stack." + NL + "\t * <!-- begin-user-doc -->" + NL + "\t * <!-- end-user-doc -->" + NL + "\t * @generated" + NL + "\t */"; - protected final String TEXT_384 = NL + "\t@Override"; - protected final String TEXT_385 = NL + "\tpublic boolean isDirty()" + NL + "\t{" + NL + "\t\treturn ((BasicCommandStack)editingDomain.getCommandStack()).isSaveNeeded();" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * This is for implementing {@link IEditorPart} and simply saves the model file." + NL + "\t * <!-- begin-user-doc -->" + NL + "\t * <!-- end-user-doc -->" + NL + "\t * @generated" + NL + "\t */"; - protected final String TEXT_386 = NL + "\t@Override"; - protected final String TEXT_387 = NL + "\tpublic void doSave(IProgressMonitor progressMonitor)" + NL + "\t{" + NL + "\t\t// Save only resources that have actually changed." + NL + "\t\t//" + NL + "\t\tfinal "; - protected final String TEXT_388 = " saveOptions = new "; - protected final String TEXT_389 = "();"; - protected final String TEXT_390 = NL + "\t\tsaveOptions.put(Resource.OPTION_SAVE_ONLY_IF_CHANGED, Resource.OPTION_SAVE_ONLY_IF_CHANGED_MEMORY_BUFFER);"; - protected final String TEXT_391 = NL + "\t\tsaveOptions.put(Resource.OPTION_LINE_DELIMITER, Resource.OPTION_LINE_DELIMITER_UNSPECIFIED);"; - protected final String TEXT_392 = NL + NL + "\t\t// Do the work within an operation because this is a long running activity that modifies the workbench." + NL + "\t\t//" + NL + "\t\t"; - protected final String TEXT_393 = " operation =" + NL + "\t\t\tnew "; - protected final String TEXT_394 = "()" + NL + "\t\t\t{" + NL + "\t\t\t\t// This is the method that gets invoked when the operation runs." + NL + "\t\t\t\t//"; - protected final String TEXT_395 = NL + "\t\t\t\t@Override"; - protected final String TEXT_396 = NL + "\t\t\t\tpublic void "; - protected final String TEXT_397 = "(IProgressMonitor monitor)" + NL + "\t\t\t\t{" + NL + "\t\t\t\t\t// Save the resources to the file system." + NL + "\t\t\t\t\t//" + NL + "\t\t\t\t\tboolean first = true;"; - protected final String TEXT_398 = NL + "\t\t\t\t\tfor (Resource resource : editingDomain.getResourceSet().getResources())"; - protected final String TEXT_399 = NL + "\t\t\t\t\tfor (Iterator i = editingDomain.getResourceSet().getResources().iterator(); i.hasNext(); )"; - protected final String TEXT_400 = NL + "\t\t\t\t\t{"; - protected final String TEXT_401 = NL + "\t\t\t\t\t\tResource resource = (Resource)i.next();"; - protected final String TEXT_402 = NL + "\t\t\t\t\t\tif ((first || !resource.getContents().isEmpty() || isPersisted(resource)) && !editingDomain.isReadOnly(resource))" + NL + "\t\t\t\t\t\t{" + NL + "\t\t\t\t\t\t\ttry" + NL + "\t\t\t\t\t\t\t{"; - protected final String TEXT_403 = NL + "\t\t\t\t\t\t\t\tlong timeStamp = resource.getTimeStamp();" + NL + "\t\t\t\t\t\t\t\tresource.save(saveOptions);" + NL + "\t\t\t\t\t\t\t\tif (resource.getTimeStamp() != timeStamp)" + NL + "\t\t\t\t\t\t\t\t{" + NL + "\t\t\t\t\t\t\t\t\tsavedResources.add(resource);" + NL + "\t\t\t\t\t\t\t\t}"; - protected final String TEXT_404 = NL + "\t\t\t\t\t\t\t\tresource.save(saveOptions);" + NL + "\t\t\t\t\t\t\t\tsavedResources.add(resource);"; - protected final String TEXT_405 = NL + "\t\t\t\t\t\t\t}" + NL + "\t\t\t\t\t\t\tcatch (Exception exception)" + NL + "\t\t\t\t\t\t\t{" + NL + "\t\t\t\t\t\t\t\tresourceToDiagnosticMap.put(resource, analyzeResourceProblems(resource, exception));" + NL + "\t\t\t\t\t\t\t}" + NL + "\t\t\t\t\t\t\tfirst = false;" + NL + "\t\t\t\t\t\t}" + NL + "\t\t\t\t\t}" + NL + "\t\t\t\t}" + NL + "\t\t\t};" + NL + "" + NL + "\t\tupdateProblemIndication = false;" + NL + "\t\ttry" + NL + "\t\t{" + NL + "\t\t\t// This runs the options, and shows progress." + NL + "\t\t\t//" + NL + "\t\t\tnew ProgressMonitorDialog(getSite().getShell()).run(true, false, operation);" + NL + "" + NL + "\t\t\t// Refresh the necessary state." + NL + "\t\t\t//" + NL + "\t\t\t((BasicCommandStack)editingDomain.getCommandStack()).saveIsDone();" + NL + "\t\t\tfirePropertyChange(IEditorPart.PROP_DIRTY);" + NL + "\t\t}" + NL + "\t\tcatch (Exception exception)" + NL + "\t\t{" + NL + "\t\t\t// Something went wrong that shouldn't." + NL + "\t\t\t//" + NL + "\t\t\t"; - protected final String TEXT_406 = ".INSTANCE.log(exception);" + NL + "\t\t}" + NL + "\t\tupdateProblemIndication = true;" + NL + "\t\tupdateProblemIndication();" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * This returns whether something has been persisted to the URI of the specified resource." + NL + "\t * The implementation uses the URI converter from the editor's resource set to try to open an input stream." + NL + "\t * <!-- begin-user-doc -->" + NL + "\t * <!-- end-user-doc -->" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected boolean isPersisted(Resource resource)" + NL + "\t{" + NL + "\t\tboolean result = false;" + NL + "\t\ttry" + NL + "\t\t{" + NL + "\t\t\tInputStream stream = editingDomain.getResourceSet().getURIConverter().createInputStream(resource.getURI());" + NL + "\t\t\tif (stream != null)" + NL + "\t\t\t{" + NL + "\t\t\t\tresult = true;" + NL + "\t\t\t\tstream.close();" + NL + "\t\t\t}" + NL + "\t\t}" + NL + "\t\tcatch (IOException e)" + NL + "\t\t{" + NL + "\t\t\t// Ignore" + NL + "\t\t}" + NL + "\t\treturn result;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * This always returns true because it is not currently supported." + NL + "\t * <!-- begin-user-doc -->" + NL + "\t * <!-- end-user-doc -->" + NL + "\t * @generated" + NL + "\t */"; - protected final String TEXT_407 = NL + "\t@Override"; - protected final String TEXT_408 = NL + "\tpublic boolean isSaveAsAllowed()" + NL + "\t{" + NL + "\t\treturn true;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * This also changes the editor's input." + NL + "\t * <!-- begin-user-doc -->" + NL + "\t * <!-- end-user-doc -->" + NL + "\t * @generated" + NL + "\t */"; - protected final String TEXT_409 = NL + "\t@Override"; - protected final String TEXT_410 = NL + "\tpublic void doSaveAs()" + NL + "\t{"; - protected final String TEXT_411 = NL + "\t\tnew "; - protected final String TEXT_412 = "(getSite().getShell(), null, SWT.NONE)" + NL + "\t\t\t{"; - protected final String TEXT_413 = NL + "\t\t\t\t@Override"; - protected final String TEXT_414 = NL + "\t\t\t\tprotected boolean isSave()" + NL + "\t\t\t\t{" + NL + "\t\t\t\t\treturn true;" + NL + "\t\t\t\t}" + NL; - protected final String TEXT_415 = NL + "\t\t\t\t@Override"; - protected final String TEXT_416 = NL + "\t\t\t\tprotected boolean processResources()" + NL + "\t\t\t\t{" + NL + "\t\t\t\t\t"; - protected final String TEXT_417 = " uris = getURIs();" + NL + "\t\t\t\t\tif (uris.size() > 0)" + NL + "\t\t\t\t\t{" + NL + "\t\t\t\t\t\tURI uri = "; - protected final String TEXT_418 = "uris.get(0);" + NL + "\t\t\t\t\t\tdoSaveAs(uri, new "; - protected final String TEXT_419 = "(uri));" + NL + "\t\t\t\t\t\treturn true;" + NL + "\t\t\t\t\t}" + NL + "\t\t\t\t\telse" + NL + "\t\t\t\t\t{" + NL + "\t\t\t\t\t\treturn false;" + NL + "\t\t\t\t\t}" + NL + "\t\t\t\t}" + NL + "\t\t\t}.open();"; - protected final String TEXT_420 = NL + "\t\tString[] filters = "; - protected final String TEXT_421 = "(String[])"; - protected final String TEXT_422 = "FILE_EXTENSION_FILTERS.toArray(new String[FILE_EXTENSION_FILTERS.size()]);" + NL + "\t\tString[] files = "; - protected final String TEXT_423 = ".openFilePathDialog(getSite().getShell(), "; - protected final String TEXT_424 = ".SAVE, filters);" + NL + "\t\tif (files.length > 0)" + NL + "\t\t{" + NL + "\t\t\tURI uri = URI.createFileURI(files[0]);" + NL + "\t\t\tdoSaveAs(uri, new "; - protected final String TEXT_425 = "(uri));" + NL + "\t\t}"; - protected final String TEXT_426 = NL + "\t\tSaveAsDialog saveAsDialog = new SaveAsDialog(getSite().getShell());" + NL + "\t\tsaveAsDialog.open();" + NL + "\t\tIPath path = saveAsDialog.getResult();" + NL + "\t\tif (path != null)" + NL + "\t\t{" + NL + "\t\t\tIFile file = ResourcesPlugin.getWorkspace().getRoot().getFile(path);" + NL + "\t\t\tif (file != null)" + NL + "\t\t\t{" + NL + "\t\t\t\tdoSaveAs(URI.createPlatformResourceURI(file.getFullPath().toString(), true), new FileEditorInput(file));" + NL + "\t\t\t}" + NL + "\t\t}"; - protected final String TEXT_427 = NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * <!-- begin-user-doc -->" + NL + "\t * <!-- end-user-doc -->" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void doSaveAs(URI uri, IEditorInput editorInput)" + NL + "\t{" + NL + "\t\t("; - protected final String TEXT_428 = "(Resource)"; - protected final String TEXT_429 = "editingDomain.getResourceSet().getResources().get(0)).setURI(uri);" + NL + "\t\tsetInputWithNotify(editorInput);" + NL + "\t\tsetPartName(editorInput.getName());" + NL + "\t\tIProgressMonitor progressMonitor =" + NL + "\t\t\tgetActionBars().getStatusLineManager() != null ?" + NL + "\t\t\t\tgetActionBars().getStatusLineManager().getProgressMonitor() :" + NL + "\t\t\t\tnew "; - protected final String TEXT_430 = "();" + NL + "\t\tdoSave(progressMonitor);" + NL + "\t}"; - protected final String TEXT_431 = NL + NL + "\t/**" + NL + "\t * <!-- begin-user-doc -->" + NL + "\t * <!-- end-user-doc -->" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void gotoMarker(IMarker marker)" + NL + "\t{"; - protected final String TEXT_432 = NL + "\t\t"; - protected final String TEXT_433 = " targetObjects = markerHelper.getTargetObjects(editingDomain, marker);" + NL + "\t\tif (!targetObjects.isEmpty())" + NL + "\t\t{" + NL + "\t\t\tsetSelectionToViewer(targetObjects);" + NL + "\t\t}"; - protected final String TEXT_434 = NL + "\t\ttry" + NL + "\t\t{" + NL + "\t\t\tif (marker.isSubtypeOf(EValidator.MARKER))" + NL + "\t\t\t{" + NL + "\t\t\t\tString uriAttribute = marker.getAttribute(EValidator.URI_ATTRIBUTE, null);" + NL + "\t\t\t\tif (uriAttribute != null)" + NL + "\t\t\t\t{" + NL + "\t\t\t\t\tURI uri = URI.createURI(uriAttribute);" + NL + "\t\t\t\t\tEObject eObject = editingDomain.getResourceSet().getEObject(uri, true);" + NL + "\t\t\t\t\tif (eObject != null)" + NL + "\t\t\t\t\t{" + NL + "\t\t\t\t\t setSelectionToViewer(Collections.singleton(editingDomain.getWrapper(eObject)));" + NL + "\t\t\t\t\t}" + NL + "\t\t\t\t}" + NL + "\t\t\t}" + NL + "\t\t}" + NL + "\t\tcatch (CoreException exception)" + NL + "\t\t{" + NL + "\t\t\t"; - protected final String TEXT_435 = ".INSTANCE.log(exception);" + NL + "\t\t}"; - protected final String TEXT_436 = NL + "\t}"; - protected final String TEXT_437 = NL + NL + "\t/**" + NL + "\t * This is called during startup." + NL + "\t * <!-- begin-user-doc -->" + NL + "\t * <!-- end-user-doc -->" + NL + "\t * @generated" + NL + "\t */"; - protected final String TEXT_438 = NL + "\t@Override"; - protected final String TEXT_439 = NL + "\tpublic void init(IEditorSite site, IEditorInput editorInput)" + NL + "\t{" + NL + "\t\tsetSite(site);" + NL + "\t\tsetInputWithNotify(editorInput);" + NL + "\t\tsetPartName(editorInput.getName());" + NL + "\t\tsite.setSelectionProvider(this);" + NL + "\t\tsite.getPage().addPartListener(partListener);"; - protected final String TEXT_440 = NL + "\t\tResourcesPlugin.getWorkspace().addResourceChangeListener(resourceChangeListener, IResourceChangeEvent.POST_CHANGE);"; - protected final String TEXT_441 = NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * <!-- begin-user-doc -->" + NL + "\t * <!-- end-user-doc -->" + NL + "\t * @generated" + NL + "\t */"; - protected final String TEXT_442 = NL + "\t@Override"; - protected final String TEXT_443 = NL + "\tpublic void setFocus()" + NL + "\t{"; - protected final String TEXT_444 = NL + "\t\tif (currentViewerPane != null)" + NL + "\t\t{" + NL + "\t\t\tcurrentViewerPane.setFocus();" + NL + "\t\t}" + NL + "\t\telse" + NL + "\t\t{" + NL + "\t\t\tgetControl(getActivePage()).setFocus();" + NL + "\t\t}"; - protected final String TEXT_445 = NL + "\t\tgetControl(getActivePage()).setFocus();"; - protected final String TEXT_446 = NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * This implements {@link org.eclipse.jface.viewers.ISelectionProvider}." + NL + "\t * <!-- begin-user-doc -->" + NL + "\t * <!-- end-user-doc -->" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void addSelectionChangedListener(ISelectionChangedListener listener)" + NL + "\t{" + NL + "\t\tselectionChangedListeners.add(listener);" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * This implements {@link org.eclipse.jface.viewers.ISelectionProvider}." + NL + "\t * <!-- begin-user-doc -->" + NL + "\t * <!-- end-user-doc -->" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void removeSelectionChangedListener(ISelectionChangedListener listener)" + NL + "\t{" + NL + "\t\tselectionChangedListeners.remove(listener);" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * This implements {@link org.eclipse.jface.viewers.ISelectionProvider} to return this editor's overall selection." + NL + "\t * <!-- begin-user-doc -->" + NL + "\t * <!-- end-user-doc -->" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic ISelection getSelection()" + NL + "\t{" + NL + "\t\treturn editorSelection;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * This implements {@link org.eclipse.jface.viewers.ISelectionProvider} to set this editor's overall selection." + NL + "\t * Calling this result will notify the listeners." + NL + "\t * <!-- begin-user-doc -->" + NL + "\t * <!-- end-user-doc -->" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void setSelection(ISelection selection)" + NL + "\t{" + NL + "\t\teditorSelection = selection;" + NL; - protected final String TEXT_447 = NL + "\t\tfor (ISelectionChangedListener listener : selectionChangedListeners)"; - protected final String TEXT_448 = NL + "\t\tfor (Iterator listeners = selectionChangedListeners.iterator(); listeners.hasNext(); )"; - protected final String TEXT_449 = NL + "\t\t{"; - protected final String TEXT_450 = NL + "\t\t\tISelectionChangedListener listener = (ISelectionChangedListener)listeners.next();"; - protected final String TEXT_451 = NL + "\t\t\tlistener.selectionChanged(new SelectionChangedEvent(this, selection));" + NL + "\t\t}" + NL + "\t\tsetStatusLineManager(selection);" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * <!-- begin-user-doc -->" + NL + "\t * <!-- end-user-doc -->" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void setStatusLineManager(ISelection selection)" + NL + "\t{" + NL + "\t\tIStatusLineManager statusLineManager = currentViewer != null && currentViewer == contentOutlineViewer ?" + NL + "\t\t\tcontentOutlineStatusLineManager : getActionBars().getStatusLineManager();" + NL + "" + NL + "\t\tif (statusLineManager != null)" + NL + "\t\t{" + NL + "\t\t\tif (selection instanceof IStructuredSelection)" + NL + "\t\t\t{" + NL + "\t\t\t\t"; - protected final String TEXT_452 = " collection = ((IStructuredSelection)selection).toList();" + NL + "\t\t\t\tswitch (collection.size())" + NL + "\t\t\t\t{" + NL + "\t\t\t\t\tcase 0:" + NL + "\t\t\t\t\t{" + NL + "\t\t\t\t\t\tstatusLineManager.setMessage(getString(\"_UI_NoObjectSelected\"));"; - protected final String TEXT_453 = NL + "\t\t\t\t\t\tbreak;" + NL + "\t\t\t\t\t}" + NL + "\t\t\t\t\tcase 1:" + NL + "\t\t\t\t\t{" + NL + "\t\t\t\t\t\tString text = new AdapterFactoryItemDelegator(adapterFactory).getText(collection.iterator().next());" + NL + "\t\t\t\t\t\tstatusLineManager.setMessage(getString(\"_UI_SingleObjectSelected\", text));"; - protected final String TEXT_454 = NL + "\t\t\t\t\t\tbreak;" + NL + "\t\t\t\t\t}" + NL + "\t\t\t\t\tdefault:" + NL + "\t\t\t\t\t{" + NL + "\t\t\t\t\t\tstatusLineManager.setMessage(getString(\"_UI_MultiObjectSelected\", Integer.toString(collection.size())));"; - protected final String TEXT_455 = NL + "\t\t\t\t\t\tbreak;" + NL + "\t\t\t\t\t}" + NL + "\t\t\t\t}" + NL + "\t\t\t}" + NL + "\t\t\telse" + NL + "\t\t\t{" + NL + "\t\t\t\tstatusLineManager.setMessage(\"\");"; - protected final String TEXT_456 = NL + "\t\t\t}" + NL + "\t\t}" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * This looks up a string in the plugin's plugin.properties file." + NL + "\t * <!-- begin-user-doc -->" + NL + "\t * <!-- end-user-doc -->" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate static String getString(String key)" + NL + "\t{" + NL + "\t\treturn "; - protected final String TEXT_457 = ".INSTANCE.getString(key);" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * This looks up a string in plugin.properties, making a substitution." + NL + "\t * <!-- begin-user-doc -->" + NL + "\t * <!-- end-user-doc -->" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate static String getString(String key, Object s1)" + NL + "\t{" + NL + "\t\treturn "; - protected final String TEXT_458 = ".INSTANCE.getString(key, new Object [] { s1 });" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * This implements {@link org.eclipse.jface.action.IMenuListener} to help fill the context menus with contributions from the Edit menu." + NL + "\t * <!-- begin-user-doc -->" + NL + "\t * <!-- end-user-doc -->" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void menuAboutToShow(IMenuManager menuManager)" + NL + "\t{" + NL + "\t\t((IMenuListener)getEditorSite().getActionBarContributor()).menuAboutToShow(menuManager);" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * <!-- begin-user-doc -->" + NL + "\t * <!-- end-user-doc -->" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic EditingDomainActionBarContributor getActionBarContributor()" + NL + "\t{" + NL + "\t\treturn (EditingDomainActionBarContributor)getEditorSite().getActionBarContributor();" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * <!-- begin-user-doc -->" + NL + "\t * <!-- end-user-doc -->" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic IActionBars getActionBars()" + NL + "\t{" + NL + "\t\treturn getActionBarContributor().getActionBars();" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * <!-- begin-user-doc -->" + NL + "\t * <!-- end-user-doc -->" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic AdapterFactory getAdapterFactory()" + NL + "\t{" + NL + "\t\treturn adapterFactory;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * <!-- begin-user-doc -->" + NL + "\t * <!-- end-user-doc -->" + NL + "\t * @generated" + NL + "\t */"; - protected final String TEXT_459 = NL + "\t@Override"; - protected final String TEXT_460 = NL + "\tpublic void dispose()" + NL + "\t{" + NL + "\t\tupdateProblemIndication = false;" + NL; - protected final String TEXT_461 = NL + "\t\tResourcesPlugin.getWorkspace().removeResourceChangeListener(resourceChangeListener);" + NL; - protected final String TEXT_462 = NL + "\t\tgetSite().getPage().removePartListener(partListener);" + NL + "" + NL + "\t\tadapterFactory.dispose();" + NL + "" + NL + "\t\tif (getActionBarContributor().getActiveEditor() == this)" + NL + "\t\t{" + NL + "\t\t\tgetActionBarContributor().setActiveEditor(null);" + NL + "\t\t}" + NL; - protected final String TEXT_463 = NL + "\t\tfor (PropertySheetPage propertySheetPage : propertySheetPages)"; - protected final String TEXT_464 = NL + "\t\tfor (Iterator i = propertySheetPages.iterator(); i.hasNext(); )"; - protected final String TEXT_465 = NL + "\t\t{"; - protected final String TEXT_466 = NL + "\t\t\tPropertySheetPage propertySheetPage = (PropertySheetPage)i.next();"; - protected final String TEXT_467 = NL + "\t\t\tpropertySheetPage.dispose();" + NL + "\t\t}" + NL + "" + NL + "\t\tif (contentOutlinePage != null)" + NL + "\t\t{" + NL + "\t\t\tcontentOutlinePage.dispose();" + NL + "\t\t}" + NL + "" + NL + "\t\tsuper.dispose();" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * Returns whether the outline view should be presented to the user." + NL + "\t * <!-- begin-user-doc -->" + NL + "\t * <!-- end-user-doc -->" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected boolean showOutlineView()" + NL + "\t{" + NL + "\t\treturn "; - protected final String TEXT_468 = ";" + NL + "\t}" + NL + "}"; - protected final String TEXT_469 = NL; + protected final String TEXT_239 = ");" + NL + "" + NL + "\t\t\t\tcreateContextMenuFor(listViewer);" + NL + "\t\t\t\tint pageIndex = addPage(viewerPane.getControl());" + NL + "\t\t\t\tsetPageText(pageIndex, getString(\"_UI_ListPage_label\"));"; + protected final String TEXT_240 = NL + "\t\t\t}" + NL + "" + NL + "\t\t\t// This is the page for the tree viewer" + NL + "\t\t\t//" + NL + "\t\t\t{" + NL + "\t\t\t\tViewerPane viewerPane =" + NL + "\t\t\t\t\tnew ViewerPane(getSite().getPage(), "; + protected final String TEXT_241 = ".this)" + NL + "\t\t\t\t\t{"; + protected final String TEXT_242 = NL + "\t\t\t\t\t\t@Override"; + protected final String TEXT_243 = NL + "\t\t\t\t\t\tpublic Viewer createViewer(Composite composite)" + NL + "\t\t\t\t\t\t{" + NL + "\t\t\t\t\t\t\treturn new TreeViewer(composite);" + NL + "\t\t\t\t\t\t}"; + protected final String TEXT_244 = NL + "\t\t\t\t\t\t@Override"; + protected final String TEXT_245 = NL + "\t\t\t\t\t\tpublic void requestActivation()" + NL + "\t\t\t\t\t\t{" + NL + "\t\t\t\t\t\t\tsuper.requestActivation();" + NL + "\t\t\t\t\t\t\tsetCurrentViewerPane(this);" + NL + "\t\t\t\t\t\t}" + NL + "\t\t\t\t\t};" + NL + "\t\t\t\tviewerPane.createControl(getContainer());" + NL + "\t\t\t\ttreeViewer = (TreeViewer)viewerPane.getViewer();" + NL + "\t\t\t\ttreeViewer.setContentProvider(new AdapterFactoryContentProvider(adapterFactory));" + NL + "\t\t\t\ttreeViewer.setLabelProvider("; + protected final String TEXT_246 = "new "; + protected final String TEXT_247 = "("; + protected final String TEXT_248 = "new "; + protected final String TEXT_249 = "("; + protected final String TEXT_250 = "new "; + protected final String TEXT_251 = "(adapterFactory"; + protected final String TEXT_252 = ", treeViewer"; + protected final String TEXT_253 = ")"; + protected final String TEXT_254 = ", new "; + protected final String TEXT_255 = "(editingDomain"; + protected final String TEXT_256 = ".getResourceSet()"; + protected final String TEXT_257 = ", treeViewer))"; + protected final String TEXT_258 = ")"; + protected final String TEXT_259 = ");" + NL + "" + NL + "\t\t\t\tnew AdapterFactoryTreeEditor(treeViewer.getTree(), adapterFactory);"; + protected final String TEXT_260 = NL + "\t\t\t\tnew "; + protected final String TEXT_261 = "(treeViewer, new "; + protected final String TEXT_262 = ".EditingDomainLocationListener(editingDomain, treeViewer));"; + protected final String TEXT_263 = NL + NL + "\t\t\t\tcreateContextMenuFor(treeViewer);" + NL + "\t\t\t\tint pageIndex = addPage(viewerPane.getControl());" + NL + "\t\t\t\tsetPageText(pageIndex, getString(\"_UI_TreePage_label\"));"; + protected final String TEXT_264 = NL + "\t\t\t}" + NL + "" + NL + "\t\t\t// This is the page for the table viewer." + NL + "\t\t\t//" + NL + "\t\t\t{" + NL + "\t\t\t\tViewerPane viewerPane =" + NL + "\t\t\t\t\tnew ViewerPane(getSite().getPage(), "; + protected final String TEXT_265 = ".this)" + NL + "\t\t\t\t\t{"; + protected final String TEXT_266 = NL + "\t\t\t\t\t\t@Override"; + protected final String TEXT_267 = NL + "\t\t\t\t\t\tpublic Viewer createViewer(Composite composite)" + NL + "\t\t\t\t\t\t{" + NL + "\t\t\t\t\t\t\treturn new TableViewer(composite);" + NL + "\t\t\t\t\t\t}"; + protected final String TEXT_268 = NL + "\t\t\t\t\t\t@Override"; + protected final String TEXT_269 = NL + "\t\t\t\t\t\tpublic void requestActivation()" + NL + "\t\t\t\t\t\t{" + NL + "\t\t\t\t\t\t\tsuper.requestActivation();" + NL + "\t\t\t\t\t\t\tsetCurrentViewerPane(this);" + NL + "\t\t\t\t\t\t}" + NL + "\t\t\t\t\t};" + NL + "\t\t\t\tviewerPane.createControl(getContainer());" + NL + "\t\t\t\ttableViewer = (TableViewer)viewerPane.getViewer();" + NL + "" + NL + "\t\t\t\tTable table = tableViewer.getTable();" + NL + "\t\t\t\tTableLayout layout = new TableLayout();" + NL + "\t\t\t\ttable.setLayout(layout);" + NL + "\t\t\t\ttable.setHeaderVisible(true);" + NL + "\t\t\t\ttable.setLinesVisible(true);" + NL + "" + NL + "\t\t\t\tTableColumn objectColumn = new TableColumn(table, SWT.NONE);" + NL + "\t\t\t\tlayout.addColumnData(new ColumnWeightData(3, 100, true));" + NL + "\t\t\t\tobjectColumn.setText(getString(\"_UI_ObjectColumn_label\"));"; + protected final String TEXT_270 = NL + "\t\t\t\tobjectColumn.setResizable(true);" + NL + "" + NL + "\t\t\t\tTableColumn selfColumn = new TableColumn(table, SWT.NONE);" + NL + "\t\t\t\tlayout.addColumnData(new ColumnWeightData(2, 100, true));" + NL + "\t\t\t\tselfColumn.setText(getString(\"_UI_SelfColumn_label\"));"; + protected final String TEXT_271 = NL + "\t\t\t\tselfColumn.setResizable(true);" + NL + "" + NL + "\t\t\t\ttableViewer.setColumnProperties(new String [] {\"a\", \"b\"});"; + protected final String TEXT_272 = NL + "\t\t\t\ttableViewer.setContentProvider(new AdapterFactoryContentProvider(adapterFactory));" + NL + "\t\t\t\ttableViewer.setLabelProvider("; + protected final String TEXT_273 = "new "; + protected final String TEXT_274 = "("; + protected final String TEXT_275 = "new "; + protected final String TEXT_276 = "("; + protected final String TEXT_277 = "new "; + protected final String TEXT_278 = "(adapterFactory"; + protected final String TEXT_279 = ", tableViewer"; + protected final String TEXT_280 = ")"; + protected final String TEXT_281 = ", new "; + protected final String TEXT_282 = "(editingDomain"; + protected final String TEXT_283 = ".getResourceSet()"; + protected final String TEXT_284 = ", tableViewer"; + protected final String TEXT_285 = ", "; + protected final String TEXT_286 = ".getPlugin().getDialogSettings()"; + protected final String TEXT_287 = "))"; + protected final String TEXT_288 = ")"; + protected final String TEXT_289 = ");" + NL; + protected final String TEXT_290 = NL + "\t\t\t\tnew "; + protected final String TEXT_291 = "(tableViewer, new "; + protected final String TEXT_292 = ".EditingDomainLocationListener(editingDomain, tableViewer));" + NL; + protected final String TEXT_293 = NL + "\t\t\t\tcreateContextMenuFor(tableViewer);" + NL + "\t\t\t\tint pageIndex = addPage(viewerPane.getControl());" + NL + "\t\t\t\tsetPageText(pageIndex, getString(\"_UI_TablePage_label\"));"; + protected final String TEXT_294 = NL + "\t\t\t}" + NL + "" + NL + "\t\t\t// This is the page for the table tree viewer." + NL + "\t\t\t//" + NL + "\t\t\t{" + NL + "\t\t\t\tViewerPane viewerPane =" + NL + "\t\t\t\t\tnew ViewerPane(getSite().getPage(), "; + protected final String TEXT_295 = ".this)" + NL + "\t\t\t\t\t{"; + protected final String TEXT_296 = NL + "\t\t\t\t\t\t@Override"; + protected final String TEXT_297 = NL + "\t\t\t\t\t\tpublic Viewer createViewer(Composite composite)" + NL + "\t\t\t\t\t\t{" + NL + "\t\t\t\t\t\t\treturn new TreeViewer(composite);" + NL + "\t\t\t\t\t\t}"; + protected final String TEXT_298 = NL + "\t\t\t\t\t\t@Override"; + protected final String TEXT_299 = NL + "\t\t\t\t\t\tpublic void requestActivation()" + NL + "\t\t\t\t\t\t{" + NL + "\t\t\t\t\t\t\tsuper.requestActivation();" + NL + "\t\t\t\t\t\t\tsetCurrentViewerPane(this);" + NL + "\t\t\t\t\t\t}" + NL + "\t\t\t\t\t};" + NL + "\t\t\t\tviewerPane.createControl(getContainer());" + NL + "" + NL + "\t\t\t\ttreeViewerWithColumns = (TreeViewer)viewerPane.getViewer();" + NL + "" + NL + "\t\t\t\tTree tree = treeViewerWithColumns.getTree();" + NL + "\t\t\t\ttree.setLayoutData(new FillLayout());" + NL + "\t\t\t\ttree.setHeaderVisible(true);" + NL + "\t\t\t\ttree.setLinesVisible(true);" + NL + "" + NL + "\t\t\t\tTreeColumn objectColumn = new TreeColumn(tree, SWT.NONE);" + NL + "\t\t\t\tobjectColumn.setText(getString(\"_UI_ObjectColumn_label\"));"; + protected final String TEXT_300 = NL + "\t\t\t\tobjectColumn.setResizable(true);" + NL + "\t\t\t\tobjectColumn.setWidth(250);" + NL + "" + NL + "\t\t\t\tTreeColumn selfColumn = new TreeColumn(tree, SWT.NONE);" + NL + "\t\t\t\tselfColumn.setText(getString(\"_UI_SelfColumn_label\"));"; + protected final String TEXT_301 = NL + "\t\t\t\tselfColumn.setResizable(true);" + NL + "\t\t\t\tselfColumn.setWidth(200);" + NL + "" + NL + "\t\t\t\ttreeViewerWithColumns.setColumnProperties(new String [] {\"a\", \"b\"});"; + protected final String TEXT_302 = NL + "\t\t\t\ttreeViewerWithColumns.setContentProvider(new AdapterFactoryContentProvider(adapterFactory));" + NL + "\t\t\t\ttreeViewerWithColumns.setLabelProvider("; + protected final String TEXT_303 = "new "; + protected final String TEXT_304 = "("; + protected final String TEXT_305 = "new "; + protected final String TEXT_306 = "("; + protected final String TEXT_307 = "new "; + protected final String TEXT_308 = "(adapterFactory"; + protected final String TEXT_309 = ", treeViewerWithColumns"; + protected final String TEXT_310 = ")"; + protected final String TEXT_311 = ", new "; + protected final String TEXT_312 = "(editingDomain"; + protected final String TEXT_313 = ".getResourceSet()"; + protected final String TEXT_314 = ", treeViewerWithColumns"; + protected final String TEXT_315 = ", "; + protected final String TEXT_316 = ".getPlugin().getDialogSettings()"; + protected final String TEXT_317 = "))"; + protected final String TEXT_318 = ")"; + protected final String TEXT_319 = ");" + NL; + protected final String TEXT_320 = NL + "\t\t\t\tnew "; + protected final String TEXT_321 = "(treeViewerWithColumns, new "; + protected final String TEXT_322 = ".EditingDomainLocationListener(editingDomain, treeViewerWithColumns));" + NL; + protected final String TEXT_323 = NL + "\t\t\t\tcreateContextMenuFor(treeViewerWithColumns);" + NL + "\t\t\t\tint pageIndex = addPage(viewerPane.getControl());" + NL + "\t\t\t\tsetPageText(pageIndex, getString(\"_UI_TreeWithColumnsPage_label\"));"; + protected final String TEXT_324 = NL + "\t\t\t}"; + protected final String TEXT_325 = NL + "\t\t\tTree tree = new Tree(getContainer(), SWT.MULTI);" + NL + "\t\t\tselectionViewer = new TreeViewer(tree);" + NL + "\t\t\tsetCurrentViewer(selectionViewer);" + NL + "" + NL + "\t\t\tselectionViewer.setContentProvider(new AdapterFactoryContentProvider(adapterFactory));" + NL + "\t\t\tselectionViewer.setLabelProvider("; + protected final String TEXT_326 = "new "; + protected final String TEXT_327 = "("; + protected final String TEXT_328 = "new "; + protected final String TEXT_329 = "("; + protected final String TEXT_330 = "new "; + protected final String TEXT_331 = "(adapterFactory"; + protected final String TEXT_332 = ", selectionViewer"; + protected final String TEXT_333 = ")"; + protected final String TEXT_334 = ", new "; + protected final String TEXT_335 = "(editingDomain"; + protected final String TEXT_336 = ".getResourceSet()"; + protected final String TEXT_337 = ", selectionViewer"; + protected final String TEXT_338 = ", "; + protected final String TEXT_339 = ".getPlugin().getDialogSettings()"; + protected final String TEXT_340 = "))"; + protected final String TEXT_341 = ")"; + protected final String TEXT_342 = ");" + NL + "\t\t\tselectionViewer.setInput(editingDomain.getResourceSet());" + NL + "\t\t\tselectionViewer.setSelection(new StructuredSelection(editingDomain.getResourceSet().getResources().get(0)), true);" + NL + "" + NL + "\t\t\tnew AdapterFactoryTreeEditor(selectionViewer.getTree(), adapterFactory);"; + protected final String TEXT_343 = NL + "\t\t\tnew "; + protected final String TEXT_344 = "(selectionViewer, new "; + protected final String TEXT_345 = ".EditingDomainLocationListener(editingDomain, selectionViewer));"; + protected final String TEXT_346 = NL + NL + "\t\t\tcreateContextMenuFor(selectionViewer);" + NL + "\t\t\tint pageIndex = addPage(tree);" + NL + "\t\t\tsetPageText(pageIndex, getString(\"_UI_SelectionPage_label\"));"; + protected final String TEXT_347 = NL + NL + "\t\t\tgetSite().getShell().getDisplay().asyncExec" + NL + "\t\t\t\t(new Runnable()" + NL + "\t\t\t\t {" + NL + "\t\t\t\t\t public void run()" + NL + "\t\t\t\t\t {" + NL + "\t\t\t\t\t\t setActivePage(0);" + NL + "\t\t\t\t\t }" + NL + "\t\t\t\t });" + NL + "\t\t}" + NL + "" + NL + "\t\t// Ensures that this editor will only display the page's tab" + NL + "\t\t// area if there are more than one page" + NL + "\t\t//" + NL + "\t\tgetContainer().addControlListener" + NL + "\t\t\t(new ControlAdapter()" + NL + "\t\t\t {" + NL + "\t\t\t\tboolean guard = false;"; + protected final String TEXT_348 = NL + "\t\t\t\t@Override"; + protected final String TEXT_349 = NL + "\t\t\t\tpublic void controlResized(ControlEvent event)" + NL + "\t\t\t\t{" + NL + "\t\t\t\t\tif (!guard)" + NL + "\t\t\t\t\t{" + NL + "\t\t\t\t\t\tguard = true;" + NL + "\t\t\t\t\t\thideTabs();" + NL + "\t\t\t\t\t\tguard = false;" + NL + "\t\t\t\t\t}" + NL + "\t\t\t\t}" + NL + "\t\t\t });" + NL + "" + NL + "\t\tgetSite().getShell().getDisplay().asyncExec" + NL + "\t\t\t(new Runnable()" + NL + "\t\t\t {" + NL + "\t\t\t\t public void run()" + NL + "\t\t\t\t {" + NL + "\t\t\t\t\t updateProblemIndication();" + NL + "\t\t\t\t }" + NL + "\t\t\t });" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * If there is just one page in the multi-page editor part," + NL + "\t * this hides the single tab at the bottom." + NL + "\t * <!-- begin-user-doc -->" + NL + "\t * <!-- end-user-doc -->" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void hideTabs()" + NL + "\t{" + NL + "\t\tif (getPageCount() <= 1)" + NL + "\t\t{" + NL + "\t\t\tsetPageText(0, \"\");"; + protected final String TEXT_350 = NL + "\t\t\tif (getContainer() instanceof CTabFolder)" + NL + "\t\t\t{" + NL + "\t\t\t\t((CTabFolder)getContainer()).setTabHeight(1);" + NL + "\t\t\t\tPoint point = getContainer().getSize();" + NL + "\t\t\t\tgetContainer().setSize(point.x, point.y + 6);" + NL + "\t\t\t}" + NL + "\t\t}" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * If there is more than one page in the multi-page editor part," + NL + "\t * this shows the tabs at the bottom." + NL + "\t * <!-- begin-user-doc -->" + NL + "\t * <!-- end-user-doc -->" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void showTabs()" + NL + "\t{" + NL + "\t\tif (getPageCount() > 1)" + NL + "\t\t{" + NL + "\t\t\tsetPageText(0, getString(\"_UI_SelectionPage_label\"));"; + protected final String TEXT_351 = NL + "\t\t\tif (getContainer() instanceof CTabFolder)" + NL + "\t\t\t{" + NL + "\t\t\t\t((CTabFolder)getContainer()).setTabHeight(SWT.DEFAULT);" + NL + "\t\t\t\tPoint point = getContainer().getSize();" + NL + "\t\t\t\tgetContainer().setSize(point.x, point.y - 6);" + NL + "\t\t\t}" + NL + "\t\t}" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * This is used to track the active viewer." + NL + "\t * <!-- begin-user-doc -->" + NL + "\t * <!-- end-user-doc -->" + NL + "\t * @generated" + NL + "\t */"; + protected final String TEXT_352 = NL + "\t@Override"; + protected final String TEXT_353 = NL + "\tprotected void pageChange(int pageIndex)" + NL + "\t{" + NL + "\t\tsuper.pageChange(pageIndex);" + NL + "" + NL + "\t\tif (contentOutlinePage != null)" + NL + "\t\t{" + NL + "\t\t\thandleContentOutlineSelection(contentOutlinePage.getSelection());" + NL + "\t\t}" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * This is how the framework determines which interfaces we implement." + NL + "\t * <!-- begin-user-doc -->" + NL + "\t * <!-- end-user-doc -->" + NL + "\t * @generated" + NL + "\t */"; + protected final String TEXT_354 = NL + "\t@SuppressWarnings(\""; + protected final String TEXT_355 = "rawtypes"; + protected final String TEXT_356 = "unchecked"; + protected final String TEXT_357 = "\")"; + protected final String TEXT_358 = NL + "\t@Override"; + protected final String TEXT_359 = NL + "\tpublic Object getAdapter(Class key)" + NL + "\t{" + NL + "\t\tif (key.equals(IContentOutlinePage.class))" + NL + "\t\t{" + NL + "\t\t\treturn showOutlineView() ? getContentOutlinePage() : null;" + NL + "\t\t}" + NL + "\t\telse if (key.equals(IPropertySheetPage.class))" + NL + "\t\t{" + NL + "\t\t\treturn getPropertySheetPage();" + NL + "\t\t}"; + protected final String TEXT_360 = NL + "\t\telse if (key.equals(IGotoMarker.class))" + NL + "\t\t{" + NL + "\t\t\treturn this;" + NL + "\t\t}"; + protected final String TEXT_361 = NL + "\t\telse" + NL + "\t\t{" + NL + "\t\t\treturn super.getAdapter(key);" + NL + "\t\t}" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * This accesses a cached version of the content outliner." + NL + "\t * <!-- begin-user-doc -->" + NL + "\t * <!-- end-user-doc -->" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic IContentOutlinePage getContentOutlinePage()" + NL + "\t{" + NL + "\t\tif (contentOutlinePage == null)" + NL + "\t\t{" + NL + "\t\t\t// The content outline is just a tree." + NL + "\t\t\t//" + NL + "\t\t\tclass MyContentOutlinePage extends ContentOutlinePage" + NL + "\t\t\t{"; + protected final String TEXT_362 = NL + "\t\t\t\t@Override"; + protected final String TEXT_363 = NL + "\t\t\t\tpublic void createControl(Composite parent)" + NL + "\t\t\t\t{" + NL + "\t\t\t\t\tsuper.createControl(parent);" + NL + "\t\t\t\t\tcontentOutlineViewer = getTreeViewer();" + NL + "\t\t\t\t\tcontentOutlineViewer.addSelectionChangedListener(this);" + NL + "" + NL + "\t\t\t\t\t// Set up the tree viewer." + NL + "\t\t\t\t\t//" + NL + "\t\t\t\t\tcontentOutlineViewer.setContentProvider(new AdapterFactoryContentProvider(adapterFactory));" + NL + "\t\t\t\t\tcontentOutlineViewer.setLabelProvider("; + protected final String TEXT_364 = "new "; + protected final String TEXT_365 = "("; + protected final String TEXT_366 = "new "; + protected final String TEXT_367 = "("; + protected final String TEXT_368 = "new "; + protected final String TEXT_369 = "(adapterFactory"; + protected final String TEXT_370 = ", contentOutlineViewer"; + protected final String TEXT_371 = ")"; + protected final String TEXT_372 = ", new "; + protected final String TEXT_373 = "(editingDomain"; + protected final String TEXT_374 = ".getResourceSet()"; + protected final String TEXT_375 = ", contentOutlineViewer"; + protected final String TEXT_376 = ", "; + protected final String TEXT_377 = ".getPlugin().getDialogSettings()"; + protected final String TEXT_378 = "))"; + protected final String TEXT_379 = ")"; + protected final String TEXT_380 = ");" + NL + "\t\t\t\t\tcontentOutlineViewer.setInput(editingDomain.getResourceSet());" + NL; + protected final String TEXT_381 = NL + "\t\t\t\t\tnew "; + protected final String TEXT_382 = "(contentOutlineViewer, new "; + protected final String TEXT_383 = ".EditingDomainLocationListener(editingDomain, contentOutlineViewer));" + NL; + protected final String TEXT_384 = NL + "\t\t\t\t\t// Make sure our popups work." + NL + "\t\t\t\t\t//" + NL + "\t\t\t\t\tcreateContextMenuFor(contentOutlineViewer);" + NL + "" + NL + "\t\t\t\t\tif (!editingDomain.getResourceSet().getResources().isEmpty())" + NL + "\t\t\t\t\t{" + NL + "\t\t\t\t\t // Select the root object in the view." + NL + "\t\t\t\t\t //" + NL + "\t\t\t\t\t contentOutlineViewer.setSelection(new StructuredSelection(editingDomain.getResourceSet().getResources().get(0)), true);" + NL + "\t\t\t\t\t}" + NL + "\t\t\t\t}" + NL; + protected final String TEXT_385 = NL + "\t\t\t\t@Override"; + protected final String TEXT_386 = NL + "\t\t\t\tpublic void makeContributions(IMenuManager menuManager, IToolBarManager toolBarManager, IStatusLineManager statusLineManager)" + NL + "\t\t\t\t{" + NL + "\t\t\t\t\tsuper.makeContributions(menuManager, toolBarManager, statusLineManager);" + NL + "\t\t\t\t\tcontentOutlineStatusLineManager = statusLineManager;" + NL + "\t\t\t\t}" + NL; + protected final String TEXT_387 = NL + "\t\t\t\t@Override"; + protected final String TEXT_388 = NL + "\t\t\t\tpublic void setActionBars(IActionBars actionBars)" + NL + "\t\t\t\t{" + NL + "\t\t\t\t\tsuper.setActionBars(actionBars);" + NL + "\t\t\t\t\tgetActionBarContributor().shareGlobalActions(this, actionBars);" + NL + "\t\t\t\t}" + NL + "\t\t\t}" + NL + "" + NL + "\t\t\tcontentOutlinePage = new MyContentOutlinePage();" + NL + "" + NL + "\t\t\t// Listen to selection so that we can handle it is a special way." + NL + "\t\t\t//" + NL + "\t\t\tcontentOutlinePage.addSelectionChangedListener" + NL + "\t\t\t\t(new ISelectionChangedListener()" + NL + "\t\t\t\t {" + NL + "\t\t\t\t\t // This ensures that we handle selections correctly." + NL + "\t\t\t\t\t //" + NL + "\t\t\t\t\t public void selectionChanged(SelectionChangedEvent event)" + NL + "\t\t\t\t\t {" + NL + "\t\t\t\t\t\t handleContentOutlineSelection(event.getSelection());" + NL + "\t\t\t\t\t }" + NL + "\t\t\t\t });" + NL + "\t\t}" + NL + "" + NL + "\t\treturn contentOutlinePage;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * This accesses a cached version of the property sheet." + NL + "\t * <!-- begin-user-doc -->" + NL + "\t * <!-- end-user-doc -->" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic IPropertySheetPage getPropertySheetPage()" + NL + "\t{" + NL + "\t\tPropertySheetPage propertySheetPage =" + NL + "\t\t\tnew ExtendedPropertySheetPage(editingDomain"; + protected final String TEXT_389 = ", ExtendedPropertySheetPage.Decoration.MANUAL"; + protected final String TEXT_390 = ", ExtendedPropertySheetPage.Decoration.LIVE, "; + protected final String TEXT_391 = ".getPlugin().getDialogSettings()"; + protected final String TEXT_392 = ")" + NL + "\t\t\t{"; + protected final String TEXT_393 = NL + "\t\t\t\t@Override"; + protected final String TEXT_394 = NL + "\t\t\t\tpublic void setSelectionToViewer("; + protected final String TEXT_395 = " selection)" + NL + "\t\t\t\t{" + NL + "\t\t\t\t\t"; + protected final String TEXT_396 = ".this.setSelectionToViewer(selection);" + NL + "\t\t\t\t\t"; + protected final String TEXT_397 = ".this.setFocus();" + NL + "\t\t\t\t}" + NL; + protected final String TEXT_398 = NL + "\t\t\t\t@Override"; + protected final String TEXT_399 = NL + "\t\t\t\tpublic void setActionBars(IActionBars actionBars)" + NL + "\t\t\t\t{" + NL + "\t\t\t\t\tsuper.setActionBars(actionBars);" + NL + "\t\t\t\t\tgetActionBarContributor().shareGlobalActions(this, actionBars);" + NL + "\t\t\t\t}" + NL + "\t\t\t};" + NL + "\t\tpropertySheetPage.setPropertySourceProvider(new AdapterFactoryContentProvider(adapterFactory));" + NL + "\t\tpropertySheetPages.add(propertySheetPage);" + NL + "" + NL + "\t\treturn propertySheetPage;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * This deals with how we want selection in the outliner to affect the other views." + NL + "\t * <!-- begin-user-doc -->" + NL + "\t * <!-- end-user-doc -->" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void handleContentOutlineSelection(ISelection selection)" + NL + "\t{"; + protected final String TEXT_400 = NL + "\t\tif (currentViewerPane != null && !selection.isEmpty() && selection instanceof IStructuredSelection)"; + protected final String TEXT_401 = NL + "\t\tif (selectionViewer != null && !selection.isEmpty() && selection instanceof IStructuredSelection)"; + protected final String TEXT_402 = NL + "\t\t{" + NL + "\t\t\tIterator"; + protected final String TEXT_403 = "<?>"; + protected final String TEXT_404 = " selectedElements = ((IStructuredSelection)selection).iterator();" + NL + "\t\t\tif (selectedElements.hasNext())" + NL + "\t\t\t{" + NL + "\t\t\t\t// Get the first selected element." + NL + "\t\t\t\t//" + NL + "\t\t\t\tObject selectedElement = selectedElements.next();" + NL; + protected final String TEXT_405 = NL + "\t\t\t\t// If it's the selection viewer, then we want it to select the same selection as this selection." + NL + "\t\t\t\t//" + NL + "\t\t\t\tif (currentViewerPane.getViewer() == selectionViewer)" + NL + "\t\t\t\t{" + NL + "\t\t\t\t\t"; + protected final String TEXT_406 = " selectionList = new "; + protected final String TEXT_407 = "();" + NL + "\t\t\t\t\tselectionList.add(selectedElement);" + NL + "\t\t\t\t\twhile (selectedElements.hasNext())" + NL + "\t\t\t\t\t{" + NL + "\t\t\t\t\t\tselectionList.add(selectedElements.next());" + NL + "\t\t\t\t\t}" + NL + "" + NL + "\t\t\t\t\t// Set the selection to the widget." + NL + "\t\t\t\t\t//" + NL + "\t\t\t\t\tselectionViewer.setSelection(new StructuredSelection(selectionList));" + NL + "\t\t\t\t}" + NL + "\t\t\t\telse" + NL + "\t\t\t\t{" + NL + "\t\t\t\t\t// Set the input to the widget." + NL + "\t\t\t\t\t//" + NL + "\t\t\t\t\tif (currentViewerPane.getViewer().getInput() != selectedElement)" + NL + "\t\t\t\t\t{" + NL + "\t\t\t\t\t\tcurrentViewerPane.getViewer().setInput(selectedElement);" + NL + "\t\t\t\t\t\tcurrentViewerPane.setTitle(selectedElement);" + NL + "\t\t\t\t\t}" + NL + "\t\t\t\t}"; + protected final String TEXT_408 = NL + "\t\t\t\t"; + protected final String TEXT_409 = " selectionList = new "; + protected final String TEXT_410 = "();" + NL + "\t\t\t\tselectionList.add(selectedElement);" + NL + "\t\t\t\twhile (selectedElements.hasNext())" + NL + "\t\t\t\t{" + NL + "\t\t\t\t\tselectionList.add(selectedElements.next());" + NL + "\t\t\t\t}" + NL + "" + NL + "\t\t\t\t// Set the selection to the widget." + NL + "\t\t\t\t//" + NL + "\t\t\t\tselectionViewer.setSelection(new StructuredSelection(selectionList));"; + protected final String TEXT_411 = NL + "\t\t\t}" + NL + "\t\t}" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * This is for implementing {@link IEditorPart} and simply tests the command stack." + NL + "\t * <!-- begin-user-doc -->" + NL + "\t * <!-- end-user-doc -->" + NL + "\t * @generated" + NL + "\t */"; + protected final String TEXT_412 = NL + "\t@Override"; + protected final String TEXT_413 = NL + "\tpublic boolean isDirty()" + NL + "\t{" + NL + "\t\treturn ((BasicCommandStack)editingDomain.getCommandStack()).isSaveNeeded();" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * This is for implementing {@link IEditorPart} and simply saves the model file." + NL + "\t * <!-- begin-user-doc -->" + NL + "\t * <!-- end-user-doc -->" + NL + "\t * @generated" + NL + "\t */"; + protected final String TEXT_414 = NL + "\t@Override"; + protected final String TEXT_415 = NL + "\tpublic void doSave(IProgressMonitor progressMonitor)" + NL + "\t{" + NL + "\t\t// Save only resources that have actually changed." + NL + "\t\t//" + NL + "\t\tfinal "; + protected final String TEXT_416 = " saveOptions = new "; + protected final String TEXT_417 = "();"; + protected final String TEXT_418 = NL + "\t\tsaveOptions.put(Resource.OPTION_SAVE_ONLY_IF_CHANGED, Resource.OPTION_SAVE_ONLY_IF_CHANGED_MEMORY_BUFFER);"; + protected final String TEXT_419 = NL + "\t\tsaveOptions.put(Resource.OPTION_LINE_DELIMITER, Resource.OPTION_LINE_DELIMITER_UNSPECIFIED);"; + protected final String TEXT_420 = NL + NL + "\t\t// Do the work within an operation because this is a long running activity that modifies the workbench." + NL + "\t\t//" + NL + "\t\t"; + protected final String TEXT_421 = " operation =" + NL + "\t\t\tnew "; + protected final String TEXT_422 = "()" + NL + "\t\t\t{" + NL + "\t\t\t\t// This is the method that gets invoked when the operation runs." + NL + "\t\t\t\t//"; + protected final String TEXT_423 = NL + "\t\t\t\t@Override"; + protected final String TEXT_424 = NL + "\t\t\t\tpublic void "; + protected final String TEXT_425 = "(IProgressMonitor monitor)" + NL + "\t\t\t\t{" + NL + "\t\t\t\t\t// Save the resources to the file system." + NL + "\t\t\t\t\t//" + NL + "\t\t\t\t\tboolean first = true;"; + protected final String TEXT_426 = NL + "\t\t\t\t\tfor (Resource resource : editingDomain.getResourceSet().getResources())"; + protected final String TEXT_427 = NL + "\t\t\t\t\tfor (Iterator i = editingDomain.getResourceSet().getResources().iterator(); i.hasNext(); )"; + protected final String TEXT_428 = NL + "\t\t\t\t\t{"; + protected final String TEXT_429 = NL + "\t\t\t\t\t\tResource resource = (Resource)i.next();"; + protected final String TEXT_430 = NL + "\t\t\t\t\t\tif ((first || !resource.getContents().isEmpty() || isPersisted(resource)) && !editingDomain.isReadOnly(resource))" + NL + "\t\t\t\t\t\t{" + NL + "\t\t\t\t\t\t\ttry" + NL + "\t\t\t\t\t\t\t{"; + protected final String TEXT_431 = NL + "\t\t\t\t\t\t\t\tlong timeStamp = resource.getTimeStamp();" + NL + "\t\t\t\t\t\t\t\tresource.save(saveOptions);" + NL + "\t\t\t\t\t\t\t\tif (resource.getTimeStamp() != timeStamp)" + NL + "\t\t\t\t\t\t\t\t{" + NL + "\t\t\t\t\t\t\t\t\tsavedResources.add(resource);" + NL + "\t\t\t\t\t\t\t\t}"; + protected final String TEXT_432 = NL + "\t\t\t\t\t\t\t\tresource.save(saveOptions);" + NL + "\t\t\t\t\t\t\t\tsavedResources.add(resource);"; + protected final String TEXT_433 = NL + "\t\t\t\t\t\t\t}" + NL + "\t\t\t\t\t\t\tcatch (Exception exception)" + NL + "\t\t\t\t\t\t\t{" + NL + "\t\t\t\t\t\t\t\tresourceToDiagnosticMap.put(resource, analyzeResourceProblems(resource, exception));" + NL + "\t\t\t\t\t\t\t}" + NL + "\t\t\t\t\t\t\tfirst = false;" + NL + "\t\t\t\t\t\t}" + NL + "\t\t\t\t\t}" + NL + "\t\t\t\t}" + NL + "\t\t\t};" + NL + "" + NL + "\t\tupdateProblemIndication = false;" + NL + "\t\ttry" + NL + "\t\t{" + NL + "\t\t\t// This runs the options, and shows progress." + NL + "\t\t\t//" + NL + "\t\t\tnew ProgressMonitorDialog(getSite().getShell()).run(true, false, operation);" + NL + "" + NL + "\t\t\t// Refresh the necessary state." + NL + "\t\t\t//" + NL + "\t\t\t((BasicCommandStack)editingDomain.getCommandStack()).saveIsDone();" + NL + "\t\t\tfirePropertyChange(IEditorPart.PROP_DIRTY);" + NL + "\t\t}" + NL + "\t\tcatch (Exception exception)" + NL + "\t\t{" + NL + "\t\t\t// Something went wrong that shouldn't." + NL + "\t\t\t//" + NL + "\t\t\t"; + protected final String TEXT_434 = ".INSTANCE.log(exception);" + NL + "\t\t}" + NL + "\t\tupdateProblemIndication = true;" + NL + "\t\tupdateProblemIndication();" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * This returns whether something has been persisted to the URI of the specified resource." + NL + "\t * The implementation uses the URI converter from the editor's resource set to try to open an input stream." + NL + "\t * <!-- begin-user-doc -->" + NL + "\t * <!-- end-user-doc -->" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected boolean isPersisted(Resource resource)" + NL + "\t{" + NL + "\t\tboolean result = false;" + NL + "\t\ttry" + NL + "\t\t{" + NL + "\t\t\tInputStream stream = editingDomain.getResourceSet().getURIConverter().createInputStream(resource.getURI());" + NL + "\t\t\tif (stream != null)" + NL + "\t\t\t{" + NL + "\t\t\t\tresult = true;" + NL + "\t\t\t\tstream.close();" + NL + "\t\t\t}" + NL + "\t\t}" + NL + "\t\tcatch (IOException e)" + NL + "\t\t{" + NL + "\t\t\t// Ignore" + NL + "\t\t}" + NL + "\t\treturn result;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * This always returns true because it is not currently supported." + NL + "\t * <!-- begin-user-doc -->" + NL + "\t * <!-- end-user-doc -->" + NL + "\t * @generated" + NL + "\t */"; + protected final String TEXT_435 = NL + "\t@Override"; + protected final String TEXT_436 = NL + "\tpublic boolean isSaveAsAllowed()" + NL + "\t{" + NL + "\t\treturn true;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * This also changes the editor's input." + NL + "\t * <!-- begin-user-doc -->" + NL + "\t * <!-- end-user-doc -->" + NL + "\t * @generated" + NL + "\t */"; + protected final String TEXT_437 = NL + "\t@Override"; + protected final String TEXT_438 = NL + "\tpublic void doSaveAs()" + NL + "\t{"; + protected final String TEXT_439 = NL + "\t\tnew "; + protected final String TEXT_440 = "(getSite().getShell(), null, SWT.NONE)" + NL + "\t\t\t{"; + protected final String TEXT_441 = NL + "\t\t\t\t@Override"; + protected final String TEXT_442 = NL + "\t\t\t\tprotected boolean isSave()" + NL + "\t\t\t\t{" + NL + "\t\t\t\t\treturn true;" + NL + "\t\t\t\t}" + NL; + protected final String TEXT_443 = NL + "\t\t\t\t@Override"; + protected final String TEXT_444 = NL + "\t\t\t\tprotected boolean processResources()" + NL + "\t\t\t\t{" + NL + "\t\t\t\t\t"; + protected final String TEXT_445 = " uris = getURIs();" + NL + "\t\t\t\t\tif (uris.size() > 0)" + NL + "\t\t\t\t\t{" + NL + "\t\t\t\t\t\tURI uri = "; + protected final String TEXT_446 = "uris.get(0);" + NL + "\t\t\t\t\t\tdoSaveAs(uri, new "; + protected final String TEXT_447 = "(uri));" + NL + "\t\t\t\t\t\treturn true;" + NL + "\t\t\t\t\t}" + NL + "\t\t\t\t\telse" + NL + "\t\t\t\t\t{" + NL + "\t\t\t\t\t\treturn false;" + NL + "\t\t\t\t\t}" + NL + "\t\t\t\t}" + NL + "\t\t\t}.open();"; + protected final String TEXT_448 = NL + "\t\tString[] filters = "; + protected final String TEXT_449 = "(String[])"; + protected final String TEXT_450 = "FILE_EXTENSION_FILTERS.toArray(new String[FILE_EXTENSION_FILTERS.size()]);" + NL + "\t\tString[] files = "; + protected final String TEXT_451 = ".openFilePathDialog(getSite().getShell(), "; + protected final String TEXT_452 = ".SAVE, filters);" + NL + "\t\tif (files.length > 0)" + NL + "\t\t{" + NL + "\t\t\tURI uri = URI.createFileURI(files[0]);" + NL + "\t\t\tdoSaveAs(uri, new "; + protected final String TEXT_453 = "(uri));" + NL + "\t\t}"; + protected final String TEXT_454 = NL + "\t\tSaveAsDialog saveAsDialog = new SaveAsDialog(getSite().getShell());" + NL + "\t\tsaveAsDialog.open();" + NL + "\t\tIPath path = saveAsDialog.getResult();" + NL + "\t\tif (path != null)" + NL + "\t\t{" + NL + "\t\t\tIFile file = ResourcesPlugin.getWorkspace().getRoot().getFile(path);" + NL + "\t\t\tif (file != null)" + NL + "\t\t\t{" + NL + "\t\t\t\tdoSaveAs(URI.createPlatformResourceURI(file.getFullPath().toString(), true), new FileEditorInput(file));" + NL + "\t\t\t}" + NL + "\t\t}"; + protected final String TEXT_455 = NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * <!-- begin-user-doc -->" + NL + "\t * <!-- end-user-doc -->" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void doSaveAs(URI uri, IEditorInput editorInput)" + NL + "\t{" + NL + "\t\t("; + protected final String TEXT_456 = "(Resource)"; + protected final String TEXT_457 = "editingDomain.getResourceSet().getResources().get(0)).setURI(uri);" + NL + "\t\tsetInputWithNotify(editorInput);" + NL + "\t\tsetPartName(editorInput.getName());" + NL + "\t\tIProgressMonitor progressMonitor =" + NL + "\t\t\tgetActionBars().getStatusLineManager() != null ?" + NL + "\t\t\t\tgetActionBars().getStatusLineManager().getProgressMonitor() :" + NL + "\t\t\t\tnew "; + protected final String TEXT_458 = "();" + NL + "\t\tdoSave(progressMonitor);" + NL + "\t}"; + protected final String TEXT_459 = NL + NL + "\t/**" + NL + "\t * <!-- begin-user-doc -->" + NL + "\t * <!-- end-user-doc -->" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void gotoMarker(IMarker marker)" + NL + "\t{"; + protected final String TEXT_460 = NL + "\t\t"; + protected final String TEXT_461 = " targetObjects = markerHelper.getTargetObjects(editingDomain, marker);" + NL + "\t\tif (!targetObjects.isEmpty())" + NL + "\t\t{" + NL + "\t\t\tsetSelectionToViewer(targetObjects);" + NL + "\t\t}"; + protected final String TEXT_462 = NL + "\t\ttry" + NL + "\t\t{" + NL + "\t\t\tif (marker.isSubtypeOf(EValidator.MARKER))" + NL + "\t\t\t{" + NL + "\t\t\t\tString uriAttribute = marker.getAttribute(EValidator.URI_ATTRIBUTE, null);" + NL + "\t\t\t\tif (uriAttribute != null)" + NL + "\t\t\t\t{" + NL + "\t\t\t\t\tURI uri = URI.createURI(uriAttribute);" + NL + "\t\t\t\t\tEObject eObject = editingDomain.getResourceSet().getEObject(uri, true);" + NL + "\t\t\t\t\tif (eObject != null)" + NL + "\t\t\t\t\t{" + NL + "\t\t\t\t\t setSelectionToViewer(Collections.singleton(editingDomain.getWrapper(eObject)));" + NL + "\t\t\t\t\t}" + NL + "\t\t\t\t}" + NL + "\t\t\t}" + NL + "\t\t}" + NL + "\t\tcatch (CoreException exception)" + NL + "\t\t{" + NL + "\t\t\t"; + protected final String TEXT_463 = ".INSTANCE.log(exception);" + NL + "\t\t}"; + protected final String TEXT_464 = NL + "\t}"; + protected final String TEXT_465 = NL + NL + "\t/**" + NL + "\t * This is called during startup." + NL + "\t * <!-- begin-user-doc -->" + NL + "\t * <!-- end-user-doc -->" + NL + "\t * @generated" + NL + "\t */"; + protected final String TEXT_466 = NL + "\t@Override"; + protected final String TEXT_467 = NL + "\tpublic void init(IEditorSite site, IEditorInput editorInput)" + NL + "\t{" + NL + "\t\tsetSite(site);" + NL + "\t\tsetInputWithNotify(editorInput);" + NL + "\t\tsetPartName(editorInput.getName());" + NL + "\t\tsite.setSelectionProvider(this);" + NL + "\t\tsite.getPage().addPartListener(partListener);"; + protected final String TEXT_468 = NL + "\t\tResourcesPlugin.getWorkspace().addResourceChangeListener(resourceChangeListener, IResourceChangeEvent.POST_CHANGE);"; + protected final String TEXT_469 = NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * <!-- begin-user-doc -->" + NL + "\t * <!-- end-user-doc -->" + NL + "\t * @generated" + NL + "\t */"; + protected final String TEXT_470 = NL + "\t@Override"; + protected final String TEXT_471 = NL + "\tpublic void setFocus()" + NL + "\t{"; + protected final String TEXT_472 = NL + "\t\tif (currentViewerPane != null)" + NL + "\t\t{" + NL + "\t\t\tcurrentViewerPane.setFocus();" + NL + "\t\t}" + NL + "\t\telse" + NL + "\t\t{" + NL + "\t\t\tgetControl(getActivePage()).setFocus();" + NL + "\t\t}"; + protected final String TEXT_473 = NL + "\t\tgetControl(getActivePage()).setFocus();"; + protected final String TEXT_474 = NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * This implements {@link org.eclipse.jface.viewers.ISelectionProvider}." + NL + "\t * <!-- begin-user-doc -->" + NL + "\t * <!-- end-user-doc -->" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void addSelectionChangedListener(ISelectionChangedListener listener)" + NL + "\t{" + NL + "\t\tselectionChangedListeners.add(listener);" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * This implements {@link org.eclipse.jface.viewers.ISelectionProvider}." + NL + "\t * <!-- begin-user-doc -->" + NL + "\t * <!-- end-user-doc -->" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void removeSelectionChangedListener(ISelectionChangedListener listener)" + NL + "\t{" + NL + "\t\tselectionChangedListeners.remove(listener);" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * This implements {@link org.eclipse.jface.viewers.ISelectionProvider} to return this editor's overall selection." + NL + "\t * <!-- begin-user-doc -->" + NL + "\t * <!-- end-user-doc -->" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic ISelection getSelection()" + NL + "\t{" + NL + "\t\treturn editorSelection;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * This implements {@link org.eclipse.jface.viewers.ISelectionProvider} to set this editor's overall selection." + NL + "\t * Calling this result will notify the listeners." + NL + "\t * <!-- begin-user-doc -->" + NL + "\t * <!-- end-user-doc -->" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void setSelection(ISelection selection)" + NL + "\t{" + NL + "\t\teditorSelection = selection;" + NL; + protected final String TEXT_475 = NL + "\t\tfor (ISelectionChangedListener listener : selectionChangedListeners)"; + protected final String TEXT_476 = NL + "\t\tfor (Iterator listeners = selectionChangedListeners.iterator(); listeners.hasNext(); )"; + protected final String TEXT_477 = NL + "\t\t{"; + protected final String TEXT_478 = NL + "\t\t\tISelectionChangedListener listener = (ISelectionChangedListener)listeners.next();"; + protected final String TEXT_479 = NL + "\t\t\tlistener.selectionChanged(new SelectionChangedEvent(this, selection));" + NL + "\t\t}" + NL + "\t\tsetStatusLineManager(selection);" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * <!-- begin-user-doc -->" + NL + "\t * <!-- end-user-doc -->" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void setStatusLineManager(ISelection selection)" + NL + "\t{" + NL + "\t\tIStatusLineManager statusLineManager = currentViewer != null && currentViewer == contentOutlineViewer ?" + NL + "\t\t\tcontentOutlineStatusLineManager : getActionBars().getStatusLineManager();" + NL + "" + NL + "\t\tif (statusLineManager != null)" + NL + "\t\t{" + NL + "\t\t\tif (selection instanceof IStructuredSelection)" + NL + "\t\t\t{" + NL + "\t\t\t\t"; + protected final String TEXT_480 = " collection = ((IStructuredSelection)selection).toList();" + NL + "\t\t\t\tswitch (collection.size())" + NL + "\t\t\t\t{" + NL + "\t\t\t\t\tcase 0:" + NL + "\t\t\t\t\t{" + NL + "\t\t\t\t\t\tstatusLineManager.setMessage(getString(\"_UI_NoObjectSelected\"));"; + protected final String TEXT_481 = NL + "\t\t\t\t\t\tbreak;" + NL + "\t\t\t\t\t}" + NL + "\t\t\t\t\tcase 1:" + NL + "\t\t\t\t\t{" + NL + "\t\t\t\t\t\tString text = new AdapterFactoryItemDelegator(adapterFactory).getText(collection.iterator().next());" + NL + "\t\t\t\t\t\tstatusLineManager.setMessage(getString(\"_UI_SingleObjectSelected\", text));"; + protected final String TEXT_482 = NL + "\t\t\t\t\t\tbreak;" + NL + "\t\t\t\t\t}" + NL + "\t\t\t\t\tdefault:" + NL + "\t\t\t\t\t{" + NL + "\t\t\t\t\t\tstatusLineManager.setMessage(getString(\"_UI_MultiObjectSelected\", Integer.toString(collection.size())));"; + protected final String TEXT_483 = NL + "\t\t\t\t\t\tbreak;" + NL + "\t\t\t\t\t}" + NL + "\t\t\t\t}" + NL + "\t\t\t}" + NL + "\t\t\telse" + NL + "\t\t\t{" + NL + "\t\t\t\tstatusLineManager.setMessage(\"\");"; + protected final String TEXT_484 = NL + "\t\t\t}" + NL + "\t\t}" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * This looks up a string in the plugin's plugin.properties file." + NL + "\t * <!-- begin-user-doc -->" + NL + "\t * <!-- end-user-doc -->" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate static String getString(String key)" + NL + "\t{" + NL + "\t\treturn "; + protected final String TEXT_485 = ".INSTANCE.getString(key);" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * This looks up a string in plugin.properties, making a substitution." + NL + "\t * <!-- begin-user-doc -->" + NL + "\t * <!-- end-user-doc -->" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate static String getString(String key, Object s1)" + NL + "\t{" + NL + "\t\treturn "; + protected final String TEXT_486 = ".INSTANCE.getString(key, new Object [] { s1 });" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * This implements {@link org.eclipse.jface.action.IMenuListener} to help fill the context menus with contributions from the Edit menu." + NL + "\t * <!-- begin-user-doc -->" + NL + "\t * <!-- end-user-doc -->" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void menuAboutToShow(IMenuManager menuManager)" + NL + "\t{" + NL + "\t\t((IMenuListener)getEditorSite().getActionBarContributor()).menuAboutToShow(menuManager);" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * <!-- begin-user-doc -->" + NL + "\t * <!-- end-user-doc -->" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic EditingDomainActionBarContributor getActionBarContributor()" + NL + "\t{" + NL + "\t\treturn (EditingDomainActionBarContributor)getEditorSite().getActionBarContributor();" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * <!-- begin-user-doc -->" + NL + "\t * <!-- end-user-doc -->" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic IActionBars getActionBars()" + NL + "\t{" + NL + "\t\treturn getActionBarContributor().getActionBars();" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * <!-- begin-user-doc -->" + NL + "\t * <!-- end-user-doc -->" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic AdapterFactory getAdapterFactory()" + NL + "\t{" + NL + "\t\treturn adapterFactory;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * <!-- begin-user-doc -->" + NL + "\t * <!-- end-user-doc -->" + NL + "\t * @generated" + NL + "\t */"; + protected final String TEXT_487 = NL + "\t@Override"; + protected final String TEXT_488 = NL + "\tpublic void dispose()" + NL + "\t{" + NL + "\t\tupdateProblemIndication = false;" + NL; + protected final String TEXT_489 = NL + "\t\tResourcesPlugin.getWorkspace().removeResourceChangeListener(resourceChangeListener);" + NL; + protected final String TEXT_490 = NL + "\t\tgetSite().getPage().removePartListener(partListener);" + NL + "" + NL + "\t\tadapterFactory.dispose();" + NL + "" + NL + "\t\tif (getActionBarContributor().getActiveEditor() == this)" + NL + "\t\t{" + NL + "\t\t\tgetActionBarContributor().setActiveEditor(null);" + NL + "\t\t}" + NL; + protected final String TEXT_491 = NL + "\t\tfor (PropertySheetPage propertySheetPage : propertySheetPages)"; + protected final String TEXT_492 = NL + "\t\tfor (Iterator i = propertySheetPages.iterator(); i.hasNext(); )"; + protected final String TEXT_493 = NL + "\t\t{"; + protected final String TEXT_494 = NL + "\t\t\tPropertySheetPage propertySheetPage = (PropertySheetPage)i.next();"; + protected final String TEXT_495 = NL + "\t\t\tpropertySheetPage.dispose();" + NL + "\t\t}" + NL + "" + NL + "\t\tif (contentOutlinePage != null)" + NL + "\t\t{" + NL + "\t\t\tcontentOutlinePage.dispose();" + NL + "\t\t}" + NL + "" + NL + "\t\tsuper.dispose();" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * Returns whether the outline view should be presented to the user." + NL + "\t * <!-- begin-user-doc -->" + NL + "\t * <!-- end-user-doc -->" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected boolean showOutlineView()" + NL + "\t{" + NL + "\t\treturn "; + protected final String TEXT_496 = ";" + NL + "\t}" + NL + "}"; + protected final String TEXT_497 = NL; public String generate(Object argument) { @@ -515,8 +543,12 @@ public class Editor String _LinkedHashMapOfResourceToDiagnostic = "LinkedHashMap" + (genModel.useGenerics() ? "<Resource, Diagnostic>" : ""); String _CollectionOfAnything = "Collection" + (genModel.useGenerics() ? "<?>" : ""); String _ListOfAnything = "List" + (genModel.useGenerics() ? "<?>" : ""); - boolean useExtendedLabelProvider = genModel.isFontProviders() || genModel.isColorProviders(); - String _AdapterFactoryLabelProvider = "AdapterFactoryLabelProvider" + (genModel.isFontProviders() && genModel.isColorProviders() ? ".FontAndColorProvider" : genModel.isFontProviders() ? ".FontProvider" : genModel.isColorProviders() ? ".ColorProvider" : ""); + boolean useExtendedLabelProvider = genModel.isStyleProviders() || genModel.isFontProviders() || genModel.isColorProviders(); + boolean useStyledLabelProvider = genModel.isStyleProviders(); + String _AdapterFactoryLabelProvider = (useStyledLabelProvider ? "AdapterFactoryLabelProvider.StyledLabelProvider" : "AdapterFactoryLabelProvider" + (genModel.isFontProviders() && genModel.isColorProviders() ? ".FontAndColorProvider" : genModel.isFontProviders() ? ".FontProvider" : genModel.isColorProviders() ? ".ColorProvider" : "")); + String _DelegatingAdapterFactoryLabelProvider = useStyledLabelProvider ? genModel.getImportedName("org.eclipse.emf.edit.ui.provider.DelegatingStyledCellLabelProvider") + (genModel.isFontProviders() && genModel.isColorProviders() ? ".FontAndColorProvider" : genModel.isFontProviders() ? ".FontProvider" : genModel.isColorProviders() ? ".ColorProvider" : "") : ""; + String _DecoratingColumLabelProvider = genModel.getDecoration() != GenDecoration.NONE ? genModel.getImportedName("org.eclipse.emf.edit.ui.provider.DecoratingColumLabelProvider") + (useStyledLabelProvider ? ".StyledLabelProvider" : "") : ""; + String _DiagnosticDecorator = genModel.getDecoration() != GenDecoration.NONE ? genModel.getImportedName("org.eclipse.emf.edit.ui.provider.DiagnosticDecorator") + (useStyledLabelProvider ? ".Styled" : "") : ""; String _ArrayListOfString = "ArrayList" + (genModel.useGenerics() ? "<String>" : ""); String _ListOfString = "List" + (genModel.useGenerics() ? "<String>" : ""); String _ListOfPropertySheetPage = "List" + (genModel.useGenerics() ? "<PropertySheetPage>" : ""); @@ -746,7 +778,7 @@ public class Editor stringBuffer.append(TEXT_108); } else { stringBuffer.append(TEXT_109); - stringBuffer.append(genModel.getImportedName("org.eclipse.emf.edit.ui.provider.DiagnosticDecorator")); + stringBuffer.append(_DiagnosticDecorator); stringBuffer.append(TEXT_110); } stringBuffer.append(TEXT_111); @@ -914,571 +946,639 @@ public class Editor stringBuffer.append(TEXT_189); } stringBuffer.append(TEXT_190); - if (genModel.getDecoration() != GenDecoration.NONE) { + if (useStyledLabelProvider) { stringBuffer.append(TEXT_191); - stringBuffer.append(genModel.getImportedName("org.eclipse.emf.edit.ui.provider.DecoratingColumLabelProvider")); + stringBuffer.append(_DelegatingAdapterFactoryLabelProvider); stringBuffer.append(TEXT_192); } + if (genModel.getDecoration() != GenDecoration.NONE) { stringBuffer.append(TEXT_193); - stringBuffer.append(_AdapterFactoryLabelProvider); + stringBuffer.append(_DecoratingColumLabelProvider); stringBuffer.append(TEXT_194); - if (useExtendedLabelProvider) { - stringBuffer.append(TEXT_195); } + stringBuffer.append(TEXT_195); + stringBuffer.append(_AdapterFactoryLabelProvider); stringBuffer.append(TEXT_196); - if (genModel.getDecoration() != GenDecoration.NONE) { + if (useExtendedLabelProvider) { stringBuffer.append(TEXT_197); - stringBuffer.append(genModel.getImportedName("org.eclipse.emf.edit.ui.provider.DiagnosticDecorator")); + } stringBuffer.append(TEXT_198); - if (genModel.getDecoration() == GenDecoration.MANUAL) { + if (genModel.getDecoration() != GenDecoration.NONE) { stringBuffer.append(TEXT_199); - } + stringBuffer.append(_DiagnosticDecorator); stringBuffer.append(TEXT_200); - if (genModel.getDecoration() == GenDecoration.LIVE) { + if (genModel.getDecoration() == GenDecoration.MANUAL) { stringBuffer.append(TEXT_201); - stringBuffer.append(genPackage.getImportedEditorPluginClassName()); - stringBuffer.append(TEXT_202); } + stringBuffer.append(TEXT_202); + if (genModel.getDecoration() == GenDecoration.LIVE) { stringBuffer.append(TEXT_203); - } + stringBuffer.append(genPackage.getImportedEditorPluginClassName()); stringBuffer.append(TEXT_204); - if (genModel.getDecoration() != GenDecoration.NONE) { + } stringBuffer.append(TEXT_205); - stringBuffer.append(genModel.getImportedName("org.eclipse.emf.common.ui.viewer.ColumnViewerInformationControlToolTipSupport")); + } + if (useStyledLabelProvider) { stringBuffer.append(TEXT_206); - stringBuffer.append(genModel.getImportedName("org.eclipse.emf.edit.ui.provider.DiagnosticDecorator")); - stringBuffer.append(TEXT_207); } + stringBuffer.append(TEXT_207); + if (genModel.getDecoration() != GenDecoration.NONE) { stringBuffer.append(TEXT_208); - stringBuffer.append(genModel.getNonNLS()); + stringBuffer.append(genModel.getImportedName("org.eclipse.emf.common.ui.viewer.ColumnViewerInformationControlToolTipSupport")); stringBuffer.append(TEXT_209); - stringBuffer.append(genPackage.getEditorClassName()); + stringBuffer.append(_DiagnosticDecorator); stringBuffer.append(TEXT_210); - if (genModel.useClassOverrideAnnotation()) { - stringBuffer.append(TEXT_211); } + stringBuffer.append(TEXT_211); + stringBuffer.append(genModel.getNonNLS()); stringBuffer.append(TEXT_212); - if (genModel.useClassOverrideAnnotation()) { + stringBuffer.append(genPackage.getEditorClassName()); stringBuffer.append(TEXT_213); - } + if (genModel.useClassOverrideAnnotation()) { stringBuffer.append(TEXT_214); - stringBuffer.append(_AdapterFactoryLabelProvider); + } stringBuffer.append(TEXT_215); - if (useExtendedLabelProvider) { + if (genModel.useClassOverrideAnnotation()) { stringBuffer.append(TEXT_216); } stringBuffer.append(TEXT_217); - stringBuffer.append(genModel.getNonNLS()); + if (useStyledLabelProvider) { stringBuffer.append(TEXT_218); - stringBuffer.append(genPackage.getEditorClassName()); + stringBuffer.append(_DelegatingAdapterFactoryLabelProvider); stringBuffer.append(TEXT_219); - if (genModel.useClassOverrideAnnotation()) { - stringBuffer.append(TEXT_220); } + stringBuffer.append(TEXT_220); + stringBuffer.append(_AdapterFactoryLabelProvider); stringBuffer.append(TEXT_221); - if (genModel.useClassOverrideAnnotation()) { + if (useExtendedLabelProvider) { stringBuffer.append(TEXT_222); } stringBuffer.append(TEXT_223); - stringBuffer.append(_AdapterFactoryLabelProvider); + if (useStyledLabelProvider) { stringBuffer.append(TEXT_224); - if (useExtendedLabelProvider) { - stringBuffer.append(TEXT_225); } - stringBuffer.append(TEXT_226); + stringBuffer.append(TEXT_225); stringBuffer.append(genModel.getNonNLS()); - stringBuffer.append(TEXT_227); + stringBuffer.append(TEXT_226); stringBuffer.append(genPackage.getEditorClassName()); - stringBuffer.append(TEXT_228); + stringBuffer.append(TEXT_227); if (genModel.useClassOverrideAnnotation()) { - stringBuffer.append(TEXT_229); + stringBuffer.append(TEXT_228); } - stringBuffer.append(TEXT_230); + stringBuffer.append(TEXT_229); if (genModel.useClassOverrideAnnotation()) { - stringBuffer.append(TEXT_231); + stringBuffer.append(TEXT_230); } + stringBuffer.append(TEXT_231); + if (useStyledLabelProvider) { stringBuffer.append(TEXT_232); - if (genModel.getDecoration() != GenDecoration.NONE) { + stringBuffer.append(_DelegatingAdapterFactoryLabelProvider); stringBuffer.append(TEXT_233); - stringBuffer.append(genModel.getImportedName("org.eclipse.emf.edit.ui.provider.DecoratingColumLabelProvider")); - stringBuffer.append(TEXT_234); } - stringBuffer.append(TEXT_235); + stringBuffer.append(TEXT_234); stringBuffer.append(_AdapterFactoryLabelProvider); - stringBuffer.append(TEXT_236); + stringBuffer.append(TEXT_235); if (useExtendedLabelProvider) { - stringBuffer.append(TEXT_237); + stringBuffer.append(TEXT_236); } + stringBuffer.append(TEXT_237); + if (useStyledLabelProvider) { stringBuffer.append(TEXT_238); - if (genModel.getDecoration() != GenDecoration.NONE) { + } stringBuffer.append(TEXT_239); - stringBuffer.append(genModel.getImportedName("org.eclipse.emf.edit.ui.provider.DiagnosticDecorator")); + stringBuffer.append(genModel.getNonNLS()); stringBuffer.append(TEXT_240); - if (genModel.getDecoration() == GenDecoration.MANUAL) { + stringBuffer.append(genPackage.getEditorClassName()); stringBuffer.append(TEXT_241); - } + if (genModel.useClassOverrideAnnotation()) { stringBuffer.append(TEXT_242); } stringBuffer.append(TEXT_243); - if (genModel.getDecoration() != GenDecoration.NONE) { + if (genModel.useClassOverrideAnnotation()) { stringBuffer.append(TEXT_244); - stringBuffer.append(genModel.getImportedName("org.eclipse.emf.common.ui.viewer.ColumnViewerInformationControlToolTipSupport")); + } stringBuffer.append(TEXT_245); - stringBuffer.append(genModel.getImportedName("org.eclipse.emf.edit.ui.provider.DiagnosticDecorator")); + if (useStyledLabelProvider) { stringBuffer.append(TEXT_246); - } + stringBuffer.append(_DelegatingAdapterFactoryLabelProvider); stringBuffer.append(TEXT_247); - stringBuffer.append(genModel.getNonNLS()); + } + if (genModel.getDecoration() != GenDecoration.NONE) { stringBuffer.append(TEXT_248); - stringBuffer.append(genPackage.getEditorClassName()); + stringBuffer.append(_DecoratingColumLabelProvider); stringBuffer.append(TEXT_249); - if (genModel.useClassOverrideAnnotation()) { - stringBuffer.append(TEXT_250); } + stringBuffer.append(TEXT_250); + stringBuffer.append(_AdapterFactoryLabelProvider); stringBuffer.append(TEXT_251); - if (genModel.useClassOverrideAnnotation()) { + if (useExtendedLabelProvider) { stringBuffer.append(TEXT_252); } stringBuffer.append(TEXT_253); - stringBuffer.append(genModel.getNonNLS()); + if (genModel.getDecoration() != GenDecoration.NONE) { stringBuffer.append(TEXT_254); - stringBuffer.append(genModel.getNonNLS()); + stringBuffer.append(_DiagnosticDecorator); stringBuffer.append(TEXT_255); - stringBuffer.append(genModel.getNonNLS()); - stringBuffer.append(genModel.getNonNLS(2)); + if (genModel.getDecoration() == GenDecoration.MANUAL) { stringBuffer.append(TEXT_256); - if (genModel.getDecoration() != GenDecoration.NONE) { + } stringBuffer.append(TEXT_257); - stringBuffer.append(genModel.getImportedName("org.eclipse.emf.edit.ui.provider.DecoratingColumLabelProvider")); + } + if (useStyledLabelProvider) { stringBuffer.append(TEXT_258); } stringBuffer.append(TEXT_259); - stringBuffer.append(_AdapterFactoryLabelProvider); + if (genModel.getDecoration() != GenDecoration.NONE) { stringBuffer.append(TEXT_260); - if (useExtendedLabelProvider) { + stringBuffer.append(genModel.getImportedName("org.eclipse.emf.common.ui.viewer.ColumnViewerInformationControlToolTipSupport")); stringBuffer.append(TEXT_261); - } + stringBuffer.append(_DiagnosticDecorator); stringBuffer.append(TEXT_262); - if (genModel.getDecoration() != GenDecoration.NONE) { + } stringBuffer.append(TEXT_263); - stringBuffer.append(genModel.getImportedName("org.eclipse.emf.edit.ui.provider.DiagnosticDecorator")); + stringBuffer.append(genModel.getNonNLS()); stringBuffer.append(TEXT_264); - if (genModel.getDecoration() == GenDecoration.MANUAL) { + stringBuffer.append(genPackage.getEditorClassName()); stringBuffer.append(TEXT_265); - } + if (genModel.useClassOverrideAnnotation()) { stringBuffer.append(TEXT_266); - if (genModel.getDecoration() == GenDecoration.LIVE) { + } stringBuffer.append(TEXT_267); - stringBuffer.append(genPackage.getImportedEditorPluginClassName()); + if (genModel.useClassOverrideAnnotation()) { stringBuffer.append(TEXT_268); } stringBuffer.append(TEXT_269); - } + stringBuffer.append(genModel.getNonNLS()); stringBuffer.append(TEXT_270); - if (genModel.getDecoration() != GenDecoration.NONE) { + stringBuffer.append(genModel.getNonNLS()); stringBuffer.append(TEXT_271); - stringBuffer.append(genModel.getImportedName("org.eclipse.emf.common.ui.viewer.ColumnViewerInformationControlToolTipSupport")); + stringBuffer.append(genModel.getNonNLS()); + stringBuffer.append(genModel.getNonNLS(2)); stringBuffer.append(TEXT_272); - stringBuffer.append(genModel.getImportedName("org.eclipse.emf.edit.ui.provider.DiagnosticDecorator")); + if (useStyledLabelProvider) { stringBuffer.append(TEXT_273); - } + stringBuffer.append(_DelegatingAdapterFactoryLabelProvider); stringBuffer.append(TEXT_274); - stringBuffer.append(genModel.getNonNLS()); + } + if (genModel.getDecoration() != GenDecoration.NONE) { stringBuffer.append(TEXT_275); - stringBuffer.append(genPackage.getEditorClassName()); + stringBuffer.append(_DecoratingColumLabelProvider); stringBuffer.append(TEXT_276); - if (genModel.useClassOverrideAnnotation()) { - stringBuffer.append(TEXT_277); } + stringBuffer.append(TEXT_277); + stringBuffer.append(_AdapterFactoryLabelProvider); stringBuffer.append(TEXT_278); - if (genModel.useClassOverrideAnnotation()) { + if (useExtendedLabelProvider) { stringBuffer.append(TEXT_279); } stringBuffer.append(TEXT_280); - stringBuffer.append(genModel.getNonNLS()); + if (genModel.getDecoration() != GenDecoration.NONE) { stringBuffer.append(TEXT_281); - stringBuffer.append(genModel.getNonNLS()); + stringBuffer.append(_DiagnosticDecorator); stringBuffer.append(TEXT_282); - stringBuffer.append(genModel.getNonNLS()); - stringBuffer.append(genModel.getNonNLS(2)); + if (genModel.getDecoration() == GenDecoration.MANUAL) { stringBuffer.append(TEXT_283); - if (genModel.getDecoration() != GenDecoration.NONE) { + } stringBuffer.append(TEXT_284); - stringBuffer.append(genModel.getImportedName("org.eclipse.emf.edit.ui.provider.DecoratingColumLabelProvider")); + if (genModel.getDecoration() == GenDecoration.LIVE) { stringBuffer.append(TEXT_285); - } + stringBuffer.append(genPackage.getImportedEditorPluginClassName()); stringBuffer.append(TEXT_286); - stringBuffer.append(_AdapterFactoryLabelProvider); + } stringBuffer.append(TEXT_287); - if (useExtendedLabelProvider) { + } + if (useStyledLabelProvider) { stringBuffer.append(TEXT_288); } stringBuffer.append(TEXT_289); if (genModel.getDecoration() != GenDecoration.NONE) { stringBuffer.append(TEXT_290); - stringBuffer.append(genModel.getImportedName("org.eclipse.emf.edit.ui.provider.DiagnosticDecorator")); + stringBuffer.append(genModel.getImportedName("org.eclipse.emf.common.ui.viewer.ColumnViewerInformationControlToolTipSupport")); stringBuffer.append(TEXT_291); - if (genModel.getDecoration() == GenDecoration.MANUAL) { + stringBuffer.append(_DiagnosticDecorator); stringBuffer.append(TEXT_292); } stringBuffer.append(TEXT_293); - if (genModel.getDecoration() == GenDecoration.LIVE) { + stringBuffer.append(genModel.getNonNLS()); stringBuffer.append(TEXT_294); - stringBuffer.append(genPackage.getImportedEditorPluginClassName()); + stringBuffer.append(genPackage.getEditorClassName()); stringBuffer.append(TEXT_295); - } + if (genModel.useClassOverrideAnnotation()) { stringBuffer.append(TEXT_296); } stringBuffer.append(TEXT_297); - if (genModel.getDecoration() != GenDecoration.NONE) { + if (genModel.useClassOverrideAnnotation()) { stringBuffer.append(TEXT_298); - stringBuffer.append(genModel.getImportedName("org.eclipse.emf.common.ui.viewer.ColumnViewerInformationControlToolTipSupport")); + } stringBuffer.append(TEXT_299); - stringBuffer.append(genModel.getImportedName("org.eclipse.emf.edit.ui.provider.DiagnosticDecorator")); + stringBuffer.append(genModel.getNonNLS()); stringBuffer.append(TEXT_300); - } + stringBuffer.append(genModel.getNonNLS()); stringBuffer.append(TEXT_301); stringBuffer.append(genModel.getNonNLS()); + stringBuffer.append(genModel.getNonNLS(2)); stringBuffer.append(TEXT_302); - } else { + if (useStyledLabelProvider) { stringBuffer.append(TEXT_303); - if (genModel.getDecoration() != GenDecoration.NONE) { + stringBuffer.append(_DelegatingAdapterFactoryLabelProvider); stringBuffer.append(TEXT_304); - stringBuffer.append(genModel.getImportedName("org.eclipse.emf.edit.ui.provider.DecoratingColumLabelProvider")); - stringBuffer.append(TEXT_305); } + if (genModel.getDecoration() != GenDecoration.NONE) { + stringBuffer.append(TEXT_305); + stringBuffer.append(_DecoratingColumLabelProvider); stringBuffer.append(TEXT_306); - stringBuffer.append(_AdapterFactoryLabelProvider); + } stringBuffer.append(TEXT_307); - if (useExtendedLabelProvider) { + stringBuffer.append(_AdapterFactoryLabelProvider); stringBuffer.append(TEXT_308); - } + if (useExtendedLabelProvider) { stringBuffer.append(TEXT_309); - if (genModel.getDecoration() != GenDecoration.NONE) { + } stringBuffer.append(TEXT_310); - stringBuffer.append(genModel.getImportedName("org.eclipse.emf.edit.ui.provider.DiagnosticDecorator")); + if (genModel.getDecoration() != GenDecoration.NONE) { stringBuffer.append(TEXT_311); - if (genModel.getDecoration() == GenDecoration.MANUAL) { + stringBuffer.append(_DiagnosticDecorator); stringBuffer.append(TEXT_312); - } + if (genModel.getDecoration() == GenDecoration.MANUAL) { stringBuffer.append(TEXT_313); - if (genModel.getDecoration() == GenDecoration.LIVE) { + } stringBuffer.append(TEXT_314); - stringBuffer.append(genPackage.getImportedEditorPluginClassName()); + if (genModel.getDecoration() == GenDecoration.LIVE) { stringBuffer.append(TEXT_315); - } + stringBuffer.append(genPackage.getImportedEditorPluginClassName()); stringBuffer.append(TEXT_316); } stringBuffer.append(TEXT_317); - if (genModel.getDecoration() != GenDecoration.NONE) { + } + if (useStyledLabelProvider) { stringBuffer.append(TEXT_318); - stringBuffer.append(genModel.getImportedName("org.eclipse.emf.common.ui.viewer.ColumnViewerInformationControlToolTipSupport")); + } stringBuffer.append(TEXT_319); - stringBuffer.append(genModel.getImportedName("org.eclipse.emf.edit.ui.provider.DiagnosticDecorator")); + if (genModel.getDecoration() != GenDecoration.NONE) { stringBuffer.append(TEXT_320); - } + stringBuffer.append(genModel.getImportedName("org.eclipse.emf.common.ui.viewer.ColumnViewerInformationControlToolTipSupport")); stringBuffer.append(TEXT_321); - stringBuffer.append(genModel.getNonNLS()); - } + stringBuffer.append(_DiagnosticDecorator); stringBuffer.append(TEXT_322); - if (genModel.useClassOverrideAnnotation()) { - stringBuffer.append(TEXT_323); } - stringBuffer.append(TEXT_324); + stringBuffer.append(TEXT_323); stringBuffer.append(genModel.getNonNLS()); + stringBuffer.append(TEXT_324); + } else { stringBuffer.append(TEXT_325); - stringBuffer.append(genModel.getNonNLS()); + if (useStyledLabelProvider) { stringBuffer.append(TEXT_326); - if (genModel.useClassOverrideAnnotation()) { + stringBuffer.append(_DelegatingAdapterFactoryLabelProvider); stringBuffer.append(TEXT_327); } + if (genModel.getDecoration() != GenDecoration.NONE) { stringBuffer.append(TEXT_328); - if (genModel.useGenerics()) { + stringBuffer.append(_DecoratingColumLabelProvider); stringBuffer.append(TEXT_329); - if (genModel.getRuntimeVersion().getValue() >= GenRuntimeVersion.EMF26_VALUE) { + } stringBuffer.append(TEXT_330); - } else { + stringBuffer.append(_AdapterFactoryLabelProvider); stringBuffer.append(TEXT_331); - } + if (useExtendedLabelProvider) { stringBuffer.append(TEXT_332); } - if (genModel.useClassOverrideAnnotation()) { stringBuffer.append(TEXT_333); - } + if (genModel.getDecoration() != GenDecoration.NONE) { stringBuffer.append(TEXT_334); - if (!genModel.isRichClientPlatform()) { + stringBuffer.append(_DiagnosticDecorator); stringBuffer.append(TEXT_335); - } + if (genModel.getDecoration() == GenDecoration.MANUAL) { stringBuffer.append(TEXT_336); - if (genModel.useClassOverrideAnnotation()) { - stringBuffer.append(TEXT_337); } + stringBuffer.append(TEXT_337); + if (genModel.getDecoration() == GenDecoration.LIVE) { stringBuffer.append(TEXT_338); - if (genModel.getDecoration() != GenDecoration.NONE) { + stringBuffer.append(genPackage.getImportedEditorPluginClassName()); stringBuffer.append(TEXT_339); - stringBuffer.append(genModel.getImportedName("org.eclipse.emf.edit.ui.provider.DecoratingColumLabelProvider")); + } stringBuffer.append(TEXT_340); } + if (useStyledLabelProvider) { stringBuffer.append(TEXT_341); - stringBuffer.append(_AdapterFactoryLabelProvider); + } stringBuffer.append(TEXT_342); - if (useExtendedLabelProvider) { + if (genModel.getDecoration() != GenDecoration.NONE) { stringBuffer.append(TEXT_343); - } + stringBuffer.append(genModel.getImportedName("org.eclipse.emf.common.ui.viewer.ColumnViewerInformationControlToolTipSupport")); stringBuffer.append(TEXT_344); - if (genModel.getDecoration() != GenDecoration.NONE) { + stringBuffer.append(_DiagnosticDecorator); stringBuffer.append(TEXT_345); - stringBuffer.append(genModel.getImportedName("org.eclipse.emf.edit.ui.provider.DiagnosticDecorator")); + } stringBuffer.append(TEXT_346); - if (genModel.getDecoration() == GenDecoration.MANUAL) { - stringBuffer.append(TEXT_347); + stringBuffer.append(genModel.getNonNLS()); } + stringBuffer.append(TEXT_347); + if (genModel.useClassOverrideAnnotation()) { stringBuffer.append(TEXT_348); - if (genModel.getDecoration() == GenDecoration.LIVE) { + } stringBuffer.append(TEXT_349); - stringBuffer.append(genPackage.getImportedEditorPluginClassName()); + stringBuffer.append(genModel.getNonNLS()); stringBuffer.append(TEXT_350); - } + stringBuffer.append(genModel.getNonNLS()); stringBuffer.append(TEXT_351); - } + if (genModel.useClassOverrideAnnotation()) { stringBuffer.append(TEXT_352); - if (genModel.getDecoration() != GenDecoration.NONE) { + } stringBuffer.append(TEXT_353); - stringBuffer.append(genModel.getImportedName("org.eclipse.emf.common.ui.viewer.ColumnViewerInformationControlToolTipSupport")); + if (genModel.useGenerics()) { stringBuffer.append(TEXT_354); - stringBuffer.append(genModel.getImportedName("org.eclipse.emf.edit.ui.provider.DiagnosticDecorator")); + if (genModel.getRuntimeVersion().getValue() >= GenRuntimeVersion.EMF26_VALUE) { stringBuffer.append(TEXT_355); - } + } else { stringBuffer.append(TEXT_356); - if (genModel.useClassOverrideAnnotation()) { + } stringBuffer.append(TEXT_357); } - stringBuffer.append(TEXT_358); if (genModel.useClassOverrideAnnotation()) { - stringBuffer.append(TEXT_359); + stringBuffer.append(TEXT_358); } + stringBuffer.append(TEXT_359); + if (!genModel.isRichClientPlatform()) { stringBuffer.append(TEXT_360); - if (genModel.getDecoration() == GenDecoration.MANUAL) { + } stringBuffer.append(TEXT_361); - } else if (genModel.getDecoration() == GenDecoration.LIVE) { + if (genModel.useClassOverrideAnnotation()) { stringBuffer.append(TEXT_362); - stringBuffer.append(genPackage.getImportedEditorPluginClassName()); - stringBuffer.append(TEXT_363); } + stringBuffer.append(TEXT_363); + if (useStyledLabelProvider) { stringBuffer.append(TEXT_364); - if (genModel.useClassOverrideAnnotation()) { + stringBuffer.append(_DelegatingAdapterFactoryLabelProvider); stringBuffer.append(TEXT_365); } + if (genModel.getDecoration() != GenDecoration.NONE) { stringBuffer.append(TEXT_366); - stringBuffer.append(_ListOfAnything); + stringBuffer.append(_DecoratingColumLabelProvider); stringBuffer.append(TEXT_367); - stringBuffer.append(genPackage.getEditorClassName()); + } stringBuffer.append(TEXT_368); - stringBuffer.append(genPackage.getEditorClassName()); + stringBuffer.append(_AdapterFactoryLabelProvider); stringBuffer.append(TEXT_369); - if (genModel.useClassOverrideAnnotation()) { + if (useExtendedLabelProvider) { stringBuffer.append(TEXT_370); } stringBuffer.append(TEXT_371); - if (genPackage.isMultipleEditorPages()) { + if (genModel.getDecoration() != GenDecoration.NONE) { stringBuffer.append(TEXT_372); - } else { + stringBuffer.append(_DiagnosticDecorator); stringBuffer.append(TEXT_373); - } + if (genModel.getDecoration() == GenDecoration.MANUAL) { stringBuffer.append(TEXT_374); - if (genModel.useGenerics()) { - stringBuffer.append(TEXT_375); } + stringBuffer.append(TEXT_375); + if (genModel.getDecoration() == GenDecoration.LIVE) { stringBuffer.append(TEXT_376); - if (genPackage.isMultipleEditorPages()) { + stringBuffer.append(genPackage.getImportedEditorPluginClassName()); stringBuffer.append(TEXT_377); - stringBuffer.append(_ArrayListOfObject); + } stringBuffer.append(TEXT_378); - stringBuffer.append(_ArrayListOfObject); + } + if (useStyledLabelProvider) { stringBuffer.append(TEXT_379); - } else { + } stringBuffer.append(TEXT_380); - stringBuffer.append(_ArrayListOfObject); + if (genModel.getDecoration() != GenDecoration.NONE) { stringBuffer.append(TEXT_381); - stringBuffer.append(_ArrayListOfObject); + stringBuffer.append(genModel.getImportedName("org.eclipse.emf.common.ui.viewer.ColumnViewerInformationControlToolTipSupport")); stringBuffer.append(TEXT_382); - } + stringBuffer.append(_DiagnosticDecorator); stringBuffer.append(TEXT_383); - if (genModel.useClassOverrideAnnotation()) { - stringBuffer.append(TEXT_384); } - stringBuffer.append(TEXT_385); + stringBuffer.append(TEXT_384); if (genModel.useClassOverrideAnnotation()) { - stringBuffer.append(TEXT_386); + stringBuffer.append(TEXT_385); } + stringBuffer.append(TEXT_386); + if (genModel.useClassOverrideAnnotation()) { stringBuffer.append(TEXT_387); - stringBuffer.append(_MapOfObjectToObject); + } stringBuffer.append(TEXT_388); - stringBuffer.append(_HashMapOfObjectToObject); + if (genModel.getDecoration() == GenDecoration.MANUAL) { stringBuffer.append(TEXT_389); - if (genModel.getRuntimeVersion().getValue() >= GenRuntimeVersion.EMF23_VALUE) { + } else if (genModel.getDecoration() == GenDecoration.LIVE) { stringBuffer.append(TEXT_390); - } - if (genModel.getRuntimeVersion().getValue() >= GenRuntimeVersion.EMF29_VALUE) { + stringBuffer.append(genPackage.getImportedEditorPluginClassName()); stringBuffer.append(TEXT_391); } stringBuffer.append(TEXT_392); - stringBuffer.append(importedOperationClassName); + if (genModel.useClassOverrideAnnotation()) { stringBuffer.append(TEXT_393); - stringBuffer.append(importedOperationClassName); + } stringBuffer.append(TEXT_394); - if (!genModel.isRichClientPlatform() && genModel.useClassOverrideAnnotation()) { + stringBuffer.append(_ListOfAnything); stringBuffer.append(TEXT_395); - } + stringBuffer.append(genPackage.getEditorClassName()); stringBuffer.append(TEXT_396); - stringBuffer.append(operationMethodName); + stringBuffer.append(genPackage.getEditorClassName()); stringBuffer.append(TEXT_397); - if (genModel.useGenerics()) { + if (genModel.useClassOverrideAnnotation()) { stringBuffer.append(TEXT_398); - } else { - stringBuffer.append(TEXT_399); } + stringBuffer.append(TEXT_399); + if (genPackage.isMultipleEditorPages()) { stringBuffer.append(TEXT_400); - if (!genModel.useGenerics()) { + } else { stringBuffer.append(TEXT_401); } stringBuffer.append(TEXT_402); - if (genModel.getRuntimeVersion().getValue() >= GenRuntimeVersion.EMF24_VALUE) { + if (genModel.useGenerics()) { stringBuffer.append(TEXT_403); - } else { - stringBuffer.append(TEXT_404); } + stringBuffer.append(TEXT_404); + if (genPackage.isMultipleEditorPages()) { stringBuffer.append(TEXT_405); - stringBuffer.append(genPackage.getImportedEditorPluginClassName()); + stringBuffer.append(_ArrayListOfObject); stringBuffer.append(TEXT_406); - if (genModel.useClassOverrideAnnotation()) { + stringBuffer.append(_ArrayListOfObject); stringBuffer.append(TEXT_407); - } + } else { stringBuffer.append(TEXT_408); - if (genModel.useClassOverrideAnnotation()) { + stringBuffer.append(_ArrayListOfObject); stringBuffer.append(TEXT_409); - } + stringBuffer.append(_ArrayListOfObject); stringBuffer.append(TEXT_410); - if (genModel.isRichClientPlatform()) { - if (genModel.isRichAjaxPlatform()) { + } stringBuffer.append(TEXT_411); - stringBuffer.append(genModel.getImportedName("org.eclipse.emf.common.ui.dialogs.ResourceDialog")); - stringBuffer.append(TEXT_412); if (genModel.useClassOverrideAnnotation()) { - stringBuffer.append(TEXT_413); + stringBuffer.append(TEXT_412); } - stringBuffer.append(TEXT_414); + stringBuffer.append(TEXT_413); if (genModel.useClassOverrideAnnotation()) { - stringBuffer.append(TEXT_415); + stringBuffer.append(TEXT_414); } + stringBuffer.append(TEXT_415); + stringBuffer.append(_MapOfObjectToObject); stringBuffer.append(TEXT_416); - stringBuffer.append("List" + (genModel.useGenerics() ? "<URI>" : "")); + stringBuffer.append(_HashMapOfObjectToObject); stringBuffer.append(TEXT_417); - stringBuffer.append(genModel.useGenerics() ? "": "(URI)"); + if (genModel.getRuntimeVersion().getValue() >= GenRuntimeVersion.EMF23_VALUE) { stringBuffer.append(TEXT_418); - stringBuffer.append(genModel.getImportedName("org.eclipse.emf.common.ui.URIEditorInput")); + } + if (genModel.getRuntimeVersion().getValue() >= GenRuntimeVersion.EMF29_VALUE) { stringBuffer.append(TEXT_419); - } else { + } stringBuffer.append(TEXT_420); - if (!genModel.useGenerics()) { + stringBuffer.append(importedOperationClassName); stringBuffer.append(TEXT_421); - } + stringBuffer.append(importedOperationClassName); stringBuffer.append(TEXT_422); - stringBuffer.append(genModel.getImportedName(genModel.getQualifiedEditorAdvisorClassName())); + if (!genModel.isRichClientPlatform() && genModel.useClassOverrideAnnotation()) { stringBuffer.append(TEXT_423); - stringBuffer.append(genModel.getImportedName("org.eclipse.swt.SWT")); + } stringBuffer.append(TEXT_424); - stringBuffer.append(genModel.getImportedName("org.eclipse.emf.common.ui.URIEditorInput")); + stringBuffer.append(operationMethodName); stringBuffer.append(TEXT_425); - } - } else { + if (genModel.useGenerics()) { stringBuffer.append(TEXT_426); - } + } else { stringBuffer.append(TEXT_427); - if (!genModel.useGenerics()) { - stringBuffer.append(TEXT_428); } + stringBuffer.append(TEXT_428); + if (!genModel.useGenerics()) { stringBuffer.append(TEXT_429); - stringBuffer.append(genModel.getImportedName("org.eclipse.core.runtime.NullProgressMonitor")); + } stringBuffer.append(TEXT_430); - if (!genModel.isRichClientPlatform()) { + if (genModel.getRuntimeVersion().getValue() >= GenRuntimeVersion.EMF24_VALUE) { stringBuffer.append(TEXT_431); - if (genModel.getRuntimeVersion().getValue() >= GenRuntimeVersion.EMF23_VALUE) { + } else { stringBuffer.append(TEXT_432); - stringBuffer.append(_ListOfAnything); + } stringBuffer.append(TEXT_433); - } else { - stringBuffer.append(TEXT_434); stringBuffer.append(genPackage.getImportedEditorPluginClassName()); + stringBuffer.append(TEXT_434); + if (genModel.useClassOverrideAnnotation()) { stringBuffer.append(TEXT_435); } stringBuffer.append(TEXT_436); - } - stringBuffer.append(TEXT_437); if (genModel.useClassOverrideAnnotation()) { - stringBuffer.append(TEXT_438); + stringBuffer.append(TEXT_437); } + stringBuffer.append(TEXT_438); + if (genModel.isRichClientPlatform()) { + if (genModel.isRichAjaxPlatform()) { stringBuffer.append(TEXT_439); - if (!genModel.isRichClientPlatform()) { + stringBuffer.append(genModel.getImportedName("org.eclipse.emf.common.ui.dialogs.ResourceDialog")); stringBuffer.append(TEXT_440); - } - stringBuffer.append(TEXT_441); if (genModel.useClassOverrideAnnotation()) { - stringBuffer.append(TEXT_442); + stringBuffer.append(TEXT_441); } + stringBuffer.append(TEXT_442); + if (genModel.useClassOverrideAnnotation()) { stringBuffer.append(TEXT_443); - if (genPackage.isMultipleEditorPages()) { + } stringBuffer.append(TEXT_444); - } else { + stringBuffer.append("List" + (genModel.useGenerics() ? "<URI>" : "")); stringBuffer.append(TEXT_445); - } + stringBuffer.append(genModel.useGenerics() ? "": "(URI)"); stringBuffer.append(TEXT_446); - if (genModel.useGenerics()) { + stringBuffer.append(genModel.getImportedName("org.eclipse.emf.common.ui.URIEditorInput")); stringBuffer.append(TEXT_447); } else { stringBuffer.append(TEXT_448); - } - stringBuffer.append(TEXT_449); if (!genModel.useGenerics()) { - stringBuffer.append(TEXT_450); + stringBuffer.append(TEXT_449); } + stringBuffer.append(TEXT_450); + stringBuffer.append(genModel.getImportedName(genModel.getQualifiedEditorAdvisorClassName())); stringBuffer.append(TEXT_451); - stringBuffer.append(_CollectionOfAnything); + stringBuffer.append(genModel.getImportedName("org.eclipse.swt.SWT")); stringBuffer.append(TEXT_452); - stringBuffer.append(genModel.getNonNLS()); + stringBuffer.append(genModel.getImportedName("org.eclipse.emf.common.ui.URIEditorInput")); stringBuffer.append(TEXT_453); - stringBuffer.append(genModel.getNonNLS()); + } + } else { stringBuffer.append(TEXT_454); - stringBuffer.append(genModel.getNonNLS()); + } stringBuffer.append(TEXT_455); - stringBuffer.append(genModel.getNonNLS()); + if (!genModel.useGenerics()) { stringBuffer.append(TEXT_456); - stringBuffer.append(genPackage.getImportedEditorPluginClassName()); + } stringBuffer.append(TEXT_457); - stringBuffer.append(genPackage.getImportedEditorPluginClassName()); + stringBuffer.append(genModel.getImportedName("org.eclipse.core.runtime.NullProgressMonitor")); stringBuffer.append(TEXT_458); - if (genModel.useClassOverrideAnnotation()) { + if (!genModel.isRichClientPlatform()) { stringBuffer.append(TEXT_459); - } + if (genModel.getRuntimeVersion().getValue() >= GenRuntimeVersion.EMF23_VALUE) { stringBuffer.append(TEXT_460); - if (!genModel.isRichClientPlatform()) { + stringBuffer.append(_ListOfAnything); stringBuffer.append(TEXT_461); - } + } else { stringBuffer.append(TEXT_462); - if (genModel.useGenerics()) { + stringBuffer.append(genPackage.getImportedEditorPluginClassName()); stringBuffer.append(TEXT_463); - } else { + } stringBuffer.append(TEXT_464); } stringBuffer.append(TEXT_465); - if (!genModel.useGenerics()) { + if (genModel.useClassOverrideAnnotation()) { stringBuffer.append(TEXT_466); } stringBuffer.append(TEXT_467); - stringBuffer.append(genPackage.isMultipleEditorPages()); + if (!genModel.isRichClientPlatform()) { stringBuffer.append(TEXT_468); - genModel.emitSortedImports(); + } stringBuffer.append(TEXT_469); + if (genModel.useClassOverrideAnnotation()) { + stringBuffer.append(TEXT_470); + } + stringBuffer.append(TEXT_471); + if (genPackage.isMultipleEditorPages()) { + stringBuffer.append(TEXT_472); + } else { + stringBuffer.append(TEXT_473); + } + stringBuffer.append(TEXT_474); + if (genModel.useGenerics()) { + stringBuffer.append(TEXT_475); + } else { + stringBuffer.append(TEXT_476); + } + stringBuffer.append(TEXT_477); + if (!genModel.useGenerics()) { + stringBuffer.append(TEXT_478); + } + stringBuffer.append(TEXT_479); + stringBuffer.append(_CollectionOfAnything); + stringBuffer.append(TEXT_480); + stringBuffer.append(genModel.getNonNLS()); + stringBuffer.append(TEXT_481); + stringBuffer.append(genModel.getNonNLS()); + stringBuffer.append(TEXT_482); + stringBuffer.append(genModel.getNonNLS()); + stringBuffer.append(TEXT_483); + stringBuffer.append(genModel.getNonNLS()); + stringBuffer.append(TEXT_484); + stringBuffer.append(genPackage.getImportedEditorPluginClassName()); + stringBuffer.append(TEXT_485); + stringBuffer.append(genPackage.getImportedEditorPluginClassName()); + stringBuffer.append(TEXT_486); + if (genModel.useClassOverrideAnnotation()) { + stringBuffer.append(TEXT_487); + } + stringBuffer.append(TEXT_488); + if (!genModel.isRichClientPlatform()) { + stringBuffer.append(TEXT_489); + } + stringBuffer.append(TEXT_490); + if (genModel.useGenerics()) { + stringBuffer.append(TEXT_491); + } else { + stringBuffer.append(TEXT_492); + } + stringBuffer.append(TEXT_493); + if (!genModel.useGenerics()) { + stringBuffer.append(TEXT_494); + } + stringBuffer.append(TEXT_495); + stringBuffer.append(genPackage.isMultipleEditorPages()); + stringBuffer.append(TEXT_496); + genModel.emitSortedImports(); + stringBuffer.append(TEXT_497); return stringBuffer.toString(); } } diff --git a/plugins/org.eclipse.emf.codegen.ecore/templates/edit/ItemProvider.javajet b/plugins/org.eclipse.emf.codegen.ecore/templates/edit/ItemProvider.javajet index c0ef71de3..84301c3c3 100644 --- a/plugins/org.eclipse.emf.codegen.ecore/templates/edit/ItemProvider.javajet +++ b/plugins/org.eclipse.emf.codegen.ecore/templates/edit/ItemProvider.javajet @@ -233,6 +233,9 @@ public class <%=genClass.getProviderClassName()%> { <%@ include file="ItemProvider/getText.override.javajetinc" fail="alternative" %> <%@ start %> +<%if (genModel.isStyleProviders()) {%> + return ((<%=genModel.getImportedName("org.eclipse.emf.edit.provider.StyledString")%>)getStyledText(object)).getString(); +<%} else {%> <%if (genClass.isMapEntry()) {%> <%=genClass.getImportedInterfaceName()%><%if (genModel.useGenerics()) {%><?, ?><%}%> <%=genClass.getSafeUncapName()%> = (<%=genClass.getImportedInterfaceName()%><%if (genModel.useGenerics()) {%><?, ?><%}%>)object; <%if (!genClass.getMapEntryKeyFeature().isPropertyMultiLine() && !genClass.getMapEntryValueFeature().isPropertyMultiLine()) {%> @@ -276,8 +279,75 @@ public class <%=genClass.getProviderClassName()%> <%} else {%> return getString("_UI_<%=genClass.getName()%>_type");<%=genModel.getNonNLS()%> <%}%> +<%}%> <%@ end %><%//ItemProvider/getText.override.javajetinc%> } + +<%if (genModel.isStyleProviders()) {%> + /** + * This returns the label styled text for the adapted class. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ +<%if (genModel.useClassOverrideAnnotation()) {%> + @Override +<%}%> + public Object getStyledText(Object object) + { +<%@ include file="ItemProvider/getStyledText.override.javajetinc" fail="alternative" %> +<%@ start %> +<%if (genClass.isMapEntry()) {%> + <%=genClass.getImportedInterfaceName()%><%if (genModel.useGenerics()) {%><?, ?><%}%> <%=genClass.getSafeUncapName()%> = (<%=genClass.getImportedInterfaceName()%><%if (genModel.useGenerics()) {%><?, ?><%}%>)object; + <%if (!genClass.getMapEntryKeyFeature().isPropertyMultiLine() && !genClass.getMapEntryValueFeature().isPropertyMultiLine()) {%> + return new <%=genModel.getImportedName("org.eclipse.emf.edit.provider.StyledString")%>("" + <%=genClass.getSafeUncapName()%>.getKey()).append(" -> ", <%=genModel.getImportedName("org.eclipse.emf.edit.provider.StyledString$Style")%>.QUALIFIER_STYLER).append("" + <%=genClass.getSafeUncapName()%>.getValue());<%=genModel.getNonNLS()%><%=genModel.getNonNLS(2)%> + <%} else {%> + <%if (genClass.getMapEntryKeyFeature().isPropertyMultiLine()) {%> + String key = crop("" + <%=genClass.getSafeUncapName()%>.getKey());<%=genModel.getNonNLS()%> + <%} else {%> + String key = "" + <%=genClass.getSafeUncapName()%>.getKey();<%=genModel.getNonNLS()%> + <%}%> + <%if (genClass.getMapEntryValueFeature().isPropertyMultiLine()) {%> + String value = crop("" + <%=genClass.getSafeUncapName()%>.getValue());<%=genModel.getNonNLS()%> + <%} else {%> + String value = "" + <%=genClass.getSafeUncapName()%>.getValue();<%=genModel.getNonNLS()%> + <%}%> + return new <%=genModel.getImportedName("org.eclipse.emf.edit.provider.StyledString")%>(key).append(" -> ", <%=genModel.getImportedName("org.eclipse.emf.edit.provider.StyledString$Style")%>.QUALIFIER_STYLER).append(value);<%=genModel.getNonNLS()%> + <%}%> +<%} else if (genClass.getLabelFeature() != null) { GenFeature labelFeature = genClass.getLabelFeature();%> + <%if (labelFeature.isPrimitiveType() && !labelFeature.getGenClass().isDynamic() && !labelFeature.isSuppressedGetVisibility()) {%> + <%=genClass.getImportedInterfaceName()%><%=genClass.getInterfaceWildTypeArguments()%> <%=genClass.getSafeUncapName()%> = (<%=genClass.getImportedInterfaceName()%><%=genClass.getInterfaceWildTypeArguments()%>)object; + return new <%=genModel.getImportedName("org.eclipse.emf.edit.provider.StyledString")%>(getString("_UI_<%=genClass.getName()%>_type", <%=genModel.getImportedName("org.eclipse.emf.edit.provider.StyledString$Style")%>.QUALIFIER_STYLER).append(" ").append(<%=genClass.getSafeUncapName()%>.<%=genClass.getLabelFeature().getGetAccessor()%>());<%=genModel.getNonNLS()%><%=genModel.getNonNLS(2)%> + <%} else {%> + <%if (labelFeature.isStringType() && !labelFeature.getGenClass().isDynamic() && !labelFeature.isSuppressedGetVisibility()) {%> + <%if (labelFeature.isPropertyMultiLine()) {%> + String label = crop(((<%=genClass.getImportedInterfaceName()%><%=genClass.getInterfaceWildTypeArguments()%>)object).<%=labelFeature.getGetAccessor()%>()); + <%} else {%> + String label = ((<%=genClass.getImportedInterfaceName()%><%=genClass.getInterfaceWildTypeArguments()%>)object).<%=labelFeature.getGetAccessor()%>(); + <%}%> + <%} else {%> + <%if (labelFeature.isSuppressedGetVisibility() || labelFeature.getGenClass().isDynamic()) {%> + <%=genModel.getImportedName("java.lang.Object")%> labelValue = ((<%=genModel.getImportedName("org.eclipse.emf.ecore.EObject")%>)object).eGet(<%=labelFeature.getQualifiedFeatureAccessor()%>); + <%} else {%> + <%=labelFeature.getRawImportedType()%> labelValue = ((<%=genClass.getImportedInterfaceName()%><%=genClass.getInterfaceWildTypeArguments()%>)object).<%=labelFeature.getGetAccessor()%>(); + <%}%> + String label = labelValue == null ? null : labelValue.toString(); + <%}%> + <%=genModel.getImportedName("org.eclipse.emf.edit.provider.StyledString")%> styledLabel = new <%=genModel.getImportedName("org.eclipse.emf.edit.provider.StyledString")%>(); + if (label == null || label.length() == 0) + { + styledLabel.append(getString("_UI_<%=genClass.getName()%>_type"), <%=genModel.getImportedName("org.eclipse.emf.edit.provider.StyledString$Style")%>.QUALIFIER_STYLER); <%=genModel.getNonNLS()%> + } else { + styledLabel.append(getString("_UI_<%=genClass.getName()%>_type"), <%=genModel.getImportedName("org.eclipse.emf.edit.provider.StyledString$Style")%>.QUALIFIER_STYLER).append(" " + label);<%=genModel.getNonNLS()%><%=genModel.getNonNLS(2)%> + } + return styledLabel; + <%}%> +<%} else {%> + return new <%=genModel.getImportedName("org.eclipse.emf.edit.provider.StyledString")%>(getString("_UI_<%=genClass.getName()%>_type"));<%=genModel.getNonNLS()%> +<%}%> +<%@ end %><%//ItemProvider/getStyledText.override.javajetinc%> + } +<%}%> /** * This handles model notifications by calling {@link #updateChildren} to update any cached diff --git a/plugins/org.eclipse.emf.codegen.ecore/templates/editor/Editor.javajet b/plugins/org.eclipse.emf.codegen.ecore/templates/editor/Editor.javajet index 8ca5e1107..14c6b76ea 100644 --- a/plugins/org.eclipse.emf.codegen.ecore/templates/editor/Editor.javajet +++ b/plugins/org.eclipse.emf.codegen.ecore/templates/editor/Editor.javajet @@ -26,8 +26,12 @@ <%String _LinkedHashMapOfResourceToDiagnostic = "LinkedHashMap" + (genModel.useGenerics() ? "<Resource, Diagnostic>" : "");%> <%String _CollectionOfAnything = "Collection" + (genModel.useGenerics() ? "<?>" : "");%> <%String _ListOfAnything = "List" + (genModel.useGenerics() ? "<?>" : "");%> -<%boolean useExtendedLabelProvider = genModel.isFontProviders() || genModel.isColorProviders();%> -<%String _AdapterFactoryLabelProvider = "AdapterFactoryLabelProvider" + (genModel.isFontProviders() && genModel.isColorProviders() ? ".FontAndColorProvider" : genModel.isFontProviders() ? ".FontProvider" : genModel.isColorProviders() ? ".ColorProvider" : "");%> +<%boolean useExtendedLabelProvider = genModel.isStyleProviders() || genModel.isFontProviders() || genModel.isColorProviders();%> +<%boolean useStyledLabelProvider = genModel.isStyleProviders();%> +<%String _AdapterFactoryLabelProvider = (useStyledLabelProvider ? "AdapterFactoryLabelProvider.StyledLabelProvider" : "AdapterFactoryLabelProvider" + (genModel.isFontProviders() && genModel.isColorProviders() ? ".FontAndColorProvider" : genModel.isFontProviders() ? ".FontProvider" : genModel.isColorProviders() ? ".ColorProvider" : ""));%> +<%String _DelegatingAdapterFactoryLabelProvider = useStyledLabelProvider ? genModel.getImportedName("org.eclipse.emf.edit.ui.provider.DelegatingStyledCellLabelProvider") + (genModel.isFontProviders() && genModel.isColorProviders() ? ".FontAndColorProvider" : genModel.isFontProviders() ? ".FontProvider" : genModel.isColorProviders() ? ".ColorProvider" : "") : "";%> +<%String _DecoratingColumLabelProvider = genModel.getDecoration() != GenDecoration.NONE ? genModel.getImportedName("org.eclipse.emf.edit.ui.provider.DecoratingColumLabelProvider") + (useStyledLabelProvider ? ".StyledLabelProvider" : "") : "";%> +<%String _DiagnosticDecorator = genModel.getDecoration() != GenDecoration.NONE ? genModel.getImportedName("org.eclipse.emf.edit.ui.provider.DiagnosticDecorator") + (useStyledLabelProvider ? ".Styled" : "") : "";%> <%String _ArrayListOfString = "ArrayList" + (genModel.useGenerics() ? "<String>" : "");%> <%String _ListOfString = "List" + (genModel.useGenerics() ? "<String>" : "");%> <%String _ListOfPropertySheetPage = "List" + (genModel.useGenerics() ? "<PropertySheetPage>" : "");%> @@ -659,7 +663,7 @@ public class <%=genPackage.getEditorClassName()%> { if ((delta.getFlags() & IResourceDelta.MARKERS) != 0) { - <%=genModel.getImportedName("org.eclipse.emf.edit.ui.provider.DiagnosticDecorator")%>.DiagnosticAdapter.update(resource, markerHelper.getMarkerDiagnostics(resource, (IFile)delta.getResource())); + <%=_DiagnosticDecorator%>.DiagnosticAdapter.update(resource, markerHelper.getMarkerDiagnostics(resource, (IFile)delta.getResource())); } if ((delta.getFlags() & IResourceDelta.CONTENT) != 0) { @@ -1378,14 +1382,14 @@ public class <%=genPackage.getEditorClassName()%> selectionViewer = (TreeViewer)viewerPane.getViewer(); selectionViewer.setContentProvider(new AdapterFactoryContentProvider(adapterFactory)); - selectionViewer.setLabelProvider(<%if (genModel.getDecoration() != GenDecoration.NONE) {%>new <%=genModel.getImportedName("org.eclipse.emf.edit.ui.provider.DecoratingColumLabelProvider")%>(<%}%>new <%=_AdapterFactoryLabelProvider%>(adapterFactory<%if (useExtendedLabelProvider) {%>, selectionViewer<%}%>)<%if (genModel.getDecoration() != GenDecoration.NONE) {%>, new <%=genModel.getImportedName("org.eclipse.emf.edit.ui.provider.DiagnosticDecorator")%>(editingDomain<%if (genModel.getDecoration() == GenDecoration.MANUAL) {%>.getResourceSet()<%}%>, selectionViewer<%if (genModel.getDecoration() == GenDecoration.LIVE) {%>, <%=genPackage.getImportedEditorPluginClassName()%>.getPlugin().getDialogSettings()<%}%>))<%}%>); + selectionViewer.setLabelProvider(<%if (useStyledLabelProvider) {%>new <%=_DelegatingAdapterFactoryLabelProvider%>(<%}%><%if (genModel.getDecoration() != GenDecoration.NONE) {%>new <%=_DecoratingColumLabelProvider%>(<%}%>new <%=_AdapterFactoryLabelProvider%>(adapterFactory<%if (useExtendedLabelProvider) {%>, selectionViewer<%}%>)<%if (genModel.getDecoration() != GenDecoration.NONE) {%>, new <%=_DiagnosticDecorator%>(editingDomain<%if (genModel.getDecoration() == GenDecoration.MANUAL) {%>.getResourceSet()<%}%>, selectionViewer<%if (genModel.getDecoration() == GenDecoration.LIVE) {%>, <%=genPackage.getImportedEditorPluginClassName()%>.getPlugin().getDialogSettings()<%}%>))<%}%><%if (useStyledLabelProvider) {%>)<%}%>); selectionViewer.setInput(editingDomain.getResourceSet()); selectionViewer.setSelection(new StructuredSelection(editingDomain.getResourceSet().getResources().get(0)), true); viewerPane.setTitle(editingDomain.getResourceSet()); new AdapterFactoryTreeEditor(selectionViewer.getTree(), adapterFactory); <%if (genModel.getDecoration() != GenDecoration.NONE) {%> - new <%=genModel.getImportedName("org.eclipse.emf.common.ui.viewer.ColumnViewerInformationControlToolTipSupport")%>(selectionViewer, new <%=genModel.getImportedName("org.eclipse.emf.edit.ui.provider.DiagnosticDecorator")%>.EditingDomainLocationListener(editingDomain, selectionViewer)); + new <%=genModel.getImportedName("org.eclipse.emf.common.ui.viewer.ColumnViewerInformationControlToolTipSupport")%>(selectionViewer, new <%=_DiagnosticDecorator%>.EditingDomainLocationListener(editingDomain, selectionViewer)); <%}%> createContextMenuFor(selectionViewer); @@ -1422,7 +1426,7 @@ public class <%=genPackage.getEditorClassName()%> parentViewer = (TreeViewer)viewerPane.getViewer(); parentViewer.setAutoExpandLevel(30); parentViewer.setContentProvider(new ReverseAdapterFactoryContentProvider(adapterFactory)); - parentViewer.setLabelProvider(new <%=_AdapterFactoryLabelProvider%>(adapterFactory<%if (useExtendedLabelProvider) {%>, parentViewer<%}%>)); + parentViewer.setLabelProvider(<%if (useStyledLabelProvider) {%>new <%=_DelegatingAdapterFactoryLabelProvider%>(<%}%>new <%=_AdapterFactoryLabelProvider%>(adapterFactory<%if (useExtendedLabelProvider) {%>, parentViewer<%}%>)<%if (useStyledLabelProvider) {%>)<%}%>); createContextMenuFor(parentViewer); int pageIndex = addPage(viewerPane.getControl()); @@ -1454,7 +1458,7 @@ public class <%=genPackage.getEditorClassName()%> viewerPane.createControl(getContainer()); listViewer = (ListViewer)viewerPane.getViewer(); listViewer.setContentProvider(new AdapterFactoryContentProvider(adapterFactory)); - listViewer.setLabelProvider(new <%=_AdapterFactoryLabelProvider%>(adapterFactory<%if (useExtendedLabelProvider) {%>, listViewer<%}%>)); + listViewer.setLabelProvider(<%if (useStyledLabelProvider) {%>new <%=_DelegatingAdapterFactoryLabelProvider%>(<%}%>new <%=_AdapterFactoryLabelProvider%>(adapterFactory<%if (useExtendedLabelProvider) {%>, listViewer<%}%>)<%if (useStyledLabelProvider) {%>)<%}%>); createContextMenuFor(listViewer); int pageIndex = addPage(viewerPane.getControl()); @@ -1486,11 +1490,11 @@ public class <%=genPackage.getEditorClassName()%> viewerPane.createControl(getContainer()); treeViewer = (TreeViewer)viewerPane.getViewer(); treeViewer.setContentProvider(new AdapterFactoryContentProvider(adapterFactory)); - treeViewer.setLabelProvider(<%if (genModel.getDecoration() != GenDecoration.NONE) {%>new <%=genModel.getImportedName("org.eclipse.emf.edit.ui.provider.DecoratingColumLabelProvider")%>(<%}%>new <%=_AdapterFactoryLabelProvider%>(adapterFactory<%if (useExtendedLabelProvider) {%>, treeViewer<%}%>)<%if (genModel.getDecoration() != GenDecoration.NONE) {%>, new <%=genModel.getImportedName("org.eclipse.emf.edit.ui.provider.DiagnosticDecorator")%>(editingDomain<%if (genModel.getDecoration() == GenDecoration.MANUAL) {%>.getResourceSet()<%}%>, treeViewer))<%}%>); + treeViewer.setLabelProvider(<%if (useStyledLabelProvider) {%>new <%=_DelegatingAdapterFactoryLabelProvider%>(<%}%><%if (genModel.getDecoration() != GenDecoration.NONE) {%>new <%=_DecoratingColumLabelProvider%>(<%}%>new <%=_AdapterFactoryLabelProvider%>(adapterFactory<%if (useExtendedLabelProvider) {%>, treeViewer<%}%>)<%if (genModel.getDecoration() != GenDecoration.NONE) {%>, new <%=_DiagnosticDecorator%>(editingDomain<%if (genModel.getDecoration() == GenDecoration.MANUAL) {%>.getResourceSet()<%}%>, treeViewer))<%}%><%if (useStyledLabelProvider) {%>)<%}%>); new AdapterFactoryTreeEditor(treeViewer.getTree(), adapterFactory); <%if (genModel.getDecoration() != GenDecoration.NONE) {%> - new <%=genModel.getImportedName("org.eclipse.emf.common.ui.viewer.ColumnViewerInformationControlToolTipSupport")%>(treeViewer, new <%=genModel.getImportedName("org.eclipse.emf.edit.ui.provider.DiagnosticDecorator")%>.EditingDomainLocationListener(editingDomain, treeViewer)); + new <%=genModel.getImportedName("org.eclipse.emf.common.ui.viewer.ColumnViewerInformationControlToolTipSupport")%>(treeViewer, new <%=_DiagnosticDecorator%>.EditingDomainLocationListener(editingDomain, treeViewer)); <%}%> createContextMenuFor(treeViewer); @@ -1541,10 +1545,10 @@ public class <%=genPackage.getEditorClassName()%> tableViewer.setColumnProperties(new String [] {"a", "b"});<%=genModel.getNonNLS()%><%=genModel.getNonNLS(2)%> tableViewer.setContentProvider(new AdapterFactoryContentProvider(adapterFactory)); - tableViewer.setLabelProvider(<%if (genModel.getDecoration() != GenDecoration.NONE) {%>new <%=genModel.getImportedName("org.eclipse.emf.edit.ui.provider.DecoratingColumLabelProvider")%>(<%}%>new <%=_AdapterFactoryLabelProvider%>(adapterFactory<%if (useExtendedLabelProvider) {%>, tableViewer<%}%>)<%if (genModel.getDecoration() != GenDecoration.NONE) {%>, new <%=genModel.getImportedName("org.eclipse.emf.edit.ui.provider.DiagnosticDecorator")%>(editingDomain<%if (genModel.getDecoration() == GenDecoration.MANUAL) {%>.getResourceSet()<%}%>, tableViewer<%if (genModel.getDecoration() == GenDecoration.LIVE) {%>, <%=genPackage.getImportedEditorPluginClassName()%>.getPlugin().getDialogSettings()<%}%>))<%}%>); + tableViewer.setLabelProvider(<%if (useStyledLabelProvider) {%>new <%=_DelegatingAdapterFactoryLabelProvider%>(<%}%><%if (genModel.getDecoration() != GenDecoration.NONE) {%>new <%=_DecoratingColumLabelProvider%>(<%}%>new <%=_AdapterFactoryLabelProvider%>(adapterFactory<%if (useExtendedLabelProvider) {%>, tableViewer<%}%>)<%if (genModel.getDecoration() != GenDecoration.NONE) {%>, new <%=_DiagnosticDecorator%>(editingDomain<%if (genModel.getDecoration() == GenDecoration.MANUAL) {%>.getResourceSet()<%}%>, tableViewer<%if (genModel.getDecoration() == GenDecoration.LIVE) {%>, <%=genPackage.getImportedEditorPluginClassName()%>.getPlugin().getDialogSettings()<%}%>))<%}%><%if (useStyledLabelProvider) {%>)<%}%>); <%if (genModel.getDecoration() != GenDecoration.NONE) {%> - new <%=genModel.getImportedName("org.eclipse.emf.common.ui.viewer.ColumnViewerInformationControlToolTipSupport")%>(tableViewer, new <%=genModel.getImportedName("org.eclipse.emf.edit.ui.provider.DiagnosticDecorator")%>.EditingDomainLocationListener(editingDomain, tableViewer)); + new <%=genModel.getImportedName("org.eclipse.emf.common.ui.viewer.ColumnViewerInformationControlToolTipSupport")%>(tableViewer, new <%=_DiagnosticDecorator%>.EditingDomainLocationListener(editingDomain, tableViewer)); <%}%> createContextMenuFor(tableViewer); @@ -1595,10 +1599,10 @@ public class <%=genPackage.getEditorClassName()%> treeViewerWithColumns.setColumnProperties(new String [] {"a", "b"});<%=genModel.getNonNLS()%><%=genModel.getNonNLS(2)%> treeViewerWithColumns.setContentProvider(new AdapterFactoryContentProvider(adapterFactory)); - treeViewerWithColumns.setLabelProvider(<%if (genModel.getDecoration() != GenDecoration.NONE) {%>new <%=genModel.getImportedName("org.eclipse.emf.edit.ui.provider.DecoratingColumLabelProvider")%>(<%}%>new <%=_AdapterFactoryLabelProvider%>(adapterFactory<%if (useExtendedLabelProvider) {%>, treeViewerWithColumns<%}%>)<%if (genModel.getDecoration() != GenDecoration.NONE) {%>, new <%=genModel.getImportedName("org.eclipse.emf.edit.ui.provider.DiagnosticDecorator")%>(editingDomain<%if (genModel.getDecoration() == GenDecoration.MANUAL) {%>.getResourceSet()<%}%>, treeViewerWithColumns<%if (genModel.getDecoration() == GenDecoration.LIVE) {%>, <%=genPackage.getImportedEditorPluginClassName()%>.getPlugin().getDialogSettings()<%}%>))<%}%>); + treeViewerWithColumns.setLabelProvider(<%if (useStyledLabelProvider) {%>new <%=_DelegatingAdapterFactoryLabelProvider%>(<%}%><%if (genModel.getDecoration() != GenDecoration.NONE) {%>new <%=_DecoratingColumLabelProvider%>(<%}%>new <%=_AdapterFactoryLabelProvider%>(adapterFactory<%if (useExtendedLabelProvider) {%>, treeViewerWithColumns<%}%>)<%if (genModel.getDecoration() != GenDecoration.NONE) {%>, new <%=_DiagnosticDecorator%>(editingDomain<%if (genModel.getDecoration() == GenDecoration.MANUAL) {%>.getResourceSet()<%}%>, treeViewerWithColumns<%if (genModel.getDecoration() == GenDecoration.LIVE) {%>, <%=genPackage.getImportedEditorPluginClassName()%>.getPlugin().getDialogSettings()<%}%>))<%}%><%if (useStyledLabelProvider) {%>)<%}%>); <%if (genModel.getDecoration() != GenDecoration.NONE) {%> - new <%=genModel.getImportedName("org.eclipse.emf.common.ui.viewer.ColumnViewerInformationControlToolTipSupport")%>(treeViewerWithColumns, new <%=genModel.getImportedName("org.eclipse.emf.edit.ui.provider.DiagnosticDecorator")%>.EditingDomainLocationListener(editingDomain, treeViewerWithColumns)); + new <%=genModel.getImportedName("org.eclipse.emf.common.ui.viewer.ColumnViewerInformationControlToolTipSupport")%>(treeViewerWithColumns, new <%=_DiagnosticDecorator%>.EditingDomainLocationListener(editingDomain, treeViewerWithColumns)); <%}%> createContextMenuFor(treeViewerWithColumns); @@ -1611,13 +1615,13 @@ public class <%=genPackage.getEditorClassName()%> setCurrentViewer(selectionViewer); selectionViewer.setContentProvider(new AdapterFactoryContentProvider(adapterFactory)); - selectionViewer.setLabelProvider(<%if (genModel.getDecoration() != GenDecoration.NONE) {%>new <%=genModel.getImportedName("org.eclipse.emf.edit.ui.provider.DecoratingColumLabelProvider")%>(<%}%>new <%=_AdapterFactoryLabelProvider%>(adapterFactory<%if (useExtendedLabelProvider) {%>, selectionViewer<%}%>)<%if (genModel.getDecoration() != GenDecoration.NONE) {%>, new <%=genModel.getImportedName("org.eclipse.emf.edit.ui.provider.DiagnosticDecorator")%>(editingDomain<%if (genModel.getDecoration() == GenDecoration.MANUAL) {%>.getResourceSet()<%}%>, selectionViewer<%if (genModel.getDecoration() == GenDecoration.LIVE) {%>, <%=genPackage.getImportedEditorPluginClassName()%>.getPlugin().getDialogSettings()<%}%>))<%}%>); + selectionViewer.setLabelProvider(<%if (useStyledLabelProvider) {%>new <%=_DelegatingAdapterFactoryLabelProvider%>(<%}%><%if (genModel.getDecoration() != GenDecoration.NONE) {%>new <%=_DecoratingColumLabelProvider%>(<%}%>new <%=_AdapterFactoryLabelProvider%>(adapterFactory<%if (useExtendedLabelProvider) {%>, selectionViewer<%}%>)<%if (genModel.getDecoration() != GenDecoration.NONE) {%>, new <%=_DiagnosticDecorator%>(editingDomain<%if (genModel.getDecoration() == GenDecoration.MANUAL) {%>.getResourceSet()<%}%>, selectionViewer<%if (genModel.getDecoration() == GenDecoration.LIVE) {%>, <%=genPackage.getImportedEditorPluginClassName()%>.getPlugin().getDialogSettings()<%}%>))<%}%><%if (useStyledLabelProvider) {%>)<%}%>); selectionViewer.setInput(editingDomain.getResourceSet()); selectionViewer.setSelection(new StructuredSelection(editingDomain.getResourceSet().getResources().get(0)), true); new AdapterFactoryTreeEditor(selectionViewer.getTree(), adapterFactory); <%if (genModel.getDecoration() != GenDecoration.NONE) {%> - new <%=genModel.getImportedName("org.eclipse.emf.common.ui.viewer.ColumnViewerInformationControlToolTipSupport")%>(selectionViewer, new <%=genModel.getImportedName("org.eclipse.emf.edit.ui.provider.DiagnosticDecorator")%>.EditingDomainLocationListener(editingDomain, selectionViewer)); + new <%=genModel.getImportedName("org.eclipse.emf.common.ui.viewer.ColumnViewerInformationControlToolTipSupport")%>(selectionViewer, new <%=_DiagnosticDecorator%>.EditingDomainLocationListener(editingDomain, selectionViewer)); <%}%> createContextMenuFor(selectionViewer); @@ -1787,11 +1791,11 @@ public class <%=genPackage.getEditorClassName()%> // Set up the tree viewer. // contentOutlineViewer.setContentProvider(new AdapterFactoryContentProvider(adapterFactory)); - contentOutlineViewer.setLabelProvider(<%if (genModel.getDecoration() != GenDecoration.NONE) {%>new <%=genModel.getImportedName("org.eclipse.emf.edit.ui.provider.DecoratingColumLabelProvider")%>(<%}%>new <%=_AdapterFactoryLabelProvider%>(adapterFactory<%if (useExtendedLabelProvider) {%>, contentOutlineViewer<%}%>)<%if (genModel.getDecoration() != GenDecoration.NONE) {%>, new <%=genModel.getImportedName("org.eclipse.emf.edit.ui.provider.DiagnosticDecorator")%>(editingDomain<%if (genModel.getDecoration() == GenDecoration.MANUAL) {%>.getResourceSet()<%}%>, contentOutlineViewer<%if (genModel.getDecoration() == GenDecoration.LIVE) {%>, <%=genPackage.getImportedEditorPluginClassName()%>.getPlugin().getDialogSettings()<%}%>))<%}%>); + contentOutlineViewer.setLabelProvider(<%if (useStyledLabelProvider) {%>new <%=_DelegatingAdapterFactoryLabelProvider%>(<%}%><%if (genModel.getDecoration() != GenDecoration.NONE) {%>new <%=_DecoratingColumLabelProvider%>(<%}%>new <%=_AdapterFactoryLabelProvider%>(adapterFactory<%if (useExtendedLabelProvider) {%>, contentOutlineViewer<%}%>)<%if (genModel.getDecoration() != GenDecoration.NONE) {%>, new <%=_DiagnosticDecorator%>(editingDomain<%if (genModel.getDecoration() == GenDecoration.MANUAL) {%>.getResourceSet()<%}%>, contentOutlineViewer<%if (genModel.getDecoration() == GenDecoration.LIVE) {%>, <%=genPackage.getImportedEditorPluginClassName()%>.getPlugin().getDialogSettings()<%}%>))<%}%><%if (useStyledLabelProvider) {%>)<%}%>); contentOutlineViewer.setInput(editingDomain.getResourceSet()); <%if (genModel.getDecoration() != GenDecoration.NONE) {%> - new <%=genModel.getImportedName("org.eclipse.emf.common.ui.viewer.ColumnViewerInformationControlToolTipSupport")%>(contentOutlineViewer, new <%=genModel.getImportedName("org.eclipse.emf.edit.ui.provider.DiagnosticDecorator")%>.EditingDomainLocationListener(editingDomain, contentOutlineViewer)); + new <%=genModel.getImportedName("org.eclipse.emf.common.ui.viewer.ColumnViewerInformationControlToolTipSupport")%>(contentOutlineViewer, new <%=_DiagnosticDecorator%>.EditingDomainLocationListener(editingDomain, contentOutlineViewer)); <%}%> // Make sure our popups work. diff --git a/plugins/org.eclipse.emf.common.ui/META-INF/MANIFEST.MF b/plugins/org.eclipse.emf.common.ui/META-INF/MANIFEST.MF index c9bb7b160..624e9ff66 100644 --- a/plugins/org.eclipse.emf.common.ui/META-INF/MANIFEST.MF +++ b/plugins/org.eclipse.emf.common.ui/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: %pluginName Bundle-SymbolicName: org.eclipse.emf.common.ui;singleton:=true -Bundle-Version: 2.8.0.qualifier +Bundle-Version: 2.9.0.qualifier Bundle-ClassPath: . Bundle-Activator: org.eclipse.emf.common.ui.CommonUIPlugin$Implementation Bundle-Vendor: %providerName diff --git a/plugins/org.eclipse.emf.common.ui/src/org/eclipse/emf/common/ui/viewer/IStyledLabelDecorator.java b/plugins/org.eclipse.emf.common.ui/src/org/eclipse/emf/common/ui/viewer/IStyledLabelDecorator.java new file mode 100644 index 000000000..02fc5db3d --- /dev/null +++ b/plugins/org.eclipse.emf.common.ui/src/org/eclipse/emf/common/ui/viewer/IStyledLabelDecorator.java @@ -0,0 +1,33 @@ +/** + * Copyright (c) 2013 Obeo and others. + * 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: + * Obeo - initial API and implementation + */ +package org.eclipse.emf.common.ui.viewer; + +import org.eclipse.jface.viewers.ILabelDecorator; +import org.eclipse.jface.viewers.StyledString; + +/** + * An extended {@link ILabelDecorator} to decorate a {@link StyledString}. + * + * @author <a href="mailto:mikael.barbero@obeo.fr">Mikael Barbero</a> + * @since 2.10 + */ +public interface IStyledLabelDecorator extends ILabelDecorator +{ + /** + * Returns a decorated {@link StyledString}. It may return the given {@code styledString} itself if no + * decoration has been done. + * + * @param styledString the {@link StyledString} to decorate. Must not be null. + * @param element the object being described by the given {@code styledString}. Must not be null. + * @return a decorated styled string or {@code styledString}. It never returns null. + */ + public StyledString decorateStyledText(StyledString styledString, Object element); +} diff --git a/plugins/org.eclipse.emf.edit.ui/src/org/eclipse/emf/edit/ui/provider/AdapterFactoryLabelProvider.java b/plugins/org.eclipse.emf.edit.ui/src/org/eclipse/emf/edit/ui/provider/AdapterFactoryLabelProvider.java index 0a1a86d8f..fa650942c 100644 --- a/plugins/org.eclipse.emf.edit.ui/src/org/eclipse/emf/edit/ui/provider/AdapterFactoryLabelProvider.java +++ b/plugins/org.eclipse.emf.edit.ui/src/org/eclipse/emf/edit/ui/provider/AdapterFactoryLabelProvider.java @@ -22,10 +22,15 @@ import org.eclipse.jface.viewers.ITableColorProvider; import org.eclipse.jface.viewers.ITableFontProvider; import org.eclipse.jface.viewers.ITableLabelProvider; import org.eclipse.jface.viewers.LabelProviderChangedEvent; +import org.eclipse.jface.viewers.StyledString; +import org.eclipse.jface.viewers.DelegatingStyledCellLabelProvider.IStyledLabelProvider; +import org.eclipse.jface.viewers.StyledString.Styler; import org.eclipse.jface.viewers.Viewer; +import org.eclipse.swt.SWT; import org.eclipse.swt.graphics.Color; import org.eclipse.swt.graphics.Font; import org.eclipse.swt.graphics.Image; +import org.eclipse.swt.graphics.TextStyle; import org.eclipse.emf.common.notify.AdapterFactory; import org.eclipse.emf.common.notify.Notification; @@ -34,11 +39,13 @@ import org.eclipse.emf.edit.provider.IChangeNotifier; import org.eclipse.emf.edit.provider.IItemColorProvider; import org.eclipse.emf.edit.provider.IItemFontProvider; import org.eclipse.emf.edit.provider.IItemLabelProvider; +import org.eclipse.emf.edit.provider.IItemStyledLabelProvider; import org.eclipse.emf.edit.provider.INotifyChangedListener; import org.eclipse.emf.edit.provider.ITableItemColorProvider; import org.eclipse.emf.edit.provider.ITableItemFontProvider; import org.eclipse.emf.edit.provider.ITableItemLabelProvider; import org.eclipse.emf.edit.provider.IViewerNotification; +import org.eclipse.emf.edit.provider.StyledString.Fragment; /** @@ -147,6 +154,45 @@ public class AdapterFactoryLabelProvider implements ILabelProvider, ITableLabelP } /** + * An extended version of the adapter factory label provider that also provides for styled string. + * <p> + * {@link ExtendedColorRegistry} and {@link ExtendedFontRegistry} may be queried to build {@link StyledString}. + * Therefore, constructors need to get default font, foreground color and background color. As such, it also + * implements {@link IFontProvider} and {@link IColorProvider}. + * + * @author <a href="mailto:mikael.barbero@obeo.fr">Mikael Barbero</a> + * @since 2.10 + */ + public static class StyledLabelProvider extends AdapterFactoryLabelProvider implements IStyledLabelProvider, IColorProvider, IFontProvider, ITableColorProvider, ITableFontProvider + { + + /** + * Construct an instance that wraps the given factory and specifies the given default font and colors. + * @param adapterFactory an adapter factory that yield adapters that implement the various item label provider interfaces. + * @param defaultFont the font that will be used when no font is specified. + * @param defaultForeground the foreground color that will be used when no foreground color is specified. + * @param defaultBackground the background color that will be used when no background color is specified. + */ + public StyledLabelProvider(AdapterFactory adapterFactory, Font defaultFont, Color defaultForeground, Color defaultBackground) + { + super(adapterFactory); + setDefaultFont(defaultFont); + setDefaultForeground(defaultForeground); + setDefaultBackground(defaultBackground); + } + + /** + * Construct an instance that wraps the given factory and uses the font and colors of the viewer's control. + * @param adapterFactory an adapter factory that yield adapters that implement the various item label provider interfaces. + * @param viewer the viewer for which the control's font and color should be used. + */ + public StyledLabelProvider(AdapterFactory adapterFactory, Viewer viewer) + { + this(adapterFactory, viewer.getControl().getFont(), viewer.getControl().getForeground(), viewer.getControl().getBackground()); + } + } + + /** * This keep track of the one factory we are using. * Use a {@link org.eclipse.emf.edit.provider.ComposedAdapterFactory} * if adapters from more the one factory are involved in the model. @@ -184,6 +230,7 @@ public class AdapterFactoryLabelProvider implements ILabelProvider, ITableLabelP private static final Class<?> IItemColorProviderClass = IItemColorProvider.class; private static final Class<?> ITableItemFontProviderClass = ITableItemFontProvider.class; private static final Class<?> ITableItemColorProviderClass = ITableItemColorProvider.class; + private static final Class<?> IItemStyledLabelProviderClass = IItemStyledLabelProvider.class; /** * Construct an instance that wraps the given factory. @@ -399,6 +446,197 @@ public class AdapterFactoryLabelProvider implements ILabelProvider, ITableLabelP } /** + * This implements {@link org.eclipse.jface.viewers.DelegatingStyledCellLabelProvider.IStyledLabelProvider}.getStyledText by forwarding it to an object that implements + * {@link org.eclipse.emf.edit.provider.IItemStyledLabelProvider#getStyledText IItemStyledLabelProvider.getStyledText} + * @since 2.10 + */ + public StyledString getStyledText(Object object) + { + // Get the adapter from the factory. + // + IItemStyledLabelProvider itemStyledLabelProvider = (IItemStyledLabelProvider) adapterFactory + .adapt(object, IItemStyledLabelProviderClass); + + return itemStyledLabelProvider != null ? getStyledStringFromObject(itemStyledLabelProvider + .getStyledText(object)) : new StyledString(getText(object)); + } + + /** + * @since 2.10 + */ + protected StyledString getStyledStringFromObject(Object object) + { + if (object == null) + { + return new StyledString(); + } + else if (object instanceof StyledString) + { + return (StyledString) object; + } + else if (object instanceof String) + { + return new StyledString((String) object); + } + else if (object instanceof org.eclipse.emf.edit.provider.StyledString) + { + return toJFaceStyledString((org.eclipse.emf.edit.provider.StyledString) object); + } + else + { + return new StyledString(object.toString()); + } + } + + /** + * @since 2.10 + */ + protected StyledString toJFaceStyledString(org.eclipse.emf.edit.provider.StyledString styledString) + { + StyledString result = new StyledString(); + for (Fragment fragment : styledString) + { + org.eclipse.emf.edit.provider.StyledString.Style style = fragment.getStyle(); + String string = fragment.getString(); + if (string == null) + { + result.append(""); + } + else if (style == org.eclipse.emf.edit.provider.StyledString.Style.NO_STYLE) + { + result.append(string); + } + else if (style == org.eclipse.emf.edit.provider.StyledString.Style.COUNTER_STYLER) + { + result.append(string, StyledString.COUNTER_STYLER); + } + else if (style == org.eclipse.emf.edit.provider.StyledString.Style.DECORATIONS_STYLER) + { + result.append(string, StyledString.DECORATIONS_STYLER); + } + else if (style == org.eclipse.emf.edit.provider.StyledString.Style.QUALIFIER_STYLER) + { + result.append(string, StyledString.QUALIFIER_STYLER); + } + else + { + Styler styler = createStyler(style); + result.append(string, styler); + } + } + return result; + } + + /** + * Returns a new styler with the same styling information as the given style. + */ + protected Styler createStyler(org.eclipse.emf.edit.provider.StyledString.Style style) + { + return new ConvertingStyler(style); + } + + /** + * A extended {@link Styler} that wraps a {@link org.eclipse.emf.edit.provider.StyledString.Style} + * and uses it as data source for {@link #applyStyles(TextStyle) applying style}. + * + * @author <a href="mailto:mikael.barbero@obeo.fr">Mikael Barbero</a> + * @since 2.10 + */ + protected class ConvertingStyler extends Styler + { + /** + * The wrapped style . + */ + protected final org.eclipse.emf.edit.provider.StyledString.Style style; + + protected ConvertingStyler(org.eclipse.emf.edit.provider.StyledString.Style style) + { + this.style = style; + } + + @Override + public void applyStyles(TextStyle textStyle) + { + textStyle.font = getFontFromObject(style.getFont()); + + textStyle.background = getColorFromObject(style.getBackgoundColor()); + textStyle.foreground = getColorFromObject(style.getForegroundColor()); + + textStyle.strikeout = style.isStrikedout(); + textStyle.strikeoutColor = getColorFromObject(style.getStrikeoutColor()); + + textStyle.borderColor = getColorFromObject(style.getBorderColor()); + switch (style.getBorderStyle()) + { + case NONE: + { + textStyle.borderStyle = SWT.NONE; + break; + } + case SOLID: + { + textStyle.borderStyle = SWT.BORDER_SOLID; + break; + } + case DOT: + { + textStyle.borderStyle = SWT.BORDER_DOT; + break; + } + case DASH: + { + textStyle.borderStyle = SWT.BORDER_DASH; + break; + } + } + + switch (style.getUnderlineStyle()) + { + case NONE: + { + textStyle.underline = false; + break; + } + case SINGLE: + { + textStyle.underline = true; + textStyle.underlineStyle = SWT.UNDERLINE_SINGLE; + textStyle.underlineColor = getColorFromObject(style.getUnderlineColor()); + break; + } + case DOUBLE: + { + textStyle.underline = true; + textStyle.underlineStyle = SWT.UNDERLINE_DOUBLE; + textStyle.underlineColor = getColorFromObject(style.getUnderlineColor()); + break; + } + case ERROR: + { + textStyle.underline = true; + textStyle.underlineStyle = SWT.UNDERLINE_ERROR; + textStyle.underlineColor = getColorFromObject(style.getUnderlineColor()); + break; + } + case LINK: + { + textStyle.underline = true; + textStyle.underlineStyle = SWT.UNDERLINE_LINK; + textStyle.underlineColor = getColorFromObject(style.getUnderlineColor()); + break; + } + case SQUIGGLE: + { + textStyle.underline = true; + textStyle.underlineStyle = SWT.UNDERLINE_SQUIGGLE; + textStyle.underlineColor = getColorFromObject(style.getUnderlineColor()); + break; + } + } + } + } + + /** * This implements {@link org.eclipse.jface.viewers.IColorProvider}.getForeground by forwarding it to an object that implements * {@link org.eclipse.emf.edit.provider.IItemColorProvider#getForeground IItemColorProvider.getForeground} */ diff --git a/plugins/org.eclipse.emf.edit.ui/src/org/eclipse/emf/edit/ui/provider/DecoratingColumLabelProvider.java b/plugins/org.eclipse.emf.edit.ui/src/org/eclipse/emf/edit/ui/provider/DecoratingColumLabelProvider.java index 296b1ce3c..f9330c487 100644 --- a/plugins/org.eclipse.emf.edit.ui/src/org/eclipse/emf/edit/ui/provider/DecoratingColumLabelProvider.java +++ b/plugins/org.eclipse.emf.edit.ui/src/org/eclipse/emf/edit/ui/provider/DecoratingColumLabelProvider.java @@ -7,13 +7,16 @@ */ package org.eclipse.emf.edit.ui.provider; +import org.eclipse.emf.common.ui.viewer.IStyledLabelDecorator; import org.eclipse.emf.common.ui.viewer.IUndecoratingLabelProvider; import org.eclipse.jface.viewers.CellLabelProvider; import org.eclipse.jface.viewers.ColumnLabelProvider; +import org.eclipse.jface.viewers.DelegatingStyledCellLabelProvider.IStyledLabelProvider; import org.eclipse.jface.viewers.IColorProvider; import org.eclipse.jface.viewers.IFontProvider; import org.eclipse.jface.viewers.ILabelDecorator; import org.eclipse.jface.viewers.ILabelProvider; +import org.eclipse.jface.viewers.StyledString; import org.eclipse.swt.graphics.Color; import org.eclipse.swt.graphics.Font; import org.eclipse.swt.graphics.Image; @@ -26,6 +29,43 @@ import org.eclipse.swt.graphics.Point; */ public class DecoratingColumLabelProvider extends ColumnLabelProvider implements IUndecoratingLabelProvider { + + /** + * An extended version of the decorating column label provider that also provides for styled string. + * + * @author <a href="mailto:mikael.barbero@obeo.fr">Mikael Barbero</a> + * @since 2.10 + */ + public static class StyledLabelProvider extends DecoratingColumLabelProvider implements IStyledLabelProvider + { + public StyledLabelProvider(ILabelProvider labelProvider, ILabelDecorator labelDecorator) + { + super(labelProvider, labelDecorator); + } + + public StyledString getStyledText(Object element) + { + if (labelDecorator instanceof IStyledLabelDecorator) + { + StyledString styledString; + if (labelProvider instanceof IStyledLabelProvider) + { + styledString = ((IStyledLabelProvider) labelProvider).getStyledText(element); + } + else + { + styledString = new StyledString(getText(element)); + } + + return ((IStyledLabelDecorator)labelDecorator).decorateStyledText(styledString, element); + } + else + { + return new StyledString(labelDecorator.decorateText(labelProvider.getText(element), element)); + } + } + } + protected ILabelProvider labelProvider; protected IFontProvider fontProvider; protected IColorProvider colorProvider; diff --git a/plugins/org.eclipse.emf.edit.ui/src/org/eclipse/emf/edit/ui/provider/DelegatingStyledCellLabelProvider.java b/plugins/org.eclipse.emf.edit.ui/src/org/eclipse/emf/edit/ui/provider/DelegatingStyledCellLabelProvider.java new file mode 100644 index 000000000..453459c25 --- /dev/null +++ b/plugins/org.eclipse.emf.edit.ui/src/org/eclipse/emf/edit/ui/provider/DelegatingStyledCellLabelProvider.java @@ -0,0 +1,178 @@ +/** + * Copyright (c) 2013 Obeo and others. + * 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: + * Obeo - initial API and implementation + */ +package org.eclipse.emf.edit.ui.provider; + +import org.eclipse.jface.viewers.IColorProvider; +import org.eclipse.jface.viewers.IFontProvider; +import org.eclipse.jface.viewers.ILabelProvider; +import org.eclipse.jface.viewers.ITableColorProvider; +import org.eclipse.jface.viewers.ITableFontProvider; +import org.eclipse.jface.viewers.ITableLabelProvider; +import org.eclipse.swt.graphics.Color; +import org.eclipse.swt.graphics.Font; +import org.eclipse.swt.graphics.Image; + +/** + * An extended {@link org.eclipse.jface.viewers.DelegatingStyledCellLabelProvider DelegatingStyledCellLabelProvider} that can + * be used as a {@link ILabelProvider standard label provider} and {@link ITableLabelProvider table label provider} by + * delegating to the wrapped {@link IStyledLabelProvider}. The methods of these interfaces will return null if the wrapped + * {@link IStyledLabelProvider} does not implement itself the proper interfaces. + * + * @author <a href="mailto:mikael.barbero@obeo.fr">Mikael Barbero</a> + * @since 2.10 + */ +public class DelegatingStyledCellLabelProvider extends org.eclipse.jface.viewers.DelegatingStyledCellLabelProvider implements + ILabelProvider, ITableLabelProvider +{ + + /** + * An extended version of the delegating styled cell label provider that also provides for fonts if the wrapped + * {@link IStyledLabelProvider} itself provides for fonts. + */ + public static class FontProvider extends DelegatingStyledCellLabelProvider implements IFontProvider, ITableFontProvider + { + /** + * Construct an instance that wraps the given styled label provider. The constructed instance will + * return null when asked to provide for {@link ILabelProvider label} and for {@link ITableLabelProvider table label} + * if the given {@code styledLabelProvider} does not implement itself the proper interfaces. + * @param styledLabelProvider the styled label provider to be wrapped + */ + public FontProvider(IStyledLabelProvider styledLabelProvider) + { + super(styledLabelProvider); + } + } + + /** + * An extended version of the delegating styled cell label provider that also provides for colors if the wrapped + * {@link IStyledLabelProvider} itself provides for colors. + */ + public static class ColorProvider extends DelegatingStyledCellLabelProvider implements IColorProvider, ITableColorProvider + { + /** + * Construct an instance that wraps the given styled label provider. The constructed instance will + * return null when asked to provide for {@link ILabelProvider label} and for {@link ITableLabelProvider table label} + * if the given {@code styledLabelProvider} does not implement itself the proper interfaces. + * @param styledLabelProvider the styled label provider to be wrapped + */ + public ColorProvider(IStyledLabelProvider styledLabelProvider) + { + super(styledLabelProvider); + } + } + + /** + * An extended version of the delegating styled cell label provider that also provides for fonts and colors if the wrapped + * {@link IStyledLabelProvider} itself provides for fonts and colors. + */ + public static class FontAndColorProvider extends DelegatingStyledCellLabelProvider implements IFontProvider, ITableFontProvider, IColorProvider, ITableColorProvider + { + /** + * Construct an instance that wraps the given styled label provider. The constructed instance will + * return null when asked to provide for {@link ILabelProvider label} and for {@link ITableLabelProvider table label} + * if the given {@code styledLabelProvider} does not implement itself the proper interfaces. + * @param styledLabelProvider the styled label provider to be wrapped + */ + public FontAndColorProvider(IStyledLabelProvider styledLabelProvider) + { + super(styledLabelProvider); + } + } + + /** + * Construct an instance that wraps the given styled label provider. The constructed instance will + * return null when asked to provide for {@link ILabelProvider label} and for {@link ITableLabelProvider table label} + * if the given {@code styledLabelProvider} does not implement itself the proper interfaces. + * @param styledLabelProvider the styled label provider to be wrapped + */ + public DelegatingStyledCellLabelProvider(IStyledLabelProvider styledLabelProvider) + { + super(styledLabelProvider); + } + + /** + * This implements {@link ILabelProvider#getText(Object)} by forwarding it to the wrapped styled label provider if + * it implements {@link ILabelProvider}. Returns null otherwise. + */ + public String getText(Object element) + { + if (getStyledStringProvider() instanceof ILabelProvider) + { + return ((ILabelProvider) getStyledStringProvider()).getText(element); + } + return null; + } + + /** + * This implements {@link ITableFontProvider#getFont(Object, int)} by forwarding it to the wrapped styled label provider if + * it implements {@link ITableFontProvider}. Returns null otherwise. + */ + public Font getFont(Object element, int columnIndex) + { + if (getStyledStringProvider() instanceof ITableFontProvider) + { + return ((ITableFontProvider) getStyledStringProvider()).getFont(element, columnIndex); + } + return null; + } + + /** + * This implements {@link ITableColorProvider#getForeground(Object, int)} by forwarding it to the wrapped styled label provider if + * it implements {@link ITableColorProvider}. Returns null otherwise. + */ + public Color getForeground(Object element, int columnIndex) + { + if (getStyledStringProvider() instanceof ITableColorProvider) + { + return ((ITableColorProvider) getStyledStringProvider()).getForeground(element, columnIndex); + } + return null; + } + + /** + * This implements {@link ITableColorProvider#getBackground(Object, int)} by forwarding it to the wrapped styled label provider if + * it implements {@link ITableColorProvider}. Returns null otherwise. + */ + public Color getBackground(Object element, int columnIndex) + { + if (getStyledStringProvider() instanceof ITableColorProvider) + { + return ((ITableColorProvider) getStyledStringProvider()).getBackground(element, columnIndex); + } + return null; + } + + /** + * This implements {@link ITableLabelProvider#getColumnImage(Object, int)} by forwarding it to the wrapped styled label provider if + * it implements {@link ITableLabelProvider}. Returns null otherwise. + */ + public Image getColumnImage(Object element, int columnIndex) + { + if (getStyledStringProvider() instanceof ITableLabelProvider) + { + return ((ITableLabelProvider) getStyledStringProvider()).getColumnImage(element, columnIndex); + } + return null; + } + + /** + * This implements {@link ITableLabelProvider#getColumnText(Object, int)} by forwarding it to the wrapped styled label provider if + * it implements {@link ITableLabelProvider}. Returns null otherwise. + */ + public String getColumnText(Object element, int columnIndex) + { + if (getStyledStringProvider() instanceof ITableLabelProvider) + { + return ((ITableLabelProvider) getStyledStringProvider()).getColumnText(element, columnIndex); + } + return null; + } +}
\ No newline at end of file diff --git a/plugins/org.eclipse.emf.edit.ui/src/org/eclipse/emf/edit/ui/provider/DiagnosticDecorator.java b/plugins/org.eclipse.emf.edit.ui/src/org/eclipse/emf/edit/ui/provider/DiagnosticDecorator.java index 8d9bd9d28..49e83d47f 100644 --- a/plugins/org.eclipse.emf.edit.ui/src/org/eclipse/emf/edit/ui/provider/DiagnosticDecorator.java +++ b/plugins/org.eclipse.emf.edit.ui/src/org/eclipse/emf/edit/ui/provider/DiagnosticDecorator.java @@ -35,6 +35,7 @@ import org.eclipse.emf.common.notify.Notifier; import org.eclipse.emf.common.ui.ImageURIRegistry; import org.eclipse.emf.common.ui.MarkerHelper; import org.eclipse.emf.common.ui.viewer.ColumnViewerInformationControlToolTipSupport; +import org.eclipse.emf.common.ui.viewer.IStyledLabelDecorator; import org.eclipse.emf.common.ui.viewer.IUndecoratingLabelProvider; import org.eclipse.emf.common.util.BasicDiagnostic; import org.eclipse.emf.common.util.Diagnostic; @@ -61,7 +62,9 @@ import org.eclipse.emf.edit.ui.util.EditUIMarkerHelper; import org.eclipse.emf.edit.ui.view.ExtendedPropertySheetPage; import org.eclipse.jface.action.Action; import org.eclipse.jface.dialogs.IDialogSettings; +import org.eclipse.jface.preference.JFacePreferences; import org.eclipse.jface.resource.ImageDescriptor; +import org.eclipse.jface.resource.JFaceResources; import org.eclipse.jface.viewers.CellLabelProvider; import org.eclipse.jface.viewers.ColumnViewer; import org.eclipse.jface.viewers.IContentProvider; @@ -71,9 +74,14 @@ import org.eclipse.jface.viewers.ILabelProviderListener; import org.eclipse.jface.viewers.IStructuredContentProvider; import org.eclipse.jface.viewers.ITreeContentProvider; import org.eclipse.jface.viewers.StructuredViewer; +import org.eclipse.jface.viewers.StyledString; +import org.eclipse.jface.viewers.StyledString.Styler; import org.eclipse.jface.viewers.ViewerCell; +import org.eclipse.swt.SWT; import org.eclipse.swt.browser.LocationEvent; +import org.eclipse.swt.custom.StyleRange; import org.eclipse.swt.graphics.Image; +import org.eclipse.swt.graphics.TextStyle; import org.eclipse.swt.widgets.Control; import org.eclipse.swt.widgets.Display; import org.eclipse.ui.IWorkbenchPart; @@ -603,6 +611,229 @@ public class DiagnosticDecorator extends CellLabelProvider implements ILabelDeco } } } + + /** + * An extended {@link DiagnosticDecorator} that handle style strings decoration. + * @since 2.10 + */ + public static class Styled extends DiagnosticDecorator implements IStyledLabelDecorator + { + /** + * Creates an instance that supports {@link LiveValidator live validation} and supports + * {@link DiagnosticDecorator.LiveValidator.LiveValidationAction#LIVE_VALIDATOR_DIALOG_SETTINGS_KEY enablement} + * via {@link IDialogSettings dialog setting}. + */ + public Styled(EditingDomain editingDomain, ExtendedPropertySheetPage propertySheetPage, IDialogSettings dialogSettings) + { + super(editingDomain, propertySheetPage, dialogSettings); + } + + /** + * Creates an instance that supports {@link LiveValidator live validation}. + */ + public Styled(EditingDomain editingDomain, ExtendedPropertySheetPage propertySheetPage) + { + super(editingDomain, propertySheetPage); + } + + /** + * Creates an instance that supports {@link LiveValidator live validation} and supports + * {@link DiagnosticDecorator.LiveValidator.LiveValidationAction#LIVE_VALIDATOR_DIALOG_SETTINGS_KEY enablement} + * via {@link IDialogSettings dialog setting}. + */ + public Styled(EditingDomain editingDomain, StructuredViewer viewer, IDialogSettings dialogSettings) + { + super(editingDomain, viewer, dialogSettings); + } + + /** + * Creates an instance that supports {@link LiveValidator live validation}. + */ + public Styled(EditingDomain editingDomain, StructuredViewer viewer) + { + super(editingDomain, viewer); + } + + /** + * Creates an instance that doesn't support {@link LiveValidator live validation}. + * Only decorations explicitly produced from {@link ValidateAction} or those + * {@link EditUIMarkerHelper#getMarkerDiagnostics(Object, org.eclipse.core.resources.IFile) + * derived from markers} are displayed. + */ + public Styled(ResourceSet resourceSet, ExtendedPropertySheetPage propertySheetPage) + { + super(resourceSet, propertySheetPage); + } + + /** + * Creates an instance that doesn't support {@link LiveValidator live validation}. + * Only decorations explicitly produced from {@link ValidateAction} or those + * {@link EditUIMarkerHelper#getMarkerDiagnostics(Object, org.eclipse.core.resources.IFile) + * derived from markers} are displayed. + */ + public Styled(ResourceSet resourceSet, StructuredViewer viewer) + { + super(resourceSet, viewer); + } + + public StyledString decorateStyledText(StyledString styledString, Object object) + { + return styledString; + } + } + + /** + * A styled diagnostic decorator that will decorate the given styled string by underlying it + * with a {@link SWT#UNDERLINE_ERROR} underline style colored in {@link JFacePreferences#ERROR_COLOR}. + * @author mbarbero + * + */ + public static class StyledError extends DiagnosticDecorator.Styled implements IStyledLabelDecorator + { + + public StyledError(EditingDomain editingDomain, + ExtendedPropertySheetPage propertySheetPage, + IDialogSettings dialogSettings) + { + super(editingDomain, propertySheetPage, dialogSettings); + } + + public StyledError(EditingDomain editingDomain, + ExtendedPropertySheetPage propertySheetPage) + { + super(editingDomain, propertySheetPage); + } + + public StyledError(EditingDomain editingDomain, StructuredViewer viewer, + IDialogSettings dialogSettings) + { + super(editingDomain, viewer, dialogSettings); + } + + public StyledError(EditingDomain editingDomain, StructuredViewer viewer) + { + super(editingDomain, viewer); + } + + public StyledError(ResourceSet resourceSet, + ExtendedPropertySheetPage propertySheetPage) + { + super(resourceSet, propertySheetPage); + } + + public StyledError(ResourceSet resourceSet, StructuredViewer viewer) + { + super(resourceSet, viewer); + } + + /** + * Decorate the given {@code styledString} by underlying the whole given {@code styledString} + * with a {@link SWT#UNDERLINE_ERROR} underline style colored in {@link JFacePreferences#ERROR_COLOR}. + */ + public StyledString decorateStyledText(StyledString styledString, Object object) + { + if (styledString == null || object == null) + { + throw new NullPointerException(); + } + Diagnostic diagnostic = getDecorations().get(object); + if (diagnostic != null && diagnostic.getSeverity() >= Diagnostic.WARNING) + { + StyledString result = new StyledString(); + StyleRange[] styleRanges = styledString.getStyleRanges(); + String string = styledString.getString(); + if (styleRanges.length == 0) + { + result.append(string, ErrorStyler.INSTANCE); + } + else + { + int start = 0; + for (StyleRange range : styleRanges) + { + if (start < range.start) + { + result.append(string.substring(start, (range.start - start)), ErrorStyler.INSTANCE); + } + start = range.start + range.length; + result.append(string.substring(range.start, start), new ComposedStyler(range, ErrorStyler.INSTANCE)); + } + if (start < styledString.length()) + { + result.append(string.substring(start, string.length()), ErrorStyler.INSTANCE); + } + } + + return result; + } + return styledString; + } + + /** + * A styler underlying the given text with a {@link SWT#UNDERLINE_ERROR} underline style colored + * in {@link JFacePreferences#ERROR_COLOR}. + * @since 2.10 + */ + public static final class ErrorStyler extends Styler + { + public static final Styler INSTANCE = new ErrorStyler(); + + @Override + public void applyStyles(TextStyle textStyle) + { + textStyle.underline = true; + textStyle.underlineStyle = SWT.UNDERLINE_ERROR; + textStyle.underlineColor = JFaceResources.getColorRegistry().get(JFacePreferences.ERROR_COLOR); + } + } + + /** + * An extended styler applying a wrapped base style first, and successively apply other + * stylers to the given TextStyle, overriding any previous style. + * + * @since 2.10 + */ + public static class ComposedStyler extends Styler + { + protected TextStyle baseStyle; + protected Styler[] stylers; + + public ComposedStyler(TextStyle baseStyle, Styler... stylers) + { + this.baseStyle = baseStyle; + this.stylers = stylers; + } + + @Override + public void applyStyles(TextStyle textStyle) + { + textStyle.font = baseStyle.font; + textStyle.metrics = baseStyle.metrics; + textStyle.rise = baseStyle.rise; + + textStyle.background = baseStyle.background; + textStyle.foreground = baseStyle.foreground; + + textStyle.borderColor = baseStyle.borderColor; + textStyle.borderStyle = baseStyle.borderStyle; + + textStyle.strikeout = baseStyle.strikeout; + textStyle.strikeoutColor = baseStyle.strikeoutColor; + + textStyle.underline = baseStyle.underline; + textStyle.underlineStyle = baseStyle.underlineStyle; + textStyle.underlineColor = baseStyle.underlineColor; + + textStyle.data = baseStyle.data; + + for (Styler styler : stylers) + { + styler.applyStyles(textStyle); + } + } + + } + } public class DiagnosticDecoratorAdapter extends DiagnosticAdapter { diff --git a/plugins/org.eclipse.emf.edit/src/org/eclipse/emf/edit/provider/IItemStyledLabelProvider.java b/plugins/org.eclipse.emf.edit/src/org/eclipse/emf/edit/provider/IItemStyledLabelProvider.java new file mode 100644 index 000000000..ba29888b8 --- /dev/null +++ b/plugins/org.eclipse.emf.edit/src/org/eclipse/emf/edit/provider/IItemStyledLabelProvider.java @@ -0,0 +1,32 @@ +/** + * Copyright (c) 2013 Obeo and others. + * 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: + * Obeo - initial API and implementation + */ +package org.eclipse.emf.edit.provider; + +/** + * This is the interface implemented to provide a styled label text for an item; + * it receives delegated calls from IStyledLabelProvider. + * + * @author <a href="mailto:mikael.barbero@obeo.fr">Mikael Barbero</a> + * @since 2.10 + */ +public interface IItemStyledLabelProvider +{ + + /** + * This does the same thing as IStyledLabelProvider.getStyledText, it fetches + * the styled label text specific to this object instance. + * + * @param object + * the object to evaluate the styled string for. + * @return the styled string. + */ + Object getStyledText(Object object); +} diff --git a/plugins/org.eclipse.emf.edit/src/org/eclipse/emf/edit/provider/ItemProvider.java b/plugins/org.eclipse.emf.edit/src/org/eclipse/emf/edit/provider/ItemProvider.java index 4ada79ab4..8de995e61 100644 --- a/plugins/org.eclipse.emf.edit/src/org/eclipse/emf/edit/provider/ItemProvider.java +++ b/plugins/org.eclipse.emf.edit/src/org/eclipse/emf/edit/provider/ItemProvider.java @@ -246,6 +246,7 @@ public class ItemProvider IItemLabelProvider, IItemColorProvider, IItemFontProvider, + IItemStyledLabelProvider, IStructuredItemContentProvider, ITreeItemContentProvider, IUpdateableItemParent @@ -276,6 +277,12 @@ public class ItemProvider protected Object background; /** + * This is the text returned by {@link IItemStyledLabelProvider#getStyledText getStyledText(Object)}. + * @since 2.10 + */ + protected Object styledText; + + /** * This is the parent returned by {@link ITreeItemContentProvider#getParent getParent(Object)}. */ protected Object parent; @@ -1026,4 +1033,48 @@ public class ItemProvider { return UnexecutableCommand.INSTANCE; } + + /** + * This implements {@link IItemStyledLabelProvider#getStyledText(Object) IItemStyledLabelProvider.getStyledText} + * by returning {@link #styledText}. + * @since 2.10 + */ + public Object getStyledText(Object object) + { + if (styledText == null) + { + return new StyledString(getText(object)); + } + return styledText; + } + + /** + * This delegates to {@link #getStyledText(Object) getStyledText(this)}. + * @since 2.10 + */ + public Object getStyledText() + { + return getStyledText(this); + } + + /** + * This allows {@link #styledText} to be set. + * If there is a domain notifier, it fires the appropriate domain event. + * @since 2.10 + */ + public void setStyledText(Object object, Object styledText) + { + this.styledText = styledText; + + fireNotifyChanged(new ItemProviderNotification(Notification.SET, null, styledText, Notification.NO_INDEX, false, false, true)); + } + + /** + * This delegates to {@link #getStyledText(Object, Object) getStyledText(this, styledText)}. + * @since 2.10 + */ + public void setStyledText(Object styledText) + { + setStyledText(this, styledText); + } } diff --git a/plugins/org.eclipse.emf.edit/src/org/eclipse/emf/edit/provider/ItemProviderAdapter.java b/plugins/org.eclipse.emf.edit/src/org/eclipse/emf/edit/provider/ItemProviderAdapter.java index 88fac9228..3224befb9 100644 --- a/plugins/org.eclipse.emf.edit/src/org/eclipse/emf/edit/provider/ItemProviderAdapter.java +++ b/plugins/org.eclipse.emf.edit/src/org/eclipse/emf/edit/provider/ItemProviderAdapter.java @@ -738,6 +738,17 @@ public class ItemProviderAdapter } /** + * This implements {@link IItemStyledLabelProvider#getStyledText IItemStyledLabelProvider.getStyledText} by simply creating + * an {@link IStyledString IStyledString} from the value returned {@link #getText getText}. + * + * @since 2.10 + */ + public Object getStyledText(Object object) + { + return new StyledString(getText(object)); + } + + /** * This implements {@link IUpdateableItemText#getUpdateableText IUpdateableItemText.getUpdateableText} * by simply calling {@link #getText}. * This will often be correct as is. diff --git a/plugins/org.eclipse.emf.edit/src/org/eclipse/emf/edit/provider/StyledString.java b/plugins/org.eclipse.emf.edit/src/org/eclipse/emf/edit/provider/StyledString.java new file mode 100644 index 000000000..b88138f16 --- /dev/null +++ b/plugins/org.eclipse.emf.edit/src/org/eclipse/emf/edit/provider/StyledString.java @@ -0,0 +1,514 @@ +/** + * Copyright (c) 2013 Obeo and others. + * 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: + * Obeo - initial API and implementation + */ +package org.eclipse.emf.edit.provider; + +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; + +import org.eclipse.emf.common.util.URI; +import org.eclipse.emf.edit.provider.StyledString.Fragment; + +/** + * A mutable string with styled ranges similar to JFaces's SyledString. All + * {@link Fragment fragments} mark substrings of the string and do not overlap. + * Styles are applied using instances of {@link StyledString.Style}. It can be iterated to + * get all composing fragments. + * + * @author <a href="mailto:mikael.barbero@obeo.fr">Mikael Barbero</a> + * @since 2.10 + */ +public final class StyledString implements Iterable<Fragment> +{ + private final List<Fragment> content = new ArrayList<Fragment>(); + + /** + * Constructs an empty styled string. + */ + public StyledString() + { + // do nothing; + } + + /** + * Constructs a new styled string with the given text with no associated style. + */ + public StyledString(String text) + { + this(text, StyledString.Style.NO_STYLE); + } + + /** + * Constructs a new styled string with the given text associated with the given style. + */ + public StyledString(String text, StyledString.Style style) + { + append(text, style); + } + + /** + * Returns the string of this {@link StyledString}. + * + * @return the current string of this {@link StyledString}. + */ + public String getString() + { + StringBuilder result = new StringBuilder(); + for (Fragment styledString : this) + { + result.append(styledString.getString()); + } + return result.toString(); + } + + /** + * Appends a string with a style to the {@link StyledString}. The appended + * string will be not be styled. + * + * @param string + * the string to append + * @return returns a reference to this object + */ + public StyledString append(String string) + { + content.add(new Fragment(string, StyledString.Style.NO_STYLE)); + return this; + } + + /** + * Appends a string with a style to the {@link StyledString}. The appended + * string will be styled with the given {@code style}. + * + * @param string + * the string to append + * @param style + * the style to use for styling the string to append or + * <code>null</code> if no style should be associated with the + * appended string. + * @return returns a reference to this object + */ + public StyledString append(String string, StyledString.Style style) + { + content.add(new Fragment(string, style)); + return this; + } + + /** + * Appends a string with styles to the {@link StyledString}. + * + * @param styledString + * the string to append + * @return returns a reference to this object + */ + public StyledString append(StyledString styledString) + { + content.addAll(styledString.content); + return this; + } + + public Iterator<Fragment> iterator() + { + return content.iterator(); + } + + /** + * An immutable string styled with a given {@link StyledString.Style}. + * + * @since 2.10 + */ + public static final class Fragment + { + private final String string; + + private final StyledString.Style style; + + private Fragment(String string, StyledString.Style style) + { + this.string = string; + this.style = style; + } + + /** + * Returns the string of this {@link Fragment}. + * + * @return the current string of this {@link Fragment}. + */ + public String getString() + { + return string; + } + + /** + * Returns the style of this {@link Fragment}. + * + * @return the current style of this {@link Fragment}. + */ + public StyledString.Style getStyle() + { + return style; + } + } + + /** + * An immutable object describing how a {@link StyledString} should be style. + * <p> + * It must be constructed with the {@link Style#newBuilder() built-in builder + * pattern}. + * + * @since 2.10 + */ + public static final class Style + { + + /** + * Constants describing that a String with the given style should not be + * styled (null object). + */ + public static final Style NO_STYLE = new Style(null, null, null, false, + null, null, null, null, null, "NO_STYLE"); + + /** + * A built-in style that will eventually be mapped to + * org.eclipse.jface.viewers.StyledString.QUALIFIER_STYLER. + */ + public static final Style QUALIFIER_STYLER = new Style(null, null, null, + false, null, null, null, null, null, "QUALIFIER_STYLER"); + + /** + * A built-in style that will eventually be mapped to + * org.eclipse.jface.viewers.StyledString.COUNTER_STYLER. + */ + public static final Style COUNTER_STYLER = new Style(null, null, null, + false, null, null, null, null, null, "COUNTER_STYLER"); + + /** + * A built-in style that will eventually be mapped to + * org.eclipse.jface.viewers.StyledString.DECORATIONS_STYLER. + */ + public static final Style DECORATIONS_STYLER = new Style(null, null, null, + false, null, null, null, null, null, "DECORATIONS_STYLER"); + + private final URI font; + + private final URI backgroundColor; + + private final URI foregroundColor; + + private final boolean isStrikedout; + + private final URI strikeoutColor; + + private final UnderLineStyle underlineStyle; + + private final URI underlineColor; + + private final BorderStyle borderStyle; + + private final URI borderColor; + + private String toString; + + private Style(URI font, URI backgroundColor, URI foregroundColor, + boolean isStrikedout, URI strikeoutColor, + UnderLineStyle underlineStyle, URI underlineColor, + BorderStyle borderStyle, URI borderColor, String toString) + { + this(font, backgroundColor, foregroundColor, isStrikedout, strikeoutColor, + underlineStyle, underlineColor, borderStyle, borderColor); + this.toString = toString; + } + + private Style(URI font, URI backgroundColor, URI foregroundColor, + boolean isStrikedout, URI strikeoutColor, + UnderLineStyle underlineStyle, URI underlineColor, + BorderStyle borderStyle, URI borderColor) + { + this.font = font; + this.backgroundColor = backgroundColor; + this.foregroundColor = foregroundColor; + this.isStrikedout = isStrikedout; + this.strikeoutColor = strikeoutColor; + this.underlineStyle = underlineStyle; + this.underlineColor = underlineColor; + this.borderStyle = borderStyle; + this.borderColor = borderColor; + } + + public URI getFont() + { + return font; + } + + public URI getBackgoundColor() + { + return backgroundColor; + } + + public URI getForegroundColor() + { + return foregroundColor; + } + + public boolean isStrikedout() + { + return isStrikedout; + } + + public URI getStrikeoutColor() + { + return strikeoutColor; + } + + public UnderLineStyle getUnderlineStyle() + { + return underlineStyle; + } + + public URI getUnderlineColor() + { + return underlineColor; + } + + public BorderStyle getBorderStyle() + { + return borderStyle; + } + + public URI getBorderColor() + { + return borderColor; + } + + /** + * All the supported underline styles. + */ + public static enum UnderLineStyle + { + NONE, SINGLE, DOUBLE, SQUIGGLE, ERROR, LINK; + } + + /** + * All the supported border styles. + */ + public static enum BorderStyle + { + NONE, SOLID, DOT, DASH; + } + + @Override + public String toString() + { + if (toString == null) + { + StringBuilder sb = new StringBuilder(Style.class.getSimpleName()).append('('); + sb.append("font: ").append(font); + sb.append(", backgroundColor: ").append(backgroundColor); + sb.append(", foregroundColor: ").append(foregroundColor); + if (isStrikedout) + { + sb.append(", strikedout(color: ").append(strikeoutColor).append(')'); + } + if (underlineStyle != UnderLineStyle.NONE) + { + sb.append(", underlined(style: "). + append(underlineStyle). + append(", color: "). + append(underlineColor). + append(')'); + } + if (borderStyle != BorderStyle.NONE) + { + sb.append(", border(style: "). + append(borderStyle). + append(", color: "). + append(borderColor). + append(')'); + } + + toString = sb.append(')').toString(); + } + return toString; + } + + /** + * Returns a new builder instance to create a custom style. + * + * @return a new builder instance to create a custom style. + */ + public static Builder newBuilder() + { + return new Builder(); + } + + /** + * Builder pattern to create a custom class. Methods calls can be chained as + * all methods returned its instance. + */ + public static final class Builder + { + private static final URI BLACK = URI.createURI("color://rgb/0/0/0"); //$NON-NLS-1$ + + private URI font; + + private URI backgroundColor; + + private URI foregroundColor; + + private boolean isStrikedout; + + private URI strikeoutColor; + + private UnderLineStyle underlineStyle = UnderLineStyle.NONE; + + private URI underlineColor; + + private BorderStyle borderStyle = BorderStyle.NONE; + + private URI borderColor; + + private Builder() + { + // prevents direct instantiation + } + + /** + * @param font + * the font to set + * @return + */ + public Builder setFont(URI font) + { + this.font = font; + return this; + } + + /** + * @param backgroundColor + * the backgroundColor to set + * @return + */ + public Builder setBackgroundColor(URI backgroundColor) + { + this.backgroundColor = backgroundColor; + return this; + } + + /** + * @param foregroundColor + * the forregroundColor to set + * @return + */ + public Builder setForegroundColor(URI foregroundColor) + { + this.foregroundColor = foregroundColor; + return this; + } + + /** + * @param isStrikedout + * the isStrikedout to set + * @return + */ + public Builder setStrikedout(boolean isStrikedout) + { + this.isStrikedout = isStrikedout; + if (strikeoutColor == null) + { + strikeoutColor = BLACK; + } + return this; + } + + /** + * @param strikeoutColor + * the strikeoutColor to set + * @return + */ + public Builder setStrikeoutColor(URI strikeoutColor) + { + this.strikeoutColor = strikeoutColor; + isStrikedout = true; + return this; + } + + /** + * @param borderColor + * the borderColor to set + * @return + */ + public Builder setBorderColor(URI borderColor) + { + this.borderColor = borderColor; + if (borderStyle == BorderStyle.NONE) + { + borderStyle = BorderStyle.SOLID; + } + return this; + } + + /** + * @param borderStyle + * the borderStyle to set + * @return + */ + public Builder setBorderStyle(BorderStyle borderStyle) + { + this.borderStyle = borderStyle; + if (borderColor == null) + { + borderColor = BLACK; + } + return this; + } + + /** + * @param underlineColor + * the underlineColor to set + * @return + */ + public Builder setUnderlineColor(URI underlineColor) + { + this.underlineColor = underlineColor; + if (underlineStyle == UnderLineStyle.NONE) + { + underlineStyle = UnderLineStyle.SINGLE; + } + return this; + } + + /** + * @param underlineStyle + * the underlineStyle to set + * @return + */ + public Builder setUnderlineStyle(UnderLineStyle underlineStyle) + { + this.underlineStyle = underlineStyle; + if (underlineColor == null) + { + underlineColor = BLACK; + } + return this; + } + + /** + * Creates and return a new Style object as configured with the builder. + * @return + */ + public Style toStyle() + { + return new Style(font, backgroundColor, foregroundColor, isStrikedout, + strikeoutColor, underlineStyle, underlineColor, borderStyle, + borderColor); + } + } + } +} |