Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCamille Letavernier2015-01-27 04:52:40 -0500
committerCamille Letavernier2015-01-27 04:52:40 -0500
commite2b9d3a3f4b08b7de11dce70c14b08cf07a0679b (patch)
treef7d865285ed6f4eeb1a677b2e7ea4c252888f374
parentd4aab3724ecd31bc3c9b57946dc00303a61ca22c (diff)
downloadorg.eclipse.papyrus-committers/cletavernie/stoPropertiesEdition.tar.gz
org.eclipse.papyrus-committers/cletavernie/stoPropertiesEdition.tar.xz
org.eclipse.papyrus-committers/cletavernie/stoPropertiesEdition.zip
358077: [Property View - UML] The UML property view should be improvedcommitters/cletavernie/stoPropertiesEdition
for usability concerns https://bugs.eclipse.org/bugs/show_bug.cgi?id=358077 - Initial contribution of properties view configuration for editing Applied Stereotype Properties selected in a diagram
-rw-r--r--plugins/uml/properties/org.eclipse.papyrus.uml.profile.properties/.classpath7
-rw-r--r--plugins/uml/properties/org.eclipse.papyrus.uml.profile.properties/.project28
-rw-r--r--plugins/uml/properties/org.eclipse.papyrus.uml.profile.properties/.settings/org.eclipse.jdt.core.prefs7
-rw-r--r--plugins/uml/properties/org.eclipse.papyrus.uml.profile.properties/META-INF/MANIFEST.MF23
-rw-r--r--plugins/uml/properties/org.eclipse.papyrus.uml.profile.properties/about.html28
-rw-r--r--plugins/uml/properties/org.eclipse.papyrus.uml.profile.properties/build.properties8
-rw-r--r--plugins/uml/properties/org.eclipse.papyrus.uml.profile.properties/model/environment.xmi12
-rw-r--r--plugins/uml/properties/org.eclipse.papyrus.uml.profile.properties/model/properties/UMLProfile.ctx142
-rw-r--r--plugins/uml/properties/org.eclipse.papyrus.uml.profile.properties/model/properties/ui/SingleBoolean.xwt11
-rw-r--r--plugins/uml/properties/org.eclipse.papyrus.uml.profile.properties/model/properties/ui/SingleInteger.xwt11
-rw-r--r--plugins/uml/properties/org.eclipse.papyrus.uml.profile.properties/model/properties/ui/SingleMultivaluedBoolean.xwt11
-rw-r--r--plugins/uml/properties/org.eclipse.papyrus.uml.profile.properties/model/properties/ui/SingleMultivaluedInteger.xwt10
-rw-r--r--plugins/uml/properties/org.eclipse.papyrus.uml.profile.properties/model/properties/ui/SingleMultivaluedReal.xwt9
-rw-r--r--plugins/uml/properties/org.eclipse.papyrus.uml.profile.properties/model/properties/ui/SingleMultivaluedReference.xwt11
-rw-r--r--plugins/uml/properties/org.eclipse.papyrus.uml.profile.properties/model/properties/ui/SingleMultivaluedString.xwt10
-rw-r--r--plugins/uml/properties/org.eclipse.papyrus.uml.profile.properties/model/properties/ui/SingleReal.xwt11
-rw-r--r--plugins/uml/properties/org.eclipse.papyrus.uml.profile.properties/model/properties/ui/SingleReference.xwt11
-rw-r--r--plugins/uml/properties/org.eclipse.papyrus.uml.profile.properties/model/properties/ui/SingleString.xwt10
-rw-r--r--plugins/uml/properties/org.eclipse.papyrus.uml.profile.properties/plugin.xml18
-rw-r--r--plugins/uml/properties/org.eclipse.papyrus.uml.profile.properties/src/org/eclipse/papyrus/uml/profile/properties/Activator.java69
-rw-r--r--plugins/uml/properties/org.eclipse.papyrus.uml.profile.properties/src/org/eclipse/papyrus/uml/profile/properties/constraints/IsAppliedStereotypePropertyConstraint.java150
-rw-r--r--plugins/uml/properties/org.eclipse.papyrus.uml.profile.properties/src/org/eclipse/papyrus/uml/profile/properties/modelelement/AppliedStereotypePropertyModelElement.java75
-rw-r--r--plugins/uml/properties/org.eclipse.papyrus.uml.profile.properties/src/org/eclipse/papyrus/uml/profile/properties/modelelement/AppliedStereotypePropertyModelElementFactory.java43
23 files changed, 715 insertions, 0 deletions
diff --git a/plugins/uml/properties/org.eclipse.papyrus.uml.profile.properties/.classpath b/plugins/uml/properties/org.eclipse.papyrus.uml.profile.properties/.classpath
new file mode 100644
index 00000000000..2d1a4302f04
--- /dev/null
+++ b/plugins/uml/properties/org.eclipse.papyrus.uml.profile.properties/.classpath
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
diff --git a/plugins/uml/properties/org.eclipse.papyrus.uml.profile.properties/.project b/plugins/uml/properties/org.eclipse.papyrus.uml.profile.properties/.project
new file mode 100644
index 00000000000..27d26d3c2a0
--- /dev/null
+++ b/plugins/uml/properties/org.eclipse.papyrus.uml.profile.properties/.project
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.papyrus.uml.profile.properties</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
diff --git a/plugins/uml/properties/org.eclipse.papyrus.uml.profile.properties/.settings/org.eclipse.jdt.core.prefs b/plugins/uml/properties/org.eclipse.papyrus.uml.profile.properties/.settings/org.eclipse.jdt.core.prefs
new file mode 100644
index 00000000000..44217f8c068
--- /dev/null
+++ b/plugins/uml/properties/org.eclipse.papyrus.uml.profile.properties/.settings/org.eclipse.jdt.core.prefs
@@ -0,0 +1,7 @@
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
+org.eclipse.jdt.core.compiler.compliance=1.5
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.5
diff --git a/plugins/uml/properties/org.eclipse.papyrus.uml.profile.properties/META-INF/MANIFEST.MF b/plugins/uml/properties/org.eclipse.papyrus.uml.profile.properties/META-INF/MANIFEST.MF
new file mode 100644
index 00000000000..47c21f1ab31
--- /dev/null
+++ b/plugins/uml/properties/org.eclipse.papyrus.uml.profile.properties/META-INF/MANIFEST.MF
@@ -0,0 +1,23 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: Profile Properties
+Bundle-SymbolicName: org.eclipse.papyrus.uml.profile.properties;singleton:=true
+Bundle-Version: 0.9.0.qualifier
+Bundle-Activator: org.eclipse.papyrus.uml.profile.properties.Activator
+Bundle-Vendor: Eclipse Modeling Project
+Require-Bundle: org.eclipse.ui,
+ org.eclipse.core.runtime,
+ org.eclipse.papyrus.views.properties;bundle-version="0.9.0",
+ org.eclipse.papyrus.views.properties.model;bundle-version="0.9.0",
+ org.eclipse.papyrus.uml.profile;bundle-version="0.9.0",
+ org.eclipse.uml2.uml;bundle-version="4.0.0",
+ org.eclipse.papyrus.infra.core.log;bundle-version="0.9.0",
+ org.eclipse.core.databinding;bundle-version="1.4.1",
+ org.eclipse.emf;bundle-version="2.6.0",
+ org.eclipse.emf.edit;bundle-version="2.8.0",
+ org.eclipse.papyrus.infra.widgets;bundle-version="0.9.0",
+ org.eclipse.emf.databinding;bundle-version="1.2.0",
+ org.eclipse.core.databinding.property;bundle-version="1.4.0",
+ org.eclipse.papyrus.uml.tools;bundle-version="0.9.0"
+Bundle-RequiredExecutionEnvironment: J2SE-1.5
+Bundle-ActivationPolicy: lazy
diff --git a/plugins/uml/properties/org.eclipse.papyrus.uml.profile.properties/about.html b/plugins/uml/properties/org.eclipse.papyrus.uml.profile.properties/about.html
new file mode 100644
index 00000000000..82d49bf5f81
--- /dev/null
+++ b/plugins/uml/properties/org.eclipse.papyrus.uml.profile.properties/about.html
@@ -0,0 +1,28 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/>
+<title>About</title>
+</head>
+<body lang="EN-US">
+<h2>About This Content</h2>
+
+<p>June 5, 2007</p>
+<h3>License</h3>
+
+<p>The Eclipse Foundation makes available all content in this plug-in (&quot;Content&quot;). Unless otherwise
+indicated below, the Content is provided to you under the terms and conditions of the
+Eclipse Public License Version 1.0 (&quot;EPL&quot;). A copy of the EPL is available
+at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
+For purposes of the EPL, &quot;Program&quot; will mean the Content.</p>
+
+<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is
+being redistributed by another party (&quot;Redistributor&quot;) and different terms and conditions may
+apply to your use of any object code in the Content. Check the Redistributor's license that was
+provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise
+indicated below, the terms and conditions of the EPL still apply to any source code in the Content
+and such source code may be obtained at <a href="http://www.eclipse.org/">http://www.eclipse.org</a>.</p>
+
+</body>
+</html>
diff --git a/plugins/uml/properties/org.eclipse.papyrus.uml.profile.properties/build.properties b/plugins/uml/properties/org.eclipse.papyrus.uml.profile.properties/build.properties
new file mode 100644
index 00000000000..8f4f36a63f4
--- /dev/null
+++ b/plugins/uml/properties/org.eclipse.papyrus.uml.profile.properties/build.properties
@@ -0,0 +1,8 @@
+source.. = src/
+output.. = bin/
+bin.includes = META-INF/,\
+ .,\
+ plugin.xml,\
+ about.html,\
+ model/
+src.includes = about.html
diff --git a/plugins/uml/properties/org.eclipse.papyrus.uml.profile.properties/model/environment.xmi b/plugins/uml/properties/org.eclipse.papyrus.uml.profile.properties/model/environment.xmi
new file mode 100644
index 00000000000..004528380c9
--- /dev/null
+++ b/plugins/uml/properties/org.eclipse.papyrus.uml.profile.properties/model/environment.xmi
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<environment:Environment
+ xmi:version="2.0"
+ xmlns:xmi="http://www.omg.org/XMI"
+ xmlns:environment="http://www.eclipse.org/papyrus/properties/environment/0.9">
+ <constraintTypes
+ label="IsAppliedStereotypeProperty"
+ constraintClass="org.eclipse.papyrus.uml.profile.properties.constraints.IsAppliedStereotypePropertyConstraint"/>
+ <modelElementFactories
+ name="Applied Stereotype Property"
+ factoryClass="org.eclipse.papyrus.uml.profile.properties.modelelement.AppliedStereotypePropertyModelElementFactory"/>
+</environment:Environment>
diff --git a/plugins/uml/properties/org.eclipse.papyrus.uml.profile.properties/model/properties/UMLProfile.ctx b/plugins/uml/properties/org.eclipse.papyrus.uml.profile.properties/model/properties/UMLProfile.ctx
new file mode 100644
index 00000000000..fe6e214e639
--- /dev/null
+++ b/plugins/uml/properties/org.eclipse.papyrus.uml.profile.properties/model/properties/UMLProfile.ctx
@@ -0,0 +1,142 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<contexts:Context xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:constraints="http://www.eclipse.org/papyrus/constraints/0.9" xmlns:contexts="http://www.eclipse.org/papyrus/properties/contexts/0.9" name="UMLProfile">
+ <tabs label="UML" id="uml" category="org.eclipse.papyrus" image="" priority="10">
+ <sections name="SingleString" sectionFile="ui/SingleString.xwt">
+ <widget href="ui/SingleString.xwt#/"/>
+ </sections>
+ <sections name="SingleInteger" sectionFile="ui/SingleInteger.xwt">
+ <widget href="ui/SingleInteger.xwt#/"/>
+ </sections>
+ <sections name="SingleReal" sectionFile="ui/SingleReal.xwt">
+ <widget href="ui/SingleReal.xwt#/"/>
+ </sections>
+ <sections name="SingleReference" sectionFile="ui/SingleReference.xwt">
+ <widget href="ui/SingleReference.xwt#/"/>
+ </sections>
+ <sections name="SingleBoolean" sectionFile="ui/SingleBoolean.xwt">
+ <widget href="ui/SingleBoolean.xwt#/"/>
+ </sections>
+ <sections name="SingleMultivaluedString" sectionFile="ui/SingleMultivaluedString.xwt">
+ <widget href="ui/SingleMultivaluedString.xwt#/"/>
+ </sections>
+ <sections name="SingleMultivaluedInteger" sectionFile="ui/SingleMultivaluedInteger.xwt">
+ <widget href="ui/SingleMultivaluedInteger.xwt#/"/>
+ </sections>
+ <sections name="SingleMultivaluedReal" sectionFile="ui/SingleMultivaluedReal.xwt">
+ <widget href="ui/SingleMultivaluedReal.xwt#/"/>
+ </sections>
+ <sections name="SingleMultivaluedReference" sectionFile="ui/SingleMultivaluedReference.xwt">
+ <widget href="ui/SingleMultivaluedReference.xwt#/"/>
+ </sections>
+ <sections name="SingleMultivaluedBoolean" sectionFile="ui/SingleMultivaluedBoolean.xwt">
+ <widget href="ui/SingleMultivaluedBoolean.xwt#/"/>
+ </sections>
+ </tabs>
+ <views name="SingleString" sections="//@tabs.0/@sections.0">
+ <constraints xsi:type="constraints:SimpleConstraint" name="isStringProperty">
+ <constraintType href="ppe:/environment/org.eclipse.papyrus.uml.profile.properties/model/environment.xmi#//@constraintTypes.0"/>
+ <properties xsi:type="constraints:ValueProperty" name="propertyType" value="String"/>
+ <properties xsi:type="constraints:ValueProperty" name="multiplicity" value="1"/>
+ </constraints>
+ </views>
+ <views name="SingleInteger" sections="//@tabs.0/@sections.1">
+ <constraints xsi:type="constraints:SimpleConstraint" name="isIntegerProperty">
+ <constraintType href="ppe:/environment/org.eclipse.papyrus.uml.profile.properties/model/environment.xmi#//@constraintTypes.0"/>
+ <properties xsi:type="constraints:ValueProperty" name="propertyType" value="Integer"/>
+ <properties xsi:type="constraints:ValueProperty" name="multiplicity" value="1"/>
+ </constraints>
+ </views>
+ <views name="SingleReal" sections="//@tabs.0/@sections.2">
+ <constraints xsi:type="constraints:SimpleConstraint" name="isRealProperty">
+ <constraintType href="ppe:/environment/org.eclipse.papyrus.uml.profile.properties/model/environment.xmi#//@constraintTypes.0"/>
+ <properties xsi:type="constraints:ValueProperty" name="propertyType" value="Real"/>
+ <properties xsi:type="constraints:ValueProperty" name="multiplicity" value="1"/>
+ </constraints>
+ </views>
+ <views name="SingleReference" sections="//@tabs.0/@sections.3">
+ <constraints xsi:type="constraints:SimpleConstraint" name="isReferenceProperty">
+ <constraintType href="ppe:/environment/org.eclipse.papyrus.uml.profile.properties/model/environment.xmi#//@constraintTypes.0"/>
+ <properties xsi:type="constraints:ValueProperty" name="propertyType" value="Reference"/>
+ <properties xsi:type="constraints:ValueProperty" name="multiplicity" value="1"/>
+ </constraints>
+ </views>
+ <views name="SingleBoolean" sections="//@tabs.0/@sections.4">
+ <constraints xsi:type="constraints:SimpleConstraint" name="isBooleanProperty">
+ <constraintType href="ppe:/environment/org.eclipse.papyrus.uml.profile.properties/model/environment.xmi#//@constraintTypes.0"/>
+ <properties xsi:type="constraints:ValueProperty" name="propertyType" value="Boolean"/>
+ <properties xsi:type="constraints:ValueProperty" name="multiplicity" value="1"/>
+ </constraints>
+ </views>
+ <views name="SingleMultivaluedString" sections="//@tabs.0/@sections.5">
+ <constraints xsi:type="constraints:SimpleConstraint" name="isMultivaluedStringProperty">
+ <constraintType href="ppe:/environment/org.eclipse.papyrus.uml.profile.properties/model/environment.xmi#//@constraintTypes.0"/>
+ <properties xsi:type="constraints:ValueProperty" name="propertyType" value="String"/>
+ <properties xsi:type="constraints:ValueProperty" name="multiplicity" value="-1"/>
+ </constraints>
+ </views>
+ <views name="SingleMultivaluedInteger" sections="//@tabs.0/@sections.6">
+ <constraints xsi:type="constraints:SimpleConstraint" name="isMultivaluedIntegerProperty">
+ <constraintType href="ppe:/environment/org.eclipse.papyrus.uml.profile.properties/model/environment.xmi#//@constraintTypes.0"/>
+ <properties xsi:type="constraints:ValueProperty" name="propertyType" value="Integer"/>
+ <properties xsi:type="constraints:ValueProperty" name="multiplicity" value="-1"/>
+ </constraints>
+ </views>
+ <views name="SingleMultivaluedReal" sections="//@tabs.0/@sections.7">
+ <constraints xsi:type="constraints:SimpleConstraint" name="isMultivaluedRealProperty">
+ <constraintType href="ppe:/environment/org.eclipse.papyrus.uml.profile.properties/model/environment.xmi#//@constraintTypes.0"/>
+ <properties xsi:type="constraints:ValueProperty" name="propertyType" value="Real"/>
+ <properties xsi:type="constraints:ValueProperty" name="multiplicity" value="-1"/>
+ </constraints>
+ </views>
+ <views name="SingleMultivaluedReference" sections="//@tabs.0/@sections.8">
+ <constraints xsi:type="constraints:SimpleConstraint" name="isMultivaluedReferenceProperty">
+ <constraintType href="ppe:/environment/org.eclipse.papyrus.uml.profile.properties/model/environment.xmi#//@constraintTypes.0"/>
+ <properties xsi:type="constraints:ValueProperty" name="propertyType" value="Reference"/>
+ <properties xsi:type="constraints:ValueProperty" name="multiplicity" value="-1"/>
+ </constraints>
+ </views>
+ <views name="SingleMultivaluedBoolean" sections="//@tabs.0/@sections.9">
+ <constraints xsi:type="constraints:SimpleConstraint" name="isMultivaluedBooleanProperty">
+ <constraintType href="ppe:/environment/org.eclipse.papyrus.uml.profile.properties/model/environment.xmi#//@constraintTypes.0"/>
+ <properties xsi:type="constraints:ValueProperty" name="propertyType" value="Boolean"/>
+ <properties xsi:type="constraints:ValueProperty" name="multiplicity" value="-1"/>
+ </constraints>
+ </views>
+ <dataContexts name="Profile" label="Profile">
+ <elements xsi:type="contexts:DataContextPackage" name="SingleValue">
+ <elements name="String">
+ <properties name="value" label="" description="The property's value"/>
+ </elements>
+ <elements name="Boolean">
+ <properties name="value" label="" type="Boolean" description="The property's value"/>
+ </elements>
+ <elements name="Integer">
+ <properties name="value" label="" type="Integer" description="The property's value"/>
+ </elements>
+ <elements name="Reference">
+ <properties name="value" label="" type="Reference" description="The property's value"/>
+ </elements>
+ <elements name="Real">
+ <properties name="value" label="" description="The property's value"/>
+ </elements>
+ </elements>
+ <elements xsi:type="contexts:DataContextPackage" name="MultiValue">
+ <elements name="String">
+ <properties name="values" label="" multiplicity="-1" description="The property's values"/>
+ </elements>
+ <elements name="Boolean">
+ <properties name="values" label="" type="Boolean" multiplicity="-1" description="The property's values"/>
+ </elements>
+ <elements name="Integer">
+ <properties name="values" label="" type="Integer" multiplicity="-1" description="The property's values"/>
+ </elements>
+ <elements name="Reference">
+ <properties name="values" label="" type="Reference" multiplicity="-1" description="The property's values"/>
+ </elements>
+ <elements name="Real">
+ <properties name="values" label="" multiplicity="-1" description="The property's values"/>
+ </elements>
+ </elements>
+ <modelElementFactory href="ppe:/environment/org.eclipse.papyrus.uml.profile.properties/model/environment.xmi#//@modelElementFactories.0"/>
+ </dataContexts>
+</contexts:Context>
diff --git a/plugins/uml/properties/org.eclipse.papyrus.uml.profile.properties/model/properties/ui/SingleBoolean.xwt b/plugins/uml/properties/org.eclipse.papyrus.uml.profile.properties/model/properties/ui/SingleBoolean.xwt
new file mode 100644
index 00000000000..18129e5ad36
--- /dev/null
+++ b/plugins/uml/properties/org.eclipse.papyrus.uml.profile.properties/model/properties/ui/SingleBoolean.xwt
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<Composite
+ xmlns:ppel="clr-namespace:org.eclipse.papyrus.views.properties.widgets.layout"
+ xmlns:x="http://www.eclipse.org/xwt" xmlns="http://www.eclipse.org/xwt/presentation"
+ xmlns:ppe="clr-namespace:org.eclipse.papyrus.views.properties.widgets">
+ <Composite.layout>
+ <ppel:PropertiesLayout></ppel:PropertiesLayout>
+ </Composite.layout>
+ <ppe:BooleanRadio input="{Binding}"
+ property="Profile:SingleValue:Boolean:value"></ppe:BooleanRadio>
+</Composite> \ No newline at end of file
diff --git a/plugins/uml/properties/org.eclipse.papyrus.uml.profile.properties/model/properties/ui/SingleInteger.xwt b/plugins/uml/properties/org.eclipse.papyrus.uml.profile.properties/model/properties/ui/SingleInteger.xwt
new file mode 100644
index 00000000000..4d870c23eaa
--- /dev/null
+++ b/plugins/uml/properties/org.eclipse.papyrus.uml.profile.properties/model/properties/ui/SingleInteger.xwt
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<Composite
+ xmlns:ppel="clr-namespace:org.eclipse.papyrus.views.properties.widgets.layout"
+ xmlns:ppe="clr-namespace:org.eclipse.papyrus.views.properties.widgets"
+ xmlns="http://www.eclipse.org/xwt/presentation" xmlns:x="http://www.eclipse.org/xwt">
+ <Composite.layout>
+ <ppel:PropertiesLayout></ppel:PropertiesLayout>
+ </Composite.layout>
+ <ppe:IntegerEditor input="{Binding}"
+ property="Profile:SingleValue:Integer:value"></ppe:IntegerEditor>
+</Composite> \ No newline at end of file
diff --git a/plugins/uml/properties/org.eclipse.papyrus.uml.profile.properties/model/properties/ui/SingleMultivaluedBoolean.xwt b/plugins/uml/properties/org.eclipse.papyrus.uml.profile.properties/model/properties/ui/SingleMultivaluedBoolean.xwt
new file mode 100644
index 00000000000..9edfec7daf8
--- /dev/null
+++ b/plugins/uml/properties/org.eclipse.papyrus.uml.profile.properties/model/properties/ui/SingleMultivaluedBoolean.xwt
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<Composite xmlns:x="http://www.eclipse.org/xwt"
+ xmlns:ppe="clr-namespace:org.eclipse.papyrus.views.properties.widgets"
+ xmlns:ppel="clr-namespace:org.eclipse.papyrus.views.properties.widgets.layout"
+ xmlns="http://www.eclipse.org/xwt/presentation">
+ <Composite.layout>
+ <ppel:PropertiesLayout></ppel:PropertiesLayout>
+ </Composite.layout>
+ <ppe:MultiString input="{Binding}"
+ property="Profile:MultiValue:Boolean:values"></ppe:MultiString>
+</Composite> \ No newline at end of file
diff --git a/plugins/uml/properties/org.eclipse.papyrus.uml.profile.properties/model/properties/ui/SingleMultivaluedInteger.xwt b/plugins/uml/properties/org.eclipse.papyrus.uml.profile.properties/model/properties/ui/SingleMultivaluedInteger.xwt
new file mode 100644
index 00000000000..eee7917b85d
--- /dev/null
+++ b/plugins/uml/properties/org.eclipse.papyrus.uml.profile.properties/model/properties/ui/SingleMultivaluedInteger.xwt
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<Composite xmlns="http://www.eclipse.org/xwt/presentation"
+ xmlns:x="http://www.eclipse.org/xwt" xmlns:ppe="clr-namespace:org.eclipse.papyrus.views.properties.widgets"
+ xmlns:ppel="clr-namespace:org.eclipse.papyrus.views.properties.widgets.layout">
+ <Composite.layout>
+ <ppel:PropertiesLayout></ppel:PropertiesLayout>
+ </Composite.layout>
+ <ppe:MultiInteger input="{Binding}"
+ property="Profile:MultiValue:Integer:values"></ppe:MultiInteger>
+</Composite> \ No newline at end of file
diff --git a/plugins/uml/properties/org.eclipse.papyrus.uml.profile.properties/model/properties/ui/SingleMultivaluedReal.xwt b/plugins/uml/properties/org.eclipse.papyrus.uml.profile.properties/model/properties/ui/SingleMultivaluedReal.xwt
new file mode 100644
index 00000000000..feb0633217c
--- /dev/null
+++ b/plugins/uml/properties/org.eclipse.papyrus.uml.profile.properties/model/properties/ui/SingleMultivaluedReal.xwt
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<Composite xmlns:ppe="clr-namespace:org.eclipse.papyrus.views.properties.widgets"
+ xmlns="http://www.eclipse.org/xwt/presentation" xmlns:x="http://www.eclipse.org/xwt"
+ xmlns:ppel="clr-namespace:org.eclipse.papyrus.views.properties.widgets.layout">
+ <Composite.layout>
+ <ppel:PropertiesLayout></ppel:PropertiesLayout>
+ </Composite.layout>
+ <ppe:MultiString input="{Binding}" property="Profile:MultiValue:Real:values"></ppe:MultiString>
+</Composite> \ No newline at end of file
diff --git a/plugins/uml/properties/org.eclipse.papyrus.uml.profile.properties/model/properties/ui/SingleMultivaluedReference.xwt b/plugins/uml/properties/org.eclipse.papyrus.uml.profile.properties/model/properties/ui/SingleMultivaluedReference.xwt
new file mode 100644
index 00000000000..7cb5b5f0247
--- /dev/null
+++ b/plugins/uml/properties/org.eclipse.papyrus.uml.profile.properties/model/properties/ui/SingleMultivaluedReference.xwt
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<Composite xmlns="http://www.eclipse.org/xwt/presentation"
+ xmlns:ppe="clr-namespace:org.eclipse.papyrus.views.properties.widgets"
+ xmlns:x="http://www.eclipse.org/xwt"
+ xmlns:ppel="clr-namespace:org.eclipse.papyrus.views.properties.widgets.layout">
+ <Composite.layout>
+ <ppel:PropertiesLayout></ppel:PropertiesLayout>
+ </Composite.layout>
+ <ppe:MultiReference input="{Binding}"
+ property="Profile:MultiValue:Reference:values"></ppe:MultiReference>
+</Composite> \ No newline at end of file
diff --git a/plugins/uml/properties/org.eclipse.papyrus.uml.profile.properties/model/properties/ui/SingleMultivaluedString.xwt b/plugins/uml/properties/org.eclipse.papyrus.uml.profile.properties/model/properties/ui/SingleMultivaluedString.xwt
new file mode 100644
index 00000000000..845cbe6beac
--- /dev/null
+++ b/plugins/uml/properties/org.eclipse.papyrus.uml.profile.properties/model/properties/ui/SingleMultivaluedString.xwt
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<Composite xmlns:x="http://www.eclipse.org/xwt" xmlns="http://www.eclipse.org/xwt/presentation"
+ xmlns:ppe="clr-namespace:org.eclipse.papyrus.views.properties.widgets"
+ xmlns:ppel="clr-namespace:org.eclipse.papyrus.views.properties.widgets.layout">
+ <Composite.layout>
+ <ppel:PropertiesLayout></ppel:PropertiesLayout>
+ </Composite.layout>
+ <ppe:MultiString input="{Binding}"
+ property="Profile:MultiValue:String:values"></ppe:MultiString>
+</Composite> \ No newline at end of file
diff --git a/plugins/uml/properties/org.eclipse.papyrus.uml.profile.properties/model/properties/ui/SingleReal.xwt b/plugins/uml/properties/org.eclipse.papyrus.uml.profile.properties/model/properties/ui/SingleReal.xwt
new file mode 100644
index 00000000000..8bfd3c0dad3
--- /dev/null
+++ b/plugins/uml/properties/org.eclipse.papyrus.uml.profile.properties/model/properties/ui/SingleReal.xwt
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<Composite xmlns:x="http://www.eclipse.org/xwt"
+ xmlns:ppe="clr-namespace:org.eclipse.papyrus.views.properties.widgets"
+ xmlns:ppel="clr-namespace:org.eclipse.papyrus.views.properties.widgets.layout"
+ xmlns="http://www.eclipse.org/xwt/presentation">
+ <Composite.layout>
+ <ppel:PropertiesLayout></ppel:PropertiesLayout>
+ </Composite.layout>
+ <ppe:StringEditor input="{Binding}"
+ property="Profile:SingleValue:Real:value"></ppe:StringEditor>
+</Composite> \ No newline at end of file
diff --git a/plugins/uml/properties/org.eclipse.papyrus.uml.profile.properties/model/properties/ui/SingleReference.xwt b/plugins/uml/properties/org.eclipse.papyrus.uml.profile.properties/model/properties/ui/SingleReference.xwt
new file mode 100644
index 00000000000..8cea8aa628c
--- /dev/null
+++ b/plugins/uml/properties/org.eclipse.papyrus.uml.profile.properties/model/properties/ui/SingleReference.xwt
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<Composite xmlns:ppe="clr-namespace:org.eclipse.papyrus.views.properties.widgets"
+ xmlns="http://www.eclipse.org/xwt/presentation"
+ xmlns:ppel="clr-namespace:org.eclipse.papyrus.views.properties.widgets.layout"
+ xmlns:x="http://www.eclipse.org/xwt">
+ <Composite.layout>
+ <ppel:PropertiesLayout></ppel:PropertiesLayout>
+ </Composite.layout>
+ <ppe:ReferenceDialog input="{Binding}"
+ property="Profile:SingleValue:Reference:value"></ppe:ReferenceDialog>
+</Composite> \ No newline at end of file
diff --git a/plugins/uml/properties/org.eclipse.papyrus.uml.profile.properties/model/properties/ui/SingleString.xwt b/plugins/uml/properties/org.eclipse.papyrus.uml.profile.properties/model/properties/ui/SingleString.xwt
new file mode 100644
index 00000000000..9cc80229624
--- /dev/null
+++ b/plugins/uml/properties/org.eclipse.papyrus.uml.profile.properties/model/properties/ui/SingleString.xwt
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<Composite xmlns:ppe="clr-namespace:org.eclipse.papyrus.views.properties.widgets"
+ xmlns="http://www.eclipse.org/xwt/presentation" xmlns:x="http://www.eclipse.org/xwt"
+ xmlns:ppel="clr-namespace:org.eclipse.papyrus.views.properties.widgets.layout">
+ <Composite.layout>
+ <ppel:PropertiesLayout></ppel:PropertiesLayout>
+ </Composite.layout>
+ <ppe:StringMultiline input="{Binding}"
+ property="Profile:SingleValue:String:value"></ppe:StringMultiline>
+</Composite> \ No newline at end of file
diff --git a/plugins/uml/properties/org.eclipse.papyrus.uml.profile.properties/plugin.xml b/plugins/uml/properties/org.eclipse.papyrus.uml.profile.properties/plugin.xml
new file mode 100644
index 00000000000..3b26bba3cf0
--- /dev/null
+++ b/plugins/uml/properties/org.eclipse.papyrus.uml.profile.properties/plugin.xml
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.4"?>
+<plugin>
+ <extension
+ point="org.eclipse.papyrus.views.properties.context">
+ <context
+ contextModel="model/properties/UMLProfile.ctx"
+ loadDefault="true">
+ </context>
+ </extension>
+ <extension
+ point="org.eclipse.papyrus.views.properties.environment">
+ <environment
+ environmentModel="model/environment.xmi">
+ </environment>
+ </extension>
+
+</plugin>
diff --git a/plugins/uml/properties/org.eclipse.papyrus.uml.profile.properties/src/org/eclipse/papyrus/uml/profile/properties/Activator.java b/plugins/uml/properties/org.eclipse.papyrus.uml.profile.properties/src/org/eclipse/papyrus/uml/profile/properties/Activator.java
new file mode 100644
index 00000000000..5ee9ee43f80
--- /dev/null
+++ b/plugins/uml/properties/org.eclipse.papyrus.uml.profile.properties/src/org/eclipse/papyrus/uml/profile/properties/Activator.java
@@ -0,0 +1,69 @@
+/*****************************************************************************
+ * Copyright (c) 2012 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.uml.profile.properties;
+
+import org.eclipse.papyrus.infra.core.log.LogHelper;
+import org.eclipse.ui.plugin.AbstractUIPlugin;
+import org.osgi.framework.BundleContext;
+
+/**
+ * The activator class controls the plug-in life cycle
+ */
+public class Activator extends AbstractUIPlugin {
+
+ // The plug-in ID
+ public static final String PLUGIN_ID = "org.eclipse.papyrus.uml.profile.properties"; //$NON-NLS-1$
+
+ // The shared instance
+ private static Activator plugin;
+
+ public static LogHelper log;
+
+ /**
+ * The constructor
+ */
+ public Activator() {
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
+ */
+ @Override
+ public void start(BundleContext context) throws Exception {
+ super.start(context);
+ plugin = this;
+ log = new LogHelper(this);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
+ */
+ @Override
+ public void stop(BundleContext context) throws Exception {
+ plugin = null;
+ super.stop(context);
+ }
+
+ /**
+ * Returns the shared instance
+ *
+ * @return the shared instance
+ */
+ public static Activator getDefault() {
+ return plugin;
+ }
+
+}
diff --git a/plugins/uml/properties/org.eclipse.papyrus.uml.profile.properties/src/org/eclipse/papyrus/uml/profile/properties/constraints/IsAppliedStereotypePropertyConstraint.java b/plugins/uml/properties/org.eclipse.papyrus.uml.profile.properties/src/org/eclipse/papyrus/uml/profile/properties/constraints/IsAppliedStereotypePropertyConstraint.java
new file mode 100644
index 00000000000..f1d082f3603
--- /dev/null
+++ b/plugins/uml/properties/org.eclipse.papyrus.uml.profile.properties/src/org/eclipse/papyrus/uml/profile/properties/constraints/IsAppliedStereotypePropertyConstraint.java
@@ -0,0 +1,150 @@
+/*****************************************************************************
+ * Copyright (c) 2012 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.uml.profile.properties.constraints;
+
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.papyrus.infra.constraints.SimpleConstraint;
+import org.eclipse.papyrus.infra.constraints.constraints.AbstractConstraint;
+import org.eclipse.papyrus.infra.constraints.constraints.Constraint;
+import org.eclipse.papyrus.uml.profile.properties.Activator;
+import org.eclipse.papyrus.uml.profile.structure.AppliedStereotypeProperty;
+import org.eclipse.uml2.uml.Classifier;
+import org.eclipse.uml2.uml.DataType;
+import org.eclipse.uml2.uml.Enumeration;
+import org.eclipse.uml2.uml.PrimitiveType;
+import org.eclipse.uml2.uml.Property;
+import org.eclipse.uml2.uml.Type;
+
+public class IsAppliedStereotypePropertyConstraint extends AbstractConstraint {
+
+ /**
+ * The "propertyType" property
+ */
+ public final static String PROPERTY_TYPE = "propertyType"; //$NON-NLS-1$
+
+ /**
+ * The "multiplicity" property
+ */
+ public final static String MULTIPLICITY = "multiplicity"; //$NON-NLS-1$
+
+ private PropertyType type;
+
+ @Override
+ protected void setDescriptor(SimpleConstraint descriptor) {
+ String propertyType = getValue(PROPERTY_TYPE);
+ try {
+ type = PropertyType.valueOf(propertyType);
+ } catch (Exception ex) {
+ Activator.log.error("The property type is invalid : \"" + propertyType + "\"", ex);
+ }
+
+ int propertyMultiplicity = 1;
+
+ String multiplicityValue = getValue(MULTIPLICITY);
+ if(multiplicityValue != null) {
+ try {
+ propertyMultiplicity = Integer.parseInt(multiplicityValue);
+ } catch (NumberFormatException ex) {
+ Activator.log.error("The property multiplicity is invalid : \"" + multiplicityValue + "\"", ex);
+ }
+ }
+
+ if(propertyMultiplicity != 1) {
+ type = getMultivaluedType(type);
+ }
+ }
+
+ public boolean match(Object selection) {
+
+ AppliedStereotypeProperty property = null;
+
+ if(selection instanceof AppliedStereotypeProperty) {
+ property = (AppliedStereotypeProperty)selection;
+ }
+
+ if(selection instanceof IAdaptable) {
+ Object adapter = ((IAdaptable)selection).getAdapter(AppliedStereotypeProperty.class);
+ if(adapter != null) {
+ property = (AppliedStereotypeProperty)adapter;
+ }
+ }
+
+ if(property == null || type == null) {
+ return false;
+ }
+
+ PropertyType propertyType = findType(property.getStereotypeProperty());
+
+ return type == propertyType;
+ }
+
+ protected PropertyType findType(Property property) {
+ Type type = property.getType();
+ if(type instanceof PrimitiveType) {
+ try {
+ return PropertyType.valueOf(type.getName());
+ } catch (Exception ex) {
+ //Unknown primitive type
+ return PropertyType.String;
+ }
+ }
+
+ if(type instanceof Enumeration) {
+ return PropertyType.Reference;
+ }
+
+ if(type instanceof DataType) {
+ return PropertyType.String;
+ }
+
+ if(type instanceof Classifier) {
+ return PropertyType.Reference;
+ }
+
+ return PropertyType.String;
+ }
+
+ protected PropertyType getMultivaluedType(PropertyType type) {
+ switch(type) {
+ case Boolean:
+ return PropertyType.MultivaluedBoolean;
+ case String:
+ return PropertyType.MultivaluedString;
+ case Real:
+ return PropertyType.MultivaluedReal;
+ case Reference:
+ return PropertyType.MultivaluedReference;
+ case Integer:
+ return PropertyType.MultivaluedInteger;
+ }
+
+ return type;
+ }
+
+ @Override
+ protected boolean equivalent(Constraint constraint) {
+ if(!(constraint instanceof IsAppliedStereotypePropertyConstraint)) {
+ return false;
+ }
+
+ if(type == null) {
+ return false;
+ }
+
+ PropertyType otherType = ((IsAppliedStereotypePropertyConstraint)constraint).type;
+ return type == otherType;
+ }
+
+ public static enum PropertyType {
+ String, Integer, Real, Boolean, Reference, MultivaluedString, MultivaluedInteger, MultivaluedReal, MultivaluedBoolean, MultivaluedReference
+ }
+}
diff --git a/plugins/uml/properties/org.eclipse.papyrus.uml.profile.properties/src/org/eclipse/papyrus/uml/profile/properties/modelelement/AppliedStereotypePropertyModelElement.java b/plugins/uml/properties/org.eclipse.papyrus.uml.profile.properties/src/org/eclipse/papyrus/uml/profile/properties/modelelement/AppliedStereotypePropertyModelElement.java
new file mode 100644
index 00000000000..84dbc73b608
--- /dev/null
+++ b/plugins/uml/properties/org.eclipse.papyrus.uml.profile.properties/src/org/eclipse/papyrus/uml/profile/properties/modelelement/AppliedStereotypePropertyModelElement.java
@@ -0,0 +1,75 @@
+/*****************************************************************************
+ * Copyright (c) 2012 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.uml.profile.properties.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.EDataType;
+import org.eclipse.emf.ecore.EEnum;
+import org.eclipse.emf.ecore.EStructuralFeature;
+import org.eclipse.emf.edit.domain.EditingDomain;
+import org.eclipse.papyrus.uml.profile.structure.AppliedStereotypeProperty;
+import org.eclipse.papyrus.uml.tools.databinding.PapyrusObservableList;
+import org.eclipse.papyrus.uml.tools.databinding.PapyrusObservableValue;
+import org.eclipse.papyrus.views.properties.modelelement.EMFModelElement;
+
+public class AppliedStereotypePropertyModelElement extends EMFModelElement {
+
+ protected AppliedStereotypeProperty stereotypeProperty;
+
+ public AppliedStereotypePropertyModelElement(AppliedStereotypeProperty stereotypeProperty) {
+ this(stereotypeProperty, null);
+ }
+
+ public AppliedStereotypePropertyModelElement(AppliedStereotypeProperty stereotypeProperty, EditingDomain domain) {
+ super(stereotypeProperty.getStereotypeApplication(), domain);
+ this.stereotypeProperty = stereotypeProperty;
+ }
+
+ @Override
+ protected IObservable doGetObservable(String propertyPath) {
+ EStructuralFeature feature = getFeature(propertyPath);
+
+ //TODO : Handle datatypes
+ //We should delegate that to StereotypeModelElement
+ if(feature.getEType() instanceof EDataType && !(feature.getEType() instanceof EEnum)) {
+ if(feature.getUpperBound() == 1) {
+ //Single-valued DataType
+ //if(DataTypeProvider.instance.canHandle((EDataType)feature.getEType())) {
+ // return new StructuredDataTypeObservableValue(source, feature, domain, (EDataType)feature.getEType());
+ //}
+ //TODO : Multi-valued DataTypes
+ }
+ }
+
+ if(feature.getUpperBound() != 1) {
+ return new PapyrusObservableList(EMFProperties.list(feature).observe(source), domain, source, feature);
+ }
+
+ return new PapyrusObservableValue(source, feature, domain);
+ }
+
+ //propertyPath = "value" | "values" : this is a generic property name.
+ //We should rely on stereotypeProperty#getStereotypeProperty#getName instead
+ @Override
+ public EStructuralFeature getFeature(String propertyPath) {
+ return super.getFeature(stereotypeProperty.getStereotypeProperty().getName());
+ }
+
+ //propertyPath = "value" | "values" : this is a generic property name.
+ //We should rely on stereotypeProperty#getStereotypeProperty#getName instead
+ @Override
+ public FeaturePath getFeaturePath(String propertyPath) {
+ return super.getFeaturePath(stereotypeProperty.getStereotypeProperty().getName());
+ }
+}
diff --git a/plugins/uml/properties/org.eclipse.papyrus.uml.profile.properties/src/org/eclipse/papyrus/uml/profile/properties/modelelement/AppliedStereotypePropertyModelElementFactory.java b/plugins/uml/properties/org.eclipse.papyrus.uml.profile.properties/src/org/eclipse/papyrus/uml/profile/properties/modelelement/AppliedStereotypePropertyModelElementFactory.java
new file mode 100644
index 00000000000..1ef47f29bd8
--- /dev/null
+++ b/plugins/uml/properties/org.eclipse.papyrus.uml.profile.properties/src/org/eclipse/papyrus/uml/profile/properties/modelelement/AppliedStereotypePropertyModelElementFactory.java
@@ -0,0 +1,43 @@
+/*****************************************************************************
+ * Copyright (c) 2012 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.uml.profile.properties.modelelement;
+
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain;
+import org.eclipse.emf.edit.domain.EditingDomain;
+import org.eclipse.papyrus.uml.profile.properties.Activator;
+import org.eclipse.papyrus.uml.profile.structure.AppliedStereotypeProperty;
+import org.eclipse.papyrus.views.properties.contexts.DataContextElement;
+import org.eclipse.papyrus.views.properties.modelelement.ModelElement;
+import org.eclipse.papyrus.views.properties.modelelement.ModelElementFactory;
+
+public class AppliedStereotypePropertyModelElementFactory implements ModelElementFactory {
+
+ public ModelElement createFromSource(Object sourceElement, DataContextElement context) {
+ AppliedStereotypeProperty stereotypeProperty = null;
+ if(sourceElement instanceof AppliedStereotypeProperty) {
+ stereotypeProperty = (AppliedStereotypeProperty)sourceElement;
+ } else if(sourceElement instanceof IAdaptable) {
+ stereotypeProperty = (AppliedStereotypeProperty)((IAdaptable)sourceElement).getAdapter(AppliedStereotypeProperty.class);
+ }
+
+ if(stereotypeProperty == null) {
+ Activator.log.warn("The source element cannot be resolved to an AppliedStereotypeProperty");
+ return null;
+ }
+
+ EditingDomain domain = AdapterFactoryEditingDomain.getEditingDomainFor(stereotypeProperty.getStereotypeApplication());
+
+ return new AppliedStereotypePropertyModelElement(stereotypeProperty, domain);
+ }
+
+}

Back to the top