Skip to main content

This CGIT instance is deprecated, and repositories have been moved to Gitlab or Github. See the repository descriptions for specific locations.

aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/uml')
-rw-r--r--plugins/uml/org.eclipse.papyrus.properties.uml/META-INF/MANIFEST.MF4
-rw-r--r--plugins/uml/org.eclipse.papyrus.properties.uml/Model/LanguagePreferences.ecore21
-rw-r--r--plugins/uml/org.eclipse.papyrus.properties.uml/Model/LanguagePreferences.genmodel23
-rw-r--r--plugins/uml/org.eclipse.papyrus.properties.uml/Model/UML/Environment.xmi4
-rw-r--r--plugins/uml/org.eclipse.papyrus.properties.uml/build.properties4
-rw-r--r--plugins/uml/org.eclipse.papyrus.properties.uml/icons/AddReg.gifbin0 -> 328 bytes
-rw-r--r--plugins/uml/org.eclipse.papyrus.properties.uml/plugin.properties2
-rw-r--r--plugins/uml/org.eclipse.papyrus.properties.uml/plugin.xml27
-rw-r--r--plugins/uml/org.eclipse.papyrus.properties.uml/schema/org.eclipse.papyrus.properties.uml.languageEditor.exsd109
-rw-r--r--plugins/uml/org.eclipse.papyrus.properties.uml/src/org/eclipse/papyrus/properties/uml/Activator.java47
-rw-r--r--plugins/uml/org.eclipse.papyrus.properties.uml/src/org/eclipse/papyrus/properties/uml/creation/ExpressionLanguageFactory.java73
-rw-r--r--plugins/uml/org.eclipse.papyrus.properties.uml/src/org/eclipse/papyrus/properties/uml/databinding/PapyrusObservableList.java194
-rw-r--r--plugins/uml/org.eclipse.papyrus.properties.uml/src/org/eclipse/papyrus/properties/uml/databinding/PapyrusObservableValue.java87
-rw-r--r--plugins/uml/org.eclipse.papyrus.properties.uml/src/org/eclipse/papyrus/properties/uml/databinding/ProfileApplicationObservableList.java197
-rw-r--r--plugins/uml/org.eclipse.papyrus.properties.uml/src/org/eclipse/papyrus/properties/uml/databinding/StereotypeApplicationObservableList.java197
-rw-r--r--plugins/uml/org.eclipse.papyrus.properties.uml/src/org/eclipse/papyrus/properties/uml/databinding/command/ApplyProfileCommand.java65
-rw-r--r--plugins/uml/org.eclipse.papyrus.properties.uml/src/org/eclipse/papyrus/properties/uml/databinding/command/ApplyStereotypeCommand.java65
-rw-r--r--plugins/uml/org.eclipse.papyrus.properties.uml/src/org/eclipse/papyrus/properties/uml/databinding/command/UnapplyProfileCommand.java64
-rw-r--r--plugins/uml/org.eclipse.papyrus.properties.uml/src/org/eclipse/papyrus/properties/uml/databinding/command/UnapplyStereotypeCommand.java65
-rw-r--r--plugins/uml/org.eclipse.papyrus.properties.uml/src/org/eclipse/papyrus/properties/uml/expression/ExpressionList.java206
-rw-r--r--plugins/uml/org.eclipse.papyrus.properties.uml/src/org/eclipse/papyrus/properties/uml/extensionpoint/LanguageEditorExtensionPoint.java42
-rw-r--r--plugins/uml/org.eclipse.papyrus.properties.uml/src/org/eclipse/papyrus/properties/uml/languagepreferences/Editor.java54
-rw-r--r--plugins/uml/org.eclipse.papyrus.properties.uml/src/org/eclipse/papyrus/properties/uml/languagepreferences/Language.java81
-rw-r--r--plugins/uml/org.eclipse.papyrus.properties.uml/src/org/eclipse/papyrus/properties/uml/languagepreferences/Preferences.java90
-rw-r--r--plugins/uml/org.eclipse.papyrus.properties.uml/src/org/eclipse/papyrus/properties/uml/languagepreferences/impl/EditorImpl.java167
-rw-r--r--plugins/uml/org.eclipse.papyrus.properties.uml/src/org/eclipse/papyrus/properties/uml/languagepreferences/impl/LanguageImpl.java229
-rw-r--r--plugins/uml/org.eclipse.papyrus.properties.uml/src/org/eclipse/papyrus/properties/uml/languagepreferences/impl/PreferencesImpl.java255
-rw-r--r--plugins/uml/org.eclipse.papyrus.properties.uml/src/org/eclipse/papyrus/properties/uml/languagepreferences/impl/languagepreferencesFactoryImpl.java121
-rw-r--r--plugins/uml/org.eclipse.papyrus.properties.uml/src/org/eclipse/papyrus/properties/uml/languagepreferences/impl/languagepreferencesPackageImpl.java279
-rw-r--r--plugins/uml/org.eclipse.papyrus.properties.uml/src/org/eclipse/papyrus/properties/uml/languagepreferences/languagepreferencesFactory.java64
-rw-r--r--plugins/uml/org.eclipse.papyrus.properties.uml/src/org/eclipse/papyrus/properties/uml/languagepreferences/languagepreferencesPackage.java372
-rw-r--r--plugins/uml/org.eclipse.papyrus.properties.uml/src/org/eclipse/papyrus/properties/uml/languagepreferences/util/languagepreferencesAdapterFactory.java160
-rw-r--r--plugins/uml/org.eclipse.papyrus.properties.uml/src/org/eclipse/papyrus/properties/uml/languagepreferences/util/languagepreferencesSwitch.java156
-rw-r--r--plugins/uml/org.eclipse.papyrus.properties.uml/src/org/eclipse/papyrus/properties/uml/modelelement/StereotypeApplicationFactory.java37
-rw-r--r--plugins/uml/org.eclipse.papyrus.properties.uml/src/org/eclipse/papyrus/properties/uml/modelelement/StereotypeApplicationModelElement.java71
-rw-r--r--plugins/uml/org.eclipse.papyrus.properties.uml/src/org/eclipse/papyrus/properties/uml/modelelement/StereotypeModelElement.java7
-rw-r--r--plugins/uml/org.eclipse.papyrus.properties.uml/src/org/eclipse/papyrus/properties/uml/modelelement/StereotypeModelElementFactory.java2
-rw-r--r--plugins/uml/org.eclipse.papyrus.properties.uml/src/org/eclipse/papyrus/properties/uml/modelelement/UMLModelElement.java54
-rw-r--r--plugins/uml/org.eclipse.papyrus.properties.uml/src/org/eclipse/papyrus/properties/uml/modelelement/UMLModelElementFactory.java15
-rw-r--r--plugins/uml/org.eclipse.papyrus.properties.uml/src/org/eclipse/papyrus/properties/uml/preferences/LanguagePreferences.java48
-rw-r--r--plugins/uml/org.eclipse.papyrus.properties.uml/src/org/eclipse/papyrus/properties/uml/preferences/LanguageRegistry.java172
-rw-r--r--plugins/uml/org.eclipse.papyrus.properties.uml/src/org/eclipse/papyrus/properties/uml/providers/ApplicableStereotypeContentProvider.java30
-rw-r--r--plugins/uml/org.eclipse.papyrus.properties.uml/src/org/eclipse/papyrus/properties/uml/widgets/BodyEditor.java82
-rw-r--r--plugins/uml/org.eclipse.papyrus.properties.uml/src/org/eclipse/papyrus/properties/uml/widgets/DynamicBodyEditor.java145
-rw-r--r--plugins/uml/org.eclipse.papyrus.properties.uml/src/org/eclipse/papyrus/properties/uml/widgets/ExpressionEditor.java116
-rw-r--r--plugins/uml/org.eclipse.papyrus.properties.uml/src/org/eclipse/papyrus/properties/uml/widgets/ExpressionLanguageEditor.java53
-rw-r--r--plugins/uml/org.eclipse.papyrus.properties.uml/src/org/eclipse/papyrus/properties/uml/widgets/LanguageSelector.java120
-rw-r--r--plugins/uml/org.eclipse.papyrus.properties.uml/src/org/eclipse/papyrus/properties/uml/widgets/NaturalLanguageEditor.java102
-rw-r--r--plugins/uml/org.eclipse.papyrus.properties.uml/src/org/eclipse/papyrus/properties/uml/widgets/ProfileApplicationEditor.java98
-rw-r--r--plugins/uml/org.eclipse.papyrus.properties.uml/src/org/eclipse/papyrus/properties/uml/widgets/ProfileApplicationPropertyEditor.java49
-rw-r--r--plugins/uml/org.eclipse.papyrus.properties.uml/src/org/eclipse/papyrus/properties/uml/xtext/CollaborationUseAdapter.java11
-rw-r--r--plugins/uml/org.eclipse.papyrus.properties.uml/src/org/eclipse/papyrus/properties/uml/xtext/ConnectionPointReferenceAdapter.java11
-rw-r--r--plugins/uml/org.eclipse.papyrus.properties.uml/src/org/eclipse/papyrus/properties/uml/xtext/MessageAdapter.java11
-rw-r--r--plugins/uml/org.eclipse.papyrus.properties.uml/src/org/eclipse/papyrus/properties/uml/xtext/ParameterAdapter.java11
-rw-r--r--plugins/uml/org.eclipse.papyrus.properties.uml/src/org/eclipse/papyrus/properties/uml/xtext/StateAdapter.java11
-rw-r--r--plugins/uml/org.eclipse.papyrus.properties.uml/src/org/eclipse/papyrus/properties/uml/xtext/TransitionAdapter.java11
56 files changed, 4782 insertions, 9 deletions
diff --git a/plugins/uml/org.eclipse.papyrus.properties.uml/META-INF/MANIFEST.MF b/plugins/uml/org.eclipse.papyrus.properties.uml/META-INF/MANIFEST.MF
index 40ef7bd3bb8..c0a470b0ba6 100644
--- a/plugins/uml/org.eclipse.papyrus.properties.uml/META-INF/MANIFEST.MF
+++ b/plugins/uml/org.eclipse.papyrus.properties.uml/META-INF/MANIFEST.MF
@@ -16,10 +16,12 @@ Require-Bundle: org.eclipse.core.runtime,
org.eclipse.jface;bundle-version="3.6.1",
org.eclipse.core.databinding.property;bundle-version="1.3.0",
org.eclipse.papyrus.log;bundle-version="0.8.0",
- org.eclipse.ui;bundle-version="3.6.1"
+ org.eclipse.ui;bundle-version="3.6.1",
+ org.eclipse.papyrus.profile;bundle-version="0.8.0"
Bundle-RequiredExecutionEnvironment: J2SE-1.5
Bundle-Vendor: %Bundle-Vendor
Export-Package: org.eclipse.papyrus.properties.uml.constraints,
+ org.eclipse.papyrus.properties.uml.databinding,
org.eclipse.papyrus.properties.uml.modelelement,
org.eclipse.papyrus.properties.uml.util
Bundle-ActivationPolicy: lazy
diff --git a/plugins/uml/org.eclipse.papyrus.properties.uml/Model/LanguagePreferences.ecore b/plugins/uml/org.eclipse.papyrus.properties.uml/Model/LanguagePreferences.ecore
new file mode 100644
index 00000000000..9812add8b92
--- /dev/null
+++ b/plugins/uml/org.eclipse.papyrus.properties.uml/Model/LanguagePreferences.ecore
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ecore:EPackage xmi:version="2.0"
+ xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" name="languagepreferences"
+ nsURI="http://www.eclipse.org/papyrus/properties/uml/languagePreferences" nsPrefix="lgpref">
+ <eClassifiers xsi:type="ecore:EClass" name="Language">
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="name" lowerBound="1" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
+ <eStructuralFeatures xsi:type="ecore:EReference" name="preferedEditor" eType="#//Editor"/>
+ </eClassifiers>
+ <eClassifiers xsi:type="ecore:EClass" name="Editor">
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="class" lowerBound="1" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
+ </eClassifiers>
+ <eClassifiers xsi:type="ecore:EClass" name="Preferences">
+ <eStructuralFeatures xsi:type="ecore:EReference" name="languages" upperBound="-1"
+ eType="#//Language" containment="true"/>
+ <eStructuralFeatures xsi:type="ecore:EReference" name="editors" upperBound="-1"
+ eType="#//Editor" containment="true"/>
+ <eStructuralFeatures xsi:type="ecore:EReference" name="defaultEditor" lowerBound="1"
+ eType="#//Editor"/>
+ </eClassifiers>
+</ecore:EPackage>
diff --git a/plugins/uml/org.eclipse.papyrus.properties.uml/Model/LanguagePreferences.genmodel b/plugins/uml/org.eclipse.papyrus.properties.uml/Model/LanguagePreferences.genmodel
new file mode 100644
index 00000000000..ff992a15010
--- /dev/null
+++ b/plugins/uml/org.eclipse.papyrus.properties.uml/Model/LanguagePreferences.genmodel
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<genmodel:GenModel xmi:version="2.0"
+ xmlns:xmi="http://www.omg.org/XMI" xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore"
+ xmlns:genmodel="http://www.eclipse.org/emf/2002/GenModel" modelDirectory="/org.eclipse.papyrus.properties.uml/src"
+ modelPluginID="org.eclipse.papyrus.properties.uml" modelName="LanguagePreferences"
+ importerID="org.eclipse.emf.importer.ecore" complianceLevel="5.0" copyrightFields="false">
+ <foreignModel>LanguagePreferences.ecore</foreignModel>
+ <genPackages prefix="languagepreferences" basePackage="org.eclipse.papyrus.properties.uml"
+ disposableProviderFactory="true" ecorePackage="LanguagePreferences.ecore#/">
+ <genClasses ecoreClass="LanguagePreferences.ecore#//Language">
+ <genFeatures createChild="false" ecoreFeature="ecore:EAttribute LanguagePreferences.ecore#//Language/name"/>
+ <genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference LanguagePreferences.ecore#//Language/preferedEditor"/>
+ </genClasses>
+ <genClasses ecoreClass="LanguagePreferences.ecore#//Editor">
+ <genFeatures createChild="false" ecoreFeature="ecore:EAttribute LanguagePreferences.ecore#//Editor/class"/>
+ </genClasses>
+ <genClasses ecoreClass="LanguagePreferences.ecore#//Preferences">
+ <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference LanguagePreferences.ecore#//Preferences/languages"/>
+ <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference LanguagePreferences.ecore#//Preferences/editors"/>
+ <genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference LanguagePreferences.ecore#//Preferences/defaultEditor"/>
+ </genClasses>
+ </genPackages>
+</genmodel:GenModel>
diff --git a/plugins/uml/org.eclipse.papyrus.properties.uml/Model/UML/Environment.xmi b/plugins/uml/org.eclipse.papyrus.properties.uml/Model/UML/Environment.xmi
index 1be0989beef..6b19012a652 100644
--- a/plugins/uml/org.eclipse.papyrus.properties.uml/Model/UML/Environment.xmi
+++ b/plugins/uml/org.eclipse.papyrus.properties.uml/Model/UML/Environment.xmi
@@ -3,6 +3,10 @@
<modelElementFactories name="UML Specific Factory" factoryClass="org.eclipse.papyrus.properties.uml.modelelement.UMLEditorFactory"/>
<modelElementFactories name="UML Factory" factoryClass="org.eclipse.papyrus.properties.uml.modelelement.UMLModelElementFactory"/>
<modelElementFactories name="Stereotype Factory" factoryClass="org.eclipse.papyrus.properties.uml.modelelement.StereotypeModelElementFactory"/>
+ <modelElementFactories name="Stereotype Application Factory" factoryClass="org.eclipse.papyrus.properties.uml.modelelement.StereotypeApplicationFactory"/>
<constraintTypes label="UML Instance Of" constraintClass="org.eclipse.papyrus.properties.uml.constraints.UmlInstanceOfConstraint"/>
<constraintTypes label="Has Stereotype" constraintClass="org.eclipse.papyrus.properties.uml.constraints.HasStereotypeConstraint"/>
+ <propertyEditorTypes label="ExpressionEditor" widgetClass="ExpressionEditor" namespace="//@namespaces.0" multiplicity="-1"/>
+ <propertyEditorTypes label="Profile Application Editor" widgetClass="ProfileApplicationPropertyEditor" namespace="//@namespaces.0" type="Reference" multiplicity="-1"/>
+ <namespaces prefix="clr-namespace" name="uml" value="org.eclipse.papyrus.properties.uml.widgets"/>
</environment:Environment>
diff --git a/plugins/uml/org.eclipse.papyrus.properties.uml/build.properties b/plugins/uml/org.eclipse.papyrus.properties.uml/build.properties
index 466174efd73..f8a8575ee92 100644
--- a/plugins/uml/org.eclipse.papyrus.properties.uml/build.properties
+++ b/plugins/uml/org.eclipse.papyrus.properties.uml/build.properties
@@ -6,4 +6,6 @@ bin.includes = META-INF/,\
Model/,\
about.html,\
OSGI-INF/,\
- plugin.properties
+ plugin.properties,\
+ icons/,\
+ schema/
diff --git a/plugins/uml/org.eclipse.papyrus.properties.uml/icons/AddReg.gif b/plugins/uml/org.eclipse.papyrus.properties.uml/icons/AddReg.gif
new file mode 100644
index 00000000000..8493df40dfe
--- /dev/null
+++ b/plugins/uml/org.eclipse.papyrus.properties.uml/icons/AddReg.gif
Binary files differ
diff --git a/plugins/uml/org.eclipse.papyrus.properties.uml/plugin.properties b/plugins/uml/org.eclipse.papyrus.properties.uml/plugin.properties
index fc38b214043..15a43304c3c 100644
--- a/plugins/uml/org.eclipse.papyrus.properties.uml/plugin.properties
+++ b/plugins/uml/org.eclipse.papyrus.properties.uml/plugin.properties
@@ -6,3 +6,5 @@
pluginName = Papyrus properties UML (Incubation)
providerName = Eclipse Modeling Project
+
+extension-point.name = LanguageEditor \ No newline at end of file
diff --git a/plugins/uml/org.eclipse.papyrus.properties.uml/plugin.xml b/plugins/uml/org.eclipse.papyrus.properties.uml/plugin.xml
index 5cf5e4da158..66399c984e1 100644
--- a/plugins/uml/org.eclipse.papyrus.properties.uml/plugin.xml
+++ b/plugins/uml/org.eclipse.papyrus.properties.uml/plugin.xml
@@ -1,6 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<?eclipse version="3.4"?>
<plugin>
+ <extension-point id="org.eclipse.papyrus.properties.uml.languageEditor" name="%extension-point.name" schema="schema/org.eclipse.papyrus.properties.uml.languageEditor.exsd"/>
<extension
point="org.eclipse.ui.views.properties.tabbed.propertyContributor">
<propertyContributor
@@ -28,5 +29,31 @@
target="platform:/plugin/org.eclipse.papyrus.properties.uml/Model/UML/">
</mapping>
</extension>
+ <extension
+ point="org.eclipse.papyrus.properties.uml.languageEditor">
+ <editor
+ editor="org.eclipse.papyrus.properties.uml.widgets.NaturalLanguageEditor">
+ </editor>
+ <editor
+ editor="org.eclipse.papyrus.properties.uml.widgets.NaturalLanguageEditor"
+ language="C">
+ </editor>
+ <editor
+ editor="org.eclipse.papyrus.properties.uml.widgets.NaturalLanguageEditor"
+ language="C++">
+ </editor>
+ <editor
+ editor="org.eclipse.papyrus.properties.uml.widgets.NaturalLanguageEditor"
+ language="Java">
+ </editor>
+ <editor
+ editor="org.eclipse.papyrus.properties.uml.widgets.NaturalLanguageEditor"
+ language="Natural language">
+ </editor>
+ <editor
+ editor="org.eclipse.papyrus.properties.uml.widgets.NaturalLanguageEditor"
+ language="PHP">
+ </editor>
+ </extension>
</plugin>
diff --git a/plugins/uml/org.eclipse.papyrus.properties.uml/schema/org.eclipse.papyrus.properties.uml.languageEditor.exsd b/plugins/uml/org.eclipse.papyrus.properties.uml/schema/org.eclipse.papyrus.properties.uml.languageEditor.exsd
new file mode 100644
index 00000000000..ceb0e70afbb
--- /dev/null
+++ b/plugins/uml/org.eclipse.papyrus.properties.uml/schema/org.eclipse.papyrus.properties.uml.languageEditor.exsd
@@ -0,0 +1,109 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<!-- Schema file written by PDE -->
+<schema targetNamespace="org.eclipse.papyrus.properties.uml" xmlns="http://www.w3.org/2001/XMLSchema">
+<annotation>
+ <appinfo>
+ <meta.schema plugin="org.eclipse.papyrus.properties.uml" id="org.eclipse.papyrus.properties.uml.languageEditor" name="LanguageEditor"/>
+ </appinfo>
+ <documentation>
+ [Enter description of this extension point.]
+ </documentation>
+ </annotation>
+
+ <element name="extension">
+ <annotation>
+ <appinfo>
+ <meta.element />
+ </appinfo>
+ </annotation>
+ <complexType>
+ <sequence>
+ <element ref="editor" minOccurs="1" maxOccurs="unbounded"/>
+ </sequence>
+ <attribute name="point" type="string" use="required">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="id" type="string">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="name" type="string">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ <appinfo>
+ <meta.attribute translatable="true"/>
+ </appinfo>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <element name="editor">
+ <complexType>
+ <attribute name="language" type="string">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="editor" type="string" use="required">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ <appinfo>
+ <meta.attribute kind="java" basedOn=":org.eclipse.papyrus.properties.uml.widgets.BodyEditor"/>
+ </appinfo>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <annotation>
+ <appinfo>
+ <meta.section type="since"/>
+ </appinfo>
+ <documentation>
+ [Enter the first release in which this extension point appears.]
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appinfo>
+ <meta.section type="examples"/>
+ </appinfo>
+ <documentation>
+ [Enter extension point usage example here.]
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appinfo>
+ <meta.section type="apiinfo"/>
+ </appinfo>
+ <documentation>
+ [Enter API information here.]
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appinfo>
+ <meta.section type="implementation"/>
+ </appinfo>
+ <documentation>
+ [Enter information about supplied implementation of this extension point.]
+ </documentation>
+ </annotation>
+
+
+</schema>
diff --git a/plugins/uml/org.eclipse.papyrus.properties.uml/src/org/eclipse/papyrus/properties/uml/Activator.java b/plugins/uml/org.eclipse.papyrus.properties.uml/src/org/eclipse/papyrus/properties/uml/Activator.java
index 042087ebb13..ad14d163c58 100644
--- a/plugins/uml/org.eclipse.papyrus.properties.uml/src/org/eclipse/papyrus/properties/uml/Activator.java
+++ b/plugins/uml/org.eclipse.papyrus.properties.uml/src/org/eclipse/papyrus/properties/uml/Activator.java
@@ -11,7 +11,11 @@
*****************************************************************************/
package org.eclipse.papyrus.properties.uml;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.jface.resource.ImageRegistry;
import org.eclipse.papyrus.log.LogHelper;
+import org.eclipse.papyrus.properties.uml.extensionpoint.LanguageEditorExtensionPoint;
+import org.eclipse.swt.graphics.Image;
import org.eclipse.ui.plugin.AbstractUIPlugin;
import org.osgi.framework.BundleContext;
@@ -21,7 +25,7 @@ import org.osgi.framework.BundleContext;
public class Activator extends AbstractUIPlugin {
/** The plug-in ID */
- public static final String PLUGIN_ID = "org.eclipse.papyrus.properties"; //$NON-NLS-1$
+ public static final String PLUGIN_ID = "org.eclipse.papyrus.properties.uml"; //$NON-NLS-1$
// The shared instance
private static Activator plugin;
@@ -45,6 +49,7 @@ public class Activator extends AbstractUIPlugin {
super.start(context);
plugin = this;
log = new LogHelper(plugin);
+ new LanguageEditorExtensionPoint();
}
/*
@@ -66,4 +71,44 @@ public class Activator extends AbstractUIPlugin {
public static Activator getDefault() {
return plugin;
}
+
+ /**
+ * @return The IPath representing the plugin's preferences folder location
+ */
+ public IPath getPreferencesPath() {
+ return getStateLocation();
+ }
+
+ /**
+ * Returns the image at the given path from this plugin
+ *
+ * @param path
+ * the path of the image to be displayed
+ * @return The Image at the given location, or null if it couldn't be found
+ */
+ public Image getImage(String path) {
+ return getImage(PLUGIN_ID, path);
+ }
+
+ /**
+ * Returns the image from the given image descriptor
+ *
+ * @param pluginId
+ * The plugin in which the image is located
+ * @param path
+ * The path to the image from the plugin
+ * @return
+ * The Image at the given location, or null if it couldn't be found
+ */
+ public Image getImage(String pluginId, String path) {
+ final ImageRegistry registry = getImageRegistry();
+ String key = pluginId + "/" + path;
+ Image image = registry.get(key);
+ if(image == null) {
+ registry.put(key, AbstractUIPlugin.imageDescriptorFromPlugin(pluginId, path));
+ image = registry.get(key);
+ }
+ return image;
+ }
+
}
diff --git a/plugins/uml/org.eclipse.papyrus.properties.uml/src/org/eclipse/papyrus/properties/uml/creation/ExpressionLanguageFactory.java b/plugins/uml/org.eclipse.papyrus.properties.uml/src/org/eclipse/papyrus/properties/uml/creation/ExpressionLanguageFactory.java
new file mode 100644
index 00000000000..50e75db961f
--- /dev/null
+++ b/plugins/uml/org.eclipse.papyrus.properties.uml/src/org/eclipse/papyrus/properties/uml/creation/ExpressionLanguageFactory.java
@@ -0,0 +1,73 @@
+/*****************************************************************************
+ * Copyright (c) 2011 CEA LIST.
+ *
+ * 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:
+ * Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Initial API and implementation
+ *****************************************************************************/
+package org.eclipse.papyrus.properties.uml.creation;
+
+import java.util.List;
+
+import org.eclipse.jface.dialogs.IInputValidator;
+import org.eclipse.papyrus.properties.uml.expression.ExpressionList.Expression;
+import org.eclipse.papyrus.widgets.creation.StringEditionFactory;
+import org.eclipse.swt.widgets.Control;
+
+
+public class ExpressionLanguageFactory extends StringEditionFactory {
+
+ private UniqueElementValidator validator;
+
+ private List<?> expressionList;
+
+ public ExpressionLanguageFactory(List<?> currentExpressionList) {
+ super("Edit language", "Set the new language");
+
+ validator = new UniqueElementValidator();
+ this.expressionList = currentExpressionList;
+
+ setValidator(validator);
+ }
+
+ private class UniqueElementValidator implements IInputValidator {
+
+ private String currentValue;
+
+ public void setCurrentValue(String currentValue) {
+ this.currentValue = currentValue;
+ }
+
+ public String isValid(String newText) {
+ if(newText.equals(currentValue))
+ return null;
+
+ for(Object object : expressionList) {
+ if(object instanceof Expression) {
+ Expression expression = (Expression)object;
+ if(newText.equals(expression.getLanguage())) {
+ return "The same language cannot be used more than once";
+ }
+ }
+ }
+
+ return null;
+ }
+ }
+
+ @Override
+ public Object edit(Control widget, Object currentValue) {
+ if(currentValue instanceof Expression) {
+ String valueToEdit = ((Expression)currentValue).getLanguage();
+ validator.setCurrentValue(valueToEdit);
+ String newValue = (String)super.edit(widget, valueToEdit);
+ ((Expression)currentValue).setLanguage(newValue);
+ }
+
+ return currentValue;
+ }
+}
diff --git a/plugins/uml/org.eclipse.papyrus.properties.uml/src/org/eclipse/papyrus/properties/uml/databinding/PapyrusObservableList.java b/plugins/uml/org.eclipse.papyrus.properties.uml/src/org/eclipse/papyrus/properties/uml/databinding/PapyrusObservableList.java
new file mode 100644
index 00000000000..8120fc6cc4b
--- /dev/null
+++ b/plugins/uml/org.eclipse.papyrus.properties.uml/src/org/eclipse/papyrus/properties/uml/databinding/PapyrusObservableList.java
@@ -0,0 +1,194 @@
+/*****************************************************************************
+ * Copyright (c) 2010 CEA LIST.
+ *
+ * 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:
+ * Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Initial API and implementation
+ *****************************************************************************/
+package org.eclipse.papyrus.properties.uml.databinding;
+
+import java.util.Collection;
+import java.util.Collections;
+import java.util.LinkedList;
+import java.util.List;
+
+import org.eclipse.emf.common.command.Command;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EStructuralFeature;
+import org.eclipse.emf.edit.domain.EditingDomain;
+import org.eclipse.gmf.runtime.common.core.command.ICommand;
+import org.eclipse.gmf.runtime.emf.type.core.requests.SetRequest;
+import org.eclipse.papyrus.diagram.common.command.wrappers.GMFtoEMFCommandWrapper;
+import org.eclipse.papyrus.properties.databinding.EMFObservableList;
+import org.eclipse.papyrus.service.edit.service.ElementEditServiceUtils;
+import org.eclipse.papyrus.service.edit.service.IElementEditService;
+import org.eclipse.papyrus.widgets.editors.ICommitListener;
+
+/**
+ * An ObservableList used to edit collections of EObjects through
+ * Papyrus commands
+ *
+ * @author Camille Letavernier
+ *
+ */
+@SuppressWarnings("unchecked")
+public class PapyrusObservableList extends EMFObservableList implements ICommitListener {
+
+ /**
+ *
+ * Constructor.
+ *
+ * @param wrappedList
+ * The list to be edited when #commit() is called
+ * @param domain
+ * The editing domain on which the commands will be executed
+ * @param source
+ * The EObject from which the list will be retrieved
+ * @param feature
+ * The feature from which the list will be retrieved
+ */
+ public PapyrusObservableList(List<?> wrappedList, EditingDomain domain, EObject source, EStructuralFeature feature) {
+ super(wrappedList, domain, source, feature);
+ }
+
+ protected IElementEditService getProvider() {
+ return ElementEditServiceUtils.getCommandProvider(source);
+ }
+
+ protected Command getCommandFromRequest(IElementEditService provider, SetRequest request) {
+ ICommand createGMFCommand = provider.getEditCommand(request);
+
+ return new GMFtoEMFCommandWrapper(createGMFCommand);
+ }
+
+ @Override
+ protected Command getAddCommand(int index, Object value) {
+ IElementEditService provider = getProvider();
+ if(provider != null) {
+ List<Object> values = new LinkedList<Object>(this);
+ values.add(index, value);
+ SetRequest request = new SetRequest(source, feature, values);
+ return getCommandFromRequest(provider, request);
+ }
+
+ return super.getAddCommand(index, value);
+ }
+
+ @Override
+ protected Command getAddCommand(Object value) {
+ IElementEditService provider = getProvider();
+ if(provider != null) {
+ List<Object> values = new LinkedList<Object>(this);
+ values.add(value);
+ SetRequest request = new SetRequest(source, feature, values);
+ return getCommandFromRequest(provider, request);
+ }
+
+ return super.getAddCommand(value);
+ }
+
+ @Override
+ protected Command getAddAllCommand(Collection<?> values) {
+ IElementEditService provider = getProvider();
+ if(provider != null) {
+ List<Object> result = new LinkedList<Object>(this);
+ result.addAll(values);
+
+ SetRequest request = new SetRequest(source, feature, values);
+ return getCommandFromRequest(provider, request);
+ }
+
+ return super.getAddAllCommand(values);
+ }
+
+ @Override
+ protected Command getAddAllCommand(int index, Collection<?> values) {
+ IElementEditService provider = getProvider();
+ if(provider != null) {
+ List<Object> result = new LinkedList<Object>(this);
+ result.addAll(index, values);
+ SetRequest request = new SetRequest(source, feature, values);
+ return getCommandFromRequest(provider, request);
+ }
+ return super.getAddAllCommand(index, values);
+ }
+
+ @Override
+ protected Command getClearCommand() {
+ IElementEditService provider = getProvider();
+ if(provider != null) {
+ SetRequest request = new SetRequest(source, feature, Collections.EMPTY_LIST);
+ return getCommandFromRequest(provider, request);
+ }
+ return super.getClearCommand();
+ }
+
+ @Override
+ protected Command getRemoveCommand(int index) {
+ IElementEditService provider = getProvider();
+ if(provider != null) {
+ List<Object> values = new LinkedList<Object>(this);
+ values.remove(index);
+ SetRequest request = new SetRequest(source, feature, values);
+ return getCommandFromRequest(provider, request);
+ }
+
+ return null;
+ }
+
+ @Override
+ protected Command getRemoveCommand(Object value) {
+ IElementEditService provider = getProvider();
+ if(provider != null) {
+ List<Object> values = new LinkedList<Object>(this);
+ values.remove(value);
+ SetRequest request = new SetRequest(source, feature, values);
+ return getCommandFromRequest(provider, request);
+ }
+
+ return super.getRemoveCommand(value);
+ }
+
+ @Override
+ protected Command getRemoveAllCommand(Collection<?> values) {
+ IElementEditService provider = getProvider();
+ if(provider != null) {
+ List<Object> result = new LinkedList<Object>(this);
+ values.removeAll(values);
+ SetRequest request = new SetRequest(source, feature, result);
+ return getCommandFromRequest(provider, request);
+ }
+ return super.getRemoveAllCommand(values);
+ }
+
+ @Override
+ protected List<Command> getMoveCommands(int oldIndex, int newIndex) {
+ IElementEditService provider = getProvider();
+ if(provider != null) {
+ List<Object> values = new LinkedList<Object>(this);
+ Object result = values.remove(oldIndex);
+ values.add(newIndex, result);
+ SetRequest request = new SetRequest(source, feature, values);
+ return Collections.singletonList(getCommandFromRequest(provider, request));
+ }
+
+ return super.getMoveCommands(oldIndex, newIndex);
+ }
+
+ @Override
+ protected Command getSetCommand(int index, Object value) {
+ IElementEditService provider = getProvider();
+ if(provider != null) {
+ List<Object> values = new LinkedList<Object>(this);
+ values.set(index, value);
+ SetRequest request = new SetRequest(source, feature, values);
+ return getCommandFromRequest(provider, request);
+ }
+
+ return super.getSetCommand(index, value);
+ }
+}
diff --git a/plugins/uml/org.eclipse.papyrus.properties.uml/src/org/eclipse/papyrus/properties/uml/databinding/PapyrusObservableValue.java b/plugins/uml/org.eclipse.papyrus.properties.uml/src/org/eclipse/papyrus/properties/uml/databinding/PapyrusObservableValue.java
new file mode 100644
index 00000000000..699814d34da
--- /dev/null
+++ b/plugins/uml/org.eclipse.papyrus.properties.uml/src/org/eclipse/papyrus/properties/uml/databinding/PapyrusObservableValue.java
@@ -0,0 +1,87 @@
+/*****************************************************************************
+ * Copyright (c) 2010 CEA LIST.
+ *
+ * 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:
+ * Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Initial API and implementation
+ *****************************************************************************/
+package org.eclipse.papyrus.properties.uml.databinding;
+
+import org.eclipse.core.databinding.observable.Realm;
+import org.eclipse.emf.common.command.Command;
+import org.eclipse.emf.databinding.EObjectObservableValue;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EStructuralFeature;
+import org.eclipse.emf.edit.domain.EditingDomain;
+import org.eclipse.gmf.runtime.common.core.command.ICommand;
+import org.eclipse.gmf.runtime.emf.type.core.requests.SetRequest;
+import org.eclipse.papyrus.diagram.common.command.wrappers.GMFtoEMFCommandWrapper;
+import org.eclipse.papyrus.properties.Activator;
+import org.eclipse.papyrus.service.edit.service.ElementEditServiceUtils;
+import org.eclipse.papyrus.service.edit.service.IElementEditService;
+
+/**
+ * An ObservableValue used to edit EObject properties through
+ * Papyrus commands
+ *
+ * @author Camille Letavernier
+ *
+ */
+public class PapyrusObservableValue extends EObjectObservableValue {
+
+ protected EditingDomain domain;
+
+ /**
+ *
+ * Constructor.
+ *
+ * @param eObject
+ * The EObject to edit
+ * @param eStructuralFeature
+ * The structural feature to edit
+ * @param domain
+ * The editing domain on which the commands will be executed
+ */
+ public PapyrusObservableValue(EObject eObject, EStructuralFeature eStructuralFeature, EditingDomain domain) {
+ this(Realm.getDefault(), eObject, eStructuralFeature, domain);
+ }
+
+ /**
+ *
+ * Constructor.
+ *
+ * @param realm
+ * @param eObject
+ * The EObject to edit
+ * @param eStructuralFeature
+ * The structural feature to edit
+ * @param domain
+ * The editing domain on which the commands will be executed
+ */
+ public PapyrusObservableValue(Realm realm, EObject eObject, EStructuralFeature eStructuralFeature, EditingDomain domain) {
+ super(realm, eObject, eStructuralFeature);
+ this.domain = domain;
+ }
+
+ @Override
+ protected void doSetValue(Object value) {
+ try {
+ IElementEditService provider = ElementEditServiceUtils.getCommandProvider(getObserved());
+
+ if(provider != null) {
+ SetRequest request = new SetRequest(eObject, eStructuralFeature, value);
+ ICommand createGMFCommand = provider.getEditCommand(request);
+
+ Command emfCommand = new GMFtoEMFCommandWrapper(createGMFCommand);
+
+ domain.getCommandStack().execute(emfCommand);
+ }
+ } catch (Exception ex) {
+ Activator.log.error(ex);
+ }
+ }
+}
diff --git a/plugins/uml/org.eclipse.papyrus.properties.uml/src/org/eclipse/papyrus/properties/uml/databinding/ProfileApplicationObservableList.java b/plugins/uml/org.eclipse.papyrus.properties.uml/src/org/eclipse/papyrus/properties/uml/databinding/ProfileApplicationObservableList.java
new file mode 100644
index 00000000000..100eab1cb63
--- /dev/null
+++ b/plugins/uml/org.eclipse.papyrus.properties.uml/src/org/eclipse/papyrus/properties/uml/databinding/ProfileApplicationObservableList.java
@@ -0,0 +1,197 @@
+/*****************************************************************************
+ * Copyright (c) 2011 CEA LIST.
+ *
+ * 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:
+ * Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Initial API and implementation
+ *****************************************************************************/
+package org.eclipse.papyrus.properties.uml.databinding;
+
+import java.util.Collection;
+import java.util.LinkedList;
+import java.util.List;
+
+import org.eclipse.core.databinding.observable.list.WritableList;
+import org.eclipse.emf.common.command.Command;
+import org.eclipse.emf.common.command.CompoundCommand;
+import org.eclipse.emf.edit.domain.EditingDomain;
+import org.eclipse.papyrus.properties.uml.databinding.command.ApplyProfileCommand;
+import org.eclipse.papyrus.properties.uml.databinding.command.UnapplyProfileCommand;
+import org.eclipse.papyrus.widgets.editors.AbstractEditor;
+import org.eclipse.papyrus.widgets.editors.ICommitListener;
+import org.eclipse.uml2.uml.Package;
+import org.eclipse.uml2.uml.Profile;
+
+@SuppressWarnings({ "unchecked", "rawtypes" })
+public class ProfileApplicationObservableList extends WritableList implements ICommitListener {
+
+ private Package umlSource;
+
+ private EditingDomain domain;
+
+ private final List<Command> commands;
+
+ public ProfileApplicationObservableList(Package umlSource, EditingDomain domain) {
+ super(new LinkedList<Object>(umlSource.getAllAppliedProfiles()), Profile.class);
+ this.umlSource = umlSource;
+ this.domain = domain;
+ commands = new LinkedList<Command>();
+ }
+
+ public void commit(AbstractEditor editor) {
+ if(commands.isEmpty()) {
+ return;
+ }
+
+ CompoundCommand compoundCommand = new CompoundCommand() {
+
+ @Override
+ public void execute() {
+ super.execute();
+ refreshCacheList();
+ }
+
+ @Override
+ public void undo() {
+ super.undo();
+ refreshCacheList();
+ }
+
+ @Override
+ public void redo() {
+ super.redo();
+ refreshCacheList();
+ }
+
+ /**
+ * We have a sequential execution : the method canExecute() in
+ * the command n+1 depends on the result of the command n. We can't
+ * check every command's canExecute() method here, so we only
+ * check the first one.
+ *
+ */
+ @Override
+ public boolean canExecute() {
+ return commandList.isEmpty() ? false : commandList.get(0).canExecute();
+ }
+
+ //TODO : edit the execute() method to call the remaining canExecute() checks
+ //during the execution
+ //(n).canExecute()
+ //(n).execute()
+ //(n+1).canExecute()
+ //(n+1).execute()
+ };
+
+ for(Command cmd : commands) {
+ compoundCommand.append(cmd);
+ }
+
+ domain.getCommandStack().execute(compoundCommand);
+ commands.clear();
+ }
+
+ private void refreshCacheList() {
+ wrappedList.clear();
+ wrappedList.addAll(umlSource.getAllAppliedProfiles());
+ fireListChange(null);
+ }
+
+ @Override
+ public void clear() {
+ removeAll(new LinkedList<Object>(wrappedList));
+ }
+
+ @Override
+ public boolean add(Object o) {
+ if(!(o instanceof Profile)) {
+ return false;
+ }
+
+ Profile profile = (Profile)o;
+ Command command = new ApplyProfileCommand(umlSource, profile);
+
+ commands.add(command);
+
+ return wrappedList.add(o);
+ }
+
+ @Override
+ public boolean remove(Object o) {
+
+ if(!(o instanceof Profile)) {
+ return false;
+ }
+
+ final Profile profile = (Profile)o;
+ Command command = new UnapplyProfileCommand(umlSource, profile);
+
+ commands.add(command);
+
+ return wrappedList.remove(o);
+ }
+
+ @Override
+ public boolean addAll(Collection c) {
+ //We only apply the profiles that are not applied yet (To avoid removing them when undo is called)
+ c.removeAll(wrappedList);
+
+ Command command = new ApplyProfileCommand(umlSource, c);
+
+ commands.add(command);
+
+ return wrappedList.addAll(c);
+ }
+
+ @Override
+ public boolean removeAll(Collection c) {
+ Command command = new UnapplyProfileCommand(umlSource, c);
+
+ commands.add(command);
+
+ return wrappedList.removeAll(c);
+ }
+
+ @Override
+ public boolean retainAll(Collection c) {
+ List<Object> objectsToRemove = new LinkedList<Object>();
+ for(Object object : c) {
+ if(!contains(object)) {
+ objectsToRemove.add(object);
+ }
+ }
+ return removeAll(objectsToRemove);
+ }
+
+
+ //Unsupported operations. Some of them have a "proxy" implementation
+ @Override
+ public void add(int index, Object value) {
+ add(value); //The list is not ordered
+ }
+
+ @Override
+ public boolean addAll(int index, Collection c) {
+ return addAll(c); //The list is not ordered
+ }
+
+ @Override
+ public Object set(int index, Object element) {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public Object move(int oldIndex, int newIndex) {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public Object remove(int index) {
+ throw new UnsupportedOperationException();
+ }
+
+}
diff --git a/plugins/uml/org.eclipse.papyrus.properties.uml/src/org/eclipse/papyrus/properties/uml/databinding/StereotypeApplicationObservableList.java b/plugins/uml/org.eclipse.papyrus.properties.uml/src/org/eclipse/papyrus/properties/uml/databinding/StereotypeApplicationObservableList.java
new file mode 100644
index 00000000000..726c3556910
--- /dev/null
+++ b/plugins/uml/org.eclipse.papyrus.properties.uml/src/org/eclipse/papyrus/properties/uml/databinding/StereotypeApplicationObservableList.java
@@ -0,0 +1,197 @@
+/*****************************************************************************
+ * Copyright (c) 2011 CEA LIST.
+ *
+ * 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:
+ * Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Initial API and implementation
+ *****************************************************************************/
+package org.eclipse.papyrus.properties.uml.databinding;
+
+import java.util.Collection;
+import java.util.LinkedList;
+import java.util.List;
+
+import org.eclipse.core.databinding.observable.list.WritableList;
+import org.eclipse.emf.common.command.Command;
+import org.eclipse.emf.common.command.CompoundCommand;
+import org.eclipse.emf.edit.domain.EditingDomain;
+import org.eclipse.papyrus.properties.uml.databinding.command.ApplyStereotypeCommand;
+import org.eclipse.papyrus.properties.uml.databinding.command.UnapplyStereotypeCommand;
+import org.eclipse.papyrus.widgets.editors.AbstractEditor;
+import org.eclipse.papyrus.widgets.editors.ICommitListener;
+import org.eclipse.uml2.uml.Element;
+import org.eclipse.uml2.uml.Stereotype;
+
+@SuppressWarnings({ "unchecked", "rawtypes" })
+public class StereotypeApplicationObservableList extends WritableList implements ICommitListener {
+
+ private Element umlSource;
+
+ private EditingDomain domain;
+
+ private final List<Command> commands;
+
+ public StereotypeApplicationObservableList(Element umlSource, EditingDomain domain) {
+ super(new LinkedList<Object>(umlSource.getAppliedStereotypes()), Stereotype.class);
+ this.umlSource = umlSource;
+ this.domain = domain;
+ commands = new LinkedList<Command>();
+ }
+
+ public void commit(AbstractEditor editor) {
+ if(commands.isEmpty()) {
+ return;
+ }
+
+ CompoundCommand compoundCommand = new CompoundCommand() {
+
+ @Override
+ public void execute() {
+ super.execute();
+ refreshCacheList();
+ }
+
+ @Override
+ public void undo() {
+ super.undo();
+ refreshCacheList();
+ }
+
+ @Override
+ public void redo() {
+ super.redo();
+ refreshCacheList();
+ }
+
+ /**
+ * We have a sequential execution : the method canExecute() in
+ * the command n+1 depends on the result of the command n. We can't
+ * check every command's canExecute() method here, so we only
+ * check the first one.
+ *
+ */
+ @Override
+ public boolean canExecute() {
+ return commandList.isEmpty() ? false : commandList.get(0).canExecute();
+ }
+
+ //TODO : edit the execute() method to call the remaining canExecute() checks
+ //during the execution
+ //(n).canExecute()
+ //(n).execute()
+ //(n+1).canExecute()
+ //(n+1).execute()
+ };
+
+ for(Command cmd : commands) {
+ compoundCommand.append(cmd);
+ }
+
+ domain.getCommandStack().execute(compoundCommand);
+ commands.clear();
+ }
+
+ private void refreshCacheList() {
+ wrappedList.clear();
+ wrappedList.addAll(umlSource.getAppliedStereotypes());
+ fireListChange(null);
+ }
+
+ @Override
+ public void clear() {
+ removeAll(new LinkedList<Object>(wrappedList));
+ }
+
+ @Override
+ public boolean add(Object o) {
+
+ if(!(o instanceof Stereotype)) {
+ return false;
+ }
+ Stereotype stereotype = (Stereotype)o;
+ Command command = new ApplyStereotypeCommand(umlSource, stereotype);
+
+ commands.add(command);
+
+ return wrappedList.add(o);
+ }
+
+ @Override
+ public boolean remove(Object o) {
+
+ if(!(o instanceof Stereotype)) {
+ return false;
+ }
+
+ final Stereotype stereotype = (Stereotype)o;
+ Command command = new UnapplyStereotypeCommand(umlSource, stereotype);
+
+
+ commands.add(command);
+
+ return wrappedList.remove(o);
+ }
+
+ @Override
+ public boolean addAll(Collection c) {
+ //We only apply the stereotypes that are not applied yet (To avoid removing them when undo is called)
+ c.removeAll(wrappedList);
+
+ Command command = new ApplyStereotypeCommand(umlSource, c);
+
+ commands.add(command);
+
+ return wrappedList.addAll(c);
+ }
+
+ @Override
+ public boolean removeAll(Collection c) {
+ Command command = new UnapplyStereotypeCommand(umlSource, c);
+
+ commands.add(command);
+
+ return wrappedList.removeAll(c);
+ }
+
+ @Override
+ public boolean retainAll(Collection c) {
+ List<Object> objectsToRemove = new LinkedList<Object>();
+ for(Object object : c) {
+ if(!contains(object)) {
+ objectsToRemove.add(object);
+ }
+ }
+ return removeAll(objectsToRemove);
+ }
+
+
+ //Unsupported operations. Some of them have a "proxy" implementation
+ @Override
+ public void add(int index, Object value) {
+ add(value); //The list is not ordered
+ }
+
+ @Override
+ public boolean addAll(int index, Collection c) {
+ return addAll(c); //The list is not ordered
+ }
+
+ @Override
+ public Object set(int index, Object element) {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public Object move(int oldIndex, int newIndex) {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public Object remove(int index) {
+ throw new UnsupportedOperationException();
+ }
+}
diff --git a/plugins/uml/org.eclipse.papyrus.properties.uml/src/org/eclipse/papyrus/properties/uml/databinding/command/ApplyProfileCommand.java b/plugins/uml/org.eclipse.papyrus.properties.uml/src/org/eclipse/papyrus/properties/uml/databinding/command/ApplyProfileCommand.java
new file mode 100644
index 00000000000..7c178aa1980
--- /dev/null
+++ b/plugins/uml/org.eclipse.papyrus.properties.uml/src/org/eclipse/papyrus/properties/uml/databinding/command/ApplyProfileCommand.java
@@ -0,0 +1,65 @@
+/*****************************************************************************
+ * Copyright (c) 2011 CEA LIST.
+ *
+ * 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:
+ * Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Initial API and implementation
+ *****************************************************************************/
+package org.eclipse.papyrus.properties.uml.databinding.command;
+
+import java.util.Collection;
+import java.util.Collections;
+
+import org.eclipse.emf.common.command.AbstractCommand;
+import org.eclipse.uml2.uml.Package;
+import org.eclipse.uml2.uml.Profile;
+
+
+public class ApplyProfileCommand extends AbstractCommand {
+
+ private Package umlPackage;
+
+ private Collection<Profile> profiles;
+
+ public ApplyProfileCommand(Package umlPackage, Collection<Profile> profiles) {
+ this.umlPackage = umlPackage;
+ this.profiles = profiles;
+ }
+
+ public ApplyProfileCommand(Package umlPackage, Profile profile) {
+ this.umlPackage = umlPackage;
+ this.profiles = Collections.singletonList(profile);
+ }
+
+ @Override
+ public boolean canExecute() {
+ return true;
+ }
+
+ public void execute() {
+ for(Profile profile : profiles) {
+ umlPackage.applyProfile(profile);
+ }
+ }
+
+ @Override
+ public boolean canUndo() {
+ return true;
+ }
+
+ @Override
+ public void undo() {
+ for(Profile profile : profiles) {
+ umlPackage.unapplyProfile(profile);
+ }
+ }
+
+ public void redo() {
+ execute();
+ }
+
+}
diff --git a/plugins/uml/org.eclipse.papyrus.properties.uml/src/org/eclipse/papyrus/properties/uml/databinding/command/ApplyStereotypeCommand.java b/plugins/uml/org.eclipse.papyrus.properties.uml/src/org/eclipse/papyrus/properties/uml/databinding/command/ApplyStereotypeCommand.java
new file mode 100644
index 00000000000..a7f6577bd28
--- /dev/null
+++ b/plugins/uml/org.eclipse.papyrus.properties.uml/src/org/eclipse/papyrus/properties/uml/databinding/command/ApplyStereotypeCommand.java
@@ -0,0 +1,65 @@
+/*****************************************************************************
+ * Copyright (c) 2011 CEA LIST.
+ *
+ * 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:
+ * Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Initial API and implementation
+ *****************************************************************************/
+package org.eclipse.papyrus.properties.uml.databinding.command;
+
+import java.util.Collection;
+import java.util.Collections;
+
+import org.eclipse.emf.common.command.AbstractCommand;
+import org.eclipse.uml2.uml.Element;
+import org.eclipse.uml2.uml.Stereotype;
+
+
+public class ApplyStereotypeCommand extends AbstractCommand {
+
+ private Element element;
+
+ private Collection<Stereotype> stereotypes;
+
+ public ApplyStereotypeCommand(Element element, Collection<Stereotype> stereotypes) {
+ this.element = element;
+ this.stereotypes = stereotypes;
+ }
+
+ public ApplyStereotypeCommand(Element element, Stereotype stereotype) {
+ this.element = element;
+ this.stereotypes = Collections.singletonList(stereotype);
+ }
+
+ @Override
+ public boolean canExecute() {
+ return true;
+ }
+
+ public void execute() {
+ for(Stereotype stereotype : stereotypes) {
+ element.applyStereotype(stereotype);
+ }
+ }
+
+ @Override
+ public boolean canUndo() {
+ return true;
+ }
+
+ @Override
+ public void undo() {
+ for(Stereotype stereotype : stereotypes) {
+ element.unapplyStereotype(stereotype);
+ }
+ }
+
+ public void redo() {
+ execute();
+ }
+
+}
diff --git a/plugins/uml/org.eclipse.papyrus.properties.uml/src/org/eclipse/papyrus/properties/uml/databinding/command/UnapplyProfileCommand.java b/plugins/uml/org.eclipse.papyrus.properties.uml/src/org/eclipse/papyrus/properties/uml/databinding/command/UnapplyProfileCommand.java
new file mode 100644
index 00000000000..6af1c3ca948
--- /dev/null
+++ b/plugins/uml/org.eclipse.papyrus.properties.uml/src/org/eclipse/papyrus/properties/uml/databinding/command/UnapplyProfileCommand.java
@@ -0,0 +1,64 @@
+/*****************************************************************************
+ * Copyright (c) 2011 CEA LIST.
+ *
+ * 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:
+ * Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Initial API and implementation
+ *****************************************************************************/
+package org.eclipse.papyrus.properties.uml.databinding.command;
+
+import java.util.Collection;
+import java.util.Collections;
+
+import org.eclipse.emf.common.command.AbstractCommand;
+import org.eclipse.uml2.uml.Package;
+import org.eclipse.uml2.uml.Profile;
+
+
+public class UnapplyProfileCommand extends AbstractCommand {
+
+ private Package umlPackage;
+
+ private Collection<Profile> profiles;
+
+ public UnapplyProfileCommand(Package umlPackage, Collection<Profile> profiles) {
+ this.umlPackage = umlPackage;
+ this.profiles = profiles;
+ }
+
+ public UnapplyProfileCommand(Package umlPackage, Profile profile) {
+ this.umlPackage = umlPackage;
+ this.profiles = Collections.singletonList(profile);
+ }
+
+ @Override
+ public boolean canExecute() {
+ return true;
+ }
+
+ public void execute() {
+ for(Profile profile : profiles) {
+ umlPackage.unapplyProfile(profile);
+ }
+ }
+
+ @Override
+ public boolean canUndo() {
+ return true;
+ }
+
+ @Override
+ public void undo() {
+ for(Profile profile : profiles) {
+ umlPackage.applyProfile(profile);
+ }
+ }
+
+ public void redo() {
+ execute();
+ }
+}
diff --git a/plugins/uml/org.eclipse.papyrus.properties.uml/src/org/eclipse/papyrus/properties/uml/databinding/command/UnapplyStereotypeCommand.java b/plugins/uml/org.eclipse.papyrus.properties.uml/src/org/eclipse/papyrus/properties/uml/databinding/command/UnapplyStereotypeCommand.java
new file mode 100644
index 00000000000..2dc32396421
--- /dev/null
+++ b/plugins/uml/org.eclipse.papyrus.properties.uml/src/org/eclipse/papyrus/properties/uml/databinding/command/UnapplyStereotypeCommand.java
@@ -0,0 +1,65 @@
+/*****************************************************************************
+ * Copyright (c) 2011 CEA LIST.
+ *
+ * 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:
+ * Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Initial API and implementation
+ *****************************************************************************/
+package org.eclipse.papyrus.properties.uml.databinding.command;
+
+import java.util.Collection;
+import java.util.Collections;
+
+import org.eclipse.emf.common.command.AbstractCommand;
+import org.eclipse.uml2.uml.Element;
+import org.eclipse.uml2.uml.Stereotype;
+
+
+public class UnapplyStereotypeCommand extends AbstractCommand {
+
+ private Element element;
+
+ private Collection<Stereotype> stereotypes;
+
+ public UnapplyStereotypeCommand(Element element, Collection<Stereotype> stereotypes) {
+ this.element = element;
+ this.stereotypes = stereotypes;
+ }
+
+ public UnapplyStereotypeCommand(Element element, Stereotype stereotype) {
+ this.element = element;
+ this.stereotypes = Collections.singletonList(stereotype);
+ }
+
+ @Override
+ public boolean canExecute() {
+ return true;
+ }
+
+ public void execute() {
+ for(Stereotype stereotype : stereotypes) {
+ element.unapplyStereotype(stereotype);
+ }
+ }
+
+ @Override
+ public boolean canUndo() {
+ return true;
+ }
+
+ @Override
+ public void undo() {
+ for(Stereotype stereotype : stereotypes) {
+ element.applyStereotype(stereotype);
+ }
+ }
+
+ public void redo() {
+ execute();
+ }
+
+}
diff --git a/plugins/uml/org.eclipse.papyrus.properties.uml/src/org/eclipse/papyrus/properties/uml/expression/ExpressionList.java b/plugins/uml/org.eclipse.papyrus.properties.uml/src/org/eclipse/papyrus/properties/uml/expression/ExpressionList.java
new file mode 100644
index 00000000000..ae766660d19
--- /dev/null
+++ b/plugins/uml/org.eclipse.papyrus.properties.uml/src/org/eclipse/papyrus/properties/uml/expression/ExpressionList.java
@@ -0,0 +1,206 @@
+/*****************************************************************************
+ * Copyright (c) 2011 CEA LIST.
+ *
+ * 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:
+ * Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Initial API and implementation
+ *****************************************************************************/
+package org.eclipse.papyrus.properties.uml.expression;
+
+import java.util.Iterator;
+import java.util.LinkedList;
+import java.util.List;
+
+import org.eclipse.core.databinding.observable.ChangeEvent;
+import org.eclipse.core.databinding.observable.IChangeListener;
+import org.eclipse.core.databinding.observable.list.IObservableList;
+import org.eclipse.core.databinding.observable.list.WritableList;
+import org.eclipse.papyrus.widgets.editors.AbstractEditor;
+import org.eclipse.papyrus.widgets.editors.ICommitListener;
+
+
+public class ExpressionList extends WritableList implements IChangeListener, ICommitListener {
+
+ private List<Expression> expressions;
+
+ private IObservableList languages;
+
+ private IObservableList bodies;
+
+ private boolean ignoreChanges = false;
+
+ public ExpressionList(IObservableList languages, IObservableList bodies) {
+ super(new LinkedList<Expression>(), Expression.class);
+ expressions = wrappedList;
+
+ this.languages = languages;
+ this.bodies = bodies;
+
+ languages.addChangeListener(this);
+ bodies.addChangeListener(this);
+
+ UMLToExpression();
+ }
+
+ private void UMLToExpression() {
+ expressions.clear();
+ int maxSize = Math.max(languages.size(), bodies.size());
+
+ Iterator<?> languageIterator = languages.iterator();
+ Iterator<?> bodyIterator = bodies.iterator();
+
+ for(int i = 0; i < maxSize; i++) {
+ Expression expression = new Expression(this);
+
+ if(languageIterator.hasNext()) {
+ expression.language = (String)languageIterator.next();
+ }
+
+ if(bodyIterator.hasNext()) {
+ expression.body = (String)bodyIterator.next();
+ }
+
+ expressions.add(expression);
+ }
+ }
+
+ public void handleChange(ChangeEvent event) {
+ //A change occurs on languages or bodies
+ if(!ignoreChanges)
+ UMLToExpression();
+ }
+
+ public void commit(AbstractEditor editor) {
+ ignoreChanges = true;
+ expressionToUML();
+ if(languages instanceof ICommitListener) {
+ ((ICommitListener)languages).commit(editor);
+ }
+
+ if(bodies instanceof ICommitListener) {
+ ((ICommitListener)bodies).commit(editor);
+ }
+ ignoreChanges = false;
+ }
+
+ void expressionToUML() { //Executes two commands, one on languages, and another one on bodies
+ int fillLanguage = 0, fillBody = 0;
+
+ languages.clear();
+ bodies.clear();
+
+ Iterator<Expression> iterator = expressions.iterator();
+ while(iterator.hasNext()) {
+ Expression expression = iterator.next();
+ if(expression == null) {
+ iterator.remove();
+ continue;
+ }
+
+ String language = expression.getLanguage();
+ String body = expression.getBody();
+ if(language == null && body == null) {
+ iterator.remove();
+ continue;
+ }
+
+ if(language != null && body != null) {
+ addLanguage(language, fillLanguage);
+ addBody(body, fillBody);
+
+ fillBody = fillLanguage = 0;
+ }
+
+ if(language == null) {
+ fillLanguage++;
+ addBody(body, fillBody);
+ fillBody = 0;
+ } else if(body == null) {
+ fillBody++;
+ addLanguage(language, fillLanguage);
+ fillLanguage = 0;
+ }
+ }
+ }
+
+ private void addBody(String body, int fillBody) {
+ for(int i = 0; i < fillBody; i++) {
+ bodies.add("");
+ }
+
+ bodies.add(body);
+ }
+
+ private void addLanguage(String language, int fillLanguage) {
+ for(int i = 0; i < fillLanguage; i++) {
+ languages.add("");
+ }
+
+ languages.add(language);
+ }
+
+ public static class Expression {
+
+ String language;
+
+ String body;
+
+ private ExpressionList owner;
+
+ public Expression() {
+
+ }
+
+ public Expression(ExpressionList owner) {
+ this.owner = owner;
+ }
+
+ public void setOwner(ExpressionList owner) {
+ this.owner = owner;
+ }
+
+ public String getLanguage() {
+ return language;
+ }
+
+ public String getBody() {
+ return body;
+ }
+
+ public void setLanguage(String language) {
+ this.language = language;
+ }
+
+ public void setBody(String body) {
+ this.body = body;
+ }
+
+ @Override
+ public String toString() {
+ return language;
+ }
+
+ @Override
+ public int hashCode() {
+ return language == null ? 0 : language.hashCode();
+ }
+
+ @Override
+ public boolean equals(Object other) {
+ if(!(other instanceof Expression)) {
+ return false;
+ }
+
+ Expression otherExpression = (Expression)other;
+ if(otherExpression.getLanguage() == null) {
+ return getLanguage() == null;
+ }
+
+ return otherExpression.getLanguage().equals(getLanguage());
+ }
+ }
+}
diff --git a/plugins/uml/org.eclipse.papyrus.properties.uml/src/org/eclipse/papyrus/properties/uml/extensionpoint/LanguageEditorExtensionPoint.java b/plugins/uml/org.eclipse.papyrus.properties.uml/src/org/eclipse/papyrus/properties/uml/extensionpoint/LanguageEditorExtensionPoint.java
new file mode 100644
index 00000000000..b5c1ae481c2
--- /dev/null
+++ b/plugins/uml/org.eclipse.papyrus.properties.uml/src/org/eclipse/papyrus/properties/uml/extensionpoint/LanguageEditorExtensionPoint.java
@@ -0,0 +1,42 @@
+/*****************************************************************************
+ * Copyright (c) 2011 CEA LIST.
+ *
+ * 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:
+ * Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Initial API and implementation
+ *****************************************************************************/
+package org.eclipse.papyrus.properties.uml.extensionpoint;
+
+import org.eclipse.core.runtime.IConfigurationElement;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.papyrus.properties.uml.languagepreferences.Editor;
+import org.eclipse.papyrus.properties.uml.languagepreferences.languagepreferencesFactory;
+import org.eclipse.papyrus.properties.uml.preferences.LanguageRegistry;
+
+public class LanguageEditorExtensionPoint {
+
+ private final String EXTENSION_ID = "org.eclipse.papyrus.properties.uml.languageEditor"; //$NON-NLS-1$
+
+ /**
+ * Constructor.
+ */
+ public LanguageEditorExtensionPoint() {
+
+ IConfigurationElement[] config = Platform.getExtensionRegistry().getConfigurationElementsFor(EXTENSION_ID);
+
+ for(IConfigurationElement e : config) {
+ String languageName = e.getAttribute("language");
+ String editorClassName = e.getAttribute("editor"); //$NON-NLS-1$
+
+
+ Editor editor = languagepreferencesFactory.eINSTANCE.createEditor();
+ editor.setClass(editorClassName);
+ LanguageRegistry.instance.registerEditor(languageName, editor);
+ }
+ }
+
+}
diff --git a/plugins/uml/org.eclipse.papyrus.properties.uml/src/org/eclipse/papyrus/properties/uml/languagepreferences/Editor.java b/plugins/uml/org.eclipse.papyrus.properties.uml/src/org/eclipse/papyrus/properties/uml/languagepreferences/Editor.java
new file mode 100644
index 00000000000..5709c0b1f41
--- /dev/null
+++ b/plugins/uml/org.eclipse.papyrus.properties.uml/src/org/eclipse/papyrus/properties/uml/languagepreferences/Editor.java
@@ -0,0 +1,54 @@
+/**
+ * <copyright>
+ * </copyright>
+ *
+ * $Id$
+ */
+package org.eclipse.papyrus.properties.uml.languagepreferences;
+
+import org.eclipse.emf.ecore.EObject;
+
+/**
+ * <!-- begin-user-doc -->
+ * A representation of the model object '<em><b>Editor</b></em>'.
+ * <!-- end-user-doc -->
+ *
+ * <p>
+ * The following features are supported:
+ * <ul>
+ * <li>{@link org.eclipse.papyrus.properties.uml.languagepreferences.Editor#getClass_ <em>Class</em>}</li>
+ * </ul>
+ * </p>
+ *
+ * @see org.eclipse.papyrus.properties.uml.languagepreferences.languagepreferencesPackage#getEditor()
+ * @model
+ * @generated
+ */
+public interface Editor extends EObject {
+ /**
+ * Returns the value of the '<em><b>Class</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Class</em>' attribute isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Class</em>' attribute.
+ * @see #setClass(String)
+ * @see org.eclipse.papyrus.properties.uml.languagepreferences.languagepreferencesPackage#getEditor_Class()
+ * @model required="true"
+ * @generated
+ */
+ String getClass_();
+
+ /**
+ * Sets the value of the '{@link org.eclipse.papyrus.properties.uml.languagepreferences.Editor#getClass_ <em>Class</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param value the new value of the '<em>Class</em>' attribute.
+ * @see #getClass_()
+ * @generated
+ */
+ void setClass(String value);
+
+} // Editor
diff --git a/plugins/uml/org.eclipse.papyrus.properties.uml/src/org/eclipse/papyrus/properties/uml/languagepreferences/Language.java b/plugins/uml/org.eclipse.papyrus.properties.uml/src/org/eclipse/papyrus/properties/uml/languagepreferences/Language.java
new file mode 100644
index 00000000000..5f108834a32
--- /dev/null
+++ b/plugins/uml/org.eclipse.papyrus.properties.uml/src/org/eclipse/papyrus/properties/uml/languagepreferences/Language.java
@@ -0,0 +1,81 @@
+/**
+ * <copyright>
+ * </copyright>
+ *
+ * $Id$
+ */
+package org.eclipse.papyrus.properties.uml.languagepreferences;
+
+import org.eclipse.emf.ecore.EObject;
+
+/**
+ * <!-- begin-user-doc -->
+ * A representation of the model object '<em><b>Language</b></em>'.
+ * <!-- end-user-doc -->
+ *
+ * <p>
+ * The following features are supported:
+ * <ul>
+ * <li>{@link org.eclipse.papyrus.properties.uml.languagepreferences.Language#getName <em>Name</em>}</li>
+ * <li>{@link org.eclipse.papyrus.properties.uml.languagepreferences.Language#getPreferedEditor <em>Prefered Editor</em>}</li>
+ * </ul>
+ * </p>
+ *
+ * @see org.eclipse.papyrus.properties.uml.languagepreferences.languagepreferencesPackage#getLanguage()
+ * @model
+ * @generated
+ */
+public interface Language extends EObject {
+ /**
+ * Returns the value of the '<em><b>Name</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Name</em>' attribute isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Name</em>' attribute.
+ * @see #setName(String)
+ * @see org.eclipse.papyrus.properties.uml.languagepreferences.languagepreferencesPackage#getLanguage_Name()
+ * @model required="true"
+ * @generated
+ */
+ String getName();
+
+ /**
+ * Sets the value of the '{@link org.eclipse.papyrus.properties.uml.languagepreferences.Language#getName <em>Name</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param value the new value of the '<em>Name</em>' attribute.
+ * @see #getName()
+ * @generated
+ */
+ void setName(String value);
+
+ /**
+ * Returns the value of the '<em><b>Prefered Editor</b></em>' reference.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Prefered Editor</em>' reference isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Prefered Editor</em>' reference.
+ * @see #setPreferedEditor(Editor)
+ * @see org.eclipse.papyrus.properties.uml.languagepreferences.languagepreferencesPackage#getLanguage_PreferedEditor()
+ * @model
+ * @generated
+ */
+ Editor getPreferedEditor();
+
+ /**
+ * Sets the value of the '{@link org.eclipse.papyrus.properties.uml.languagepreferences.Language#getPreferedEditor <em>Prefered Editor</em>}' reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param value the new value of the '<em>Prefered Editor</em>' reference.
+ * @see #getPreferedEditor()
+ * @generated
+ */
+ void setPreferedEditor(Editor value);
+
+} // Language
diff --git a/plugins/uml/org.eclipse.papyrus.properties.uml/src/org/eclipse/papyrus/properties/uml/languagepreferences/Preferences.java b/plugins/uml/org.eclipse.papyrus.properties.uml/src/org/eclipse/papyrus/properties/uml/languagepreferences/Preferences.java
new file mode 100644
index 00000000000..fbcfb555a72
--- /dev/null
+++ b/plugins/uml/org.eclipse.papyrus.properties.uml/src/org/eclipse/papyrus/properties/uml/languagepreferences/Preferences.java
@@ -0,0 +1,90 @@
+/**
+ * <copyright>
+ * </copyright>
+ *
+ * $Id$
+ */
+package org.eclipse.papyrus.properties.uml.languagepreferences;
+
+import org.eclipse.emf.common.util.EList;
+
+import org.eclipse.emf.ecore.EObject;
+
+/**
+ * <!-- begin-user-doc -->
+ * A representation of the model object '<em><b>Preferences</b></em>'.
+ * <!-- end-user-doc -->
+ *
+ * <p>
+ * The following features are supported:
+ * <ul>
+ * <li>{@link org.eclipse.papyrus.properties.uml.languagepreferences.Preferences#getLanguages <em>Languages</em>}</li>
+ * <li>{@link org.eclipse.papyrus.properties.uml.languagepreferences.Preferences#getEditors <em>Editors</em>}</li>
+ * <li>{@link org.eclipse.papyrus.properties.uml.languagepreferences.Preferences#getDefaultEditor <em>Default Editor</em>}</li>
+ * </ul>
+ * </p>
+ *
+ * @see org.eclipse.papyrus.properties.uml.languagepreferences.languagepreferencesPackage#getPreferences()
+ * @model
+ * @generated
+ */
+public interface Preferences extends EObject {
+ /**
+ * Returns the value of the '<em><b>Languages</b></em>' containment reference list.
+ * The list contents are of type {@link org.eclipse.papyrus.properties.uml.languagepreferences.Language}.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Languages</em>' containment reference list isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Languages</em>' containment reference list.
+ * @see org.eclipse.papyrus.properties.uml.languagepreferences.languagepreferencesPackage#getPreferences_Languages()
+ * @model containment="true"
+ * @generated
+ */
+ EList<Language> getLanguages();
+
+ /**
+ * Returns the value of the '<em><b>Editors</b></em>' containment reference list.
+ * The list contents are of type {@link org.eclipse.papyrus.properties.uml.languagepreferences.Editor}.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Editors</em>' containment reference list isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Editors</em>' containment reference list.
+ * @see org.eclipse.papyrus.properties.uml.languagepreferences.languagepreferencesPackage#getPreferences_Editors()
+ * @model containment="true"
+ * @generated
+ */
+ EList<Editor> getEditors();
+
+ /**
+ * Returns the value of the '<em><b>Default Editor</b></em>' reference.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Default Editor</em>' reference isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Default Editor</em>' reference.
+ * @see #setDefaultEditor(Editor)
+ * @see org.eclipse.papyrus.properties.uml.languagepreferences.languagepreferencesPackage#getPreferences_DefaultEditor()
+ * @model required="true"
+ * @generated
+ */
+ Editor getDefaultEditor();
+
+ /**
+ * Sets the value of the '{@link org.eclipse.papyrus.properties.uml.languagepreferences.Preferences#getDefaultEditor <em>Default Editor</em>}' reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param value the new value of the '<em>Default Editor</em>' reference.
+ * @see #getDefaultEditor()
+ * @generated
+ */
+ void setDefaultEditor(Editor value);
+
+} // Preferences
diff --git a/plugins/uml/org.eclipse.papyrus.properties.uml/src/org/eclipse/papyrus/properties/uml/languagepreferences/impl/EditorImpl.java b/plugins/uml/org.eclipse.papyrus.properties.uml/src/org/eclipse/papyrus/properties/uml/languagepreferences/impl/EditorImpl.java
new file mode 100644
index 00000000000..2d6e9155d44
--- /dev/null
+++ b/plugins/uml/org.eclipse.papyrus.properties.uml/src/org/eclipse/papyrus/properties/uml/languagepreferences/impl/EditorImpl.java
@@ -0,0 +1,167 @@
+/**
+ * <copyright>
+ * </copyright>
+ *
+ * $Id$
+ */
+package org.eclipse.papyrus.properties.uml.languagepreferences.impl;
+
+import org.eclipse.emf.common.notify.Notification;
+
+import org.eclipse.emf.ecore.EClass;
+
+import org.eclipse.emf.ecore.impl.ENotificationImpl;
+import org.eclipse.emf.ecore.impl.EObjectImpl;
+
+import org.eclipse.papyrus.properties.uml.languagepreferences.Editor;
+import org.eclipse.papyrus.properties.uml.languagepreferences.languagepreferencesPackage;
+
+/**
+ * <!-- begin-user-doc -->
+ * An implementation of the model object '<em><b>Editor</b></em>'.
+ * <!-- end-user-doc -->
+ * <p>
+ * The following features are implemented:
+ * <ul>
+ * <li>{@link org.eclipse.papyrus.properties.uml.languagepreferences.impl.EditorImpl#getClass_ <em>Class</em>}</li>
+ * </ul>
+ * </p>
+ *
+ * @generated
+ */
+public class EditorImpl extends EObjectImpl implements Editor {
+ /**
+ * The default value of the '{@link #getClass_() <em>Class</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getClass_()
+ * @generated
+ * @ordered
+ */
+ protected static final String CLASS_EDEFAULT = null;
+
+ /**
+ * The cached value of the '{@link #getClass_() <em>Class</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getClass_()
+ * @generated
+ * @ordered
+ */
+ protected String class_ = CLASS_EDEFAULT;
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected EditorImpl() {
+ super();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ protected EClass eStaticClass() {
+ return languagepreferencesPackage.Literals.EDITOR;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public String getClass_() {
+ return class_;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setClass(String newClass) {
+ String oldClass = class_;
+ class_ = newClass;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET, languagepreferencesPackage.EDITOR__CLASS, oldClass, class_));
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public Object eGet(int featureID, boolean resolve, boolean coreType) {
+ switch (featureID) {
+ case languagepreferencesPackage.EDITOR__CLASS:
+ return getClass_();
+ }
+ return super.eGet(featureID, resolve, coreType);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public void eSet(int featureID, Object newValue) {
+ switch (featureID) {
+ case languagepreferencesPackage.EDITOR__CLASS:
+ setClass((String)newValue);
+ return;
+ }
+ super.eSet(featureID, newValue);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public void eUnset(int featureID) {
+ switch (featureID) {
+ case languagepreferencesPackage.EDITOR__CLASS:
+ setClass(CLASS_EDEFAULT);
+ return;
+ }
+ super.eUnset(featureID);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public boolean eIsSet(int featureID) {
+ switch (featureID) {
+ case languagepreferencesPackage.EDITOR__CLASS:
+ return CLASS_EDEFAULT == null ? class_ != null : !CLASS_EDEFAULT.equals(class_);
+ }
+ return super.eIsSet(featureID);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public String toString() {
+ if (eIsProxy()) return super.toString();
+
+ StringBuffer result = new StringBuffer(super.toString());
+ result.append(" (class: ");
+ result.append(class_);
+ result.append(')');
+ return result.toString();
+ }
+
+} //EditorImpl
diff --git a/plugins/uml/org.eclipse.papyrus.properties.uml/src/org/eclipse/papyrus/properties/uml/languagepreferences/impl/LanguageImpl.java b/plugins/uml/org.eclipse.papyrus.properties.uml/src/org/eclipse/papyrus/properties/uml/languagepreferences/impl/LanguageImpl.java
new file mode 100644
index 00000000000..5619eff107c
--- /dev/null
+++ b/plugins/uml/org.eclipse.papyrus.properties.uml/src/org/eclipse/papyrus/properties/uml/languagepreferences/impl/LanguageImpl.java
@@ -0,0 +1,229 @@
+/**
+ * <copyright>
+ * </copyright>
+ *
+ * $Id$
+ */
+package org.eclipse.papyrus.properties.uml.languagepreferences.impl;
+
+import org.eclipse.emf.common.notify.Notification;
+
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.InternalEObject;
+
+import org.eclipse.emf.ecore.impl.ENotificationImpl;
+import org.eclipse.emf.ecore.impl.EObjectImpl;
+
+import org.eclipse.papyrus.properties.uml.languagepreferences.Editor;
+import org.eclipse.papyrus.properties.uml.languagepreferences.Language;
+import org.eclipse.papyrus.properties.uml.languagepreferences.languagepreferencesPackage;
+
+/**
+ * <!-- begin-user-doc -->
+ * An implementation of the model object '<em><b>Language</b></em>'.
+ * <!-- end-user-doc -->
+ * <p>
+ * The following features are implemented:
+ * <ul>
+ * <li>{@link org.eclipse.papyrus.properties.uml.languagepreferences.impl.LanguageImpl#getName <em>Name</em>}</li>
+ * <li>{@link org.eclipse.papyrus.properties.uml.languagepreferences.impl.LanguageImpl#getPreferedEditor <em>Prefered Editor</em>}</li>
+ * </ul>
+ * </p>
+ *
+ * @generated
+ */
+public class LanguageImpl extends EObjectImpl implements Language {
+ /**
+ * The default value of the '{@link #getName() <em>Name</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getName()
+ * @generated
+ * @ordered
+ */
+ protected static final String NAME_EDEFAULT = null;
+
+ /**
+ * The cached value of the '{@link #getName() <em>Name</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getName()
+ * @generated
+ * @ordered
+ */
+ protected String name = NAME_EDEFAULT;
+
+ /**
+ * The cached value of the '{@link #getPreferedEditor() <em>Prefered Editor</em>}' reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getPreferedEditor()
+ * @generated
+ * @ordered
+ */
+ protected Editor preferedEditor;
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected LanguageImpl() {
+ super();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ protected EClass eStaticClass() {
+ return languagepreferencesPackage.Literals.LANGUAGE;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public String getName() {
+ return name;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setName(String newName) {
+ String oldName = name;
+ name = newName;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET, languagepreferencesPackage.LANGUAGE__NAME, oldName, name));
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public Editor getPreferedEditor() {
+ if (preferedEditor != null && preferedEditor.eIsProxy()) {
+ InternalEObject oldPreferedEditor = (InternalEObject)preferedEditor;
+ preferedEditor = (Editor)eResolveProxy(oldPreferedEditor);
+ if (preferedEditor != oldPreferedEditor) {
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.RESOLVE, languagepreferencesPackage.LANGUAGE__PREFERED_EDITOR, oldPreferedEditor, preferedEditor));
+ }
+ }
+ return preferedEditor;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public Editor basicGetPreferedEditor() {
+ return preferedEditor;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setPreferedEditor(Editor newPreferedEditor) {
+ Editor oldPreferedEditor = preferedEditor;
+ preferedEditor = newPreferedEditor;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET, languagepreferencesPackage.LANGUAGE__PREFERED_EDITOR, oldPreferedEditor, preferedEditor));
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public Object eGet(int featureID, boolean resolve, boolean coreType) {
+ switch (featureID) {
+ case languagepreferencesPackage.LANGUAGE__NAME:
+ return getName();
+ case languagepreferencesPackage.LANGUAGE__PREFERED_EDITOR:
+ if (resolve) return getPreferedEditor();
+ return basicGetPreferedEditor();
+ }
+ return super.eGet(featureID, resolve, coreType);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public void eSet(int featureID, Object newValue) {
+ switch (featureID) {
+ case languagepreferencesPackage.LANGUAGE__NAME:
+ setName((String)newValue);
+ return;
+ case languagepreferencesPackage.LANGUAGE__PREFERED_EDITOR:
+ setPreferedEditor((Editor)newValue);
+ return;
+ }
+ super.eSet(featureID, newValue);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public void eUnset(int featureID) {
+ switch (featureID) {
+ case languagepreferencesPackage.LANGUAGE__NAME:
+ setName(NAME_EDEFAULT);
+ return;
+ case languagepreferencesPackage.LANGUAGE__PREFERED_EDITOR:
+ setPreferedEditor((Editor)null);
+ return;
+ }
+ super.eUnset(featureID);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public boolean eIsSet(int featureID) {
+ switch (featureID) {
+ case languagepreferencesPackage.LANGUAGE__NAME:
+ return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name);
+ case languagepreferencesPackage.LANGUAGE__PREFERED_EDITOR:
+ return preferedEditor != null;
+ }
+ return super.eIsSet(featureID);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public String toString() {
+ if (eIsProxy()) return super.toString();
+
+ StringBuffer result = new StringBuffer(super.toString());
+ result.append(" (name: ");
+ result.append(name);
+ result.append(')');
+ return result.toString();
+ }
+
+} //LanguageImpl
diff --git a/plugins/uml/org.eclipse.papyrus.properties.uml/src/org/eclipse/papyrus/properties/uml/languagepreferences/impl/PreferencesImpl.java b/plugins/uml/org.eclipse.papyrus.properties.uml/src/org/eclipse/papyrus/properties/uml/languagepreferences/impl/PreferencesImpl.java
new file mode 100644
index 00000000000..37fd54f2d06
--- /dev/null
+++ b/plugins/uml/org.eclipse.papyrus.properties.uml/src/org/eclipse/papyrus/properties/uml/languagepreferences/impl/PreferencesImpl.java
@@ -0,0 +1,255 @@
+/**
+ * <copyright>
+ * </copyright>
+ *
+ * $Id$
+ */
+package org.eclipse.papyrus.properties.uml.languagepreferences.impl;
+
+import java.util.Collection;
+
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.emf.common.notify.NotificationChain;
+
+import org.eclipse.emf.common.util.EList;
+
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.InternalEObject;
+
+import org.eclipse.emf.ecore.impl.ENotificationImpl;
+import org.eclipse.emf.ecore.impl.EObjectImpl;
+
+import org.eclipse.emf.ecore.util.EObjectContainmentEList;
+import org.eclipse.emf.ecore.util.InternalEList;
+
+import org.eclipse.papyrus.properties.uml.languagepreferences.Editor;
+import org.eclipse.papyrus.properties.uml.languagepreferences.Language;
+import org.eclipse.papyrus.properties.uml.languagepreferences.Preferences;
+import org.eclipse.papyrus.properties.uml.languagepreferences.languagepreferencesPackage;
+
+/**
+ * <!-- begin-user-doc -->
+ * An implementation of the model object '<em><b>Preferences</b></em>'.
+ * <!-- end-user-doc -->
+ * <p>
+ * The following features are implemented:
+ * <ul>
+ * <li>{@link org.eclipse.papyrus.properties.uml.languagepreferences.impl.PreferencesImpl#getLanguages <em>Languages</em>}</li>
+ * <li>{@link org.eclipse.papyrus.properties.uml.languagepreferences.impl.PreferencesImpl#getEditors <em>Editors</em>}</li>
+ * <li>{@link org.eclipse.papyrus.properties.uml.languagepreferences.impl.PreferencesImpl#getDefaultEditor <em>Default Editor</em>}</li>
+ * </ul>
+ * </p>
+ *
+ * @generated
+ */
+public class PreferencesImpl extends EObjectImpl implements Preferences {
+ /**
+ * The cached value of the '{@link #getLanguages() <em>Languages</em>}' containment reference list.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getLanguages()
+ * @generated
+ * @ordered
+ */
+ protected EList<Language> languages;
+
+ /**
+ * The cached value of the '{@link #getEditors() <em>Editors</em>}' containment reference list.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getEditors()
+ * @generated
+ * @ordered
+ */
+ protected EList<Editor> editors;
+
+ /**
+ * The cached value of the '{@link #getDefaultEditor() <em>Default Editor</em>}' reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getDefaultEditor()
+ * @generated
+ * @ordered
+ */
+ protected Editor defaultEditor;
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected PreferencesImpl() {
+ super();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ protected EClass eStaticClass() {
+ return languagepreferencesPackage.Literals.PREFERENCES;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EList<Language> getLanguages() {
+ if (languages == null) {
+ languages = new EObjectContainmentEList<Language>(Language.class, this, languagepreferencesPackage.PREFERENCES__LANGUAGES);
+ }
+ return languages;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EList<Editor> getEditors() {
+ if (editors == null) {
+ editors = new EObjectContainmentEList<Editor>(Editor.class, this, languagepreferencesPackage.PREFERENCES__EDITORS);
+ }
+ return editors;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public Editor getDefaultEditor() {
+ if (defaultEditor != null && defaultEditor.eIsProxy()) {
+ InternalEObject oldDefaultEditor = (InternalEObject)defaultEditor;
+ defaultEditor = (Editor)eResolveProxy(oldDefaultEditor);
+ if (defaultEditor != oldDefaultEditor) {
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.RESOLVE, languagepreferencesPackage.PREFERENCES__DEFAULT_EDITOR, oldDefaultEditor, defaultEditor));
+ }
+ }
+ return defaultEditor;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public Editor basicGetDefaultEditor() {
+ return defaultEditor;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setDefaultEditor(Editor newDefaultEditor) {
+ Editor oldDefaultEditor = defaultEditor;
+ defaultEditor = newDefaultEditor;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET, languagepreferencesPackage.PREFERENCES__DEFAULT_EDITOR, oldDefaultEditor, defaultEditor));
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
+ switch (featureID) {
+ case languagepreferencesPackage.PREFERENCES__LANGUAGES:
+ return ((InternalEList<?>)getLanguages()).basicRemove(otherEnd, msgs);
+ case languagepreferencesPackage.PREFERENCES__EDITORS:
+ return ((InternalEList<?>)getEditors()).basicRemove(otherEnd, msgs);
+ }
+ return super.eInverseRemove(otherEnd, featureID, msgs);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public Object eGet(int featureID, boolean resolve, boolean coreType) {
+ switch (featureID) {
+ case languagepreferencesPackage.PREFERENCES__LANGUAGES:
+ return getLanguages();
+ case languagepreferencesPackage.PREFERENCES__EDITORS:
+ return getEditors();
+ case languagepreferencesPackage.PREFERENCES__DEFAULT_EDITOR:
+ if (resolve) return getDefaultEditor();
+ return basicGetDefaultEditor();
+ }
+ return super.eGet(featureID, resolve, coreType);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @SuppressWarnings("unchecked")
+ @Override
+ public void eSet(int featureID, Object newValue) {
+ switch (featureID) {
+ case languagepreferencesPackage.PREFERENCES__LANGUAGES:
+ getLanguages().clear();
+ getLanguages().addAll((Collection<? extends Language>)newValue);
+ return;
+ case languagepreferencesPackage.PREFERENCES__EDITORS:
+ getEditors().clear();
+ getEditors().addAll((Collection<? extends Editor>)newValue);
+ return;
+ case languagepreferencesPackage.PREFERENCES__DEFAULT_EDITOR:
+ setDefaultEditor((Editor)newValue);
+ return;
+ }
+ super.eSet(featureID, newValue);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public void eUnset(int featureID) {
+ switch (featureID) {
+ case languagepreferencesPackage.PREFERENCES__LANGUAGES:
+ getLanguages().clear();
+ return;
+ case languagepreferencesPackage.PREFERENCES__EDITORS:
+ getEditors().clear();
+ return;
+ case languagepreferencesPackage.PREFERENCES__DEFAULT_EDITOR:
+ setDefaultEditor((Editor)null);
+ return;
+ }
+ super.eUnset(featureID);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public boolean eIsSet(int featureID) {
+ switch (featureID) {
+ case languagepreferencesPackage.PREFERENCES__LANGUAGES:
+ return languages != null && !languages.isEmpty();
+ case languagepreferencesPackage.PREFERENCES__EDITORS:
+ return editors != null && !editors.isEmpty();
+ case languagepreferencesPackage.PREFERENCES__DEFAULT_EDITOR:
+ return defaultEditor != null;
+ }
+ return super.eIsSet(featureID);
+ }
+
+} //PreferencesImpl
diff --git a/plugins/uml/org.eclipse.papyrus.properties.uml/src/org/eclipse/papyrus/properties/uml/languagepreferences/impl/languagepreferencesFactoryImpl.java b/plugins/uml/org.eclipse.papyrus.properties.uml/src/org/eclipse/papyrus/properties/uml/languagepreferences/impl/languagepreferencesFactoryImpl.java
new file mode 100644
index 00000000000..d79ad5a10da
--- /dev/null
+++ b/plugins/uml/org.eclipse.papyrus.properties.uml/src/org/eclipse/papyrus/properties/uml/languagepreferences/impl/languagepreferencesFactoryImpl.java
@@ -0,0 +1,121 @@
+/**
+ * <copyright>
+ * </copyright>
+ *
+ * $Id$
+ */
+package org.eclipse.papyrus.properties.uml.languagepreferences.impl;
+
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EPackage;
+
+import org.eclipse.emf.ecore.impl.EFactoryImpl;
+
+import org.eclipse.emf.ecore.plugin.EcorePlugin;
+
+import org.eclipse.papyrus.properties.uml.languagepreferences.*;
+
+/**
+ * <!-- begin-user-doc -->
+ * An implementation of the model <b>Factory</b>.
+ * <!-- end-user-doc -->
+ * @generated
+ */
+public class languagepreferencesFactoryImpl extends EFactoryImpl implements languagepreferencesFactory {
+ /**
+ * Creates the default factory implementation.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public static languagepreferencesFactory init() {
+ try {
+ languagepreferencesFactory thelanguagepreferencesFactory = (languagepreferencesFactory)EPackage.Registry.INSTANCE.getEFactory("http://www.eclipse.org/papyrus/properties/uml/languagePreferences");
+ if (thelanguagepreferencesFactory != null) {
+ return thelanguagepreferencesFactory;
+ }
+ }
+ catch (Exception exception) {
+ EcorePlugin.INSTANCE.log(exception);
+ }
+ return new languagepreferencesFactoryImpl();
+ }
+
+ /**
+ * Creates an instance of the factory.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public languagepreferencesFactoryImpl() {
+ super();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public EObject create(EClass eClass) {
+ switch (eClass.getClassifierID()) {
+ case languagepreferencesPackage.LANGUAGE: return createLanguage();
+ case languagepreferencesPackage.EDITOR: return createEditor();
+ case languagepreferencesPackage.PREFERENCES: return createPreferences();
+ default:
+ throw new IllegalArgumentException("The class '" + eClass.getName() + "' is not a valid classifier");
+ }
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public Language createLanguage() {
+ LanguageImpl language = new LanguageImpl();
+ return language;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public Editor createEditor() {
+ EditorImpl editor = new EditorImpl();
+ return editor;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public Preferences createPreferences() {
+ PreferencesImpl preferences = new PreferencesImpl();
+ return preferences;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public languagepreferencesPackage getlanguagepreferencesPackage() {
+ return (languagepreferencesPackage)getEPackage();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @deprecated
+ * @generated
+ */
+ @Deprecated
+ public static languagepreferencesPackage getPackage() {
+ return languagepreferencesPackage.eINSTANCE;
+ }
+
+} //languagepreferencesFactoryImpl
diff --git a/plugins/uml/org.eclipse.papyrus.properties.uml/src/org/eclipse/papyrus/properties/uml/languagepreferences/impl/languagepreferencesPackageImpl.java b/plugins/uml/org.eclipse.papyrus.properties.uml/src/org/eclipse/papyrus/properties/uml/languagepreferences/impl/languagepreferencesPackageImpl.java
new file mode 100644
index 00000000000..dab48441760
--- /dev/null
+++ b/plugins/uml/org.eclipse.papyrus.properties.uml/src/org/eclipse/papyrus/properties/uml/languagepreferences/impl/languagepreferencesPackageImpl.java
@@ -0,0 +1,279 @@
+/**
+ * <copyright>
+ * </copyright>
+ *
+ * $Id$
+ */
+package org.eclipse.papyrus.properties.uml.languagepreferences.impl;
+
+import org.eclipse.emf.ecore.EAttribute;
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EPackage;
+import org.eclipse.emf.ecore.EReference;
+
+import org.eclipse.emf.ecore.impl.EPackageImpl;
+
+import org.eclipse.papyrus.properties.uml.languagepreferences.Editor;
+import org.eclipse.papyrus.properties.uml.languagepreferences.Language;
+import org.eclipse.papyrus.properties.uml.languagepreferences.Preferences;
+import org.eclipse.papyrus.properties.uml.languagepreferences.languagepreferencesFactory;
+import org.eclipse.papyrus.properties.uml.languagepreferences.languagepreferencesPackage;
+
+/**
+ * <!-- begin-user-doc -->
+ * An implementation of the model <b>Package</b>.
+ * <!-- end-user-doc -->
+ * @generated
+ */
+public class languagepreferencesPackageImpl extends EPackageImpl implements languagepreferencesPackage {
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ private EClass languageEClass = null;
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ private EClass editorEClass = null;
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ private EClass preferencesEClass = null;
+
+ /**
+ * Creates an instance of the model <b>Package</b>, registered with
+ * {@link org.eclipse.emf.ecore.EPackage.Registry EPackage.Registry} by the package
+ * package URI value.
+ * <p>Note: the correct way to create the package is via the static
+ * factory method {@link #init init()}, which also performs
+ * initialization of the package, or returns the registered package,
+ * if one already exists.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see org.eclipse.emf.ecore.EPackage.Registry
+ * @see org.eclipse.papyrus.properties.uml.languagepreferences.languagepreferencesPackage#eNS_URI
+ * @see #init()
+ * @generated
+ */
+ private languagepreferencesPackageImpl() {
+ super(eNS_URI, languagepreferencesFactory.eINSTANCE);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ private static boolean isInited = false;
+
+ /**
+ * Creates, registers, and initializes the <b>Package</b> for this model, and for any others upon which it depends.
+ *
+ * <p>This method is used to initialize {@link languagepreferencesPackage#eINSTANCE} when that field is accessed.
+ * Clients should not invoke it directly. Instead, they should simply access that field to obtain the package.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #eNS_URI
+ * @see #createPackageContents()
+ * @see #initializePackageContents()
+ * @generated
+ */
+ public static languagepreferencesPackage init() {
+ if (isInited) return (languagepreferencesPackage)EPackage.Registry.INSTANCE.getEPackage(languagepreferencesPackage.eNS_URI);
+
+ // Obtain or create and register package
+ languagepreferencesPackageImpl thelanguagepreferencesPackage = (languagepreferencesPackageImpl)(EPackage.Registry.INSTANCE.get(eNS_URI) instanceof languagepreferencesPackageImpl ? EPackage.Registry.INSTANCE.get(eNS_URI) : new languagepreferencesPackageImpl());
+
+ isInited = true;
+
+ // Create package meta-data objects
+ thelanguagepreferencesPackage.createPackageContents();
+
+ // Initialize created meta-data
+ thelanguagepreferencesPackage.initializePackageContents();
+
+ // Mark meta-data to indicate it can't be changed
+ thelanguagepreferencesPackage.freeze();
+
+
+ // Update the registry and return the package
+ EPackage.Registry.INSTANCE.put(languagepreferencesPackage.eNS_URI, thelanguagepreferencesPackage);
+ return thelanguagepreferencesPackage;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EClass getLanguage() {
+ return languageEClass;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EAttribute getLanguage_Name() {
+ return (EAttribute)languageEClass.getEStructuralFeatures().get(0);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EReference getLanguage_PreferedEditor() {
+ return (EReference)languageEClass.getEStructuralFeatures().get(1);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EClass getEditor() {
+ return editorEClass;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EAttribute getEditor_Class() {
+ return (EAttribute)editorEClass.getEStructuralFeatures().get(0);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EClass getPreferences() {
+ return preferencesEClass;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EReference getPreferences_Languages() {
+ return (EReference)preferencesEClass.getEStructuralFeatures().get(0);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EReference getPreferences_Editors() {
+ return (EReference)preferencesEClass.getEStructuralFeatures().get(1);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EReference getPreferences_DefaultEditor() {
+ return (EReference)preferencesEClass.getEStructuralFeatures().get(2);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public languagepreferencesFactory getlanguagepreferencesFactory() {
+ return (languagepreferencesFactory)getEFactoryInstance();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ private boolean isCreated = false;
+
+ /**
+ * Creates the meta-model objects for the package. This method is
+ * guarded to have no affect on any invocation but its first.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void createPackageContents() {
+ if (isCreated) return;
+ isCreated = true;
+
+ // Create classes and their features
+ languageEClass = createEClass(LANGUAGE);
+ createEAttribute(languageEClass, LANGUAGE__NAME);
+ createEReference(languageEClass, LANGUAGE__PREFERED_EDITOR);
+
+ editorEClass = createEClass(EDITOR);
+ createEAttribute(editorEClass, EDITOR__CLASS);
+
+ preferencesEClass = createEClass(PREFERENCES);
+ createEReference(preferencesEClass, PREFERENCES__LANGUAGES);
+ createEReference(preferencesEClass, PREFERENCES__EDITORS);
+ createEReference(preferencesEClass, PREFERENCES__DEFAULT_EDITOR);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ private boolean isInitialized = false;
+
+ /**
+ * Complete the initialization of the package and its meta-model. This
+ * method is guarded to have no affect on any invocation but its first.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void initializePackageContents() {
+ if (isInitialized) return;
+ isInitialized = true;
+
+ // Initialize package
+ setName(eNAME);
+ setNsPrefix(eNS_PREFIX);
+ setNsURI(eNS_URI);
+
+ // Create type parameters
+
+ // Set bounds for type parameters
+
+ // Add supertypes to classes
+
+ // Initialize classes and features; add operations and parameters
+ initEClass(languageEClass, Language.class, "Language", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
+ initEAttribute(getLanguage_Name(), ecorePackage.getEString(), "name", null, 1, 1, Language.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEReference(getLanguage_PreferedEditor(), this.getEditor(), null, "preferedEditor", null, 0, 1, Language.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+
+ initEClass(editorEClass, Editor.class, "Editor", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
+ initEAttribute(getEditor_Class(), ecorePackage.getEString(), "class", null, 1, 1, Editor.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+
+ initEClass(preferencesEClass, Preferences.class, "Preferences", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
+ initEReference(getPreferences_Languages(), this.getLanguage(), null, "languages", null, 0, -1, Preferences.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEReference(getPreferences_Editors(), this.getEditor(), null, "editors", null, 0, -1, Preferences.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEReference(getPreferences_DefaultEditor(), this.getEditor(), null, "defaultEditor", null, 1, 1, Preferences.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+
+ // Create resource
+ createResource(eNS_URI);
+ }
+
+} //languagepreferencesPackageImpl
diff --git a/plugins/uml/org.eclipse.papyrus.properties.uml/src/org/eclipse/papyrus/properties/uml/languagepreferences/languagepreferencesFactory.java b/plugins/uml/org.eclipse.papyrus.properties.uml/src/org/eclipse/papyrus/properties/uml/languagepreferences/languagepreferencesFactory.java
new file mode 100644
index 00000000000..c1daf34a996
--- /dev/null
+++ b/plugins/uml/org.eclipse.papyrus.properties.uml/src/org/eclipse/papyrus/properties/uml/languagepreferences/languagepreferencesFactory.java
@@ -0,0 +1,64 @@
+/**
+ * <copyright>
+ * </copyright>
+ *
+ * $Id$
+ */
+package org.eclipse.papyrus.properties.uml.languagepreferences;
+
+import org.eclipse.emf.ecore.EFactory;
+
+/**
+ * <!-- begin-user-doc -->
+ * The <b>Factory</b> for the model.
+ * It provides a create method for each non-abstract class of the model.
+ * <!-- end-user-doc -->
+ * @see org.eclipse.papyrus.properties.uml.languagepreferences.languagepreferencesPackage
+ * @generated
+ */
+public interface languagepreferencesFactory extends EFactory {
+ /**
+ * The singleton instance of the factory.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ languagepreferencesFactory eINSTANCE = org.eclipse.papyrus.properties.uml.languagepreferences.impl.languagepreferencesFactoryImpl.init();
+
+ /**
+ * Returns a new object of class '<em>Language</em>'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return a new object of class '<em>Language</em>'.
+ * @generated
+ */
+ Language createLanguage();
+
+ /**
+ * Returns a new object of class '<em>Editor</em>'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return a new object of class '<em>Editor</em>'.
+ * @generated
+ */
+ Editor createEditor();
+
+ /**
+ * Returns a new object of class '<em>Preferences</em>'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return a new object of class '<em>Preferences</em>'.
+ * @generated
+ */
+ Preferences createPreferences();
+
+ /**
+ * Returns the package supported by this factory.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the package supported by this factory.
+ * @generated
+ */
+ languagepreferencesPackage getlanguagepreferencesPackage();
+
+} //languagepreferencesFactory
diff --git a/plugins/uml/org.eclipse.papyrus.properties.uml/src/org/eclipse/papyrus/properties/uml/languagepreferences/languagepreferencesPackage.java b/plugins/uml/org.eclipse.papyrus.properties.uml/src/org/eclipse/papyrus/properties/uml/languagepreferences/languagepreferencesPackage.java
new file mode 100644
index 00000000000..842609bd7ac
--- /dev/null
+++ b/plugins/uml/org.eclipse.papyrus.properties.uml/src/org/eclipse/papyrus/properties/uml/languagepreferences/languagepreferencesPackage.java
@@ -0,0 +1,372 @@
+/**
+ * <copyright>
+ * </copyright>
+ *
+ * $Id$
+ */
+package org.eclipse.papyrus.properties.uml.languagepreferences;
+
+import org.eclipse.emf.ecore.EAttribute;
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EPackage;
+import org.eclipse.emf.ecore.EReference;
+
+/**
+ * <!-- begin-user-doc -->
+ * The <b>Package</b> for the model.
+ * It contains accessors for the meta objects to represent
+ * <ul>
+ * <li>each class,</li>
+ * <li>each feature of each class,</li>
+ * <li>each enum,</li>
+ * <li>and each data type</li>
+ * </ul>
+ * <!-- end-user-doc -->
+ * @see org.eclipse.papyrus.properties.uml.languagepreferences.languagepreferencesFactory
+ * @model kind="package"
+ * @generated
+ */
+public interface languagepreferencesPackage extends EPackage {
+ /**
+ * The package name.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ String eNAME = "languagepreferences";
+
+ /**
+ * The package namespace URI.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ String eNS_URI = "http://www.eclipse.org/papyrus/properties/uml/languagePreferences";
+
+ /**
+ * The package namespace name.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ String eNS_PREFIX = "lgpref";
+
+ /**
+ * The singleton instance of the package.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ languagepreferencesPackage eINSTANCE = org.eclipse.papyrus.properties.uml.languagepreferences.impl.languagepreferencesPackageImpl.init();
+
+ /**
+ * The meta object id for the '{@link org.eclipse.papyrus.properties.uml.languagepreferences.impl.LanguageImpl <em>Language</em>}' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see org.eclipse.papyrus.properties.uml.languagepreferences.impl.LanguageImpl
+ * @see org.eclipse.papyrus.properties.uml.languagepreferences.impl.languagepreferencesPackageImpl#getLanguage()
+ * @generated
+ */
+ int LANGUAGE = 0;
+
+ /**
+ * The feature id for the '<em><b>Name</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int LANGUAGE__NAME = 0;
+
+ /**
+ * The feature id for the '<em><b>Prefered Editor</b></em>' reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int LANGUAGE__PREFERED_EDITOR = 1;
+
+ /**
+ * The number of structural features of the '<em>Language</em>' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int LANGUAGE_FEATURE_COUNT = 2;
+
+ /**
+ * The meta object id for the '{@link org.eclipse.papyrus.properties.uml.languagepreferences.impl.EditorImpl <em>Editor</em>}' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see org.eclipse.papyrus.properties.uml.languagepreferences.impl.EditorImpl
+ * @see org.eclipse.papyrus.properties.uml.languagepreferences.impl.languagepreferencesPackageImpl#getEditor()
+ * @generated
+ */
+ int EDITOR = 1;
+
+ /**
+ * The feature id for the '<em><b>Class</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int EDITOR__CLASS = 0;
+
+ /**
+ * The number of structural features of the '<em>Editor</em>' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int EDITOR_FEATURE_COUNT = 1;
+
+ /**
+ * The meta object id for the '{@link org.eclipse.papyrus.properties.uml.languagepreferences.impl.PreferencesImpl <em>Preferences</em>}' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see org.eclipse.papyrus.properties.uml.languagepreferences.impl.PreferencesImpl
+ * @see org.eclipse.papyrus.properties.uml.languagepreferences.impl.languagepreferencesPackageImpl#getPreferences()
+ * @generated
+ */
+ int PREFERENCES = 2;
+
+ /**
+ * The feature id for the '<em><b>Languages</b></em>' containment reference list.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int PREFERENCES__LANGUAGES = 0;
+
+ /**
+ * The feature id for the '<em><b>Editors</b></em>' containment reference list.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int PREFERENCES__EDITORS = 1;
+
+ /**
+ * The feature id for the '<em><b>Default Editor</b></em>' reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int PREFERENCES__DEFAULT_EDITOR = 2;
+
+ /**
+ * The number of structural features of the '<em>Preferences</em>' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int PREFERENCES_FEATURE_COUNT = 3;
+
+
+ /**
+ * Returns the meta object for class '{@link org.eclipse.papyrus.properties.uml.languagepreferences.Language <em>Language</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for class '<em>Language</em>'.
+ * @see org.eclipse.papyrus.properties.uml.languagepreferences.Language
+ * @generated
+ */
+ EClass getLanguage();
+
+ /**
+ * Returns the meta object for the attribute '{@link org.eclipse.papyrus.properties.uml.languagepreferences.Language#getName <em>Name</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for the attribute '<em>Name</em>'.
+ * @see org.eclipse.papyrus.properties.uml.languagepreferences.Language#getName()
+ * @see #getLanguage()
+ * @generated
+ */
+ EAttribute getLanguage_Name();
+
+ /**
+ * Returns the meta object for the reference '{@link org.eclipse.papyrus.properties.uml.languagepreferences.Language#getPreferedEditor <em>Prefered Editor</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for the reference '<em>Prefered Editor</em>'.
+ * @see org.eclipse.papyrus.properties.uml.languagepreferences.Language#getPreferedEditor()
+ * @see #getLanguage()
+ * @generated
+ */
+ EReference getLanguage_PreferedEditor();
+
+ /**
+ * Returns the meta object for class '{@link org.eclipse.papyrus.properties.uml.languagepreferences.Editor <em>Editor</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for class '<em>Editor</em>'.
+ * @see org.eclipse.papyrus.properties.uml.languagepreferences.Editor
+ * @generated
+ */
+ EClass getEditor();
+
+ /**
+ * Returns the meta object for the attribute '{@link org.eclipse.papyrus.properties.uml.languagepreferences.Editor#getClass_ <em>Class</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for the attribute '<em>Class</em>'.
+ * @see org.eclipse.papyrus.properties.uml.languagepreferences.Editor#getClass_()
+ * @see #getEditor()
+ * @generated
+ */
+ EAttribute getEditor_Class();
+
+ /**
+ * Returns the meta object for class '{@link org.eclipse.papyrus.properties.uml.languagepreferences.Preferences <em>Preferences</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for class '<em>Preferences</em>'.
+ * @see org.eclipse.papyrus.properties.uml.languagepreferences.Preferences
+ * @generated
+ */
+ EClass getPreferences();
+
+ /**
+ * Returns the meta object for the containment reference list '{@link org.eclipse.papyrus.properties.uml.languagepreferences.Preferences#getLanguages <em>Languages</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for the containment reference list '<em>Languages</em>'.
+ * @see org.eclipse.papyrus.properties.uml.languagepreferences.Preferences#getLanguages()
+ * @see #getPreferences()
+ * @generated
+ */
+ EReference getPreferences_Languages();
+
+ /**
+ * Returns the meta object for the containment reference list '{@link org.eclipse.papyrus.properties.uml.languagepreferences.Preferences#getEditors <em>Editors</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for the containment reference list '<em>Editors</em>'.
+ * @see org.eclipse.papyrus.properties.uml.languagepreferences.Preferences#getEditors()
+ * @see #getPreferences()
+ * @generated
+ */
+ EReference getPreferences_Editors();
+
+ /**
+ * Returns the meta object for the reference '{@link org.eclipse.papyrus.properties.uml.languagepreferences.Preferences#getDefaultEditor <em>Default Editor</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for the reference '<em>Default Editor</em>'.
+ * @see org.eclipse.papyrus.properties.uml.languagepreferences.Preferences#getDefaultEditor()
+ * @see #getPreferences()
+ * @generated
+ */
+ EReference getPreferences_DefaultEditor();
+
+ /**
+ * Returns the factory that creates the instances of the model.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the factory that creates the instances of the model.
+ * @generated
+ */
+ languagepreferencesFactory getlanguagepreferencesFactory();
+
+ /**
+ * <!-- begin-user-doc -->
+ * Defines literals for the meta objects that represent
+ * <ul>
+ * <li>each class,</li>
+ * <li>each feature of each class,</li>
+ * <li>each enum,</li>
+ * <li>and each data type</li>
+ * </ul>
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ interface Literals {
+ /**
+ * The meta object literal for the '{@link org.eclipse.papyrus.properties.uml.languagepreferences.impl.LanguageImpl <em>Language</em>}' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see org.eclipse.papyrus.properties.uml.languagepreferences.impl.LanguageImpl
+ * @see org.eclipse.papyrus.properties.uml.languagepreferences.impl.languagepreferencesPackageImpl#getLanguage()
+ * @generated
+ */
+ EClass LANGUAGE = eINSTANCE.getLanguage();
+
+ /**
+ * The meta object literal for the '<em><b>Name</b></em>' attribute feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ EAttribute LANGUAGE__NAME = eINSTANCE.getLanguage_Name();
+
+ /**
+ * The meta object literal for the '<em><b>Prefered Editor</b></em>' reference feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ EReference LANGUAGE__PREFERED_EDITOR = eINSTANCE.getLanguage_PreferedEditor();
+
+ /**
+ * The meta object literal for the '{@link org.eclipse.papyrus.properties.uml.languagepreferences.impl.EditorImpl <em>Editor</em>}' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see org.eclipse.papyrus.properties.uml.languagepreferences.impl.EditorImpl
+ * @see org.eclipse.papyrus.properties.uml.languagepreferences.impl.languagepreferencesPackageImpl#getEditor()
+ * @generated
+ */
+ EClass EDITOR = eINSTANCE.getEditor();
+
+ /**
+ * The meta object literal for the '<em><b>Class</b></em>' attribute feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ EAttribute EDITOR__CLASS = eINSTANCE.getEditor_Class();
+
+ /**
+ * The meta object literal for the '{@link org.eclipse.papyrus.properties.uml.languagepreferences.impl.PreferencesImpl <em>Preferences</em>}' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see org.eclipse.papyrus.properties.uml.languagepreferences.impl.PreferencesImpl
+ * @see org.eclipse.papyrus.properties.uml.languagepreferences.impl.languagepreferencesPackageImpl#getPreferences()
+ * @generated
+ */
+ EClass PREFERENCES = eINSTANCE.getPreferences();
+
+ /**
+ * The meta object literal for the '<em><b>Languages</b></em>' containment reference list feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ EReference PREFERENCES__LANGUAGES = eINSTANCE.getPreferences_Languages();
+
+ /**
+ * The meta object literal for the '<em><b>Editors</b></em>' containment reference list feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ EReference PREFERENCES__EDITORS = eINSTANCE.getPreferences_Editors();
+
+ /**
+ * The meta object literal for the '<em><b>Default Editor</b></em>' reference feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ EReference PREFERENCES__DEFAULT_EDITOR = eINSTANCE.getPreferences_DefaultEditor();
+
+ }
+
+} //languagepreferencesPackage
diff --git a/plugins/uml/org.eclipse.papyrus.properties.uml/src/org/eclipse/papyrus/properties/uml/languagepreferences/util/languagepreferencesAdapterFactory.java b/plugins/uml/org.eclipse.papyrus.properties.uml/src/org/eclipse/papyrus/properties/uml/languagepreferences/util/languagepreferencesAdapterFactory.java
new file mode 100644
index 00000000000..c41ac6a8e12
--- /dev/null
+++ b/plugins/uml/org.eclipse.papyrus.properties.uml/src/org/eclipse/papyrus/properties/uml/languagepreferences/util/languagepreferencesAdapterFactory.java
@@ -0,0 +1,160 @@
+/**
+ * <copyright>
+ * </copyright>
+ *
+ * $Id$
+ */
+package org.eclipse.papyrus.properties.uml.languagepreferences.util;
+
+import org.eclipse.emf.common.notify.Adapter;
+import org.eclipse.emf.common.notify.Notifier;
+
+import org.eclipse.emf.common.notify.impl.AdapterFactoryImpl;
+
+import org.eclipse.emf.ecore.EObject;
+
+import org.eclipse.papyrus.properties.uml.languagepreferences.*;
+
+/**
+ * <!-- begin-user-doc -->
+ * The <b>Adapter Factory</b> for the model.
+ * It provides an adapter <code>createXXX</code> method for each class of the model.
+ * <!-- end-user-doc -->
+ * @see org.eclipse.papyrus.properties.uml.languagepreferences.languagepreferencesPackage
+ * @generated
+ */
+public class languagepreferencesAdapterFactory extends AdapterFactoryImpl {
+ /**
+ * The cached model package.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected static languagepreferencesPackage modelPackage;
+
+ /**
+ * Creates an instance of the adapter factory.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public languagepreferencesAdapterFactory() {
+ if (modelPackage == null) {
+ modelPackage = languagepreferencesPackage.eINSTANCE;
+ }
+ }
+
+ /**
+ * Returns whether this factory is applicable for the type of the object.
+ * <!-- begin-user-doc -->
+ * This implementation returns <code>true</code> if the object is either the model's package or is an instance object of the model.
+ * <!-- end-user-doc -->
+ * @return whether this factory is applicable for the type of the object.
+ * @generated
+ */
+ @Override
+ public boolean isFactoryForType(Object object) {
+ if (object == modelPackage) {
+ return true;
+ }
+ if (object instanceof EObject) {
+ return ((EObject)object).eClass().getEPackage() == modelPackage;
+ }
+ return false;
+ }
+
+ /**
+ * The switch that delegates to the <code>createXXX</code> methods.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected languagepreferencesSwitch<Adapter> modelSwitch =
+ new languagepreferencesSwitch<Adapter>() {
+ @Override
+ public Adapter caseLanguage(Language object) {
+ return createLanguageAdapter();
+ }
+ @Override
+ public Adapter caseEditor(Editor object) {
+ return createEditorAdapter();
+ }
+ @Override
+ public Adapter casePreferences(Preferences object) {
+ return createPreferencesAdapter();
+ }
+ @Override
+ public Adapter defaultCase(EObject object) {
+ return createEObjectAdapter();
+ }
+ };
+
+ /**
+ * Creates an adapter for the <code>target</code>.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param target the object to adapt.
+ * @return the adapter for the <code>target</code>.
+ * @generated
+ */
+ @Override
+ public Adapter createAdapter(Notifier target) {
+ return modelSwitch.doSwitch((EObject)target);
+ }
+
+
+ /**
+ * Creates a new adapter for an object of class '{@link org.eclipse.papyrus.properties.uml.languagepreferences.Language <em>Language</em>}'.
+ * <!-- begin-user-doc -->
+ * This default implementation returns null so that we can easily ignore cases;
+ * it's useful to ignore a case when inheritance will catch all the cases anyway.
+ * <!-- end-user-doc -->
+ * @return the new adapter.
+ * @see org.eclipse.papyrus.properties.uml.languagepreferences.Language
+ * @generated
+ */
+ public Adapter createLanguageAdapter() {
+ return null;
+ }
+
+ /**
+ * Creates a new adapter for an object of class '{@link org.eclipse.papyrus.properties.uml.languagepreferences.Editor <em>Editor</em>}'.
+ * <!-- begin-user-doc -->
+ * This default implementation returns null so that we can easily ignore cases;
+ * it's useful to ignore a case when inheritance will catch all the cases anyway.
+ * <!-- end-user-doc -->
+ * @return the new adapter.
+ * @see org.eclipse.papyrus.properties.uml.languagepreferences.Editor
+ * @generated
+ */
+ public Adapter createEditorAdapter() {
+ return null;
+ }
+
+ /**
+ * Creates a new adapter for an object of class '{@link org.eclipse.papyrus.properties.uml.languagepreferences.Preferences <em>Preferences</em>}'.
+ * <!-- begin-user-doc -->
+ * This default implementation returns null so that we can easily ignore cases;
+ * it's useful to ignore a case when inheritance will catch all the cases anyway.
+ * <!-- end-user-doc -->
+ * @return the new adapter.
+ * @see org.eclipse.papyrus.properties.uml.languagepreferences.Preferences
+ * @generated
+ */
+ public Adapter createPreferencesAdapter() {
+ return null;
+ }
+
+ /**
+ * Creates a new adapter for the default case.
+ * <!-- begin-user-doc -->
+ * This default implementation returns null.
+ * <!-- end-user-doc -->
+ * @return the new adapter.
+ * @generated
+ */
+ public Adapter createEObjectAdapter() {
+ return null;
+ }
+
+} //languagepreferencesAdapterFactory
diff --git a/plugins/uml/org.eclipse.papyrus.properties.uml/src/org/eclipse/papyrus/properties/uml/languagepreferences/util/languagepreferencesSwitch.java b/plugins/uml/org.eclipse.papyrus.properties.uml/src/org/eclipse/papyrus/properties/uml/languagepreferences/util/languagepreferencesSwitch.java
new file mode 100644
index 00000000000..e94168d94ab
--- /dev/null
+++ b/plugins/uml/org.eclipse.papyrus.properties.uml/src/org/eclipse/papyrus/properties/uml/languagepreferences/util/languagepreferencesSwitch.java
@@ -0,0 +1,156 @@
+/**
+ * <copyright>
+ * </copyright>
+ *
+ * $Id$
+ */
+package org.eclipse.papyrus.properties.uml.languagepreferences.util;
+
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EPackage;
+
+import org.eclipse.emf.ecore.util.Switch;
+
+import org.eclipse.papyrus.properties.uml.languagepreferences.*;
+
+/**
+ * <!-- begin-user-doc -->
+ * The <b>Switch</b> for the model's inheritance hierarchy.
+ * It supports the call {@link #doSwitch(EObject) doSwitch(object)}
+ * to invoke the <code>caseXXX</code> method for each class of the model,
+ * starting with the actual class of the object
+ * and proceeding up the inheritance hierarchy
+ * until a non-null result is returned,
+ * which is the result of the switch.
+ * <!-- end-user-doc -->
+ * @see org.eclipse.papyrus.properties.uml.languagepreferences.languagepreferencesPackage
+ * @generated
+ */
+public class languagepreferencesSwitch<T> extends Switch<T> {
+ /**
+ * The cached model package
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected static languagepreferencesPackage modelPackage;
+
+ /**
+ * Creates an instance of the switch.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public languagepreferencesSwitch() {
+ if (modelPackage == null) {
+ modelPackage = languagepreferencesPackage.eINSTANCE;
+ }
+ }
+
+ /**
+ * Checks whether this is a switch for the given package.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @parameter ePackage the package in question.
+ * @return whether this is a switch for the given package.
+ * @generated
+ */
+ @Override
+ protected boolean isSwitchFor(EPackage ePackage) {
+ return ePackage == modelPackage;
+ }
+
+ /**
+ * Calls <code>caseXXX</code> for each class of the model until one returns a non null result; it yields that result.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the first non-null result returned by a <code>caseXXX</code> call.
+ * @generated
+ */
+ @Override
+ protected T doSwitch(int classifierID, EObject theEObject) {
+ switch (classifierID) {
+ case languagepreferencesPackage.LANGUAGE: {
+ Language language = (Language)theEObject;
+ T result = caseLanguage(language);
+ if (result == null) result = defaultCase(theEObject);
+ return result;
+ }
+ case languagepreferencesPackage.EDITOR: {
+ Editor editor = (Editor)theEObject;
+ T result = caseEditor(editor);
+ if (result == null) result = defaultCase(theEObject);
+ return result;
+ }
+ case languagepreferencesPackage.PREFERENCES: {
+ Preferences preferences = (Preferences)theEObject;
+ T result = casePreferences(preferences);
+ if (result == null) result = defaultCase(theEObject);
+ return result;
+ }
+ default: return defaultCase(theEObject);
+ }
+ }
+
+ /**
+ * Returns the result of interpreting the object as an instance of '<em>Language</em>'.
+ * <!-- begin-user-doc -->
+ * This implementation returns null;
+ * returning a non-null result will terminate the switch.
+ * <!-- end-user-doc -->
+ * @param object the target of the switch.
+ * @return the result of interpreting the object as an instance of '<em>Language</em>'.
+ * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
+ * @generated
+ */
+ public T caseLanguage(Language object) {
+ return null;
+ }
+
+ /**
+ * Returns the result of interpreting the object as an instance of '<em>Editor</em>'.
+ * <!-- begin-user-doc -->
+ * This implementation returns null;
+ * returning a non-null result will terminate the switch.
+ * <!-- end-user-doc -->
+ * @param object the target of the switch.
+ * @return the result of interpreting the object as an instance of '<em>Editor</em>'.
+ * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
+ * @generated
+ */
+ public T caseEditor(Editor object) {
+ return null;
+ }
+
+ /**
+ * Returns the result of interpreting the object as an instance of '<em>Preferences</em>'.
+ * <!-- begin-user-doc -->
+ * This implementation returns null;
+ * returning a non-null result will terminate the switch.
+ * <!-- end-user-doc -->
+ * @param object the target of the switch.
+ * @return the result of interpreting the object as an instance of '<em>Preferences</em>'.
+ * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
+ * @generated
+ */
+ public T casePreferences(Preferences object) {
+ return null;
+ }
+
+ /**
+ * Returns the result of interpreting the object as an instance of '<em>EObject</em>'.
+ * <!-- begin-user-doc -->
+ * This implementation returns null;
+ * returning a non-null result will terminate the switch, but this is the last case anyway.
+ * <!-- end-user-doc -->
+ * @param object the target of the switch.
+ * @return the result of interpreting the object as an instance of '<em>EObject</em>'.
+ * @see #doSwitch(org.eclipse.emf.ecore.EObject)
+ * @generated
+ */
+ @Override
+ public T defaultCase(EObject object) {
+ return null;
+ }
+
+} //languagepreferencesSwitch
diff --git a/plugins/uml/org.eclipse.papyrus.properties.uml/src/org/eclipse/papyrus/properties/uml/modelelement/StereotypeApplicationFactory.java b/plugins/uml/org.eclipse.papyrus.properties.uml/src/org/eclipse/papyrus/properties/uml/modelelement/StereotypeApplicationFactory.java
new file mode 100644
index 00000000000..baae2c5ad80
--- /dev/null
+++ b/plugins/uml/org.eclipse.papyrus.properties.uml/src/org/eclipse/papyrus/properties/uml/modelelement/StereotypeApplicationFactory.java
@@ -0,0 +1,37 @@
+/*****************************************************************************
+ * Copyright (c) 2011 CEA LIST.
+ *
+ * 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:
+ * Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Initial API and implementation
+ *****************************************************************************/
+package org.eclipse.papyrus.properties.uml.modelelement;
+
+import org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain;
+import org.eclipse.emf.edit.domain.EditingDomain;
+import org.eclipse.papyrus.properties.Activator;
+import org.eclipse.papyrus.properties.contexts.DataContextElement;
+import org.eclipse.papyrus.properties.modelelement.ModelElement;
+import org.eclipse.papyrus.properties.modelelement.ModelElementFactory;
+import org.eclipse.papyrus.properties.uml.util.UMLUtil;
+import org.eclipse.uml2.uml.Element;
+
+
+public class StereotypeApplicationFactory implements ModelElementFactory {
+
+ public ModelElement createFromSource(Object sourceElement, DataContextElement context) {
+ Element umlSource = UMLUtil.resolveUMLElement(sourceElement);
+ if(umlSource == null) {
+ Activator.log.warn("Unable to resolve the selected element to a UML Element"); //$NON-NLS-1$
+ return null;
+ }
+
+ EditingDomain domain = AdapterFactoryEditingDomain.getEditingDomainFor(umlSource);
+ return new StereotypeApplicationModelElement(umlSource, domain);
+ }
+
+}
diff --git a/plugins/uml/org.eclipse.papyrus.properties.uml/src/org/eclipse/papyrus/properties/uml/modelelement/StereotypeApplicationModelElement.java b/plugins/uml/org.eclipse.papyrus.properties.uml/src/org/eclipse/papyrus/properties/uml/modelelement/StereotypeApplicationModelElement.java
new file mode 100644
index 00000000000..d3d7db58249
--- /dev/null
+++ b/plugins/uml/org.eclipse.papyrus.properties.uml/src/org/eclipse/papyrus/properties/uml/modelelement/StereotypeApplicationModelElement.java
@@ -0,0 +1,71 @@
+/*****************************************************************************
+ * Copyright (c) 2011 CEA LIST.
+ *
+ * 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:
+ * Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Initial API and implementation
+ *****************************************************************************/
+package org.eclipse.papyrus.properties.uml.modelelement;
+
+import org.eclipse.core.databinding.observable.IObservable;
+import org.eclipse.emf.edit.domain.EditingDomain;
+import org.eclipse.jface.viewers.ILabelProvider;
+import org.eclipse.papyrus.properties.modelelement.AbstractModelElement;
+import org.eclipse.papyrus.properties.providers.EMFObjectLabelProvider;
+import org.eclipse.papyrus.properties.uml.databinding.ProfileApplicationObservableList;
+import org.eclipse.papyrus.properties.uml.databinding.StereotypeApplicationObservableList;
+import org.eclipse.papyrus.properties.uml.providers.ApplicableStereotypeContentProvider;
+import org.eclipse.papyrus.widgets.providers.IStaticContentProvider;
+import org.eclipse.uml2.uml.Element;
+import org.eclipse.uml2.uml.Package;
+
+/**
+ * A ModelElement for handling stereotypes applied on a UML Element
+ *
+ * @author Camille Letavernier
+ */
+public class StereotypeApplicationModelElement extends AbstractModelElement {
+
+ private Element umlSource;
+
+ private EditingDomain domain;
+
+ public StereotypeApplicationModelElement(Element umlSource, EditingDomain domain) {
+ this.umlSource = umlSource;
+ this.domain = domain;
+ }
+
+ public IObservable getObservable(String propertyPath) {
+ if(propertyPath.equals("stereotypeApplication")) {
+ return new StereotypeApplicationObservableList(umlSource, domain);
+ } else if(propertyPath.equals("profileApplication")) {
+ return new ProfileApplicationObservableList((Package)umlSource, domain);
+ }
+
+ return null;
+ }
+
+ @Override
+ public ILabelProvider getLabelProvider(String propertyPath) {
+ return new EMFObjectLabelProvider();
+ }
+
+ @Override
+ public IStaticContentProvider getContentProvider(String propertyPath) {
+ return new ApplicableStereotypeContentProvider(umlSource);
+ }
+
+ @Override
+ public boolean isUnique(String propertyPath) {
+ return true;
+ }
+
+ @Override
+ public boolean isOrdered(String propertyPath) {
+ return false;
+ }
+}
diff --git a/plugins/uml/org.eclipse.papyrus.properties.uml/src/org/eclipse/papyrus/properties/uml/modelelement/StereotypeModelElement.java b/plugins/uml/org.eclipse.papyrus.properties.uml/src/org/eclipse/papyrus/properties/uml/modelelement/StereotypeModelElement.java
index c9387c3818d..2c0669bcd80 100644
--- a/plugins/uml/org.eclipse.papyrus.properties.uml/src/org/eclipse/papyrus/properties/uml/modelelement/StereotypeModelElement.java
+++ b/plugins/uml/org.eclipse.papyrus.properties.uml/src/org/eclipse/papyrus/properties/uml/modelelement/StereotypeModelElement.java
@@ -12,13 +12,14 @@
package org.eclipse.papyrus.properties.uml.modelelement;
import org.eclipse.core.databinding.observable.IObservable;
+import org.eclipse.emf.databinding.EMFProperties;
import org.eclipse.emf.databinding.FeaturePath;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.EStructuralFeature;
import org.eclipse.emf.edit.domain.EditingDomain;
-import org.eclipse.papyrus.properties.databinding.PapyrusObservableList;
-import org.eclipse.papyrus.properties.databinding.PapyrusObservableValue;
import org.eclipse.papyrus.properties.modelelement.EMFModelElement;
+import org.eclipse.papyrus.properties.uml.databinding.PapyrusObservableList;
+import org.eclipse.papyrus.properties.uml.databinding.PapyrusObservableValue;
/**
* A Model Element for manipulating Stereotype properties
@@ -45,7 +46,7 @@ public class StereotypeModelElement extends EMFModelElement {
FeaturePath featurePath = getFeaturePath(propertyPath);
EStructuralFeature feature = getFeature(featurePath);
if(feature.getUpperBound() != 1) {
- return new PapyrusObservableList(getSource(featurePath), feature, domain);
+ return new PapyrusObservableList(EMFProperties.list(featurePath).observe(source), domain, getSource(featurePath), feature);
}
return new PapyrusObservableValue(getSource(featurePath), feature, domain);
diff --git a/plugins/uml/org.eclipse.papyrus.properties.uml/src/org/eclipse/papyrus/properties/uml/modelelement/StereotypeModelElementFactory.java b/plugins/uml/org.eclipse.papyrus.properties.uml/src/org/eclipse/papyrus/properties/uml/modelelement/StereotypeModelElementFactory.java
index 660e75b01f6..11aecba7321 100644
--- a/plugins/uml/org.eclipse.papyrus.properties.uml/src/org/eclipse/papyrus/properties/uml/modelelement/StereotypeModelElementFactory.java
+++ b/plugins/uml/org.eclipse.papyrus.properties.uml/src/org/eclipse/papyrus/properties/uml/modelelement/StereotypeModelElementFactory.java
@@ -37,6 +37,8 @@ import org.eclipse.uml2.uml.Stereotype;
*
* TODO : enable the framework to handle B:name and C:name (Currently not possible,
* as "name" is not directly a property of B nor C)
+ * The problem probably comes from the Stereotype generator, which uses the same
+ * inheritance mechanism as the Ecore generator, and not from the framework itself
*
* @author Camille Letavernier
*/
diff --git a/plugins/uml/org.eclipse.papyrus.properties.uml/src/org/eclipse/papyrus/properties/uml/modelelement/UMLModelElement.java b/plugins/uml/org.eclipse.papyrus.properties.uml/src/org/eclipse/papyrus/properties/uml/modelelement/UMLModelElement.java
new file mode 100644
index 00000000000..2d1bb05ac2c
--- /dev/null
+++ b/plugins/uml/org.eclipse.papyrus.properties.uml/src/org/eclipse/papyrus/properties/uml/modelelement/UMLModelElement.java
@@ -0,0 +1,54 @@
+/*****************************************************************************
+ * Copyright (c) 2011 CEA LIST.
+ *
+ * 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:
+ * Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Initial API and implementation
+ *****************************************************************************/
+package org.eclipse.papyrus.properties.uml.modelelement;
+
+import org.eclipse.core.databinding.observable.IObservable;
+import org.eclipse.core.databinding.observable.list.IObservableList;
+import org.eclipse.core.databinding.observable.value.IObservableValue;
+import org.eclipse.emf.databinding.EMFProperties;
+import org.eclipse.emf.databinding.FeaturePath;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EStructuralFeature;
+import org.eclipse.emf.edit.domain.EditingDomain;
+import org.eclipse.papyrus.properties.modelelement.EMFModelElement;
+import org.eclipse.papyrus.properties.uml.databinding.PapyrusObservableList;
+import org.eclipse.papyrus.properties.uml.databinding.PapyrusObservableValue;
+
+
+public class UMLModelElement extends EMFModelElement {
+
+ public UMLModelElement(EObject source) {
+ super(source);
+ }
+
+ public UMLModelElement(EObject source, EditingDomain domain) {
+ super(source, domain);
+ }
+
+ @Override
+ public IObservable getObservable(String propertyPath) {
+ FeaturePath featurePath = getFeaturePath(propertyPath);
+ EStructuralFeature feature = getFeature(propertyPath);
+ if(feature == null)
+ return null;
+
+ //TODO : PapyrusObservableList (With commit support)
+ if(feature.getUpperBound() != 1) {
+ IObservableList list = domain == null ? EMFProperties.list(featurePath).observe(source) : new PapyrusObservableList(EMFProperties.list(featurePath).observe(source), domain, getSource(featurePath), feature);
+ return list;
+ }
+
+ IObservableValue value = domain == null ? EMFProperties.value(featurePath).observe(source) : new PapyrusObservableValue(getSource(featurePath), feature, domain);
+ return value;
+ }
+
+}
diff --git a/plugins/uml/org.eclipse.papyrus.properties.uml/src/org/eclipse/papyrus/properties/uml/modelelement/UMLModelElementFactory.java b/plugins/uml/org.eclipse.papyrus.properties.uml/src/org/eclipse/papyrus/properties/uml/modelelement/UMLModelElementFactory.java
index 0f7a3a3cf77..a194030ef40 100644
--- a/plugins/uml/org.eclipse.papyrus.properties.uml/src/org/eclipse/papyrus/properties/uml/modelelement/UMLModelElementFactory.java
+++ b/plugins/uml/org.eclipse.papyrus.properties.uml/src/org/eclipse/papyrus/properties/uml/modelelement/UMLModelElementFactory.java
@@ -11,11 +11,14 @@
*****************************************************************************/
package org.eclipse.papyrus.properties.uml.modelelement;
-import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain;
+import org.eclipse.emf.edit.domain.EditingDomain;
+import org.eclipse.papyrus.properties.Activator;
import org.eclipse.papyrus.properties.contexts.DataContextElement;
import org.eclipse.papyrus.properties.modelelement.EMFModelElementFactory;
import org.eclipse.papyrus.properties.modelelement.ModelElement;
import org.eclipse.papyrus.properties.uml.util.UMLUtil;
+import org.eclipse.uml2.uml.Element;
/**
* A Factory for building ModelElements manipulating UML Objects.
@@ -26,7 +29,13 @@ public class UMLModelElementFactory extends EMFModelElementFactory {
@Override
public ModelElement createFromSource(Object source, DataContextElement context) {
- EObject umlSource = UMLUtil.resolveUMLElement(source);
- return super.createFromSource(umlSource, context);
+ Element umlSource = UMLUtil.resolveUMLElement(source);
+ if(umlSource == null) {
+ Activator.log.warn("Unable to resolve the selected element to a UML Element"); //$NON-NLS-1$
+ return null;
+ }
+
+ EditingDomain domain = AdapterFactoryEditingDomain.getEditingDomainFor(umlSource);
+ return new UMLModelElement(umlSource, domain);
}
}
diff --git a/plugins/uml/org.eclipse.papyrus.properties.uml/src/org/eclipse/papyrus/properties/uml/preferences/LanguagePreferences.java b/plugins/uml/org.eclipse.papyrus.properties.uml/src/org/eclipse/papyrus/properties/uml/preferences/LanguagePreferences.java
new file mode 100644
index 00000000000..fd46dba8939
--- /dev/null
+++ b/plugins/uml/org.eclipse.papyrus.properties.uml/src/org/eclipse/papyrus/properties/uml/preferences/LanguagePreferences.java
@@ -0,0 +1,48 @@
+/*****************************************************************************
+ * Copyright (c) 2011 CEA LIST.
+ *
+ * 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:
+ * Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Initial API and implementation
+ *****************************************************************************/
+package org.eclipse.papyrus.properties.uml.preferences;
+
+import org.eclipse.jface.preference.PreferencePage;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.ui.IWorkbench;
+import org.eclipse.ui.IWorkbenchPreferencePage;
+
+
+public class LanguagePreferences extends PreferencePage implements IWorkbenchPreferencePage {
+
+ @Override
+ protected Control createContents(Composite parent) {
+ return null;
+ }
+
+ public void init(IWorkbench workbench) {
+ //Nothing
+ }
+
+ @Override
+ public boolean performOk() {
+
+ return super.performOk();
+ }
+
+ @Override
+ public void performApply() {
+
+ }
+
+ @Override
+ public void performDefaults() {
+
+ }
+
+}
diff --git a/plugins/uml/org.eclipse.papyrus.properties.uml/src/org/eclipse/papyrus/properties/uml/preferences/LanguageRegistry.java b/plugins/uml/org.eclipse.papyrus.properties.uml/src/org/eclipse/papyrus/properties/uml/preferences/LanguageRegistry.java
new file mode 100644
index 00000000000..823bb1f687a
--- /dev/null
+++ b/plugins/uml/org.eclipse.papyrus.properties.uml/src/org/eclipse/papyrus/properties/uml/preferences/LanguageRegistry.java
@@ -0,0 +1,172 @@
+/*****************************************************************************
+ * Copyright (c) 2011 CEA LIST.
+ *
+ * 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:
+ * Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Initial API and implementation
+ *****************************************************************************/
+package org.eclipse.papyrus.properties.uml.preferences;
+
+import java.io.IOException;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Map;
+
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.emf.common.util.URI;
+import org.eclipse.emf.ecore.resource.Resource;
+import org.eclipse.emf.ecore.resource.ResourceSet;
+import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl;
+import org.eclipse.papyrus.properties.uml.Activator;
+import org.eclipse.papyrus.properties.uml.languagepreferences.Editor;
+import org.eclipse.papyrus.properties.uml.languagepreferences.Language;
+import org.eclipse.papyrus.properties.uml.languagepreferences.Preferences;
+import org.eclipse.papyrus.properties.uml.languagepreferences.languagepreferencesFactory;
+import org.eclipse.papyrus.properties.uml.widgets.BodyEditor;
+import org.eclipse.papyrus.properties.util.EMFHelper;
+
+
+public class LanguageRegistry {
+
+ public static LanguageRegistry instance = new LanguageRegistry();
+
+ private LanguageRegistry() {
+ languageMapping = new HashMap<String, List<Editor>>();
+
+ IPath path = Activator.getDefault().getPreferencesPath();
+ String preferencesPath = path.toString() + "/languagePreferences.xmi"; //$NON-NLS-1$
+ URI preferencesURI = URI.createFileURI(preferencesPath);
+
+ try {
+ ResourceSet resourceSet = new ResourceSetImpl();
+ preferences = (Preferences)EMFHelper.loadEMFModel(resourceSet, preferencesURI);
+ } catch (IOException e) {
+ createPreferences(preferencesURI);
+ }
+
+ //Init
+ }
+
+ private void createPreferences(URI preferencesURI) {
+ preferences = languagepreferencesFactory.eINSTANCE.createPreferences();
+ Editor defaultEditor = languagepreferencesFactory.eINSTANCE.createEditor();
+ defaultEditor.setClass("org.eclipse.papyrus.properties.uml.widgets.NaturalLanguageEditor");
+
+ preferences.getEditors().add(defaultEditor);
+ preferences.setDefaultEditor(defaultEditor);
+
+ ResourceSet resourceSet = new ResourceSetImpl();
+ Resource resource = resourceSet.createResource(preferencesURI);
+ resource.getContents().add(preferences);
+
+ persist();
+ }
+
+ private void persist() {
+ try {
+ preferences.eResource().save(Collections.EMPTY_MAP);
+ } catch (IOException ex) {
+ Activator.log.error(ex);
+ }
+ }
+
+ public BodyEditor getEditorFor(String language) {
+ if(languageMapping.containsKey(language)) {
+ List<Editor> editors = languageMapping.get(language);
+ if(editors != null && !editors.isEmpty()) {
+ return getInstance(editors.get(0));
+ }
+ }
+
+ return getEditorFor("");
+ }
+
+ public void setDefaultEditorFor(String languageName, Editor editor) {
+ if(!languageMapping.containsKey(languageName)) {
+ languageMapping.put(languageName, new LinkedList<Editor>());
+ }
+
+ List<Editor> availableEditors = languageMapping.get(languageName);
+ availableEditors.removeAll(Collections.singleton(editor));
+ availableEditors.add(0, editor);
+
+ Language language = getLanguage(languageName);
+ language.setPreferedEditor(editor);
+ }
+
+ public Preferences getPreferences() {
+ return preferences;
+ }
+
+ public void registerEditor(String language, Editor editor) {
+ if(language == null)
+ language = "";
+
+ if(!languageMapping.containsKey(language)) {
+ languageMapping.put(language, new LinkedList<Editor>());
+ }
+
+ List<Editor> editors = languageMapping.get(language);
+ if(!editors.contains(editors)) {
+ editors.add(editor);
+ }
+ }
+
+ private Language getLanguage(String name) {
+ for(Language language : preferences.getLanguages()) {
+ if(language.getName().equals(name)) {
+ return language;
+ }
+ }
+
+ Language language = languagepreferencesFactory.eINSTANCE.createLanguage();
+ language.setName(name);
+ preferences.getLanguages().add(language);
+
+ return language;
+ }
+
+ private BodyEditor getInstance(Editor editor) {
+ Class<? extends BodyEditor> editorClass = getEditorClass(editor);
+ try {
+ return editorClass.newInstance();
+ } catch (InstantiationException ex) {
+ Activator.log.error(ex);
+ } catch (IllegalAccessException ex) {
+ Activator.log.error(ex);
+ }
+
+ return null;
+ }
+
+ private Class<? extends BodyEditor> getEditorClass(Editor editor) {
+ String className = editor.getClass_();
+
+ try {
+ Class<? extends BodyEditor> clazz = Class.forName(className).asSubclass(BodyEditor.class);
+ return clazz;
+ } catch (ClassNotFoundException ex) {
+ Activator.log.error(ex);
+ }
+
+ return null;
+
+ }
+
+ private Map<String, List<Editor>> languageMapping;
+
+ private Preferences preferences;
+
+ public List<String> getLanguages() {
+ List<String> result = new LinkedList<String>(languageMapping.keySet());
+ result.remove("");
+ Collections.sort(result);
+ return result;
+ }
+}
diff --git a/plugins/uml/org.eclipse.papyrus.properties.uml/src/org/eclipse/papyrus/properties/uml/providers/ApplicableStereotypeContentProvider.java b/plugins/uml/org.eclipse.papyrus.properties.uml/src/org/eclipse/papyrus/properties/uml/providers/ApplicableStereotypeContentProvider.java
new file mode 100644
index 00000000000..2139dced52c
--- /dev/null
+++ b/plugins/uml/org.eclipse.papyrus.properties.uml/src/org/eclipse/papyrus/properties/uml/providers/ApplicableStereotypeContentProvider.java
@@ -0,0 +1,30 @@
+/*****************************************************************************
+ * Copyright (c) 2011 CEA LIST.
+ *
+ * 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:
+ * Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Initial API and implementation
+ *****************************************************************************/
+package org.eclipse.papyrus.properties.uml.providers;
+
+import org.eclipse.papyrus.widgets.providers.AbstractStaticContentProvider;
+import org.eclipse.uml2.uml.Element;
+
+
+public class ApplicableStereotypeContentProvider extends AbstractStaticContentProvider {
+
+ private Element umlElement;
+
+ public ApplicableStereotypeContentProvider(Element umlElement) {
+ this.umlElement = umlElement;
+ }
+
+ public Object[] getElements() {
+ return umlElement.getApplicableStereotypes().toArray();
+ }
+
+}
diff --git a/plugins/uml/org.eclipse.papyrus.properties.uml/src/org/eclipse/papyrus/properties/uml/widgets/BodyEditor.java b/plugins/uml/org.eclipse.papyrus.properties.uml/src/org/eclipse/papyrus/properties/uml/widgets/BodyEditor.java
new file mode 100644
index 00000000000..cfb0e6d28cb
--- /dev/null
+++ b/plugins/uml/org.eclipse.papyrus.properties.uml/src/org/eclipse/papyrus/properties/uml/widgets/BodyEditor.java
@@ -0,0 +1,82 @@
+/*****************************************************************************
+ * Copyright (c) 2011 CEA LIST.
+ *
+ * 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:
+ * Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Initial API and implementation
+ *****************************************************************************/
+package org.eclipse.papyrus.properties.uml.widgets;
+
+import org.eclipse.papyrus.properties.modelelement.ModelElement;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Listener;
+
+/**
+ * An interface representing a widget able to edit the body of an
+ * expression.
+ *
+ * Unlike most editors, this editor takes two slots in a grid (One
+ * slot for the languages, and another one for the body)
+ *
+ * @author Camille Letavernier
+ *
+ */
+public interface BodyEditor {
+
+ /**
+ * Creates a widget for editing the body of an expression
+ *
+ * @param parent
+ * The SWT Composite in which the widgets will be displayed
+ * @param style
+ * The style for this widget
+ */
+ public void createWidget(Composite parent, int style);
+
+ /**
+ * Sets the current value for this expression
+ *
+ * @param input
+ * The initial value for the String being edited
+ */
+ public void setInput(String value);
+
+ /**
+ * Disposes this editor
+ */
+ public void dispose();
+
+ /**
+ * Adds a change listener for this editor
+ */
+ public void addChangeListener(Listener listener);
+
+ /**
+ * Removes a registered change listener from this editor
+ */
+ public void removeChangeListener(Listener listener);
+
+ /**
+ * @return the current value for this editor
+ */
+ public String getValue();
+
+ /**
+ * Marks this editor as read-only
+ *
+ * @param readOnly
+ */
+ public void setReadOnly(boolean readOnly);
+
+ /**
+ * Sets the context for this editor
+ *
+ * @param element
+ * The ModelElement being edited
+ */
+ public void setContext(ModelElement context);
+}
diff --git a/plugins/uml/org.eclipse.papyrus.properties.uml/src/org/eclipse/papyrus/properties/uml/widgets/DynamicBodyEditor.java b/plugins/uml/org.eclipse.papyrus.properties.uml/src/org/eclipse/papyrus/properties/uml/widgets/DynamicBodyEditor.java
new file mode 100644
index 00000000000..7d8dd6a5e31
--- /dev/null
+++ b/plugins/uml/org.eclipse.papyrus.properties.uml/src/org/eclipse/papyrus/properties/uml/widgets/DynamicBodyEditor.java
@@ -0,0 +1,145 @@
+/*****************************************************************************
+ * Copyright (c) 2011 CEA LIST.
+ *
+ * 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:
+ * Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Initial API and implementation
+ *****************************************************************************/
+package org.eclipse.papyrus.properties.uml.widgets;
+
+import java.util.HashSet;
+import java.util.Set;
+
+import org.eclipse.papyrus.properties.modelelement.ModelElement;
+import org.eclipse.papyrus.properties.uml.expression.ExpressionList.Expression;
+import org.eclipse.papyrus.properties.uml.preferences.LanguageRegistry;
+import org.eclipse.papyrus.widgets.editors.AbstractValueEditor;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.layout.FillLayout;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Event;
+import org.eclipse.swt.widgets.Listener;
+
+
+public class DynamicBodyEditor extends AbstractValueEditor implements Listener {
+
+ private BodyEditor currentEditor;
+
+ private final Composite bodyEditorContainer;
+
+ private final Set<Listener> changeListeners = new HashSet<Listener>();
+
+ private boolean readOnly = false;
+
+ private ModelElement context = null;
+
+ public DynamicBodyEditor(Composite parent, int style) {
+ super(parent, style);
+
+ bodyEditorContainer = new Composite(this, style);
+ bodyEditorContainer.setLayout(new FillLayout());
+ bodyEditorContainer.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
+ }
+
+ public void display(Expression expression) {
+ String language = expression.getLanguage();
+ String initialText = expression.getBody();
+
+ if(currentEditor != null) {
+ disposeBodyEditor();
+ }
+
+ BodyEditor editor = getEditor(language);
+ editor.createWidget(bodyEditorContainer, SWT.NONE);
+ if(context != null) {
+ editor.setContext(context);
+ }
+
+ editor.setInput(initialText);
+ editor.addChangeListener(this);
+
+ editor.setReadOnly(readOnly);
+
+ bodyEditorContainer.layout();
+
+ currentEditor = editor;
+ }
+
+ public void addChangeListener(Listener listener) {
+ changeListeners.add(listener);
+ }
+
+ public void removeChangeListener(Listener listener) {
+ changeListeners.remove(listener);
+ }
+
+ private BodyEditor getEditor(String language) {
+ return LanguageRegistry.instance.getEditorFor(language);
+ }
+
+ private void disposeBodyEditor() {
+ currentEditor.removeChangeListener(this);
+ currentEditor.dispose();
+ for(Control control : bodyEditorContainer.getChildren()) {
+ control.dispose();
+ }
+ }
+
+ @Override
+ public String getValue() {
+ if(currentEditor != null) {
+ return currentEditor.getValue();
+ }
+ return null;
+ }
+
+ @Override
+ public Object getEditableType() {
+ return String.class;
+ }
+
+ @Override
+ public void setReadOnly(boolean readOnly) {
+ if(currentEditor != null) {
+ currentEditor.setReadOnly(readOnly);
+ }
+
+ this.readOnly = readOnly;
+ }
+
+ @Override
+ public boolean isReadOnly() {
+ return readOnly;
+ }
+
+ @Override
+ public void setToolTipText(String text) {
+ super.setLabelToolTipText(text);
+ }
+
+ public void handleEvent(Event event) {
+ for(Listener listener : changeListeners) {
+ listener.handleEvent(event);
+ }
+ }
+
+ @Override
+ protected GridData getLabelLayoutData() {
+ GridData result = super.getLabelLayoutData();
+ result.verticalAlignment = SWT.BEGINNING;
+ return result;
+ }
+
+ public void setContext(ModelElement modelElement) {
+ this.context = modelElement;
+ if(currentEditor != null) {
+ currentEditor.setContext(context);
+ }
+ }
+}
diff --git a/plugins/uml/org.eclipse.papyrus.properties.uml/src/org/eclipse/papyrus/properties/uml/widgets/ExpressionEditor.java b/plugins/uml/org.eclipse.papyrus.properties.uml/src/org/eclipse/papyrus/properties/uml/widgets/ExpressionEditor.java
new file mode 100644
index 00000000000..3da1dc2764b
--- /dev/null
+++ b/plugins/uml/org.eclipse.papyrus.properties.uml/src/org/eclipse/papyrus/properties/uml/widgets/ExpressionEditor.java
@@ -0,0 +1,116 @@
+/*****************************************************************************
+ * Copyright (c) 2011 CEA LIST.
+ *
+ * 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:
+ * Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Initial API and implementation
+ *****************************************************************************/
+package org.eclipse.papyrus.properties.uml.widgets;
+
+import org.eclipse.core.databinding.observable.list.IObservableList;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.ISelectionChangedListener;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.viewers.SelectionChangedEvent;
+import org.eclipse.jface.viewers.StructuredSelection;
+import org.eclipse.papyrus.properties.modelelement.DataSource;
+import org.eclipse.papyrus.properties.uml.expression.ExpressionList;
+import org.eclipse.papyrus.properties.uml.expression.ExpressionList.Expression;
+import org.eclipse.papyrus.properties.widgets.AbstractPropertyEditor;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.layout.FillLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Event;
+import org.eclipse.swt.widgets.Listener;
+
+
+public class ExpressionEditor extends AbstractPropertyEditor implements Listener, ISelectionChangedListener {
+
+ private final ExpressionLanguageEditor languageEditor;
+
+ private final Composite bodyEditorContainer;
+
+ private IObservableList bodies;
+
+ private Expression currentExpression = null;
+
+ private DynamicBodyEditor bodyEditor;
+
+ public ExpressionEditor(Composite parent, int style) {
+
+ languageEditor = new ExpressionLanguageEditor(parent, SWT.NONE);
+
+ bodyEditorContainer = new Composite(parent, SWT.NONE);
+ bodyEditorContainer.setLayout(new FillLayout());
+
+ bodyEditor = new DynamicBodyEditor(bodyEditorContainer, style);
+ bodyEditor.setLabel("Body");
+ bodyEditor.addChangeListener(this);
+
+ languageEditor.getViewer().addSelectionChangedListener(this);
+
+ setEditor(languageEditor);
+ }
+
+ @Override
+ public void setInput(DataSource input) {
+ bodies = (IObservableList)input.getObservable("UML:OpaqueExpression:body");
+ super.setInput(input);
+ }
+
+ @Override
+ protected void doBinding() {
+ super.doBinding();
+ languageEditor.addCommitListener((ExpressionList)observableList);
+ bodyEditor.setContext(input.getModelElement(propertyPath));
+
+ if(languageEditor.getViewer().getList().getItemCount() > 0) {
+ Object firstItem = languageEditor.getViewer().getElementAt(0);
+ StructuredSelection selection = new StructuredSelection(firstItem);
+ languageEditor.getViewer().setSelection(selection);
+ }
+ }
+
+ /**
+ * @return the IObservableList for this propertyEditor, or null if it is not
+ * available
+ */
+ @Override
+ protected IObservableList getInputObservableList() {
+ if(observableList == null) {
+ observableList = new ExpressionList(super.getInputObservableList(), bodies);
+ }
+
+ return observableList;
+ }
+
+ public void handleEvent(Event event) {
+ String newValue = bodyEditor.getValue();
+ if(newValue == null)
+ return;
+
+ currentExpression.setBody(newValue);
+ ((ExpressionList)observableList).commit(bodyEditor);
+ }
+
+ public void selectionChanged(SelectionChangedEvent event) {
+ ISelection selection = event.getSelection();
+
+ if(!selection.isEmpty() && selection instanceof IStructuredSelection) {
+ IStructuredSelection sSelection = (IStructuredSelection)selection;
+ currentExpression = (Expression)sSelection.getFirstElement();
+
+ bodyEditor.display(currentExpression);
+ }
+ }
+
+ @Override
+ protected void applyReadOnly(boolean readOnly) {
+ languageEditor.setReadOnly(readOnly);
+ bodyEditor.setReadOnly(readOnly);
+ }
+}
diff --git a/plugins/uml/org.eclipse.papyrus.properties.uml/src/org/eclipse/papyrus/properties/uml/widgets/ExpressionLanguageEditor.java b/plugins/uml/org.eclipse.papyrus.properties.uml/src/org/eclipse/papyrus/properties/uml/widgets/ExpressionLanguageEditor.java
new file mode 100644
index 00000000000..3a0e1580ed9
--- /dev/null
+++ b/plugins/uml/org.eclipse.papyrus.properties.uml/src/org/eclipse/papyrus/properties/uml/widgets/ExpressionLanguageEditor.java
@@ -0,0 +1,53 @@
+/*****************************************************************************
+ * Copyright (c) 2011 CEA LIST.
+ *
+ * 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:
+ * Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Initial API and implementation
+ *****************************************************************************/
+package org.eclipse.papyrus.properties.uml.widgets;
+
+import org.eclipse.core.databinding.observable.list.IObservableList;
+import org.eclipse.papyrus.properties.uml.creation.ExpressionLanguageFactory;
+import org.eclipse.papyrus.widgets.editors.MultipleValueEditor;
+import org.eclipse.swt.widgets.Composite;
+
+
+public class ExpressionLanguageEditor extends MultipleValueEditor {
+
+ /**
+ *
+ * Constructor.
+ *
+ * @param parent
+ * The composite in which this editor is created
+ * @param style
+ * The style for this editor's list
+ * @param ordered
+ * True if the list should be ordered
+ * @param unique
+ * True if the list values should be unique
+ * @param label
+ * The label for this editor
+ */
+ public ExpressionLanguageEditor(Composite parent, int style) {
+ super(parent, style, new LanguageSelector(), true, true, null);
+ this.selector = super.selector;
+ }
+
+ @Override
+ public void setReadOnly(boolean readOnly) {
+ super.setReadOnly(readOnly);
+ list.setEnabled(true); //The list is always enabled, to keep the selection-change event
+ }
+
+ @Override
+ public void setModelObservable(IObservableList modelProperty) {
+ super.setModelObservable(modelProperty);
+ setFactory(new ExpressionLanguageFactory(modelProperty));
+ }
+}
diff --git a/plugins/uml/org.eclipse.papyrus.properties.uml/src/org/eclipse/papyrus/properties/uml/widgets/LanguageSelector.java b/plugins/uml/org.eclipse.papyrus.properties.uml/src/org/eclipse/papyrus/properties/uml/widgets/LanguageSelector.java
new file mode 100644
index 00000000000..e4e6d836e86
--- /dev/null
+++ b/plugins/uml/org.eclipse.papyrus.properties.uml/src/org/eclipse/papyrus/properties/uml/widgets/LanguageSelector.java
@@ -0,0 +1,120 @@
+/*****************************************************************************
+ * Copyright (c) 2011 CEA LIST.
+ *
+ * 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:
+ * Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Initial API and implementation
+ *****************************************************************************/
+package org.eclipse.papyrus.properties.uml.widgets;
+
+import java.util.LinkedList;
+
+import org.eclipse.papyrus.properties.uml.expression.ExpressionList.Expression;
+import org.eclipse.papyrus.properties.uml.preferences.LanguageRegistry;
+import org.eclipse.papyrus.properties.widgets.layout.GridData;
+import org.eclipse.papyrus.properties.widgets.layout.PropertiesLayout;
+import org.eclipse.papyrus.widgets.editors.IElementSelectionListener;
+import org.eclipse.papyrus.widgets.editors.IElementSelector;
+import org.eclipse.papyrus.widgets.selectors.StringSelector;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.List;
+import org.eclipse.swt.widgets.Text;
+
+public class LanguageSelector extends StringSelector {
+
+ private Text text;
+
+ private List list;
+
+ /**
+ * Returns a single-element array containing the current text
+ *
+ * {@link IElementSelector#getSelectedElements()}
+ */
+ @Override
+ public Object[] getSelectedElements() {
+ java.util.List<String> languageNames = new LinkedList<String>();
+
+ if(text.getText() != null && !text.getText().trim().equals("")) {
+ languageNames.add(text.getText());
+ } else {
+ String[] selection = list.getSelection();
+ if(selection.length > 0) {
+ for(String languageName : selection) {
+ languageNames.add(languageName);
+ }
+ }
+ list.setSelection(-1);
+ }
+
+ java.util.List<Expression> result = new LinkedList<Expression>();
+
+ for(String languageName : languageNames) {
+ Expression expression = new Expression();
+ expression.setLanguage(languageName);
+ result.add(expression);
+ }
+
+ text.setText(""); //$NON-NLS-1$
+ return result.toArray();
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public void createControls(Composite parent) {
+ Composite container = new Composite(parent, SWT.NONE);
+ container.setLayout(new PropertiesLayout());
+
+ text = new Text(container, SWT.NONE | SWT.BORDER);
+ list = new List(container, SWT.MULTI | SWT.BORDER);
+ list.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
+ for(String language : LanguageRegistry.instance.getLanguages()) {
+ list.add(language);
+ }
+
+ list.addSelectionListener(new SelectionListener() {
+
+ public void widgetSelected(SelectionEvent e) {
+ //Nothing
+ }
+
+ public void widgetDefaultSelected(SelectionEvent e) {
+ if(!elementSelectionListeners.isEmpty()) {
+ Object[] value = getSelectedElements();
+ for(IElementSelectionListener listener : elementSelectionListeners) {
+ listener.addElements(value);
+ }
+ }
+ }
+
+ });
+ }
+
+ /**
+ * Returns all the known languages
+ *
+ * @see org.eclipse.papyrus.widgets.selectors.IElementSelector#getAllElements()
+ */
+ @Override
+ public Object[] getAllElements() {
+ java.util.List<Expression> result = new LinkedList<Expression>();
+ for(String language : list.getItems()) {
+ Expression expression = new Expression();
+ expression.setLanguage(language);
+ result.add(expression);
+ }
+
+ list.setSelection(-1);
+
+ return result.toArray();
+ }
+}
diff --git a/plugins/uml/org.eclipse.papyrus.properties.uml/src/org/eclipse/papyrus/properties/uml/widgets/NaturalLanguageEditor.java b/plugins/uml/org.eclipse.papyrus.properties.uml/src/org/eclipse/papyrus/properties/uml/widgets/NaturalLanguageEditor.java
new file mode 100644
index 00000000000..d67337b079b
--- /dev/null
+++ b/plugins/uml/org.eclipse.papyrus.properties.uml/src/org/eclipse/papyrus/properties/uml/widgets/NaturalLanguageEditor.java
@@ -0,0 +1,102 @@
+/*****************************************************************************
+ * Copyright (c) 2011 CEA LIST.
+ *
+ * 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:
+ * Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Initial API and implementation
+ *****************************************************************************/
+package org.eclipse.papyrus.properties.uml.widgets;
+
+import java.util.HashSet;
+import java.util.Set;
+
+import org.eclipse.core.databinding.observable.value.AbstractObservableValue;
+import org.eclipse.core.databinding.observable.value.IObservableValue;
+import org.eclipse.papyrus.properties.modelelement.ModelElement;
+import org.eclipse.papyrus.widgets.editors.AbstractEditor;
+import org.eclipse.papyrus.widgets.editors.ICommitListener;
+import org.eclipse.papyrus.widgets.editors.StringEditor;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Event;
+import org.eclipse.swt.widgets.Listener;
+
+
+public class NaturalLanguageEditor implements BodyEditor {
+
+ private StringEditor editor;
+
+ private final Set<Listener> changeListeners = new HashSet<Listener>();
+
+ private String currentValue;
+
+ public void createWidget(Composite parent, int style) {
+ editor = new StringEditor(parent, style | SWT.MULTI);
+ editor.addCommitListener(new ICommitListener() {
+
+ public void commit(AbstractEditor editor) {
+ Event event = new Event();
+ event.text = getValue();
+ for(Listener listener : changeListeners) {
+ listener.handleEvent(event);
+ }
+ }
+
+ });
+ }
+
+ public void setInput(String value) {
+ currentValue = value;
+
+ IObservableValue observable = new AbstractObservableValue() {
+
+ public Object getValueType() {
+ return String.class;
+ }
+
+ @Override
+ protected Object doGetValue() {
+ return currentValue;
+ }
+
+ @Override
+ protected void doSetValue(Object value) {
+ if(value instanceof String)
+ currentValue = (String)value;
+ }
+
+ };
+
+ editor.setModelObservable(observable);
+ }
+
+ public void dispose() {
+ editor.dispose();
+ changeListeners.clear();
+ }
+
+ public void addChangeListener(Listener listener) {
+ changeListeners.add(listener);
+ }
+
+ public void removeChangeListener(Listener listener) {
+ changeListeners.remove(listener);
+ }
+
+ public String getValue() {
+ return currentValue;
+ }
+
+ public void setReadOnly(boolean readOnly) {
+ editor.setReadOnly(readOnly);
+ }
+
+ public void setContext(ModelElement context) {
+ // Nothing
+ }
+
+}
diff --git a/plugins/uml/org.eclipse.papyrus.properties.uml/src/org/eclipse/papyrus/properties/uml/widgets/ProfileApplicationEditor.java b/plugins/uml/org.eclipse.papyrus.properties.uml/src/org/eclipse/papyrus/properties/uml/widgets/ProfileApplicationEditor.java
new file mode 100644
index 00000000000..54ab22999ba
--- /dev/null
+++ b/plugins/uml/org.eclipse.papyrus.properties.uml/src/org/eclipse/papyrus/properties/uml/widgets/ProfileApplicationEditor.java
@@ -0,0 +1,98 @@
+/*****************************************************************************
+ * Copyright (c) 2011 CEA LIST.
+ *
+ * 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:
+ * Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Initial API and implementation
+ *****************************************************************************/
+package org.eclipse.papyrus.properties.uml.widgets;
+
+import java.util.List;
+
+import org.eclipse.papyrus.profile.ui.dialogs.RegisteredProfileSelectionDialog;
+import org.eclipse.papyrus.properties.uml.Activator;
+import org.eclipse.papyrus.widgets.editors.MultipleReferenceEditor;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.uml2.uml.Package;
+import org.eclipse.uml2.uml.Profile;
+
+
+public class ProfileApplicationEditor extends MultipleReferenceEditor {
+
+ protected Button addRegisteredProfile;
+
+ protected Package umlPackage;
+
+ public ProfileApplicationEditor(Composite parent, int style) {
+ super(parent, style);
+ }
+
+ /**
+ * Creates the Add/Remove controls,
+ * and the Up/Down controls if the collection is ordered
+ *
+ * @param ordered
+ */
+ @Override
+ protected void createListControls() {
+ super.createListControls();
+ up.dispose();
+ down.dispose();
+ edit.dispose();
+ up = down = edit = null;
+
+ add.setToolTipText("Apply profile");
+ addRegisteredProfile = createButton(Activator.getDefault().getImage("/icons/AddReg.gif"), "Apply registered profile");
+ }
+
+ /**
+ * Applies a profile from workspace
+ *
+ * @see org.eclipse.papyrus.widgets.editors.MultipleValueEditor#addAction()
+ *
+ */
+ @Override
+ protected void addAction() {
+ addRegisteredAction();
+ }
+
+ /**
+ * Applies a profile from the registry
+ */
+ protected void addRegisteredAction() {
+ RegisteredProfileSelectionDialog profileSelectionDialog = new RegisteredProfileSelectionDialog(getShell(), umlPackage);
+ List<Profile> profilesToApply = profileSelectionDialog.run();
+ for(Profile profile : profilesToApply) {
+ modelProperty.add(profile);
+ }
+
+ commit();
+ }
+
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ super.widgetSelected(e);
+ if(e.widget == addRegisteredProfile) {
+ addRegisteredAction();
+ }
+ }
+
+ public void setPackage(Package umlPackage) {
+ this.umlPackage = umlPackage;
+ updateControls();
+ }
+
+ @Override
+ protected void updateControls() {
+ boolean enabled = modelProperty != null && umlPackage != null;
+ add.setEnabled(enabled);
+ addRegisteredProfile.setEnabled(enabled);
+ remove.setEnabled(enabled);
+ }
+}
diff --git a/plugins/uml/org.eclipse.papyrus.properties.uml/src/org/eclipse/papyrus/properties/uml/widgets/ProfileApplicationPropertyEditor.java b/plugins/uml/org.eclipse.papyrus.properties.uml/src/org/eclipse/papyrus/properties/uml/widgets/ProfileApplicationPropertyEditor.java
new file mode 100644
index 00000000000..551558592bf
--- /dev/null
+++ b/plugins/uml/org.eclipse.papyrus.properties.uml/src/org/eclipse/papyrus/properties/uml/widgets/ProfileApplicationPropertyEditor.java
@@ -0,0 +1,49 @@
+/*****************************************************************************
+ * Copyright (c) 2011 CEA LIST.
+ *
+ * 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:
+ * Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Initial API and implementation
+ *****************************************************************************/
+package org.eclipse.papyrus.properties.uml.widgets;
+
+import org.eclipse.papyrus.properties.uml.Activator;
+import org.eclipse.papyrus.properties.uml.util.UMLUtil;
+import org.eclipse.papyrus.properties.widgets.AbstractPropertyEditor;
+import org.eclipse.papyrus.widgets.editors.ICommitListener;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.uml2.uml.Element;
+import org.eclipse.uml2.uml.Package;
+
+public class ProfileApplicationPropertyEditor extends AbstractPropertyEditor {
+
+ private ProfileApplicationEditor editor;
+
+ public ProfileApplicationPropertyEditor(Composite parent, int style) {
+ editor = new ProfileApplicationEditor(parent, style);
+ super.setEditor(editor);
+ }
+
+ @Override
+ public void doBinding() {
+ Object firstSelection = input.getSelection().getFirstElement();
+ Element umlElement = UMLUtil.resolveUMLElement(firstSelection);
+ if(umlElement == null || !(umlElement instanceof Package)) {
+ Activator.log.warn("This editor can only be used with UML Packages");
+ return;
+ }
+
+ editor.setLabelProvider(input.getLabelProvider(propertyPath));
+ editor.setPackage((Package)umlElement);
+
+ if(getInputObservableList() instanceof ICommitListener) {
+ editor.addCommitListener((ICommitListener)getInputObservableList());
+ }
+
+ super.doBinding();
+ }
+}
diff --git a/plugins/uml/org.eclipse.papyrus.properties.uml/src/org/eclipse/papyrus/properties/uml/xtext/CollaborationUseAdapter.java b/plugins/uml/org.eclipse.papyrus.properties.uml/src/org/eclipse/papyrus/properties/uml/xtext/CollaborationUseAdapter.java
index 7aba802cbad..f37b0c7d39c 100644
--- a/plugins/uml/org.eclipse.papyrus.properties.uml/src/org/eclipse/papyrus/properties/uml/xtext/CollaborationUseAdapter.java
+++ b/plugins/uml/org.eclipse.papyrus.properties.uml/src/org/eclipse/papyrus/properties/uml/xtext/CollaborationUseAdapter.java
@@ -1,3 +1,14 @@
+/*****************************************************************************
+ * Copyright (c) 2011 CEA LIST.
+ *
+ * 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:
+ * Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Initial API and implementation
+ *****************************************************************************/
package org.eclipse.papyrus.properties.uml.xtext;
import org.eclipse.emf.ecore.EObject;
diff --git a/plugins/uml/org.eclipse.papyrus.properties.uml/src/org/eclipse/papyrus/properties/uml/xtext/ConnectionPointReferenceAdapter.java b/plugins/uml/org.eclipse.papyrus.properties.uml/src/org/eclipse/papyrus/properties/uml/xtext/ConnectionPointReferenceAdapter.java
index b58382b535a..5031db13726 100644
--- a/plugins/uml/org.eclipse.papyrus.properties.uml/src/org/eclipse/papyrus/properties/uml/xtext/ConnectionPointReferenceAdapter.java
+++ b/plugins/uml/org.eclipse.papyrus.properties.uml/src/org/eclipse/papyrus/properties/uml/xtext/ConnectionPointReferenceAdapter.java
@@ -1,3 +1,14 @@
+/*****************************************************************************
+ * Copyright (c) 2011 CEA LIST.
+ *
+ * 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:
+ * Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Initial API and implementation
+ *****************************************************************************/
package org.eclipse.papyrus.properties.uml.xtext;
import org.eclipse.emf.ecore.EObject;
diff --git a/plugins/uml/org.eclipse.papyrus.properties.uml/src/org/eclipse/papyrus/properties/uml/xtext/MessageAdapter.java b/plugins/uml/org.eclipse.papyrus.properties.uml/src/org/eclipse/papyrus/properties/uml/xtext/MessageAdapter.java
index e3ab5775ef7..516610ca5fc 100644
--- a/plugins/uml/org.eclipse.papyrus.properties.uml/src/org/eclipse/papyrus/properties/uml/xtext/MessageAdapter.java
+++ b/plugins/uml/org.eclipse.papyrus.properties.uml/src/org/eclipse/papyrus/properties/uml/xtext/MessageAdapter.java
@@ -1,3 +1,14 @@
+/*****************************************************************************
+ * Copyright (c) 2011 CEA LIST.
+ *
+ * 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:
+ * Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Initial API and implementation
+ *****************************************************************************/
package org.eclipse.papyrus.properties.uml.xtext;
import org.eclipse.emf.ecore.EObject;
diff --git a/plugins/uml/org.eclipse.papyrus.properties.uml/src/org/eclipse/papyrus/properties/uml/xtext/ParameterAdapter.java b/plugins/uml/org.eclipse.papyrus.properties.uml/src/org/eclipse/papyrus/properties/uml/xtext/ParameterAdapter.java
index 032a2db9c07..8715a718251 100644
--- a/plugins/uml/org.eclipse.papyrus.properties.uml/src/org/eclipse/papyrus/properties/uml/xtext/ParameterAdapter.java
+++ b/plugins/uml/org.eclipse.papyrus.properties.uml/src/org/eclipse/papyrus/properties/uml/xtext/ParameterAdapter.java
@@ -1,3 +1,14 @@
+/*****************************************************************************
+ * Copyright (c) 2011 CEA LIST.
+ *
+ * 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:
+ * Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Initial API and implementation
+ *****************************************************************************/
package org.eclipse.papyrus.properties.uml.xtext;
import org.eclipse.emf.ecore.EObject;
diff --git a/plugins/uml/org.eclipse.papyrus.properties.uml/src/org/eclipse/papyrus/properties/uml/xtext/StateAdapter.java b/plugins/uml/org.eclipse.papyrus.properties.uml/src/org/eclipse/papyrus/properties/uml/xtext/StateAdapter.java
index 72733575b6a..5407bcaba1c 100644
--- a/plugins/uml/org.eclipse.papyrus.properties.uml/src/org/eclipse/papyrus/properties/uml/xtext/StateAdapter.java
+++ b/plugins/uml/org.eclipse.papyrus.properties.uml/src/org/eclipse/papyrus/properties/uml/xtext/StateAdapter.java
@@ -1,3 +1,14 @@
+/*****************************************************************************
+ * Copyright (c) 2011 CEA LIST.
+ *
+ * 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:
+ * Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Initial API and implementation
+ *****************************************************************************/
package org.eclipse.papyrus.properties.uml.xtext;
import org.eclipse.emf.ecore.EObject;
diff --git a/plugins/uml/org.eclipse.papyrus.properties.uml/src/org/eclipse/papyrus/properties/uml/xtext/TransitionAdapter.java b/plugins/uml/org.eclipse.papyrus.properties.uml/src/org/eclipse/papyrus/properties/uml/xtext/TransitionAdapter.java
index 0f8a9e19ffb..156cedb695b 100644
--- a/plugins/uml/org.eclipse.papyrus.properties.uml/src/org/eclipse/papyrus/properties/uml/xtext/TransitionAdapter.java
+++ b/plugins/uml/org.eclipse.papyrus.properties.uml/src/org/eclipse/papyrus/properties/uml/xtext/TransitionAdapter.java
@@ -1,3 +1,14 @@
+/*****************************************************************************
+ * Copyright (c) 2011 CEA LIST.
+ *
+ * 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:
+ * Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Initial API and implementation
+ *****************************************************************************/
package org.eclipse.papyrus.properties.uml.xtext;
import org.eclipse.emf.ecore.EObject;

Back to the top