diff options
243 files changed, 7519 insertions, 1022 deletions
diff --git a/incoming/org.eclipse.papyrus.properties.customization/Model/Customization.ctx b/incoming/org.eclipse.papyrus.properties.customization/Model/Customization.ctx index c07fc0ba1a0..51739e36bb3 100644 --- a/incoming/org.eclipse.papyrus.properties.customization/Model/Customization.ctx +++ b/incoming/org.eclipse.papyrus.properties.customization/Model/Customization.ctx @@ -262,6 +262,24 @@ </constraints>
<widget href="ui/Label.xwt#/"/>
</sections>
+ <sections name="Single ToggleButton" sectionFile="ui/Single ToggleButton.xwt">
+ <constraints name="isSingleToggleButton">
+ <constraintType href="pathmap://PPEResources/Environment.xmi#//@constraintTypes.2"/>
+ <properties xsi:type="contexts:ReferenceProperty" name="query">
+ <value href="custom.querySet#isToggleButton"/>
+ </properties>
+ </constraints>
+ <widget href="ui/Single ToggleButton.xwt#/"/>
+ </sections>
+ <sections name="SingleFileSelector" sectionFile="ui/SingleFileSelector.xwt">
+ <constraints name="isSingleFileSelector">
+ <constraintType href="pathmap://PPEResources/Environment.xmi#//@constraintTypes.2"/>
+ <properties xsi:type="contexts:ReferenceProperty" name="query">
+ <value href="custom.querySet#isFileSelector"/>
+ </properties>
+ </constraints>
+ <widget href="ui/SingleFileSelector.xwt#/"/>
+ </sections>
</tabs>
<views name="Single Environment" sections="//@tabs.0/@sections.0" automaticContext="true">
<constraints name="isSingleEnvironment">
@@ -627,7 +645,7 @@ <properties xsi:type="contexts:ValueProperty" name="nsUri" value="http://www.eclipse.org/papyrus/properties/ui"/>
</constraints>
</views>
- <views name="Single PropertyEditor" sections="//@tabs.0/@sections.52" automaticContext="true">
+ <views name="Single PropertyEditor" sections="//@tabs.0/@sections.52 //@tabs.0/@sections.73 //@tabs.0/@sections.74" automaticContext="true">
<constraints name="isSinglePropertyEditor">
<constraintType href="pathmap://PPEResources/Environment.xmi#//@constraintTypes.0"/>
<properties xsi:type="contexts:ValueProperty" name="nsUri" value="http://www.eclipse.org/papyrus/properties/ui"/>
@@ -800,6 +818,7 @@ <properties name="type" type="Enumeration" description="The type of this property"/>
<properties name="contextElement" type="Reference" description="The element to which this property belongs"/>
<properties name="multiplicity" type="Integer" description="The multiplicity of this property."/>
+ <properties name="description"/>
</elements>
<elements name="UnknownProperty" supertypes="//@dataContexts.0/@elements.1/@elements.6"/>
<elements name="DataContextPackage" supertypes="//@dataContexts.0/@elements.1/@elements.5">
@@ -816,6 +835,7 @@ <properties name="constraints" type="Reference" multiplicity="-1" description="The sub-constraints of this constraint (Used for Composite constraints - Not implemented yet)"/>
<properties name="properties" label="" type="Reference" multiplicity="-1" description="The list of properties used to instantiate this constraint (key - value pairs)"/>
<properties name="overriddenConstraints" type="Reference" multiplicity="-1" description="The constraints overridden by this constraint. If two constraints match a given selection, a constraint may override another one. In such a case, the overridden constraint's displayUnit won't be displayed. This property is dedicated to manual resolution of constraints : the Constraint classes may also implement an automatic resolution of conflicts"/>
+ <properties name="overrideable" type="Boolean" description="If set to false, this constraint cannot be automatically overridden by other constraints. Only constraints which explicitly specify they need to override this constraint (Through the "overriddenConstraints" property) will be able to disable it."/>
</elements>
<elements name="ConfigProperty">
<properties name="name" description="The name of the property"/>
@@ -840,6 +860,7 @@ <properties name="property" type="Reference" description="The property that this editor will edit"/>
<properties name="readOnly" type="Boolean" description="Indicates if this editor should be read-only. Note that in some cases, the read only state may be applied at runtime, independently of this field's value"/>
<properties name="widgetType" type="Reference" description="The type of this widget"/>
+ <properties name="showLabel" type="Boolean" description="If set to false, the property editor's label won't be displayed"/>
</elements>
<elements name="CompositeWidget" supertypes="//@dataContexts.0/@elements.2/@elements.2">
<properties name="layout" type="Reference" description="The layout of this widget"/>
@@ -879,6 +900,14 @@ <elements name="Label">
<properties name="text" label="Text" description="The text to display"/>
</elements>
+ <elements name="BooleanToggle">
+ <properties name="image" label="Image"/>
+ </elements>
+ <elements name="FileSelector">
+ <properties name="allowWorkspace"/>
+ <properties name="allowFileSystem"/>
+ <properties name="filteredExtension"/>
+ </elements>
</elements>
<modelElementFactory href="pathmap://PPECustom/CustomizationEnvironment.xmi#//@modelElementFactories.0"/>
</dataContexts>
diff --git a/incoming/org.eclipse.papyrus.properties.customization/Model/custom.querySet b/incoming/org.eclipse.papyrus.properties.customization/Model/custom.querySet index 899958c9161..9cc38b506ba 100644 --- a/incoming/org.eclipse.papyrus.properties.customization/Model/custom.querySet +++ b/incoming/org.eclipse.papyrus.properties.customization/Model/custom.querySet @@ -30,4 +30,12 @@ <returnType xsi:type="ecore:EDataType" href="http://www.eclipse.org/emf/2002/Ecore#//EBoolean"/>
<scope href="http://www.eclipse.org/papyrus/properties/ui#//StandardWidget"/>
</queries>
+ <queries xsi:type="query:OCLModelQuery" name="isToggleButton" description="Tests if the given PropertyEditor is a ToggleButton" lowerBound="1" query="widgetType.widgetClass = 'BooleanToggle' and widgetType.namespace.name = 'ppe'">
+ <returnType xsi:type="ecore:EDataType" href="http://www.eclipse.org/emf/2002/Ecore#//EBoolean"/>
+ <scope href="http://www.eclipse.org/papyrus/properties/ui#//PropertyEditor"/>
+ </queries>
+ <queries xsi:type="query:OCLModelQuery" name="isFileSelector" description="Tests if a PropertyEditor is a File Selector" lowerBound="1" query="widgetType.widgetClass = 'StringFileSelector' and widgetType.namespace.name = 'ppe'">
+ <returnType xsi:type="ecore:EDataType" href="http://www.eclipse.org/emf/2002/Ecore#//EBoolean"/>
+ <scope href="http://www.eclipse.org/papyrus/properties/ui#//PropertyEditor"/>
+ </queries>
</query:ModelQuerySet>
diff --git a/incoming/org.eclipse.papyrus.properties.customization/Model/ui/EcoreInstanceOf.xwt b/incoming/org.eclipse.papyrus.properties.customization/Model/ui/EcoreInstanceOf.xwt index 22edc5226db..dc2e8c4b749 100644 --- a/incoming/org.eclipse.papyrus.properties.customization/Model/ui/EcoreInstanceOf.xwt +++ b/incoming/org.eclipse.papyrus.properties.customization/Model/ui/EcoreInstanceOf.xwt @@ -1,2 +1,2 @@ <?xml version="1.0" encoding="UTF-8"?>
-<Composite xmlns="http://www.eclipse.org/xwt/presentation" xmlns:ppel="clr-namespace:org.eclipse.papyrus.properties.widgets.layout" xmlns:ppe="clr-namespace:org.eclipse.papyrus.properties.widgets" xmlns:x="http://www.eclipse.org/xwt"><Composite.layout><ppel:PropertiesLayout></ppel:PropertiesLayout></Composite.layout><Composite><Composite.layout><ppel:PropertiesLayout></ppel:PropertiesLayout></Composite.layout><ppe:StringEditor input="{Binding}" property="Properties:EcoreInstanceOf:nsUri"></ppe:StringEditor><ppe:StringEditor input="{Binding}" property="Properties:EcoreInstanceOf:className"></ppe:StringEditor></Composite></Composite>
\ No newline at end of file +<Composite xmlns:ppe="clr-namespace:org.eclipse.papyrus.properties.widgets" xmlns:ppel="clr-namespace:org.eclipse.papyrus.properties.widgets.layout" xmlns="http://www.eclipse.org/xwt/presentation" xmlns:x="http://www.eclipse.org/xwt"><Composite.layout><ppel:PropertiesLayout></ppel:PropertiesLayout></Composite.layout><Composite><Composite.layout><ppel:PropertiesLayout></ppel:PropertiesLayout></Composite.layout><ppe:StringEditor input="{Binding}" property="Properties:EcoreInstanceOf:nsUri"></ppe:StringEditor><ppe:StringEditor input="{Binding}" property="Properties:EcoreInstanceOf:className"></ppe:StringEditor></Composite></Composite>
\ No newline at end of file diff --git a/incoming/org.eclipse.papyrus.properties.customization/Model/ui/GridLayout.xwt b/incoming/org.eclipse.papyrus.properties.customization/Model/ui/GridLayout.xwt index abafcfcb299..8580425afc2 100644 --- a/incoming/org.eclipse.papyrus.properties.customization/Model/ui/GridLayout.xwt +++ b/incoming/org.eclipse.papyrus.properties.customization/Model/ui/GridLayout.xwt @@ -1,2 +1,2 @@ <?xml version="1.0" encoding="UTF-8"?>
-<Composite xmlns:ppe="clr-namespace:org.eclipse.papyrus.properties.widgets" xmlns:ppel="clr-namespace:org.eclipse.papyrus.properties.widgets.layout" xmlns="http://www.eclipse.org/xwt/presentation" xmlns:x="http://www.eclipse.org/xwt"><Composite.layout><ppel:PropertiesLayout></ppel:PropertiesLayout></Composite.layout><Composite><Composite.layout><ppel:PropertiesLayout></ppel:PropertiesLayout></Composite.layout><ppe:StringEditor input="{Binding}" property="Custom:Attribute:GridLayout:numColumns"></ppe:StringEditor><ppe:StringEditor input="{Binding}" property="Custom:Attribute:GridLayout:makeColumnsEqualWidth"></ppe:StringEditor></Composite></Composite>
\ No newline at end of file +<Composite xmlns:ppel="clr-namespace:org.eclipse.papyrus.properties.widgets.layout" xmlns="http://www.eclipse.org/xwt/presentation" xmlns:ppe="clr-namespace:org.eclipse.papyrus.properties.widgets" xmlns:x="http://www.eclipse.org/xwt"><Composite.layout><ppel:PropertiesLayout></ppel:PropertiesLayout></Composite.layout><Composite><Composite.layout><ppel:PropertiesLayout></ppel:PropertiesLayout></Composite.layout><ppe:StringEditor input="{Binding}" property="Custom:Attribute:GridLayout:numColumns"></ppe:StringEditor><ppe:StringEditor input="{Binding}" property="Custom:Attribute:GridLayout:makeColumnsEqualWidth"></ppe:StringEditor></Composite></Composite>
\ No newline at end of file diff --git a/incoming/org.eclipse.papyrus.properties.customization/Model/ui/GroupAttributes.xwt b/incoming/org.eclipse.papyrus.properties.customization/Model/ui/GroupAttributes.xwt index 2acc6ac56e4..fb48283a435 100644 --- a/incoming/org.eclipse.papyrus.properties.customization/Model/ui/GroupAttributes.xwt +++ b/incoming/org.eclipse.papyrus.properties.customization/Model/ui/GroupAttributes.xwt @@ -1,2 +1,2 @@ <?xml version="1.0" encoding="UTF-8"?>
-<Composite xmlns:ppe="clr-namespace:org.eclipse.papyrus.properties.widgets" xmlns="http://www.eclipse.org/xwt/presentation" xmlns:ppel="clr-namespace:org.eclipse.papyrus.properties.widgets.layout" xmlns:x="http://www.eclipse.org/xwt"><Composite.layout><ppel:PropertiesLayout></ppel:PropertiesLayout></Composite.layout><Composite><Composite.layout><ppel:PropertiesLayout></ppel:PropertiesLayout></Composite.layout><ppe:StringEditor input="{Binding}" property="Custom:Attribute:Group:text"></ppe:StringEditor></Composite></Composite>
\ No newline at end of file +<Composite xmlns:ppe="clr-namespace:org.eclipse.papyrus.properties.widgets" xmlns:ppel="clr-namespace:org.eclipse.papyrus.properties.widgets.layout" xmlns:x="http://www.eclipse.org/xwt" xmlns="http://www.eclipse.org/xwt/presentation"><Composite.layout><ppel:PropertiesLayout></ppel:PropertiesLayout></Composite.layout><Composite><Composite.layout><ppel:PropertiesLayout></ppel:PropertiesLayout></Composite.layout><ppe:StringEditor input="{Binding}" property="Custom:Attribute:Group:text"></ppe:StringEditor></Composite></Composite>
\ No newline at end of file diff --git a/incoming/org.eclipse.papyrus.properties.customization/Model/ui/Label.xwt b/incoming/org.eclipse.papyrus.properties.customization/Model/ui/Label.xwt index a2fc88b42bf..95ff06fe63a 100644 --- a/incoming/org.eclipse.papyrus.properties.customization/Model/ui/Label.xwt +++ b/incoming/org.eclipse.papyrus.properties.customization/Model/ui/Label.xwt @@ -1,2 +1,2 @@ <?xml version="1.0" encoding="UTF-8"?>
-<Composite xmlns:ppe="clr-namespace:org.eclipse.papyrus.properties.widgets" xmlns:ppel="clr-namespace:org.eclipse.papyrus.properties.widgets.layout" xmlns:x="http://www.eclipse.org/xwt" xmlns="http://www.eclipse.org/xwt/presentation"><Composite.layout><ppel:PropertiesLayout></ppel:PropertiesLayout></Composite.layout><Composite><Composite.layout><ppel:PropertiesLayout></ppel:PropertiesLayout></Composite.layout><ppe:StringEditor input="{Binding}" property="Custom:Attribute:Label:text"></ppe:StringEditor></Composite></Composite>
\ No newline at end of file +<Composite xmlns:ppe="clr-namespace:org.eclipse.papyrus.properties.widgets" xmlns:x="http://www.eclipse.org/xwt" xmlns="http://www.eclipse.org/xwt/presentation" xmlns:ppel="clr-namespace:org.eclipse.papyrus.properties.widgets.layout"><Composite.layout><ppel:PropertiesLayout></ppel:PropertiesLayout></Composite.layout><Composite><Composite.layout><ppel:PropertiesLayout></ppel:PropertiesLayout></Composite.layout><ppe:StringEditor input="{Binding}" property="Custom:Attribute:Label:text"></ppe:StringEditor></Composite></Composite>
\ No newline at end of file diff --git a/incoming/org.eclipse.papyrus.properties.customization/Model/ui/MultipleCompositeWidget.xwt b/incoming/org.eclipse.papyrus.properties.customization/Model/ui/MultipleCompositeWidget.xwt index 43527b5a314..b7fa33615e2 100644 --- a/incoming/org.eclipse.papyrus.properties.customization/Model/ui/MultipleCompositeWidget.xwt +++ b/incoming/org.eclipse.papyrus.properties.customization/Model/ui/MultipleCompositeWidget.xwt @@ -1,2 +1,2 @@ <?xml version="1.0" encoding="UTF-8"?>
-<Composite xmlns="http://www.eclipse.org/xwt/presentation" xmlns:ppel="clr-namespace:org.eclipse.papyrus.properties.widgets.layout" xmlns:x="http://www.eclipse.org/xwt" xmlns:ppe="clr-namespace:org.eclipse.papyrus.properties.widgets"><Composite.layout><ppel:PropertiesLayout></ppel:PropertiesLayout></Composite.layout></Composite>
\ No newline at end of file +<Composite xmlns:ppe="clr-namespace:org.eclipse.papyrus.properties.widgets" xmlns:x="http://www.eclipse.org/xwt" xmlns="http://www.eclipse.org/xwt/presentation" xmlns:ppel="clr-namespace:org.eclipse.papyrus.properties.widgets.layout"><Composite.layout><ppel:PropertiesLayout></ppel:PropertiesLayout></Composite.layout></Composite>
\ No newline at end of file diff --git a/incoming/org.eclipse.papyrus.properties.customization/Model/ui/MultipleCompositeWidgetType.xwt b/incoming/org.eclipse.papyrus.properties.customization/Model/ui/MultipleCompositeWidgetType.xwt index 1ba60ede71f..bd0571a7538 100644 --- a/incoming/org.eclipse.papyrus.properties.customization/Model/ui/MultipleCompositeWidgetType.xwt +++ b/incoming/org.eclipse.papyrus.properties.customization/Model/ui/MultipleCompositeWidgetType.xwt @@ -1,2 +1,2 @@ <?xml version="1.0" encoding="UTF-8"?>
-<Composite xmlns:x="http://www.eclipse.org/xwt" xmlns:ppe="clr-namespace:org.eclipse.papyrus.properties.widgets" xmlns="http://www.eclipse.org/xwt/presentation" xmlns:ppel="clr-namespace:org.eclipse.papyrus.properties.widgets.layout"><Composite.layout><ppel:PropertiesLayout></ppel:PropertiesLayout></Composite.layout></Composite>
\ No newline at end of file +<Composite xmlns:ppel="clr-namespace:org.eclipse.papyrus.properties.widgets.layout" xmlns="http://www.eclipse.org/xwt/presentation" xmlns:ppe="clr-namespace:org.eclipse.papyrus.properties.widgets" xmlns:x="http://www.eclipse.org/xwt"><Composite.layout><ppel:PropertiesLayout></ppel:PropertiesLayout></Composite.layout></Composite>
\ No newline at end of file diff --git a/incoming/org.eclipse.papyrus.properties.customization/Model/ui/MultipleConfigProperty.xwt b/incoming/org.eclipse.papyrus.properties.customization/Model/ui/MultipleConfigProperty.xwt index 1cfcab2425b..7302f1fef08 100644 --- a/incoming/org.eclipse.papyrus.properties.customization/Model/ui/MultipleConfigProperty.xwt +++ b/incoming/org.eclipse.papyrus.properties.customization/Model/ui/MultipleConfigProperty.xwt @@ -1,2 +1,2 @@ <?xml version="1.0" encoding="UTF-8"?>
-<Composite xmlns:x="http://www.eclipse.org/xwt" xmlns:ppel="clr-namespace:org.eclipse.papyrus.properties.widgets.layout" xmlns="http://www.eclipse.org/xwt/presentation" xmlns:ppe="clr-namespace:org.eclipse.papyrus.properties.widgets"><Composite.layout><ppel:PropertiesLayout></ppel:PropertiesLayout></Composite.layout></Composite>
\ No newline at end of file +<Composite xmlns:ppe="clr-namespace:org.eclipse.papyrus.properties.widgets" xmlns="http://www.eclipse.org/xwt/presentation" xmlns:ppel="clr-namespace:org.eclipse.papyrus.properties.widgets.layout" xmlns:x="http://www.eclipse.org/xwt"><Composite.layout><ppel:PropertiesLayout></ppel:PropertiesLayout></Composite.layout></Composite>
\ No newline at end of file diff --git a/incoming/org.eclipse.papyrus.properties.customization/Model/ui/MultipleConstraintDescriptor.xwt b/incoming/org.eclipse.papyrus.properties.customization/Model/ui/MultipleConstraintDescriptor.xwt index 699b974ca4f..7d59c5a021d 100644 --- a/incoming/org.eclipse.papyrus.properties.customization/Model/ui/MultipleConstraintDescriptor.xwt +++ b/incoming/org.eclipse.papyrus.properties.customization/Model/ui/MultipleConstraintDescriptor.xwt @@ -1,2 +1,2 @@ <?xml version="1.0" encoding="UTF-8"?>
-<Composite xmlns:x="http://www.eclipse.org/xwt" xmlns:ppe="clr-namespace:org.eclipse.papyrus.properties.widgets" xmlns:ppel="clr-namespace:org.eclipse.papyrus.properties.widgets.layout" xmlns="http://www.eclipse.org/xwt/presentation"><Composite.layout><ppel:PropertiesLayout></ppel:PropertiesLayout></Composite.layout></Composite>
\ No newline at end of file +<Composite xmlns:ppel="clr-namespace:org.eclipse.papyrus.properties.widgets.layout" xmlns:ppe="clr-namespace:org.eclipse.papyrus.properties.widgets" xmlns="http://www.eclipse.org/xwt/presentation" xmlns:x="http://www.eclipse.org/xwt"><Composite.layout><ppel:PropertiesLayout></ppel:PropertiesLayout></Composite.layout></Composite>
\ No newline at end of file diff --git a/incoming/org.eclipse.papyrus.properties.customization/Model/ui/MultipleConstraintType.xwt b/incoming/org.eclipse.papyrus.properties.customization/Model/ui/MultipleConstraintType.xwt index 4411f6d9377..e042a6b22df 100644 --- a/incoming/org.eclipse.papyrus.properties.customization/Model/ui/MultipleConstraintType.xwt +++ b/incoming/org.eclipse.papyrus.properties.customization/Model/ui/MultipleConstraintType.xwt @@ -1,2 +1,2 @@ <?xml version="1.0" encoding="UTF-8"?>
-<Composite xmlns:x="http://www.eclipse.org/xwt" xmlns="http://www.eclipse.org/xwt/presentation" xmlns:ppel="clr-namespace:org.eclipse.papyrus.properties.widgets.layout" xmlns:ppe="clr-namespace:org.eclipse.papyrus.properties.widgets"><Composite.layout><ppel:PropertiesLayout></ppel:PropertiesLayout></Composite.layout></Composite>
\ No newline at end of file +<Composite xmlns:x="http://www.eclipse.org/xwt" xmlns:ppel="clr-namespace:org.eclipse.papyrus.properties.widgets.layout" xmlns:ppe="clr-namespace:org.eclipse.papyrus.properties.widgets" xmlns="http://www.eclipse.org/xwt/presentation"><Composite.layout><ppel:PropertiesLayout></ppel:PropertiesLayout></Composite.layout></Composite>
\ No newline at end of file diff --git a/incoming/org.eclipse.papyrus.properties.customization/Model/ui/MultipleContext.xwt b/incoming/org.eclipse.papyrus.properties.customization/Model/ui/MultipleContext.xwt index 34c895e0be7..d8af99ae532 100644 --- a/incoming/org.eclipse.papyrus.properties.customization/Model/ui/MultipleContext.xwt +++ b/incoming/org.eclipse.papyrus.properties.customization/Model/ui/MultipleContext.xwt @@ -1,2 +1,2 @@ <?xml version="1.0" encoding="UTF-8"?>
-<Composite xmlns:ppel="clr-namespace:org.eclipse.papyrus.properties.widgets.layout" xmlns:x="http://www.eclipse.org/xwt" xmlns="http://www.eclipse.org/xwt/presentation" xmlns:ppe="clr-namespace:org.eclipse.papyrus.properties.widgets"><Composite.layout><ppel:PropertiesLayout></ppel:PropertiesLayout></Composite.layout></Composite>
\ No newline at end of file +<Composite xmlns="http://www.eclipse.org/xwt/presentation" xmlns:ppe="clr-namespace:org.eclipse.papyrus.properties.widgets" xmlns:x="http://www.eclipse.org/xwt" xmlns:ppel="clr-namespace:org.eclipse.papyrus.properties.widgets.layout"><Composite.layout><ppel:PropertiesLayout></ppel:PropertiesLayout></Composite.layout></Composite>
\ No newline at end of file diff --git a/incoming/org.eclipse.papyrus.properties.customization/Model/ui/MultipleDataContextElement.xwt b/incoming/org.eclipse.papyrus.properties.customization/Model/ui/MultipleDataContextElement.xwt index 2380a4c605f..0652e3cca94 100644 --- a/incoming/org.eclipse.papyrus.properties.customization/Model/ui/MultipleDataContextElement.xwt +++ b/incoming/org.eclipse.papyrus.properties.customization/Model/ui/MultipleDataContextElement.xwt @@ -1,2 +1,2 @@ <?xml version="1.0" encoding="UTF-8"?>
-<Composite xmlns:ppe="clr-namespace:org.eclipse.papyrus.properties.widgets" xmlns:x="http://www.eclipse.org/xwt" xmlns:ppel="clr-namespace:org.eclipse.papyrus.properties.widgets.layout" xmlns="http://www.eclipse.org/xwt/presentation"><Composite.layout><ppel:PropertiesLayout></ppel:PropertiesLayout></Composite.layout></Composite>
\ No newline at end of file +<Composite xmlns:ppe="clr-namespace:org.eclipse.papyrus.properties.widgets" xmlns:ppel="clr-namespace:org.eclipse.papyrus.properties.widgets.layout" xmlns:x="http://www.eclipse.org/xwt" xmlns="http://www.eclipse.org/xwt/presentation"><Composite.layout><ppel:PropertiesLayout></ppel:PropertiesLayout></Composite.layout></Composite>
\ No newline at end of file diff --git a/incoming/org.eclipse.papyrus.properties.customization/Model/ui/MultipleDataContextPackage.xwt b/incoming/org.eclipse.papyrus.properties.customization/Model/ui/MultipleDataContextPackage.xwt index 1cfcab2425b..e042a6b22df 100644 --- a/incoming/org.eclipse.papyrus.properties.customization/Model/ui/MultipleDataContextPackage.xwt +++ b/incoming/org.eclipse.papyrus.properties.customization/Model/ui/MultipleDataContextPackage.xwt @@ -1,2 +1,2 @@ <?xml version="1.0" encoding="UTF-8"?>
-<Composite xmlns:x="http://www.eclipse.org/xwt" xmlns:ppel="clr-namespace:org.eclipse.papyrus.properties.widgets.layout" xmlns="http://www.eclipse.org/xwt/presentation" xmlns:ppe="clr-namespace:org.eclipse.papyrus.properties.widgets"><Composite.layout><ppel:PropertiesLayout></ppel:PropertiesLayout></Composite.layout></Composite>
\ No newline at end of file +<Composite xmlns:x="http://www.eclipse.org/xwt" xmlns:ppel="clr-namespace:org.eclipse.papyrus.properties.widgets.layout" xmlns:ppe="clr-namespace:org.eclipse.papyrus.properties.widgets" xmlns="http://www.eclipse.org/xwt/presentation"><Composite.layout><ppel:PropertiesLayout></ppel:PropertiesLayout></Composite.layout></Composite>
\ No newline at end of file diff --git a/incoming/org.eclipse.papyrus.properties.customization/Model/ui/MultipleDataContextRoot.xwt b/incoming/org.eclipse.papyrus.properties.customization/Model/ui/MultipleDataContextRoot.xwt index d8af99ae532..b7fa33615e2 100644 --- a/incoming/org.eclipse.papyrus.properties.customization/Model/ui/MultipleDataContextRoot.xwt +++ b/incoming/org.eclipse.papyrus.properties.customization/Model/ui/MultipleDataContextRoot.xwt @@ -1,2 +1,2 @@ <?xml version="1.0" encoding="UTF-8"?>
-<Composite xmlns="http://www.eclipse.org/xwt/presentation" xmlns:ppe="clr-namespace:org.eclipse.papyrus.properties.widgets" xmlns:x="http://www.eclipse.org/xwt" xmlns:ppel="clr-namespace:org.eclipse.papyrus.properties.widgets.layout"><Composite.layout><ppel:PropertiesLayout></ppel:PropertiesLayout></Composite.layout></Composite>
\ No newline at end of file +<Composite xmlns:ppe="clr-namespace:org.eclipse.papyrus.properties.widgets" xmlns:x="http://www.eclipse.org/xwt" xmlns="http://www.eclipse.org/xwt/presentation" xmlns:ppel="clr-namespace:org.eclipse.papyrus.properties.widgets.layout"><Composite.layout><ppel:PropertiesLayout></ppel:PropertiesLayout></Composite.layout></Composite>
\ No newline at end of file diff --git a/incoming/org.eclipse.papyrus.properties.customization/Model/ui/MultipleDisplayUnit.xwt b/incoming/org.eclipse.papyrus.properties.customization/Model/ui/MultipleDisplayUnit.xwt index 21d4be90379..43527b5a314 100644 --- a/incoming/org.eclipse.papyrus.properties.customization/Model/ui/MultipleDisplayUnit.xwt +++ b/incoming/org.eclipse.papyrus.properties.customization/Model/ui/MultipleDisplayUnit.xwt @@ -1,2 +1,2 @@ <?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.properties.widgets" xmlns:ppel="clr-namespace:org.eclipse.papyrus.properties.widgets.layout"><Composite.layout><ppel:PropertiesLayout></ppel:PropertiesLayout></Composite.layout></Composite>
\ No newline at end of file +<Composite xmlns="http://www.eclipse.org/xwt/presentation" xmlns:ppel="clr-namespace:org.eclipse.papyrus.properties.widgets.layout" xmlns:x="http://www.eclipse.org/xwt" xmlns:ppe="clr-namespace:org.eclipse.papyrus.properties.widgets"><Composite.layout><ppel:PropertiesLayout></ppel:PropertiesLayout></Composite.layout></Composite>
\ No newline at end of file diff --git a/incoming/org.eclipse.papyrus.properties.customization/Model/ui/MultipleElement.xwt b/incoming/org.eclipse.papyrus.properties.customization/Model/ui/MultipleElement.xwt index 1ba60ede71f..34c895e0be7 100644 --- a/incoming/org.eclipse.papyrus.properties.customization/Model/ui/MultipleElement.xwt +++ b/incoming/org.eclipse.papyrus.properties.customization/Model/ui/MultipleElement.xwt @@ -1,2 +1,2 @@ <?xml version="1.0" encoding="UTF-8"?>
-<Composite xmlns:x="http://www.eclipse.org/xwt" xmlns:ppe="clr-namespace:org.eclipse.papyrus.properties.widgets" xmlns="http://www.eclipse.org/xwt/presentation" xmlns:ppel="clr-namespace:org.eclipse.papyrus.properties.widgets.layout"><Composite.layout><ppel:PropertiesLayout></ppel:PropertiesLayout></Composite.layout></Composite>
\ No newline at end of file +<Composite xmlns:ppel="clr-namespace:org.eclipse.papyrus.properties.widgets.layout" xmlns:x="http://www.eclipse.org/xwt" xmlns="http://www.eclipse.org/xwt/presentation" xmlns:ppe="clr-namespace:org.eclipse.papyrus.properties.widgets"><Composite.layout><ppel:PropertiesLayout></ppel:PropertiesLayout></Composite.layout></Composite>
\ No newline at end of file diff --git a/incoming/org.eclipse.papyrus.properties.customization/Model/ui/MultipleEnvironment.xwt b/incoming/org.eclipse.papyrus.properties.customization/Model/ui/MultipleEnvironment.xwt index 34c895e0be7..bf5b2414a33 100644 --- a/incoming/org.eclipse.papyrus.properties.customization/Model/ui/MultipleEnvironment.xwt +++ b/incoming/org.eclipse.papyrus.properties.customization/Model/ui/MultipleEnvironment.xwt @@ -1,2 +1,2 @@ <?xml version="1.0" encoding="UTF-8"?>
-<Composite xmlns:ppel="clr-namespace:org.eclipse.papyrus.properties.widgets.layout" xmlns:x="http://www.eclipse.org/xwt" xmlns="http://www.eclipse.org/xwt/presentation" xmlns:ppe="clr-namespace:org.eclipse.papyrus.properties.widgets"><Composite.layout><ppel:PropertiesLayout></ppel:PropertiesLayout></Composite.layout></Composite>
\ No newline at end of file +<Composite xmlns="http://www.eclipse.org/xwt/presentation" xmlns:ppe="clr-namespace:org.eclipse.papyrus.properties.widgets" xmlns:ppel="clr-namespace:org.eclipse.papyrus.properties.widgets.layout" xmlns:x="http://www.eclipse.org/xwt"><Composite.layout><ppel:PropertiesLayout></ppel:PropertiesLayout></Composite.layout></Composite>
\ No newline at end of file diff --git a/incoming/org.eclipse.papyrus.properties.customization/Model/ui/MultipleLayout.xwt b/incoming/org.eclipse.papyrus.properties.customization/Model/ui/MultipleLayout.xwt index 43527b5a314..01e70cc0e40 100644 --- a/incoming/org.eclipse.papyrus.properties.customization/Model/ui/MultipleLayout.xwt +++ b/incoming/org.eclipse.papyrus.properties.customization/Model/ui/MultipleLayout.xwt @@ -1,2 +1,2 @@ <?xml version="1.0" encoding="UTF-8"?>
-<Composite xmlns="http://www.eclipse.org/xwt/presentation" xmlns:ppel="clr-namespace:org.eclipse.papyrus.properties.widgets.layout" xmlns:x="http://www.eclipse.org/xwt" xmlns:ppe="clr-namespace:org.eclipse.papyrus.properties.widgets"><Composite.layout><ppel:PropertiesLayout></ppel:PropertiesLayout></Composite.layout></Composite>
\ No newline at end of file +<Composite xmlns:ppel="clr-namespace:org.eclipse.papyrus.properties.widgets.layout" xmlns:x="http://www.eclipse.org/xwt" xmlns:ppe="clr-namespace:org.eclipse.papyrus.properties.widgets" xmlns="http://www.eclipse.org/xwt/presentation"><Composite.layout><ppel:PropertiesLayout></ppel:PropertiesLayout></Composite.layout></Composite>
\ No newline at end of file diff --git a/incoming/org.eclipse.papyrus.properties.customization/Model/ui/MultipleModelElementFactoryDescriptor.xwt b/incoming/org.eclipse.papyrus.properties.customization/Model/ui/MultipleModelElementFactoryDescriptor.xwt index cb1dd71bcfb..1ba60ede71f 100644 --- a/incoming/org.eclipse.papyrus.properties.customization/Model/ui/MultipleModelElementFactoryDescriptor.xwt +++ b/incoming/org.eclipse.papyrus.properties.customization/Model/ui/MultipleModelElementFactoryDescriptor.xwt @@ -1,2 +1,2 @@ <?xml version="1.0" encoding="UTF-8"?>
-<Composite xmlns:ppel="clr-namespace:org.eclipse.papyrus.properties.widgets.layout" xmlns:ppe="clr-namespace:org.eclipse.papyrus.properties.widgets" xmlns:x="http://www.eclipse.org/xwt" xmlns="http://www.eclipse.org/xwt/presentation"><Composite.layout><ppel:PropertiesLayout></ppel:PropertiesLayout></Composite.layout></Composite>
\ No newline at end of file +<Composite xmlns:x="http://www.eclipse.org/xwt" xmlns:ppe="clr-namespace:org.eclipse.papyrus.properties.widgets" xmlns="http://www.eclipse.org/xwt/presentation" xmlns:ppel="clr-namespace:org.eclipse.papyrus.properties.widgets.layout"><Composite.layout><ppel:PropertiesLayout></ppel:PropertiesLayout></Composite.layout></Composite>
\ No newline at end of file diff --git a/incoming/org.eclipse.papyrus.properties.customization/Model/ui/MultipleProperty.xwt b/incoming/org.eclipse.papyrus.properties.customization/Model/ui/MultipleProperty.xwt index a0040f3e1b8..af560c63b67 100644 --- a/incoming/org.eclipse.papyrus.properties.customization/Model/ui/MultipleProperty.xwt +++ b/incoming/org.eclipse.papyrus.properties.customization/Model/ui/MultipleProperty.xwt @@ -1,2 +1,2 @@ <?xml version="1.0" encoding="UTF-8"?>
-<Composite xmlns:x="http://www.eclipse.org/xwt" xmlns:ppel="clr-namespace:org.eclipse.papyrus.properties.widgets.layout" xmlns="http://www.eclipse.org/xwt/presentation" xmlns:ppe="clr-namespace:org.eclipse.papyrus.properties.widgets"><Composite.layout><ppel:PropertiesLayout></ppel:PropertiesLayout></Composite.layout><Composite><Composite.layout><ppel:PropertiesLayout numColumns="2"></ppel:PropertiesLayout></Composite.layout><ppe:IntegerEditor input="{Binding}" property="properties:contexts:Property:multiplicity"></ppe:IntegerEditor></Composite><Composite><Composite.layout><ppel:PropertiesLayout numColumns="1"></ppel:PropertiesLayout></Composite.layout><ppe:EnumCombo input="{Binding}" property="properties:contexts:Property:type"></ppe:EnumCombo></Composite></Composite>
\ No newline at end of file +<Composite xmlns:ppe="clr-namespace:org.eclipse.papyrus.properties.widgets" xmlns="http://www.eclipse.org/xwt/presentation" xmlns:x="http://www.eclipse.org/xwt" xmlns:ppel="clr-namespace:org.eclipse.papyrus.properties.widgets.layout"><Composite.layout><ppel:PropertiesLayout></ppel:PropertiesLayout></Composite.layout><Composite><Composite.layout><ppel:PropertiesLayout numColumns="2"></ppel:PropertiesLayout></Composite.layout><ppe:IntegerEditor input="{Binding}" property="properties:contexts:Property:multiplicity"></ppe:IntegerEditor></Composite><Composite><Composite.layout><ppel:PropertiesLayout numColumns="1"></ppel:PropertiesLayout></Composite.layout><ppe:EnumCombo input="{Binding}" property="properties:contexts:Property:type"></ppe:EnumCombo></Composite></Composite>
\ No newline at end of file diff --git a/incoming/org.eclipse.papyrus.properties.customization/Model/ui/MultiplePropertyEditor.xwt b/incoming/org.eclipse.papyrus.properties.customization/Model/ui/MultiplePropertyEditor.xwt index c975de6c23c..d497495c81c 100644 --- a/incoming/org.eclipse.papyrus.properties.customization/Model/ui/MultiplePropertyEditor.xwt +++ b/incoming/org.eclipse.papyrus.properties.customization/Model/ui/MultiplePropertyEditor.xwt @@ -1,2 +1,2 @@ <?xml version="1.0" encoding="UTF-8"?>
-<Composite xmlns:x="http://www.eclipse.org/xwt" xmlns:ppe="clr-namespace:org.eclipse.papyrus.properties.widgets" xmlns:ppel="clr-namespace:org.eclipse.papyrus.properties.widgets.layout" xmlns="http://www.eclipse.org/xwt/presentation"><Composite.layout><ppel:PropertiesLayout></ppel:PropertiesLayout></Composite.layout><Composite><Composite.layout><ppel:PropertiesLayout numColumns="2"></ppel:PropertiesLayout></Composite.layout><ppe:BooleanRadio input="{Binding}" property="properties:ui:PropertyEditor:readOnly"></ppe:BooleanRadio></Composite></Composite>
\ No newline at end of file +<Composite xmlns="http://www.eclipse.org/xwt/presentation" xmlns:ppe="clr-namespace:org.eclipse.papyrus.properties.widgets" xmlns:ppel="clr-namespace:org.eclipse.papyrus.properties.widgets.layout" xmlns:x="http://www.eclipse.org/xwt"><Composite.layout><ppel:PropertiesLayout></ppel:PropertiesLayout></Composite.layout><Composite><Composite.layout><ppel:PropertiesLayout numColumns="2"></ppel:PropertiesLayout></Composite.layout><ppe:BooleanRadio input="{Binding}" property="properties:ui:PropertyEditor:readOnly"></ppe:BooleanRadio></Composite></Composite>
\ No newline at end of file diff --git a/incoming/org.eclipse.papyrus.properties.customization/Model/ui/MultiplePropertyEditorType.xwt b/incoming/org.eclipse.papyrus.properties.customization/Model/ui/MultiplePropertyEditorType.xwt index a0b68d3f774..761bd0a61b0 100644 --- a/incoming/org.eclipse.papyrus.properties.customization/Model/ui/MultiplePropertyEditorType.xwt +++ b/incoming/org.eclipse.papyrus.properties.customization/Model/ui/MultiplePropertyEditorType.xwt @@ -1,2 +1,2 @@ <?xml version="1.0" encoding="UTF-8"?>
-<Composite xmlns:ppe="clr-namespace:org.eclipse.papyrus.properties.widgets" xmlns:x="http://www.eclipse.org/xwt" xmlns:ppel="clr-namespace:org.eclipse.papyrus.properties.widgets.layout" xmlns="http://www.eclipse.org/xwt/presentation"><Composite.layout><ppel:PropertiesLayout></ppel:PropertiesLayout></Composite.layout><Composite><Composite.layout><ppel:PropertiesLayout numColumns="2"></ppel:PropertiesLayout></Composite.layout><ppe:IntegerEditor input="{Binding}" property="properties:environment:PropertyEditorType:multiplicity"></ppe:IntegerEditor></Composite><Composite><Composite.layout><ppel:PropertiesLayout numColumns="1"></ppel:PropertiesLayout></Composite.layout><ppe:EnumCombo input="{Binding}" property="properties:environment:PropertyEditorType:type"></ppe:EnumCombo></Composite></Composite>
\ No newline at end of file +<Composite xmlns:ppe="clr-namespace:org.eclipse.papyrus.properties.widgets" xmlns:ppel="clr-namespace:org.eclipse.papyrus.properties.widgets.layout" xmlns="http://www.eclipse.org/xwt/presentation" xmlns:x="http://www.eclipse.org/xwt"><Composite.layout><ppel:PropertiesLayout></ppel:PropertiesLayout></Composite.layout><Composite><Composite.layout><ppel:PropertiesLayout numColumns="2"></ppel:PropertiesLayout></Composite.layout><ppe:IntegerEditor input="{Binding}" property="properties:environment:PropertyEditorType:multiplicity"></ppe:IntegerEditor></Composite><Composite><Composite.layout><ppel:PropertiesLayout numColumns="1"></ppel:PropertiesLayout></Composite.layout><ppe:EnumCombo input="{Binding}" property="properties:environment:PropertyEditorType:type"></ppe:EnumCombo></Composite></Composite>
\ No newline at end of file diff --git a/incoming/org.eclipse.papyrus.properties.customization/Model/ui/MultipleReferenceProperty.xwt b/incoming/org.eclipse.papyrus.properties.customization/Model/ui/MultipleReferenceProperty.xwt index ab3d7fcf9b9..d8af99ae532 100644 --- a/incoming/org.eclipse.papyrus.properties.customization/Model/ui/MultipleReferenceProperty.xwt +++ b/incoming/org.eclipse.papyrus.properties.customization/Model/ui/MultipleReferenceProperty.xwt @@ -1,2 +1,2 @@ <?xml version="1.0" encoding="UTF-8"?>
-<Composite xmlns:ppe="clr-namespace:org.eclipse.papyrus.properties.widgets" xmlns:ppel="clr-namespace:org.eclipse.papyrus.properties.widgets.layout" xmlns="http://www.eclipse.org/xwt/presentation" xmlns:x="http://www.eclipse.org/xwt"><Composite.layout><ppel:PropertiesLayout></ppel:PropertiesLayout></Composite.layout></Composite>
\ No newline at end of file +<Composite xmlns="http://www.eclipse.org/xwt/presentation" xmlns:ppe="clr-namespace:org.eclipse.papyrus.properties.widgets" xmlns:x="http://www.eclipse.org/xwt" xmlns:ppel="clr-namespace:org.eclipse.papyrus.properties.widgets.layout"><Composite.layout><ppel:PropertiesLayout></ppel:PropertiesLayout></Composite.layout></Composite>
\ No newline at end of file diff --git a/incoming/org.eclipse.papyrus.properties.customization/Model/ui/MultipleSection.xwt b/incoming/org.eclipse.papyrus.properties.customization/Model/ui/MultipleSection.xwt index cb1dd71bcfb..b7fa33615e2 100644 --- a/incoming/org.eclipse.papyrus.properties.customization/Model/ui/MultipleSection.xwt +++ b/incoming/org.eclipse.papyrus.properties.customization/Model/ui/MultipleSection.xwt @@ -1,2 +1,2 @@ <?xml version="1.0" encoding="UTF-8"?>
-<Composite xmlns:ppel="clr-namespace:org.eclipse.papyrus.properties.widgets.layout" xmlns:ppe="clr-namespace:org.eclipse.papyrus.properties.widgets" xmlns:x="http://www.eclipse.org/xwt" xmlns="http://www.eclipse.org/xwt/presentation"><Composite.layout><ppel:PropertiesLayout></ppel:PropertiesLayout></Composite.layout></Composite>
\ No newline at end of file +<Composite xmlns:ppe="clr-namespace:org.eclipse.papyrus.properties.widgets" xmlns:x="http://www.eclipse.org/xwt" xmlns="http://www.eclipse.org/xwt/presentation" xmlns:ppel="clr-namespace:org.eclipse.papyrus.properties.widgets.layout"><Composite.layout><ppel:PropertiesLayout></ppel:PropertiesLayout></Composite.layout></Composite>
\ No newline at end of file diff --git a/incoming/org.eclipse.papyrus.properties.customization/Model/ui/MultipleStandardWidget.xwt b/incoming/org.eclipse.papyrus.properties.customization/Model/ui/MultipleStandardWidget.xwt index ab3d7fcf9b9..699b974ca4f 100644 --- a/incoming/org.eclipse.papyrus.properties.customization/Model/ui/MultipleStandardWidget.xwt +++ b/incoming/org.eclipse.papyrus.properties.customization/Model/ui/MultipleStandardWidget.xwt @@ -1,2 +1,2 @@ <?xml version="1.0" encoding="UTF-8"?>
-<Composite xmlns:ppe="clr-namespace:org.eclipse.papyrus.properties.widgets" xmlns:ppel="clr-namespace:org.eclipse.papyrus.properties.widgets.layout" xmlns="http://www.eclipse.org/xwt/presentation" xmlns:x="http://www.eclipse.org/xwt"><Composite.layout><ppel:PropertiesLayout></ppel:PropertiesLayout></Composite.layout></Composite>
\ No newline at end of file +<Composite xmlns:x="http://www.eclipse.org/xwt" xmlns:ppe="clr-namespace:org.eclipse.papyrus.properties.widgets" xmlns:ppel="clr-namespace:org.eclipse.papyrus.properties.widgets.layout" xmlns="http://www.eclipse.org/xwt/presentation"><Composite.layout><ppel:PropertiesLayout></ppel:PropertiesLayout></Composite.layout></Composite>
\ No newline at end of file diff --git a/incoming/org.eclipse.papyrus.properties.customization/Model/ui/MultipleStandardWidgetType.xwt b/incoming/org.eclipse.papyrus.properties.customization/Model/ui/MultipleStandardWidgetType.xwt index 1ba60ede71f..e042a6b22df 100644 --- a/incoming/org.eclipse.papyrus.properties.customization/Model/ui/MultipleStandardWidgetType.xwt +++ b/incoming/org.eclipse.papyrus.properties.customization/Model/ui/MultipleStandardWidgetType.xwt @@ -1,2 +1,2 @@ <?xml version="1.0" encoding="UTF-8"?>
-<Composite xmlns:x="http://www.eclipse.org/xwt" xmlns:ppe="clr-namespace:org.eclipse.papyrus.properties.widgets" xmlns="http://www.eclipse.org/xwt/presentation" xmlns:ppel="clr-namespace:org.eclipse.papyrus.properties.widgets.layout"><Composite.layout><ppel:PropertiesLayout></ppel:PropertiesLayout></Composite.layout></Composite>
\ No newline at end of file +<Composite xmlns:x="http://www.eclipse.org/xwt" xmlns:ppel="clr-namespace:org.eclipse.papyrus.properties.widgets.layout" xmlns:ppe="clr-namespace:org.eclipse.papyrus.properties.widgets" xmlns="http://www.eclipse.org/xwt/presentation"><Composite.layout><ppel:PropertiesLayout></ppel:PropertiesLayout></Composite.layout></Composite>
\ No newline at end of file diff --git a/incoming/org.eclipse.papyrus.properties.customization/Model/ui/MultipleTab.xwt b/incoming/org.eclipse.papyrus.properties.customization/Model/ui/MultipleTab.xwt index fc430ba1f77..583f071265a 100644 --- a/incoming/org.eclipse.papyrus.properties.customization/Model/ui/MultipleTab.xwt +++ b/incoming/org.eclipse.papyrus.properties.customization/Model/ui/MultipleTab.xwt @@ -1,2 +1,2 @@ <?xml version="1.0" encoding="UTF-8"?>
-<Composite xmlns:ppel="clr-namespace:org.eclipse.papyrus.properties.widgets.layout" xmlns:ppe="clr-namespace:org.eclipse.papyrus.properties.widgets" xmlns:x="http://www.eclipse.org/xwt" xmlns="http://www.eclipse.org/xwt/presentation"><Composite.layout><ppel:PropertiesLayout></ppel:PropertiesLayout></Composite.layout><ppe:BooleanRadio input="{Binding}" property="properties:contexts:Tab:indented"></ppe:BooleanRadio></Composite>
\ No newline at end of file +<Composite xmlns:ppel="clr-namespace:org.eclipse.papyrus.properties.widgets.layout" xmlns:x="http://www.eclipse.org/xwt" xmlns="http://www.eclipse.org/xwt/presentation" xmlns:ppe="clr-namespace:org.eclipse.papyrus.properties.widgets"><Composite.layout><ppel:PropertiesLayout></ppel:PropertiesLayout></Composite.layout><ppe:BooleanRadio input="{Binding}" property="properties:contexts:Tab:indented"></ppe:BooleanRadio></Composite>
\ No newline at end of file diff --git a/incoming/org.eclipse.papyrus.properties.customization/Model/ui/MultipleUIComponent.xwt b/incoming/org.eclipse.papyrus.properties.customization/Model/ui/MultipleUIComponent.xwt index 0652e3cca94..4467d5e2d3b 100644 --- a/incoming/org.eclipse.papyrus.properties.customization/Model/ui/MultipleUIComponent.xwt +++ b/incoming/org.eclipse.papyrus.properties.customization/Model/ui/MultipleUIComponent.xwt @@ -1,2 +1,2 @@ <?xml version="1.0" encoding="UTF-8"?>
-<Composite xmlns:ppe="clr-namespace:org.eclipse.papyrus.properties.widgets" xmlns:ppel="clr-namespace:org.eclipse.papyrus.properties.widgets.layout" xmlns:x="http://www.eclipse.org/xwt" xmlns="http://www.eclipse.org/xwt/presentation"><Composite.layout><ppel:PropertiesLayout></ppel:PropertiesLayout></Composite.layout></Composite>
\ No newline at end of file +<Composite xmlns="http://www.eclipse.org/xwt/presentation" xmlns:x="http://www.eclipse.org/xwt" xmlns:ppel="clr-namespace:org.eclipse.papyrus.properties.widgets.layout" xmlns:ppe="clr-namespace:org.eclipse.papyrus.properties.widgets"><Composite.layout><ppel:PropertiesLayout></ppel:PropertiesLayout></Composite.layout></Composite>
\ No newline at end of file diff --git a/incoming/org.eclipse.papyrus.properties.customization/Model/ui/MultipleUnknownComponent.xwt b/incoming/org.eclipse.papyrus.properties.customization/Model/ui/MultipleUnknownComponent.xwt index bf5b2414a33..d8af99ae532 100644 --- a/incoming/org.eclipse.papyrus.properties.customization/Model/ui/MultipleUnknownComponent.xwt +++ b/incoming/org.eclipse.papyrus.properties.customization/Model/ui/MultipleUnknownComponent.xwt @@ -1,2 +1,2 @@ <?xml version="1.0" encoding="UTF-8"?>
-<Composite xmlns="http://www.eclipse.org/xwt/presentation" xmlns:ppe="clr-namespace:org.eclipse.papyrus.properties.widgets" xmlns:ppel="clr-namespace:org.eclipse.papyrus.properties.widgets.layout" xmlns:x="http://www.eclipse.org/xwt"><Composite.layout><ppel:PropertiesLayout></ppel:PropertiesLayout></Composite.layout></Composite>
\ No newline at end of file +<Composite xmlns="http://www.eclipse.org/xwt/presentation" xmlns:ppe="clr-namespace:org.eclipse.papyrus.properties.widgets" xmlns:x="http://www.eclipse.org/xwt" xmlns:ppel="clr-namespace:org.eclipse.papyrus.properties.widgets.layout"><Composite.layout><ppel:PropertiesLayout></ppel:PropertiesLayout></Composite.layout></Composite>
\ No newline at end of file diff --git a/incoming/org.eclipse.papyrus.properties.customization/Model/ui/MultipleUnknownProperty.xwt b/incoming/org.eclipse.papyrus.properties.customization/Model/ui/MultipleUnknownProperty.xwt index 609c6c9572b..4164993f3c4 100644 --- a/incoming/org.eclipse.papyrus.properties.customization/Model/ui/MultipleUnknownProperty.xwt +++ b/incoming/org.eclipse.papyrus.properties.customization/Model/ui/MultipleUnknownProperty.xwt @@ -1,2 +1,2 @@ <?xml version="1.0" encoding="UTF-8"?>
-<Composite xmlns:x="http://www.eclipse.org/xwt" xmlns:ppe="clr-namespace:org.eclipse.papyrus.properties.widgets" xmlns:ppel="clr-namespace:org.eclipse.papyrus.properties.widgets.layout" xmlns="http://www.eclipse.org/xwt/presentation"><Composite.layout><ppel:PropertiesLayout></ppel:PropertiesLayout></Composite.layout><Composite><Composite.layout><ppel:PropertiesLayout numColumns="2"></ppel:PropertiesLayout></Composite.layout><ppe:IntegerEditor input="{Binding}" property="properties:contexts:Property:multiplicity"></ppe:IntegerEditor></Composite><Composite><Composite.layout><ppel:PropertiesLayout numColumns="1"></ppel:PropertiesLayout></Composite.layout><ppe:EnumCombo input="{Binding}" property="properties:contexts:Property:type"></ppe:EnumCombo></Composite></Composite>
\ No newline at end of file +<Composite xmlns="http://www.eclipse.org/xwt/presentation" xmlns:ppel="clr-namespace:org.eclipse.papyrus.properties.widgets.layout" xmlns:ppe="clr-namespace:org.eclipse.papyrus.properties.widgets" xmlns:x="http://www.eclipse.org/xwt"><Composite.layout><ppel:PropertiesLayout></ppel:PropertiesLayout></Composite.layout><Composite><Composite.layout><ppel:PropertiesLayout numColumns="2"></ppel:PropertiesLayout></Composite.layout><ppe:IntegerEditor input="{Binding}" property="properties:contexts:Property:multiplicity"></ppe:IntegerEditor></Composite><Composite><Composite.layout><ppel:PropertiesLayout numColumns="1"></ppel:PropertiesLayout></Composite.layout><ppe:EnumCombo input="{Binding}" property="properties:contexts:Property:type"></ppe:EnumCombo></Composite></Composite>
\ No newline at end of file diff --git a/incoming/org.eclipse.papyrus.properties.customization/Model/ui/MultipleValueAttribute.xwt b/incoming/org.eclipse.papyrus.properties.customization/Model/ui/MultipleValueAttribute.xwt index 2380a4c605f..0652e3cca94 100644 --- a/incoming/org.eclipse.papyrus.properties.customization/Model/ui/MultipleValueAttribute.xwt +++ b/incoming/org.eclipse.papyrus.properties.customization/Model/ui/MultipleValueAttribute.xwt @@ -1,2 +1,2 @@ <?xml version="1.0" encoding="UTF-8"?>
-<Composite xmlns:ppe="clr-namespace:org.eclipse.papyrus.properties.widgets" xmlns:x="http://www.eclipse.org/xwt" xmlns:ppel="clr-namespace:org.eclipse.papyrus.properties.widgets.layout" xmlns="http://www.eclipse.org/xwt/presentation"><Composite.layout><ppel:PropertiesLayout></ppel:PropertiesLayout></Composite.layout></Composite>
\ No newline at end of file +<Composite xmlns:ppe="clr-namespace:org.eclipse.papyrus.properties.widgets" xmlns:ppel="clr-namespace:org.eclipse.papyrus.properties.widgets.layout" xmlns:x="http://www.eclipse.org/xwt" xmlns="http://www.eclipse.org/xwt/presentation"><Composite.layout><ppel:PropertiesLayout></ppel:PropertiesLayout></Composite.layout></Composite>
\ No newline at end of file diff --git a/incoming/org.eclipse.papyrus.properties.customization/Model/ui/MultipleValueProperty.xwt b/incoming/org.eclipse.papyrus.properties.customization/Model/ui/MultipleValueProperty.xwt index ab3d7fcf9b9..43527b5a314 100644 --- a/incoming/org.eclipse.papyrus.properties.customization/Model/ui/MultipleValueProperty.xwt +++ b/incoming/org.eclipse.papyrus.properties.customization/Model/ui/MultipleValueProperty.xwt @@ -1,2 +1,2 @@ <?xml version="1.0" encoding="UTF-8"?>
-<Composite xmlns:ppe="clr-namespace:org.eclipse.papyrus.properties.widgets" xmlns:ppel="clr-namespace:org.eclipse.papyrus.properties.widgets.layout" xmlns="http://www.eclipse.org/xwt/presentation" xmlns:x="http://www.eclipse.org/xwt"><Composite.layout><ppel:PropertiesLayout></ppel:PropertiesLayout></Composite.layout></Composite>
\ No newline at end of file +<Composite xmlns="http://www.eclipse.org/xwt/presentation" xmlns:ppel="clr-namespace:org.eclipse.papyrus.properties.widgets.layout" xmlns:x="http://www.eclipse.org/xwt" xmlns:ppe="clr-namespace:org.eclipse.papyrus.properties.widgets"><Composite.layout><ppel:PropertiesLayout></ppel:PropertiesLayout></Composite.layout></Composite>
\ No newline at end of file diff --git a/incoming/org.eclipse.papyrus.properties.customization/Model/ui/MultipleView.xwt b/incoming/org.eclipse.papyrus.properties.customization/Model/ui/MultipleView.xwt index 848676a7433..4fa8c07cae3 100644 --- a/incoming/org.eclipse.papyrus.properties.customization/Model/ui/MultipleView.xwt +++ b/incoming/org.eclipse.papyrus.properties.customization/Model/ui/MultipleView.xwt @@ -1,2 +1,2 @@ <?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.properties.widgets" xmlns:ppel="clr-namespace:org.eclipse.papyrus.properties.widgets.layout"><Composite.layout><ppel:PropertiesLayout></ppel:PropertiesLayout></Composite.layout><Composite><Composite.layout><ppel:PropertiesLayout numColumns="2"></ppel:PropertiesLayout></Composite.layout><ppe:IntegerEditor input="{Binding}" property="properties:contexts:View:elementMultiplicity"></ppe:IntegerEditor></Composite></Composite>
\ No newline at end of file +<Composite xmlns:ppe="clr-namespace:org.eclipse.papyrus.properties.widgets" xmlns:x="http://www.eclipse.org/xwt" xmlns:ppel="clr-namespace:org.eclipse.papyrus.properties.widgets.layout" xmlns="http://www.eclipse.org/xwt/presentation"><Composite.layout><ppel:PropertiesLayout></ppel:PropertiesLayout></Composite.layout><Composite><Composite.layout><ppel:PropertiesLayout numColumns="2"></ppel:PropertiesLayout></Composite.layout><ppe:IntegerEditor input="{Binding}" property="properties:contexts:View:elementMultiplicity"></ppe:IntegerEditor></Composite></Composite>
\ No newline at end of file diff --git a/incoming/org.eclipse.papyrus.properties.customization/Model/ui/MultipleWidget.xwt b/incoming/org.eclipse.papyrus.properties.customization/Model/ui/MultipleWidget.xwt index 627779f9e7f..1ac31f24dbe 100644 --- a/incoming/org.eclipse.papyrus.properties.customization/Model/ui/MultipleWidget.xwt +++ b/incoming/org.eclipse.papyrus.properties.customization/Model/ui/MultipleWidget.xwt @@ -1,2 +1,2 @@ <?xml version="1.0" encoding="UTF-8"?>
-<Composite xmlns:ppe="clr-namespace:org.eclipse.papyrus.properties.widgets" xmlns="http://www.eclipse.org/xwt/presentation" xmlns:x="http://www.eclipse.org/xwt" xmlns:ppel="clr-namespace:org.eclipse.papyrus.properties.widgets.layout"><Composite.layout><ppel:PropertiesLayout></ppel:PropertiesLayout></Composite.layout></Composite>
\ No newline at end of file +<Composite xmlns:ppel="clr-namespace:org.eclipse.papyrus.properties.widgets.layout" xmlns="http://www.eclipse.org/xwt/presentation" xmlns:x="http://www.eclipse.org/xwt" xmlns:ppe="clr-namespace:org.eclipse.papyrus.properties.widgets"><Composite.layout><ppel:PropertiesLayout></ppel:PropertiesLayout></Composite.layout></Composite>
\ No newline at end of file diff --git a/incoming/org.eclipse.papyrus.properties.customization/Model/ui/MultipleWidgetAttribute.xwt b/incoming/org.eclipse.papyrus.properties.customization/Model/ui/MultipleWidgetAttribute.xwt index 1cfcab2425b..1ba60ede71f 100644 --- a/incoming/org.eclipse.papyrus.properties.customization/Model/ui/MultipleWidgetAttribute.xwt +++ b/incoming/org.eclipse.papyrus.properties.customization/Model/ui/MultipleWidgetAttribute.xwt @@ -1,2 +1,2 @@ <?xml version="1.0" encoding="UTF-8"?>
-<Composite xmlns:x="http://www.eclipse.org/xwt" xmlns:ppel="clr-namespace:org.eclipse.papyrus.properties.widgets.layout" xmlns="http://www.eclipse.org/xwt/presentation" xmlns:ppe="clr-namespace:org.eclipse.papyrus.properties.widgets"><Composite.layout><ppel:PropertiesLayout></ppel:PropertiesLayout></Composite.layout></Composite>
\ No newline at end of file +<Composite xmlns:x="http://www.eclipse.org/xwt" xmlns:ppe="clr-namespace:org.eclipse.papyrus.properties.widgets" xmlns="http://www.eclipse.org/xwt/presentation" xmlns:ppel="clr-namespace:org.eclipse.papyrus.properties.widgets.layout"><Composite.layout><ppel:PropertiesLayout></ppel:PropertiesLayout></Composite.layout></Composite>
\ No newline at end of file diff --git a/incoming/org.eclipse.papyrus.properties.customization/Model/ui/MultipleWidgetType.xwt b/incoming/org.eclipse.papyrus.properties.customization/Model/ui/MultipleWidgetType.xwt index 627779f9e7f..43527b5a314 100644 --- a/incoming/org.eclipse.papyrus.properties.customization/Model/ui/MultipleWidgetType.xwt +++ b/incoming/org.eclipse.papyrus.properties.customization/Model/ui/MultipleWidgetType.xwt @@ -1,2 +1,2 @@ <?xml version="1.0" encoding="UTF-8"?>
-<Composite xmlns:ppe="clr-namespace:org.eclipse.papyrus.properties.widgets" xmlns="http://www.eclipse.org/xwt/presentation" xmlns:x="http://www.eclipse.org/xwt" xmlns:ppel="clr-namespace:org.eclipse.papyrus.properties.widgets.layout"><Composite.layout><ppel:PropertiesLayout></ppel:PropertiesLayout></Composite.layout></Composite>
\ No newline at end of file +<Composite xmlns="http://www.eclipse.org/xwt/presentation" xmlns:ppel="clr-namespace:org.eclipse.papyrus.properties.widgets.layout" xmlns:x="http://www.eclipse.org/xwt" xmlns:ppe="clr-namespace:org.eclipse.papyrus.properties.widgets"><Composite.layout><ppel:PropertiesLayout></ppel:PropertiesLayout></Composite.layout></Composite>
\ No newline at end of file diff --git a/incoming/org.eclipse.papyrus.properties.customization/Model/ui/OCLQuery.xwt b/incoming/org.eclipse.papyrus.properties.customization/Model/ui/OCLQuery.xwt index ffc31849921..f776424b579 100644 --- a/incoming/org.eclipse.papyrus.properties.customization/Model/ui/OCLQuery.xwt +++ b/incoming/org.eclipse.papyrus.properties.customization/Model/ui/OCLQuery.xwt @@ -1,2 +1,2 @@ <?xml version="1.0" encoding="UTF-8"?>
-<Composite xmlns:ppel="clr-namespace:org.eclipse.papyrus.properties.widgets.layout" xmlns="http://www.eclipse.org/xwt/presentation" xmlns:ppe="clr-namespace:org.eclipse.papyrus.properties.widgets" xmlns:x="http://www.eclipse.org/xwt"><Composite.layout><ppel:PropertiesLayout></ppel:PropertiesLayout></Composite.layout><Composite><Composite.layout><ppel:PropertiesLayout></ppel:PropertiesLayout></Composite.layout><ppe:ReferenceDialog input="{Binding}" property="Properties:OCLQuery:query"></ppe:ReferenceDialog></Composite></Composite>
\ No newline at end of file +<Composite xmlns:x="http://www.eclipse.org/xwt" xmlns="http://www.eclipse.org/xwt/presentation" xmlns:ppel="clr-namespace:org.eclipse.papyrus.properties.widgets.layout" xmlns:ppe="clr-namespace:org.eclipse.papyrus.properties.widgets"><Composite.layout><ppel:PropertiesLayout></ppel:PropertiesLayout></Composite.layout><Composite><Composite.layout><ppel:PropertiesLayout></ppel:PropertiesLayout></Composite.layout><ppe:ReferenceDialog input="{Binding}" property="Properties:OCLQuery:query"></ppe:ReferenceDialog></Composite></Composite>
\ No newline at end of file diff --git a/incoming/org.eclipse.papyrus.properties.customization/Model/ui/Single ToggleButton.xwt b/incoming/org.eclipse.papyrus.properties.customization/Model/ui/Single ToggleButton.xwt new file mode 100644 index 00000000000..4205bfbeb12 --- /dev/null +++ b/incoming/org.eclipse.papyrus.properties.customization/Model/ui/Single ToggleButton.xwt @@ -0,0 +1,2 @@ +<?xml version="1.0" encoding="UTF-8"?>
+<Composite xmlns:x="http://www.eclipse.org/xwt" xmlns:ppel="clr-namespace:org.eclipse.papyrus.properties.widgets.layout" xmlns="http://www.eclipse.org/xwt/presentation" xmlns:ppe="clr-namespace:org.eclipse.papyrus.properties.widgets"><Composite.layout><ppel:PropertiesLayout></ppel:PropertiesLayout></Composite.layout><ppe:StringFileSelector allowWorkspace="true" allowFileSystem="false" input="{Binding}" property="Custom:Attribute:BooleanToggle:image"></ppe:StringFileSelector></Composite>
\ No newline at end of file diff --git a/incoming/org.eclipse.papyrus.properties.customization/Model/ui/SingleCompositeWidget.xwt b/incoming/org.eclipse.papyrus.properties.customization/Model/ui/SingleCompositeWidget.xwt index d19c2b54a1c..6b0ebc12a5c 100644 --- a/incoming/org.eclipse.papyrus.properties.customization/Model/ui/SingleCompositeWidget.xwt +++ b/incoming/org.eclipse.papyrus.properties.customization/Model/ui/SingleCompositeWidget.xwt @@ -1,2 +1,2 @@ <?xml version="1.0" encoding="UTF-8"?>
-<Composite xmlns:ppec="clr-namespace:org.eclipse.papyrus.properties.creation" xmlns:ppel="clr-namespace:org.eclipse.papyrus.properties.widgets.layout" xmlns:ppe="clr-namespace:org.eclipse.papyrus.properties.widgets" xmlns="http://www.eclipse.org/xwt/presentation" xmlns:x="http://www.eclipse.org/xwt"><Composite.layout><ppel:PropertiesLayout></ppel:PropertiesLayout></Composite.layout><Composite><Composite.layout><ppel:PropertiesLayout numColumns="1"></ppel:PropertiesLayout></Composite.layout><ppe:ReferenceDialog input="{Binding}" property="properties:ui:CompositeWidget:widgetType"></ppe:ReferenceDialog></Composite></Composite>
\ No newline at end of file +<Composite xmlns="http://www.eclipse.org/xwt/presentation" xmlns:ppe="clr-namespace:org.eclipse.papyrus.properties.widgets" xmlns:ppel="clr-namespace:org.eclipse.papyrus.properties.widgets.layout" xmlns:ppec="clr-namespace:org.eclipse.papyrus.properties.creation" xmlns:x="http://www.eclipse.org/xwt"><Composite.layout><ppel:PropertiesLayout></ppel:PropertiesLayout></Composite.layout><Composite><Composite.layout><ppel:PropertiesLayout numColumns="1"></ppel:PropertiesLayout></Composite.layout><ppe:ReferenceDialog input="{Binding}" property="properties:ui:CompositeWidget:widgetType"></ppe:ReferenceDialog></Composite></Composite>
\ No newline at end of file diff --git a/incoming/org.eclipse.papyrus.properties.customization/Model/ui/SingleCompositeWidgetType.xwt b/incoming/org.eclipse.papyrus.properties.customization/Model/ui/SingleCompositeWidgetType.xwt index f236f77b159..ef2970175df 100644 --- a/incoming/org.eclipse.papyrus.properties.customization/Model/ui/SingleCompositeWidgetType.xwt +++ b/incoming/org.eclipse.papyrus.properties.customization/Model/ui/SingleCompositeWidgetType.xwt @@ -1,2 +1,2 @@ <?xml version="1.0" encoding="UTF-8"?>
-<Composite xmlns:ppel="clr-namespace:org.eclipse.papyrus.properties.widgets.layout" xmlns="http://www.eclipse.org/xwt/presentation" xmlns:ppe="clr-namespace:org.eclipse.papyrus.properties.widgets" xmlns:x="http://www.eclipse.org/xwt"><Composite.layout><ppel:PropertiesLayout></ppel:PropertiesLayout></Composite.layout><Composite><Composite.layout><ppel:PropertiesLayout numColumns="1"></ppel:PropertiesLayout></Composite.layout><ppe:StringEditor input="{Binding}" property="properties:environment:WidgetType:label"></ppe:StringEditor><ppe:StringEditor input="{Binding}" property="properties:environment:WidgetType:widgetClass"></ppe:StringEditor></Composite></Composite>
\ No newline at end of file +<Composite xmlns:x="http://www.eclipse.org/xwt" xmlns="http://www.eclipse.org/xwt/presentation" xmlns:ppe="clr-namespace:org.eclipse.papyrus.properties.widgets" xmlns:ppel="clr-namespace:org.eclipse.papyrus.properties.widgets.layout"><Composite.layout><ppel:PropertiesLayout></ppel:PropertiesLayout></Composite.layout><Composite><Composite.layout><ppel:PropertiesLayout numColumns="1"></ppel:PropertiesLayout></Composite.layout><ppe:StringEditor input="{Binding}" property="properties:environment:WidgetType:label"></ppe:StringEditor><ppe:StringEditor input="{Binding}" property="properties:environment:WidgetType:widgetClass"></ppe:StringEditor></Composite></Composite>
\ No newline at end of file diff --git a/incoming/org.eclipse.papyrus.properties.customization/Model/ui/SingleConfigProperty.xwt b/incoming/org.eclipse.papyrus.properties.customization/Model/ui/SingleConfigProperty.xwt index 87db1de875a..fd8723f7a3e 100644 --- a/incoming/org.eclipse.papyrus.properties.customization/Model/ui/SingleConfigProperty.xwt +++ b/incoming/org.eclipse.papyrus.properties.customization/Model/ui/SingleConfigProperty.xwt @@ -1,2 +1,2 @@ <?xml version="1.0" encoding="UTF-8"?>
-<Composite xmlns="http://www.eclipse.org/xwt/presentation" xmlns:ppel="clr-namespace:org.eclipse.papyrus.properties.widgets.layout" xmlns:ppe="clr-namespace:org.eclipse.papyrus.properties.widgets" xmlns:x="http://www.eclipse.org/xwt"><Composite.layout><ppel:PropertiesLayout></ppel:PropertiesLayout></Composite.layout><Composite><Composite.layout><ppel:PropertiesLayout numColumns="1"></ppel:PropertiesLayout></Composite.layout><ppe:StringEditor input="{Binding}" property="properties:contexts:ConfigProperty:name"></ppe:StringEditor></Composite></Composite>
\ No newline at end of file +<Composite xmlns:ppe="clr-namespace:org.eclipse.papyrus.properties.widgets" xmlns:ppel="clr-namespace:org.eclipse.papyrus.properties.widgets.layout" xmlns:x="http://www.eclipse.org/xwt" xmlns="http://www.eclipse.org/xwt/presentation"><Composite.layout><ppel:PropertiesLayout></ppel:PropertiesLayout></Composite.layout><Composite><Composite.layout><ppel:PropertiesLayout numColumns="1"></ppel:PropertiesLayout></Composite.layout><ppe:StringEditor input="{Binding}" property="properties:contexts:ConfigProperty:name"></ppe:StringEditor></Composite></Composite>
\ No newline at end of file diff --git a/incoming/org.eclipse.papyrus.properties.customization/Model/ui/SingleConstraintDescriptor.xwt b/incoming/org.eclipse.papyrus.properties.customization/Model/ui/SingleConstraintDescriptor.xwt index 1e5b7c564db..fffc16eed9c 100644 --- a/incoming/org.eclipse.papyrus.properties.customization/Model/ui/SingleConstraintDescriptor.xwt +++ b/incoming/org.eclipse.papyrus.properties.customization/Model/ui/SingleConstraintDescriptor.xwt @@ -1,2 +1,2 @@ <?xml version="1.0" encoding="UTF-8"?>
-<Composite xmlns:ppe="clr-namespace:org.eclipse.papyrus.properties.widgets" xmlns:ppel="clr-namespace:org.eclipse.papyrus.properties.widgets.layout" xmlns:x="http://www.eclipse.org/xwt" xmlns="http://www.eclipse.org/xwt/presentation"><Composite.layout><ppel:PropertiesLayout></ppel:PropertiesLayout></Composite.layout><Composite><Composite.layout><ppel:PropertiesLayout numColumns="1"></ppel:PropertiesLayout></Composite.layout><ppe:StringEditor input="{Binding}" property="properties:contexts:ConstraintDescriptor:name"></ppe:StringEditor></Composite><Composite><Composite.layout><ppel:PropertiesLayout numColumns="1"></ppel:PropertiesLayout></Composite.layout><ppe:ReferenceDialog input="{Binding}" property="properties:contexts:ConstraintDescriptor:constraintType"></ppe:ReferenceDialog></Composite><Composite><Composite.layout><ppel:PropertiesLayout numColumns="1"></ppel:PropertiesLayout></Composite.layout><ppe:MultiReference input="{Binding}" property="properties:contexts:ConstraintDescriptor:overriddenConstraints"></ppe:MultiReference></Composite></Composite>
\ No newline at end of file +<Composite xmlns:x="http://www.eclipse.org/xwt" xmlns:ppel="clr-namespace:org.eclipse.papyrus.properties.widgets.layout" xmlns="http://www.eclipse.org/xwt/presentation" xmlns:ppe="clr-namespace:org.eclipse.papyrus.properties.widgets"><Composite.layout><ppel:PropertiesLayout></ppel:PropertiesLayout></Composite.layout><Composite><Composite.layout><ppel:PropertiesLayout numColumns="1"></ppel:PropertiesLayout></Composite.layout><ppe:StringEditor input="{Binding}" property="properties:contexts:ConstraintDescriptor:name"></ppe:StringEditor></Composite><Composite><Composite.layout><ppel:PropertiesLayout numColumns="1"></ppel:PropertiesLayout></Composite.layout><ppe:ReferenceDialog input="{Binding}" property="properties:contexts:ConstraintDescriptor:constraintType"></ppe:ReferenceDialog></Composite><Composite><Composite.layout><ppel:PropertiesLayout numColumns="1"></ppel:PropertiesLayout></Composite.layout><ppe:BooleanRadio property="properties:contexts:ConstraintDescriptor:overrideable" input="{Binding}"></ppe:BooleanRadio><ppe:MultiReference input="{Binding}" property="properties:contexts:ConstraintDescriptor:overriddenConstraints"></ppe:MultiReference></Composite></Composite>
\ No newline at end of file diff --git a/incoming/org.eclipse.papyrus.properties.customization/Model/ui/SingleConstraintType.xwt b/incoming/org.eclipse.papyrus.properties.customization/Model/ui/SingleConstraintType.xwt index 309fa5d053d..4fdb60727be 100644 --- a/incoming/org.eclipse.papyrus.properties.customization/Model/ui/SingleConstraintType.xwt +++ b/incoming/org.eclipse.papyrus.properties.customization/Model/ui/SingleConstraintType.xwt @@ -1,2 +1,2 @@ <?xml version="1.0" encoding="UTF-8"?>
-<Composite xmlns="http://www.eclipse.org/xwt/presentation" xmlns:ppel="clr-namespace:org.eclipse.papyrus.properties.widgets.layout" xmlns:ppe="clr-namespace:org.eclipse.papyrus.properties.widgets" xmlns:x="http://www.eclipse.org/xwt"><Composite.layout><ppel:PropertiesLayout></ppel:PropertiesLayout></Composite.layout><Composite><Composite.layout><ppel:PropertiesLayout numColumns="1"></ppel:PropertiesLayout></Composite.layout><ppe:StringEditor input="{Binding}" property="properties:environment:ConstraintType:label"></ppe:StringEditor><ppe:StringEditor input="{Binding}" property="properties:environment:ConstraintType:constraintClass"></ppe:StringEditor></Composite></Composite>
\ No newline at end of file +<Composite xmlns="http://www.eclipse.org/xwt/presentation" xmlns:ppel="clr-namespace:org.eclipse.papyrus.properties.widgets.layout" xmlns:x="http://www.eclipse.org/xwt" xmlns:ppe="clr-namespace:org.eclipse.papyrus.properties.widgets"><Composite.layout><ppel:PropertiesLayout></ppel:PropertiesLayout></Composite.layout><Composite><Composite.layout><ppel:PropertiesLayout numColumns="1"></ppel:PropertiesLayout></Composite.layout><ppe:StringEditor input="{Binding}" property="properties:environment:ConstraintType:label"></ppe:StringEditor><ppe:StringEditor input="{Binding}" property="properties:environment:ConstraintType:constraintClass"></ppe:StringEditor></Composite></Composite>
\ No newline at end of file diff --git a/incoming/org.eclipse.papyrus.properties.customization/Model/ui/SingleContext.xwt b/incoming/org.eclipse.papyrus.properties.customization/Model/ui/SingleContext.xwt index ef11d6f49ab..e2d87b0e8ce 100644 --- a/incoming/org.eclipse.papyrus.properties.customization/Model/ui/SingleContext.xwt +++ b/incoming/org.eclipse.papyrus.properties.customization/Model/ui/SingleContext.xwt @@ -1,2 +1,2 @@ <?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.properties.widgets" xmlns:ppel="clr-namespace:org.eclipse.papyrus.properties.widgets.layout"><Composite.layout><ppel:PropertiesLayout></ppel:PropertiesLayout></Composite.layout><Composite><Composite.layout><ppel:PropertiesLayout numColumns="1"></ppel:PropertiesLayout></Composite.layout><ppe:StringEditor input="{Binding}" property="properties:contexts:Context:name"></ppe:StringEditor><ppe:MultiReference input="{Binding}" property="properties:contexts:Context:dependencies"></ppe:MultiReference></Composite></Composite>
\ No newline at end of file +<Composite xmlns="http://www.eclipse.org/xwt/presentation" xmlns:x="http://www.eclipse.org/xwt" xmlns:ppel="clr-namespace:org.eclipse.papyrus.properties.widgets.layout" xmlns:ppe="clr-namespace:org.eclipse.papyrus.properties.widgets"><Composite.layout><ppel:PropertiesLayout></ppel:PropertiesLayout></Composite.layout><Composite><Composite.layout><ppel:PropertiesLayout numColumns="1"></ppel:PropertiesLayout></Composite.layout><ppe:StringEditor input="{Binding}" property="properties:contexts:Context:name"></ppe:StringEditor><ppe:MultiReference input="{Binding}" property="properties:contexts:Context:dependencies"></ppe:MultiReference></Composite></Composite>
\ No newline at end of file diff --git a/incoming/org.eclipse.papyrus.properties.customization/Model/ui/SingleDataContextElement.xwt b/incoming/org.eclipse.papyrus.properties.customization/Model/ui/SingleDataContextElement.xwt index 576d4ac7523..8de0c7fbada 100644 --- a/incoming/org.eclipse.papyrus.properties.customization/Model/ui/SingleDataContextElement.xwt +++ b/incoming/org.eclipse.papyrus.properties.customization/Model/ui/SingleDataContextElement.xwt @@ -1,2 +1,2 @@ <?xml version="1.0" encoding="UTF-8"?>
-<Composite xmlns:ppe="clr-namespace:org.eclipse.papyrus.properties.widgets" xmlns:x="http://www.eclipse.org/xwt" xmlns="http://www.eclipse.org/xwt/presentation" xmlns:ppel="clr-namespace:org.eclipse.papyrus.properties.widgets.layout"><Composite.layout><ppel:PropertiesLayout></ppel:PropertiesLayout></Composite.layout><Composite><Composite.layout><ppel:PropertiesLayout numColumns="1"></ppel:PropertiesLayout></Composite.layout><ppe:StringEditor input="{Binding}" property="properties:contexts:DataContextElement:name"></ppe:StringEditor></Composite><Composite><Composite.layout><ppel:PropertiesLayout numColumns="1"></ppel:PropertiesLayout></Composite.layout><ppe:MultiReference input="{Binding}" property="properties:contexts:DataContextElement:supertypes"></ppe:MultiReference><ppe:MultiReference input="{Binding}" property="properties:contexts:DataContextElement:properties"></ppe:MultiReference></Composite></Composite>
\ No newline at end of file +<Composite xmlns="http://www.eclipse.org/xwt/presentation" xmlns:ppe="clr-namespace:org.eclipse.papyrus.properties.widgets" xmlns:ppel="clr-namespace:org.eclipse.papyrus.properties.widgets.layout" xmlns:x="http://www.eclipse.org/xwt"><Composite.layout><ppel:PropertiesLayout></ppel:PropertiesLayout></Composite.layout><Composite><Composite.layout><ppel:PropertiesLayout numColumns="1"></ppel:PropertiesLayout></Composite.layout><ppe:StringEditor input="{Binding}" property="properties:contexts:DataContextElement:name"></ppe:StringEditor></Composite><Composite><Composite.layout><ppel:PropertiesLayout numColumns="1"></ppel:PropertiesLayout></Composite.layout><ppe:MultiReference input="{Binding}" property="properties:contexts:DataContextElement:supertypes"></ppe:MultiReference><ppe:MultiReference input="{Binding}" property="properties:contexts:DataContextElement:properties"></ppe:MultiReference></Composite></Composite>
\ No newline at end of file diff --git a/incoming/org.eclipse.papyrus.properties.customization/Model/ui/SingleDataContextPackage.xwt b/incoming/org.eclipse.papyrus.properties.customization/Model/ui/SingleDataContextPackage.xwt index e01263bd923..d1be21bdc17 100644 --- a/incoming/org.eclipse.papyrus.properties.customization/Model/ui/SingleDataContextPackage.xwt +++ b/incoming/org.eclipse.papyrus.properties.customization/Model/ui/SingleDataContextPackage.xwt @@ -1,2 +1,2 @@ <?xml version="1.0" encoding="UTF-8"?>
-<Composite xmlns:ppe="clr-namespace:org.eclipse.papyrus.properties.widgets" xmlns:x="http://www.eclipse.org/xwt" xmlns:ppel="clr-namespace:org.eclipse.papyrus.properties.widgets.layout" xmlns="http://www.eclipse.org/xwt/presentation"><Composite.layout><ppel:PropertiesLayout></ppel:PropertiesLayout></Composite.layout><Composite><Composite.layout><ppel:PropertiesLayout numColumns="1"></ppel:PropertiesLayout></Composite.layout><ppe:StringEditor input="{Binding}" property="properties:contexts:DataContextElement:name"></ppe:StringEditor></Composite><Composite><Composite.layout><ppel:PropertiesLayout numColumns="1"></ppel:PropertiesLayout></Composite.layout><ppe:MultiReference input="{Binding}" property="properties:contexts:DataContextElement:supertypes"></ppe:MultiReference><ppe:MultiReference input="{Binding}" property="properties:contexts:Property:contextElement"></ppe:MultiReference></Composite></Composite>
\ No newline at end of file +<Composite xmlns:x="http://www.eclipse.org/xwt" xmlns="http://www.eclipse.org/xwt/presentation" xmlns:ppel="clr-namespace:org.eclipse.papyrus.properties.widgets.layout" xmlns:ppe="clr-namespace:org.eclipse.papyrus.properties.widgets"><Composite.layout><ppel:PropertiesLayout></ppel:PropertiesLayout></Composite.layout><Composite><Composite.layout><ppel:PropertiesLayout numColumns="1"></ppel:PropertiesLayout></Composite.layout><ppe:StringEditor input="{Binding}" property="properties:contexts:DataContextElement:name"></ppe:StringEditor></Composite><Composite><Composite.layout><ppel:PropertiesLayout numColumns="1"></ppel:PropertiesLayout></Composite.layout><ppe:MultiReference input="{Binding}" property="properties:contexts:DataContextElement:supertypes"></ppe:MultiReference><ppe:MultiReference input="{Binding}" property="properties:contexts:Property:contextElement"></ppe:MultiReference></Composite></Composite>
\ No newline at end of file diff --git a/incoming/org.eclipse.papyrus.properties.customization/Model/ui/SingleDataContextRoot.xwt b/incoming/org.eclipse.papyrus.properties.customization/Model/ui/SingleDataContextRoot.xwt index 19ff4ba9fe9..fd949677848 100644 --- a/incoming/org.eclipse.papyrus.properties.customization/Model/ui/SingleDataContextRoot.xwt +++ b/incoming/org.eclipse.papyrus.properties.customization/Model/ui/SingleDataContextRoot.xwt @@ -1,2 +1,2 @@ <?xml version="1.0" encoding="UTF-8"?>
-<Composite xmlns:x="http://www.eclipse.org/xwt" xmlns:ppe="clr-namespace:org.eclipse.papyrus.properties.widgets" xmlns="http://www.eclipse.org/xwt/presentation" xmlns:ppel="clr-namespace:org.eclipse.papyrus.properties.widgets.layout"><Composite.layout><ppel:PropertiesLayout></ppel:PropertiesLayout></Composite.layout><Composite><Composite.layout><ppel:PropertiesLayout numColumns="1"></ppel:PropertiesLayout></Composite.layout><ppe:StringEditor input="{Binding}" property="properties:contexts:DataContextElement:name"></ppe:StringEditor><ppe:StringEditor input="{Binding}" property="properties:contexts:DataContextRoot:label"></ppe:StringEditor></Composite><Composite><Composite.layout><ppel:PropertiesLayout numColumns="1"></ppel:PropertiesLayout></Composite.layout><ppe:ReferenceDialog input="{Binding}" property="properties:contexts:DataContextRoot:modelElementFactory"></ppe:ReferenceDialog></Composite><Composite><Composite.layout><ppel:PropertiesLayout numColumns="1"></ppel:PropertiesLayout></Composite.layout><ppe:MultiReference input="{Binding}" property="properties:contexts:DataContextElement:supertypes"></ppe:MultiReference></Composite></Composite>
\ No newline at end of file +<Composite xmlns="http://www.eclipse.org/xwt/presentation" xmlns:ppe="clr-namespace:org.eclipse.papyrus.properties.widgets" xmlns:ppel="clr-namespace:org.eclipse.papyrus.properties.widgets.layout" xmlns:x="http://www.eclipse.org/xwt"><Composite.layout><ppel:PropertiesLayout></ppel:PropertiesLayout></Composite.layout><Composite><Composite.layout><ppel:PropertiesLayout numColumns="1"></ppel:PropertiesLayout></Composite.layout><ppe:StringEditor input="{Binding}" property="properties:contexts:DataContextElement:name"></ppe:StringEditor><ppe:StringEditor input="{Binding}" property="properties:contexts:DataContextRoot:label"></ppe:StringEditor></Composite><Composite><Composite.layout><ppel:PropertiesLayout numColumns="1"></ppel:PropertiesLayout></Composite.layout><ppe:ReferenceDialog input="{Binding}" property="properties:contexts:DataContextRoot:modelElementFactory"></ppe:ReferenceDialog></Composite><Composite><Composite.layout><ppel:PropertiesLayout numColumns="1"></ppel:PropertiesLayout></Composite.layout><ppe:MultiReference input="{Binding}" property="properties:contexts:DataContextElement:supertypes"></ppe:MultiReference></Composite></Composite>
\ No newline at end of file diff --git a/incoming/org.eclipse.papyrus.properties.customization/Model/ui/SingleDisplayUnit.xwt b/incoming/org.eclipse.papyrus.properties.customization/Model/ui/SingleDisplayUnit.xwt index 2380a4c605f..7302f1fef08 100644 --- a/incoming/org.eclipse.papyrus.properties.customization/Model/ui/SingleDisplayUnit.xwt +++ b/incoming/org.eclipse.papyrus.properties.customization/Model/ui/SingleDisplayUnit.xwt @@ -1,2 +1,2 @@ <?xml version="1.0" encoding="UTF-8"?>
-<Composite xmlns:ppe="clr-namespace:org.eclipse.papyrus.properties.widgets" xmlns:x="http://www.eclipse.org/xwt" xmlns:ppel="clr-namespace:org.eclipse.papyrus.properties.widgets.layout" xmlns="http://www.eclipse.org/xwt/presentation"><Composite.layout><ppel:PropertiesLayout></ppel:PropertiesLayout></Composite.layout></Composite>
\ No newline at end of file +<Composite xmlns:ppe="clr-namespace:org.eclipse.papyrus.properties.widgets" xmlns="http://www.eclipse.org/xwt/presentation" xmlns:ppel="clr-namespace:org.eclipse.papyrus.properties.widgets.layout" xmlns:x="http://www.eclipse.org/xwt"><Composite.layout><ppel:PropertiesLayout></ppel:PropertiesLayout></Composite.layout></Composite>
\ No newline at end of file diff --git a/incoming/org.eclipse.papyrus.properties.customization/Model/ui/SingleElement.xwt b/incoming/org.eclipse.papyrus.properties.customization/Model/ui/SingleElement.xwt index bd0571a7538..4467d5e2d3b 100644 --- a/incoming/org.eclipse.papyrus.properties.customization/Model/ui/SingleElement.xwt +++ b/incoming/org.eclipse.papyrus.properties.customization/Model/ui/SingleElement.xwt @@ -1,2 +1,2 @@ <?xml version="1.0" encoding="UTF-8"?>
-<Composite xmlns:ppel="clr-namespace:org.eclipse.papyrus.properties.widgets.layout" xmlns="http://www.eclipse.org/xwt/presentation" xmlns:ppe="clr-namespace:org.eclipse.papyrus.properties.widgets" xmlns:x="http://www.eclipse.org/xwt"><Composite.layout><ppel:PropertiesLayout></ppel:PropertiesLayout></Composite.layout></Composite>
\ No newline at end of file +<Composite xmlns="http://www.eclipse.org/xwt/presentation" xmlns:x="http://www.eclipse.org/xwt" xmlns:ppel="clr-namespace:org.eclipse.papyrus.properties.widgets.layout" xmlns:ppe="clr-namespace:org.eclipse.papyrus.properties.widgets"><Composite.layout><ppel:PropertiesLayout></ppel:PropertiesLayout></Composite.layout></Composite>
\ No newline at end of file diff --git a/incoming/org.eclipse.papyrus.properties.customization/Model/ui/SingleEnvironment.xwt b/incoming/org.eclipse.papyrus.properties.customization/Model/ui/SingleEnvironment.xwt index 9d4a124e5c8..a33bf938270 100644 --- a/incoming/org.eclipse.papyrus.properties.customization/Model/ui/SingleEnvironment.xwt +++ b/incoming/org.eclipse.papyrus.properties.customization/Model/ui/SingleEnvironment.xwt @@ -1,2 +1,2 @@ <?xml version="1.0" encoding="UTF-8"?>
-<Composite xmlns:ppel="clr-namespace:org.eclipse.papyrus.properties.widgets.layout" xmlns:x="http://www.eclipse.org/xwt" xmlns="http://www.eclipse.org/xwt/presentation"><Composite.layout><ppel:PropertiesLayout></ppel:PropertiesLayout></Composite.layout></Composite>
\ No newline at end of file +<Composite xmlns="http://www.eclipse.org/xwt/presentation" xmlns:ppel="clr-namespace:org.eclipse.papyrus.properties.widgets.layout" xmlns:x="http://www.eclipse.org/xwt"><Composite.layout><ppel:PropertiesLayout></ppel:PropertiesLayout></Composite.layout></Composite>
\ No newline at end of file diff --git a/incoming/org.eclipse.papyrus.properties.customization/Model/ui/SingleFileSelector.xwt b/incoming/org.eclipse.papyrus.properties.customization/Model/ui/SingleFileSelector.xwt new file mode 100644 index 00000000000..59f754a3776 --- /dev/null +++ b/incoming/org.eclipse.papyrus.properties.customization/Model/ui/SingleFileSelector.xwt @@ -0,0 +1,2 @@ +<?xml version="1.0" encoding="UTF-8"?>
+<Composite xmlns:ppe="clr-namespace:org.eclipse.papyrus.properties.widgets" xmlns:x="http://www.eclipse.org/xwt" xmlns:ppel="clr-namespace:org.eclipse.papyrus.properties.widgets.layout" xmlns="http://www.eclipse.org/xwt/presentation"><Composite.layout><ppel:PropertiesLayout></ppel:PropertiesLayout></Composite.layout><ppe:StringEditor input="{Binding}" property="Custom:Attribute:FileSelector:allowWorkspace"></ppe:StringEditor><ppe:StringEditor input="{Binding}" property="Custom:Attribute:FileSelector:allowFileSystem"></ppe:StringEditor></Composite>
\ No newline at end of file diff --git a/incoming/org.eclipse.papyrus.properties.customization/Model/ui/SingleLayout.xwt b/incoming/org.eclipse.papyrus.properties.customization/Model/ui/SingleLayout.xwt index f99324da1f8..94a774d44ac 100644 --- a/incoming/org.eclipse.papyrus.properties.customization/Model/ui/SingleLayout.xwt +++ b/incoming/org.eclipse.papyrus.properties.customization/Model/ui/SingleLayout.xwt @@ -1,2 +1,2 @@ <?xml version="1.0" encoding="UTF-8"?>
-<Composite xmlns:ppec="clr-namespace:org.eclipse.papyrus.properties.creation" xmlns="http://www.eclipse.org/xwt/presentation" xmlns:ppe="clr-namespace:org.eclipse.papyrus.properties.widgets" xmlns:ppel="clr-namespace:org.eclipse.papyrus.properties.widgets.layout" xmlns:x="http://www.eclipse.org/xwt"><Composite.layout><ppel:PropertiesLayout></ppel:PropertiesLayout></Composite.layout><Composite><Composite.layout><ppel:PropertiesLayout></ppel:PropertiesLayout></Composite.layout><ppe:ReferenceDialog input="{Binding}" property="properties:ui:Layout:layoutType"></ppe:ReferenceDialog></Composite></Composite>
\ No newline at end of file +<Composite xmlns:ppec="clr-namespace:org.eclipse.papyrus.properties.creation" xmlns:ppe="clr-namespace:org.eclipse.papyrus.properties.widgets" xmlns:ppel="clr-namespace:org.eclipse.papyrus.properties.widgets.layout" xmlns:x="http://www.eclipse.org/xwt" xmlns="http://www.eclipse.org/xwt/presentation"><Composite.layout><ppel:PropertiesLayout></ppel:PropertiesLayout></Composite.layout><Composite><Composite.layout><ppel:PropertiesLayout></ppel:PropertiesLayout></Composite.layout><ppe:ReferenceDialog input="{Binding}" property="properties:ui:Layout:layoutType"></ppe:ReferenceDialog></Composite></Composite>
\ No newline at end of file diff --git a/incoming/org.eclipse.papyrus.properties.customization/Model/ui/SingleLayoutType.xwt b/incoming/org.eclipse.papyrus.properties.customization/Model/ui/SingleLayoutType.xwt index f236f77b159..0a737190284 100644 --- a/incoming/org.eclipse.papyrus.properties.customization/Model/ui/SingleLayoutType.xwt +++ b/incoming/org.eclipse.papyrus.properties.customization/Model/ui/SingleLayoutType.xwt @@ -1,2 +1,2 @@ <?xml version="1.0" encoding="UTF-8"?>
-<Composite xmlns:ppel="clr-namespace:org.eclipse.papyrus.properties.widgets.layout" xmlns="http://www.eclipse.org/xwt/presentation" xmlns:ppe="clr-namespace:org.eclipse.papyrus.properties.widgets" xmlns:x="http://www.eclipse.org/xwt"><Composite.layout><ppel:PropertiesLayout></ppel:PropertiesLayout></Composite.layout><Composite><Composite.layout><ppel:PropertiesLayout numColumns="1"></ppel:PropertiesLayout></Composite.layout><ppe:StringEditor input="{Binding}" property="properties:environment:WidgetType:label"></ppe:StringEditor><ppe:StringEditor input="{Binding}" property="properties:environment:WidgetType:widgetClass"></ppe:StringEditor></Composite></Composite>
\ No newline at end of file +<Composite xmlns:x="http://www.eclipse.org/xwt" xmlns="http://www.eclipse.org/xwt/presentation" xmlns:ppel="clr-namespace:org.eclipse.papyrus.properties.widgets.layout" xmlns:ppe="clr-namespace:org.eclipse.papyrus.properties.widgets"><Composite.layout><ppel:PropertiesLayout></ppel:PropertiesLayout></Composite.layout><Composite><Composite.layout><ppel:PropertiesLayout numColumns="1"></ppel:PropertiesLayout></Composite.layout><ppe:StringEditor input="{Binding}" showLabel="false" property="properties:environment:WidgetType:label"></ppe:StringEditor><ppe:StringEditor input="{Binding}" showLabel="false" property="properties:environment:WidgetType:widgetClass"></ppe:StringEditor></Composite></Composite>
\ No newline at end of file diff --git a/incoming/org.eclipse.papyrus.properties.customization/Model/ui/SingleModelElementFactoryDescriptor.xwt b/incoming/org.eclipse.papyrus.properties.customization/Model/ui/SingleModelElementFactoryDescriptor.xwt index 0423989f41c..1883030c47b 100644 --- a/incoming/org.eclipse.papyrus.properties.customization/Model/ui/SingleModelElementFactoryDescriptor.xwt +++ b/incoming/org.eclipse.papyrus.properties.customization/Model/ui/SingleModelElementFactoryDescriptor.xwt @@ -1,2 +1,2 @@ <?xml version="1.0" encoding="UTF-8"?>
-<Composite xmlns="http://www.eclipse.org/xwt/presentation" xmlns:ppel="clr-namespace:org.eclipse.papyrus.properties.widgets.layout" xmlns:ppe="clr-namespace:org.eclipse.papyrus.properties.widgets" xmlns:x="http://www.eclipse.org/xwt"><Composite.layout><ppel:PropertiesLayout></ppel:PropertiesLayout></Composite.layout><Composite><Composite.layout><ppel:PropertiesLayout numColumns="1"></ppel:PropertiesLayout></Composite.layout><ppe:StringEditor input="{Binding}" property="properties:environment:ModelElementFactoryDescriptor:name"></ppe:StringEditor><ppe:StringEditor input="{Binding}" property="properties:environment:ModelElementFactoryDescriptor:factoryClass"></ppe:StringEditor></Composite></Composite>
\ No newline at end of file +<Composite xmlns:ppel="clr-namespace:org.eclipse.papyrus.properties.widgets.layout" xmlns:ppe="clr-namespace:org.eclipse.papyrus.properties.widgets" xmlns="http://www.eclipse.org/xwt/presentation" xmlns:x="http://www.eclipse.org/xwt"><Composite.layout><ppel:PropertiesLayout></ppel:PropertiesLayout></Composite.layout><Composite><Composite.layout><ppel:PropertiesLayout numColumns="1"></ppel:PropertiesLayout></Composite.layout><ppe:StringEditor input="{Binding}" property="properties:environment:ModelElementFactoryDescriptor:name"></ppe:StringEditor><ppe:StringEditor input="{Binding}" property="properties:environment:ModelElementFactoryDescriptor:factoryClass"></ppe:StringEditor></Composite></Composite>
\ No newline at end of file diff --git a/incoming/org.eclipse.papyrus.properties.customization/Model/ui/SingleProperty.xwt b/incoming/org.eclipse.papyrus.properties.customization/Model/ui/SingleProperty.xwt index bbfd4c54d58..47272191553 100644 --- a/incoming/org.eclipse.papyrus.properties.customization/Model/ui/SingleProperty.xwt +++ b/incoming/org.eclipse.papyrus.properties.customization/Model/ui/SingleProperty.xwt @@ -1,2 +1,2 @@ <?xml version="1.0" encoding="UTF-8"?>
-<Composite xmlns:x="http://www.eclipse.org/xwt" xmlns:ppel="clr-namespace:org.eclipse.papyrus.properties.widgets.layout" xmlns="http://www.eclipse.org/xwt/presentation" xmlns:ppe="clr-namespace:org.eclipse.papyrus.properties.widgets"><Composite.layout><ppel:PropertiesLayout></ppel:PropertiesLayout></Composite.layout><Composite><Composite.layout><ppel:PropertiesLayout numColumns="1"></ppel:PropertiesLayout></Composite.layout><ppe:StringEditor input="{Binding}" property="properties:contexts:Property:name"></ppe:StringEditor><ppe:StringEditor input="{Binding}" property="properties:contexts:Property:label"></ppe:StringEditor></Composite><Composite><Composite.layout><ppel:PropertiesLayout numColumns="2"></ppel:PropertiesLayout></Composite.layout><ppe:IntegerEditor input="{Binding}" property="properties:contexts:Property:multiplicity"></ppe:IntegerEditor></Composite><Composite><Composite.layout><ppel:PropertiesLayout numColumns="1"></ppel:PropertiesLayout></Composite.layout><ppe:EnumCombo input="{Binding}" property="properties:contexts:Property:type"></ppe:EnumCombo></Composite></Composite>
\ No newline at end of file +<Composite xmlns="http://www.eclipse.org/xwt/presentation" xmlns:x="http://www.eclipse.org/xwt" xmlns:ppe="clr-namespace:org.eclipse.papyrus.properties.widgets" xmlns:ppel="clr-namespace:org.eclipse.papyrus.properties.widgets.layout"><Composite.layout><ppel:PropertiesLayout></ppel:PropertiesLayout></Composite.layout><Composite><Composite.layout><ppel:PropertiesLayout numColumns="1"></ppel:PropertiesLayout></Composite.layout><ppe:StringEditor input="{Binding}" property="properties:contexts:Property:name"></ppe:StringEditor><ppe:StringEditor input="{Binding}" property="properties:contexts:Property:label"></ppe:StringEditor><ppe:StringMultiline input="{Binding}" property="properties:contexts:Property:description"></ppe:StringMultiline></Composite><Composite><Composite.layout><ppel:PropertiesLayout numColumns="2"></ppel:PropertiesLayout></Composite.layout><ppe:IntegerEditor input="{Binding}" property="properties:contexts:Property:multiplicity"></ppe:IntegerEditor></Composite><Composite><Composite.layout><ppel:PropertiesLayout numColumns="1"></ppel:PropertiesLayout></Composite.layout><ppe:EnumCombo input="{Binding}" property="properties:contexts:Property:type"></ppe:EnumCombo></Composite></Composite>
\ No newline at end of file diff --git a/incoming/org.eclipse.papyrus.properties.customization/Model/ui/SinglePropertyEditor.xwt b/incoming/org.eclipse.papyrus.properties.customization/Model/ui/SinglePropertyEditor.xwt index 6ac8019890d..c9b74cf2bb4 100644 --- a/incoming/org.eclipse.papyrus.properties.customization/Model/ui/SinglePropertyEditor.xwt +++ b/incoming/org.eclipse.papyrus.properties.customization/Model/ui/SinglePropertyEditor.xwt @@ -1,2 +1,2 @@ <?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.properties.widgets" xmlns:ppel="clr-namespace:org.eclipse.papyrus.properties.widgets.layout" xmlns:ppec="clr-namespace:org.eclipse.papyrus.properties.creation"><Composite.layout><ppel:PropertiesLayout></ppel:PropertiesLayout></Composite.layout><Composite><Composite.layout><ppel:PropertiesLayout numColumns="2"></ppel:PropertiesLayout></Composite.layout><ppe:BooleanRadio input="{Binding}" property="properties:ui:PropertyEditor:readOnly"></ppe:BooleanRadio></Composite><Composite><Composite.layout><ppel:PropertiesLayout numColumns="1"></ppel:PropertiesLayout></Composite.layout><ppe:ReferenceDialog input="{Binding}" property="properties:ui:PropertyEditor:property"></ppe:ReferenceDialog><ppe:ReferenceDialog input="{Binding}" property="properties:ui:PropertyEditor:widgetType"></ppe:ReferenceDialog></Composite></Composite>
\ No newline at end of file +<Composite xmlns="http://www.eclipse.org/xwt/presentation" xmlns:ppe="clr-namespace:org.eclipse.papyrus.properties.widgets" xmlns:ppec="clr-namespace:org.eclipse.papyrus.properties.creation" xmlns:x="http://www.eclipse.org/xwt" xmlns:ppel="clr-namespace:org.eclipse.papyrus.properties.widgets.layout"><Composite.layout><ppel:PropertiesLayout></ppel:PropertiesLayout></Composite.layout><Composite><Composite.layout><ppel:PropertiesLayout numColumns="2"></ppel:PropertiesLayout></Composite.layout><ppe:BooleanRadio input="{Binding}" property="properties:ui:PropertyEditor:readOnly"></ppe:BooleanRadio><ppe:BooleanRadio input="{Binding}" property="properties:ui:PropertyEditor:showLabel"></ppe:BooleanRadio></Composite><Composite><Composite.layout><ppel:PropertiesLayout numColumns="1"></ppel:PropertiesLayout></Composite.layout><ppe:ReferenceDialog input="{Binding}" property="properties:ui:PropertyEditor:property"></ppe:ReferenceDialog><ppe:ReferenceDialog input="{Binding}" property="properties:ui:PropertyEditor:widgetType"></ppe:ReferenceDialog></Composite></Composite>
\ No newline at end of file diff --git a/incoming/org.eclipse.papyrus.properties.customization/Model/ui/SinglePropertyEditorType.xwt b/incoming/org.eclipse.papyrus.properties.customization/Model/ui/SinglePropertyEditorType.xwt index 5423991072e..67f2c0c0aac 100644 --- a/incoming/org.eclipse.papyrus.properties.customization/Model/ui/SinglePropertyEditorType.xwt +++ b/incoming/org.eclipse.papyrus.properties.customization/Model/ui/SinglePropertyEditorType.xwt @@ -1,2 +1,2 @@ <?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.properties.widgets" xmlns:ppel="clr-namespace:org.eclipse.papyrus.properties.widgets.layout"><Composite.layout><ppel:PropertiesLayout></ppel:PropertiesLayout></Composite.layout><Composite><Composite.layout><ppel:PropertiesLayout numColumns="1"></ppel:PropertiesLayout></Composite.layout><ppe:StringEditor input="{Binding}" property="properties:environment:WidgetType:label"></ppe:StringEditor><ppe:StringEditor input="{Binding}" property="properties:environment:WidgetType:widgetClass"></ppe:StringEditor></Composite><Composite><Composite.layout><ppel:PropertiesLayout numColumns="2"></ppel:PropertiesLayout></Composite.layout><ppe:IntegerEditor input="{Binding}" property="properties:environment:PropertyEditorType:multiplicity"></ppe:IntegerEditor></Composite><Composite><Composite.layout><ppel:PropertiesLayout numColumns="1"></ppel:PropertiesLayout></Composite.layout><ppe:EnumCombo input="{Binding}" property="properties:environment:PropertyEditorType:type"></ppe:EnumCombo></Composite></Composite>
\ No newline at end of file +<Composite xmlns:ppel="clr-namespace:org.eclipse.papyrus.properties.widgets.layout" xmlns="http://www.eclipse.org/xwt/presentation" xmlns:ppe="clr-namespace:org.eclipse.papyrus.properties.widgets" xmlns:x="http://www.eclipse.org/xwt"><Composite.layout><ppel:PropertiesLayout></ppel:PropertiesLayout></Composite.layout><Composite><Composite.layout><ppel:PropertiesLayout numColumns="1"></ppel:PropertiesLayout></Composite.layout><ppe:StringEditor input="{Binding}" property="properties:environment:WidgetType:label"></ppe:StringEditor><ppe:StringEditor input="{Binding}" property="properties:environment:WidgetType:widgetClass"></ppe:StringEditor></Composite><Composite><Composite.layout><ppel:PropertiesLayout numColumns="2"></ppel:PropertiesLayout></Composite.layout><ppe:IntegerEditor input="{Binding}" property="properties:environment:PropertyEditorType:multiplicity"></ppe:IntegerEditor></Composite><Composite><Composite.layout><ppel:PropertiesLayout numColumns="1"></ppel:PropertiesLayout></Composite.layout><ppe:EnumCombo input="{Binding}" property="properties:environment:PropertyEditorType:type"></ppe:EnumCombo></Composite></Composite>
\ No newline at end of file diff --git a/incoming/org.eclipse.papyrus.properties.customization/Model/ui/SingleReferenceAttribute.xwt b/incoming/org.eclipse.papyrus.properties.customization/Model/ui/SingleReferenceAttribute.xwt index 40dbad784ef..420114da3e2 100644 --- a/incoming/org.eclipse.papyrus.properties.customization/Model/ui/SingleReferenceAttribute.xwt +++ b/incoming/org.eclipse.papyrus.properties.customization/Model/ui/SingleReferenceAttribute.xwt @@ -1,2 +1,2 @@ <?xml version="1.0" encoding="UTF-8"?>
-<Composite xmlns:ppe="clr-namespace:org.eclipse.papyrus.properties.widgets" xmlns:ppel="clr-namespace:org.eclipse.papyrus.properties.widgets.layout" xmlns="http://www.eclipse.org/xwt/presentation" xmlns:x="http://www.eclipse.org/xwt"><Composite.layout><ppel:PropertiesLayout></ppel:PropertiesLayout></Composite.layout><Composite><Composite.layout><ppel:PropertiesLayout numColumns="1"></ppel:PropertiesLayout></Composite.layout><ppe:StringEditor input="{Binding}" property="properties:ui:WidgetAttribute:name"></ppe:StringEditor></Composite></Composite>
\ No newline at end of file +<Composite xmlns:ppel="clr-namespace:org.eclipse.papyrus.properties.widgets.layout" xmlns:x="http://www.eclipse.org/xwt" xmlns:ppe="clr-namespace:org.eclipse.papyrus.properties.widgets" xmlns="http://www.eclipse.org/xwt/presentation"><Composite.layout><ppel:PropertiesLayout></ppel:PropertiesLayout></Composite.layout><Composite><Composite.layout><ppel:PropertiesLayout numColumns="1"></ppel:PropertiesLayout></Composite.layout><ppe:StringEditor input="{Binding}" property="properties:ui:WidgetAttribute:name"></ppe:StringEditor></Composite></Composite>
\ No newline at end of file diff --git a/incoming/org.eclipse.papyrus.properties.customization/Model/ui/SingleReferenceProperty.xwt b/incoming/org.eclipse.papyrus.properties.customization/Model/ui/SingleReferenceProperty.xwt index f4237a265c0..f98d1889f68 100644 --- a/incoming/org.eclipse.papyrus.properties.customization/Model/ui/SingleReferenceProperty.xwt +++ b/incoming/org.eclipse.papyrus.properties.customization/Model/ui/SingleReferenceProperty.xwt @@ -1,2 +1,2 @@ <?xml version="1.0" encoding="UTF-8"?>
-<Composite xmlns:ppel="clr-namespace:org.eclipse.papyrus.properties.widgets.layout" xmlns:x="http://www.eclipse.org/xwt" xmlns="http://www.eclipse.org/xwt/presentation" xmlns:ppe="clr-namespace:org.eclipse.papyrus.properties.widgets"><Composite.layout><ppel:PropertiesLayout></ppel:PropertiesLayout></Composite.layout><Composite><Composite.layout><ppel:PropertiesLayout numColumns="1"></ppel:PropertiesLayout></Composite.layout><ppe:StringEditor input="{Binding}" property="properties:contexts:ConfigProperty:name"></ppe:StringEditor></Composite><Composite><Composite.layout><ppel:PropertiesLayout numColumns="1"></ppel:PropertiesLayout></Composite.layout><ppe:ReferenceDialog input="{Binding}" property="properties:contexts:ReferenceProperty:value"></ppe:ReferenceDialog></Composite></Composite>
\ No newline at end of file +<Composite xmlns="http://www.eclipse.org/xwt/presentation" xmlns:ppel="clr-namespace:org.eclipse.papyrus.properties.widgets.layout" xmlns:x="http://www.eclipse.org/xwt" xmlns:ppe="clr-namespace:org.eclipse.papyrus.properties.widgets"><Composite.layout><ppel:PropertiesLayout></ppel:PropertiesLayout></Composite.layout><Composite><Composite.layout><ppel:PropertiesLayout numColumns="1"></ppel:PropertiesLayout></Composite.layout><ppe:StringEditor input="{Binding}" property="properties:contexts:ConfigProperty:name"></ppe:StringEditor></Composite><Composite><Composite.layout><ppel:PropertiesLayout numColumns="1"></ppel:PropertiesLayout></Composite.layout><ppe:ReferenceDialog input="{Binding}" property="properties:contexts:ReferenceProperty:value"></ppe:ReferenceDialog></Composite></Composite>
\ No newline at end of file diff --git a/incoming/org.eclipse.papyrus.properties.customization/Model/ui/SingleSection.xwt b/incoming/org.eclipse.papyrus.properties.customization/Model/ui/SingleSection.xwt index b0cf1062be1..0a0a5d7ffbe 100644 --- a/incoming/org.eclipse.papyrus.properties.customization/Model/ui/SingleSection.xwt +++ b/incoming/org.eclipse.papyrus.properties.customization/Model/ui/SingleSection.xwt @@ -1,2 +1,2 @@ <?xml version="1.0" encoding="UTF-8"?>
-<Composite xmlns:ppe="clr-namespace:org.eclipse.papyrus.properties.widgets" xmlns:x="http://www.eclipse.org/xwt" xmlns:ppec="clr-namespace:org.eclipse.papyrus.properties.creation" xmlns="http://www.eclipse.org/xwt/presentation" xmlns:ppel="clr-namespace:org.eclipse.papyrus.properties.widgets.layout"><Composite.layout><ppel:PropertiesLayout></ppel:PropertiesLayout></Composite.layout><Composite><Composite.layout><ppel:PropertiesLayout numColumns="1"></ppel:PropertiesLayout></Composite.layout><ppe:StringEditor input="{Binding}" property="properties:contexts:Section:name"></ppe:StringEditor><ppe:StringEditor input="{Binding}" property="properties:contexts:Section:sectionFile"></ppe:StringEditor><ppe:ReferenceCombo input="{Binding}" property="properties:contexts:Section:tab"></ppe:ReferenceCombo><ppe:MultiReference input="{Binding}" property="properties:contexts:DisplayUnit:constraints"><ppe:MultiReference.factory><ppec:EcorePropertyEditorFactory nsUri="http://www.eclipse.org/papyrus/properties/contexts" className="ConstraintDescriptor"></ppec:EcorePropertyEditorFactory></ppe:MultiReference.factory></ppe:MultiReference></Composite></Composite>
\ No newline at end of file +<Composite xmlns:x="http://www.eclipse.org/xwt" xmlns:ppel="clr-namespace:org.eclipse.papyrus.properties.widgets.layout" xmlns="http://www.eclipse.org/xwt/presentation" xmlns:ppec="clr-namespace:org.eclipse.papyrus.properties.creation" xmlns:ppe="clr-namespace:org.eclipse.papyrus.properties.widgets"><Composite.layout><ppel:PropertiesLayout></ppel:PropertiesLayout></Composite.layout><Composite><Composite.layout><ppel:PropertiesLayout numColumns="1"></ppel:PropertiesLayout></Composite.layout><ppe:StringEditor input="{Binding}" property="properties:contexts:Section:name"></ppe:StringEditor><ppe:StringEditor input="{Binding}" property="properties:contexts:Section:sectionFile"></ppe:StringEditor><ppe:ReferenceCombo input="{Binding}" property="properties:contexts:Section:tab"></ppe:ReferenceCombo><ppe:MultiReference input="{Binding}" property="properties:contexts:DisplayUnit:constraints"><ppe:MultiReference.factory><ppec:EcorePropertyEditorFactory className="ConstraintDescriptor" nsUri="http://www.eclipse.org/papyrus/properties/contexts"></ppec:EcorePropertyEditorFactory></ppe:MultiReference.factory></ppe:MultiReference></Composite></Composite>
\ No newline at end of file diff --git a/incoming/org.eclipse.papyrus.properties.customization/Model/ui/SingleStandardWidget.xwt b/incoming/org.eclipse.papyrus.properties.customization/Model/ui/SingleStandardWidget.xwt index c4cc00aa2fd..18d54f353bd 100644 --- a/incoming/org.eclipse.papyrus.properties.customization/Model/ui/SingleStandardWidget.xwt +++ b/incoming/org.eclipse.papyrus.properties.customization/Model/ui/SingleStandardWidget.xwt @@ -1,2 +1,2 @@ <?xml version="1.0" encoding="UTF-8"?>
-<Composite xmlns:x="http://www.eclipse.org/xwt" xmlns:ppel="clr-namespace:org.eclipse.papyrus.properties.widgets.layout" xmlns:ppec="clr-namespace:org.eclipse.papyrus.properties.creation" xmlns:ppe="clr-namespace:org.eclipse.papyrus.properties.widgets" xmlns="http://www.eclipse.org/xwt/presentation"><Composite.layout><ppel:PropertiesLayout></ppel:PropertiesLayout></Composite.layout><Composite><Composite.layout><ppel:PropertiesLayout numColumns="1"></ppel:PropertiesLayout></Composite.layout><ppe:ReferenceDialog input="{Binding}" property="properties:ui:StandardWidget:widgetType"></ppe:ReferenceDialog></Composite></Composite>
\ No newline at end of file +<Composite xmlns:ppe="clr-namespace:org.eclipse.papyrus.properties.widgets" xmlns="http://www.eclipse.org/xwt/presentation" xmlns:x="http://www.eclipse.org/xwt" xmlns:ppel="clr-namespace:org.eclipse.papyrus.properties.widgets.layout" xmlns:ppec="clr-namespace:org.eclipse.papyrus.properties.creation"><Composite.layout><ppel:PropertiesLayout></ppel:PropertiesLayout></Composite.layout><Composite><Composite.layout><ppel:PropertiesLayout numColumns="1"></ppel:PropertiesLayout></Composite.layout><ppe:ReferenceDialog input="{Binding}" property="properties:ui:StandardWidget:widgetType"></ppe:ReferenceDialog></Composite></Composite>
\ No newline at end of file diff --git a/incoming/org.eclipse.papyrus.properties.customization/Model/ui/SingleStandardWidgetType.xwt b/incoming/org.eclipse.papyrus.properties.customization/Model/ui/SingleStandardWidgetType.xwt index 06df7b9306e..5df5140d967 100644 --- a/incoming/org.eclipse.papyrus.properties.customization/Model/ui/SingleStandardWidgetType.xwt +++ b/incoming/org.eclipse.papyrus.properties.customization/Model/ui/SingleStandardWidgetType.xwt @@ -1,2 +1,2 @@ <?xml version="1.0" encoding="UTF-8"?>
-<Composite xmlns:x="http://www.eclipse.org/xwt" xmlns:ppe="clr-namespace:org.eclipse.papyrus.properties.widgets" xmlns="http://www.eclipse.org/xwt/presentation" xmlns:ppel="clr-namespace:org.eclipse.papyrus.properties.widgets.layout"><Composite.layout><ppel:PropertiesLayout></ppel:PropertiesLayout></Composite.layout><Composite><Composite.layout><ppel:PropertiesLayout numColumns="1"></ppel:PropertiesLayout></Composite.layout><ppe:StringEditor input="{Binding}" property="properties:environment:WidgetType:label"></ppe:StringEditor><ppe:StringEditor input="{Binding}" property="properties:environment:WidgetType:widgetClass"></ppe:StringEditor></Composite></Composite>
\ No newline at end of file +<Composite xmlns:x="http://www.eclipse.org/xwt" xmlns:ppel="clr-namespace:org.eclipse.papyrus.properties.widgets.layout" xmlns:ppe="clr-namespace:org.eclipse.papyrus.properties.widgets" xmlns="http://www.eclipse.org/xwt/presentation"><Composite.layout><ppel:PropertiesLayout></ppel:PropertiesLayout></Composite.layout><Composite><Composite.layout><ppel:PropertiesLayout numColumns="1"></ppel:PropertiesLayout></Composite.layout><ppe:StringEditor input="{Binding}" property="properties:environment:WidgetType:label"></ppe:StringEditor><ppe:StringEditor input="{Binding}" property="properties:environment:WidgetType:widgetClass"></ppe:StringEditor></Composite></Composite>
\ No newline at end of file diff --git a/incoming/org.eclipse.papyrus.properties.customization/Model/ui/SingleTab.xwt b/incoming/org.eclipse.papyrus.properties.customization/Model/ui/SingleTab.xwt index 23e190dc035..573c41e19e2 100644 --- a/incoming/org.eclipse.papyrus.properties.customization/Model/ui/SingleTab.xwt +++ b/incoming/org.eclipse.papyrus.properties.customization/Model/ui/SingleTab.xwt @@ -1,2 +1,2 @@ <?xml version="1.0" encoding="UTF-8"?>
-<Composite xmlns:ppe="clr-namespace:org.eclipse.papyrus.properties.widgets" xmlns="http://www.eclipse.org/xwt/presentation" xmlns:x="http://www.eclipse.org/xwt" xmlns:ppel="clr-namespace:org.eclipse.papyrus.properties.widgets.layout"><Composite.layout><ppel:PropertiesLayout></ppel:PropertiesLayout></Composite.layout><Composite><Composite.layout><ppel:PropertiesLayout numColumns="1"></ppel:PropertiesLayout></Composite.layout><ppe:StringEditor input="{Binding}" property="properties:contexts:Tab:label"></ppe:StringEditor><ppe:StringEditor input="{Binding}" property="properties:contexts:Tab:id"></ppe:StringEditor><ppe:StringEditor input="{Binding}" property="properties:contexts:Tab:image"></ppe:StringEditor><ppe:BooleanRadio input="{Binding}" property="properties:contexts:Tab:indented"></ppe:BooleanRadio></Composite><Composite><Composite.layout><ppel:PropertiesLayout numColumns="1"></ppel:PropertiesLayout></Composite.layout><ppe:StringEditor input="{Binding}" property="properties:contexts:Tab:category"></ppe:StringEditor><ppe:ReferenceCombo input="{Binding}" property="properties:contexts:Tab:afterTab"></ppe:ReferenceCombo></Composite></Composite>
\ No newline at end of file +<Composite xmlns:ppel="clr-namespace:org.eclipse.papyrus.properties.widgets.layout" xmlns="http://www.eclipse.org/xwt/presentation" xmlns:ppe="clr-namespace:org.eclipse.papyrus.properties.widgets" xmlns:x="http://www.eclipse.org/xwt"><Composite.layout><ppel:PropertiesLayout></ppel:PropertiesLayout></Composite.layout><Composite><Composite.layout><ppel:PropertiesLayout numColumns="1"></ppel:PropertiesLayout></Composite.layout><ppe:StringEditor input="{Binding}" property="properties:contexts:Tab:label"></ppe:StringEditor><ppe:StringEditor input="{Binding}" property="properties:contexts:Tab:id"></ppe:StringEditor><ppe:StringEditor input="{Binding}" property="properties:contexts:Tab:image"></ppe:StringEditor><ppe:BooleanRadio input="{Binding}" property="properties:contexts:Tab:indented"></ppe:BooleanRadio></Composite><Composite><Composite.layout><ppel:PropertiesLayout numColumns="1"></ppel:PropertiesLayout></Composite.layout><ppe:StringEditor input="{Binding}" property="properties:contexts:Tab:category"></ppe:StringEditor><ppe:ReferenceCombo input="{Binding}" property="properties:contexts:Tab:afterTab"></ppe:ReferenceCombo></Composite></Composite>
\ No newline at end of file diff --git a/incoming/org.eclipse.papyrus.properties.customization/Model/ui/SingleUIComponent.xwt b/incoming/org.eclipse.papyrus.properties.customization/Model/ui/SingleUIComponent.xwt index f8a74f3b961..d77783aeb5c 100644 --- a/incoming/org.eclipse.papyrus.properties.customization/Model/ui/SingleUIComponent.xwt +++ b/incoming/org.eclipse.papyrus.properties.customization/Model/ui/SingleUIComponent.xwt @@ -1,2 +1,2 @@ <?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.properties.widgets" xmlns:ppec="clr-namespace:org.eclipse.papyrus.properties.creation" xmlns:ppel="clr-namespace:org.eclipse.papyrus.properties.widgets.layout"><Composite.layout><ppel:PropertiesLayout></ppel:PropertiesLayout></Composite.layout><ppe:MultiReference input="{Binding}" property="properties:ui:UIComponent:attributes"><ppe:MultiReference.factory><ppec:EcorePropertyEditorFactory nsUri="http://www.eclipse.org/papyrus/properties/ui" className="ValueAttribute"></ppec:EcorePropertyEditorFactory></ppe:MultiReference.factory></ppe:MultiReference></Composite>
\ No newline at end of file +<Composite xmlns="http://www.eclipse.org/xwt/presentation" xmlns:ppe="clr-namespace:org.eclipse.papyrus.properties.widgets" xmlns:x="http://www.eclipse.org/xwt" xmlns:ppec="clr-namespace:org.eclipse.papyrus.properties.creation" xmlns:ppel="clr-namespace:org.eclipse.papyrus.properties.widgets.layout"><Composite.layout><ppel:PropertiesLayout></ppel:PropertiesLayout></Composite.layout><ppe:MultiReference input="{Binding}" property="properties:ui:UIComponent:attributes"><ppe:MultiReference.factory><ppec:EcorePropertyEditorFactory className="ValueAttribute" nsUri="http://www.eclipse.org/papyrus/properties/ui"></ppec:EcorePropertyEditorFactory></ppe:MultiReference.factory></ppe:MultiReference></Composite>
\ No newline at end of file diff --git a/incoming/org.eclipse.papyrus.properties.customization/Model/ui/SingleUnknownComponent.xwt b/incoming/org.eclipse.papyrus.properties.customization/Model/ui/SingleUnknownComponent.xwt index 34136b4ddf3..acff327e257 100644 --- a/incoming/org.eclipse.papyrus.properties.customization/Model/ui/SingleUnknownComponent.xwt +++ b/incoming/org.eclipse.papyrus.properties.customization/Model/ui/SingleUnknownComponent.xwt @@ -1,2 +1,2 @@ <?xml version="1.0" encoding="UTF-8"?>
-<Composite xmlns:ppec="clr-namespace:org.eclipse.papyrus.properties.creation" xmlns="http://www.eclipse.org/xwt/presentation" xmlns:ppe="clr-namespace:org.eclipse.papyrus.properties.widgets" xmlns:x="http://www.eclipse.org/xwt" xmlns:ppel="clr-namespace:org.eclipse.papyrus.properties.widgets.layout"><Composite.layout><ppel:PropertiesLayout></ppel:PropertiesLayout></Composite.layout><Composite><Composite.layout><ppel:PropertiesLayout numColumns="1"></ppel:PropertiesLayout></Composite.layout><ppe:StringEditor input="{Binding}" property="properties:ui:UnknownComponent:typeName"></ppe:StringEditor></Composite></Composite>
\ No newline at end of file +<Composite xmlns="http://www.eclipse.org/xwt/presentation" xmlns:ppel="clr-namespace:org.eclipse.papyrus.properties.widgets.layout" xmlns:ppec="clr-namespace:org.eclipse.papyrus.properties.creation" xmlns:x="http://www.eclipse.org/xwt" xmlns:ppe="clr-namespace:org.eclipse.papyrus.properties.widgets"><Composite.layout><ppel:PropertiesLayout></ppel:PropertiesLayout></Composite.layout><Composite><Composite.layout><ppel:PropertiesLayout numColumns="1"></ppel:PropertiesLayout></Composite.layout><ppe:StringEditor input="{Binding}" property="properties:ui:UnknownComponent:typeName"></ppe:StringEditor></Composite></Composite>
\ No newline at end of file diff --git a/incoming/org.eclipse.papyrus.properties.customization/Model/ui/SingleUnknownProperty.xwt b/incoming/org.eclipse.papyrus.properties.customization/Model/ui/SingleUnknownProperty.xwt index c53ee92f1aa..87f2b155d3f 100644 --- a/incoming/org.eclipse.papyrus.properties.customization/Model/ui/SingleUnknownProperty.xwt +++ b/incoming/org.eclipse.papyrus.properties.customization/Model/ui/SingleUnknownProperty.xwt @@ -1,2 +1,2 @@ <?xml version="1.0" encoding="UTF-8"?>
-<Composite xmlns:ppe="clr-namespace:org.eclipse.papyrus.properties.widgets" xmlns:x="http://www.eclipse.org/xwt" xmlns:ppel="clr-namespace:org.eclipse.papyrus.properties.widgets.layout" xmlns="http://www.eclipse.org/xwt/presentation"><Composite.layout><ppel:PropertiesLayout></ppel:PropertiesLayout></Composite.layout><Composite><Composite.layout><ppel:PropertiesLayout numColumns="1"></ppel:PropertiesLayout></Composite.layout><ppe:StringEditor input="{Binding}" property="properties:contexts:Property:name"></ppe:StringEditor><ppe:StringEditor input="{Binding}" property="properties:contexts:Property:label"></ppe:StringEditor></Composite><Composite><Composite.layout><ppel:PropertiesLayout numColumns="2"></ppel:PropertiesLayout></Composite.layout><ppe:IntegerEditor input="{Binding}" property="properties:contexts:Property:multiplicity"></ppe:IntegerEditor></Composite><Composite><Composite.layout><ppel:PropertiesLayout numColumns="1"></ppel:PropertiesLayout></Composite.layout><ppe:EnumCombo input="{Binding}" property="properties:contexts:Property:type"></ppe:EnumCombo></Composite></Composite>
\ No newline at end of file +<Composite xmlns="http://www.eclipse.org/xwt/presentation" xmlns:ppel="clr-namespace:org.eclipse.papyrus.properties.widgets.layout" xmlns:x="http://www.eclipse.org/xwt" xmlns:ppe="clr-namespace:org.eclipse.papyrus.properties.widgets"><Composite.layout><ppel:PropertiesLayout></ppel:PropertiesLayout></Composite.layout><Composite><Composite.layout><ppel:PropertiesLayout numColumns="1"></ppel:PropertiesLayout></Composite.layout><ppe:StringEditor input="{Binding}" property="properties:contexts:Property:name"></ppe:StringEditor><ppe:StringEditor input="{Binding}" property="properties:contexts:Property:label"></ppe:StringEditor></Composite><Composite><Composite.layout><ppel:PropertiesLayout numColumns="2"></ppel:PropertiesLayout></Composite.layout><ppe:IntegerEditor input="{Binding}" property="properties:contexts:Property:multiplicity"></ppe:IntegerEditor></Composite><Composite><Composite.layout><ppel:PropertiesLayout numColumns="1"></ppel:PropertiesLayout></Composite.layout><ppe:EnumCombo input="{Binding}" property="properties:contexts:Property:type"></ppe:EnumCombo></Composite></Composite>
\ No newline at end of file diff --git a/incoming/org.eclipse.papyrus.properties.customization/Model/ui/SingleValueAttribute.xwt b/incoming/org.eclipse.papyrus.properties.customization/Model/ui/SingleValueAttribute.xwt index 9f21e88e85f..7f268016b73 100644 --- a/incoming/org.eclipse.papyrus.properties.customization/Model/ui/SingleValueAttribute.xwt +++ b/incoming/org.eclipse.papyrus.properties.customization/Model/ui/SingleValueAttribute.xwt @@ -1,2 +1,2 @@ <?xml version="1.0" encoding="UTF-8"?>
-<Composite xmlns:ppel="clr-namespace:org.eclipse.papyrus.properties.widgets.layout" xmlns="http://www.eclipse.org/xwt/presentation" xmlns:x="http://www.eclipse.org/xwt" xmlns:ppe="clr-namespace:org.eclipse.papyrus.properties.widgets"><Composite.layout><ppel:PropertiesLayout></ppel:PropertiesLayout></Composite.layout><Composite><Composite.layout><ppel:PropertiesLayout numColumns="1"></ppel:PropertiesLayout></Composite.layout><ppe:StringEditor input="{Binding}" property="properties:ui:WidgetAttribute:name"></ppe:StringEditor><ppe:StringEditor input="{Binding}" property="properties:ui:ValueAttribute:value"></ppe:StringEditor></Composite></Composite>
\ No newline at end of file +<Composite xmlns:x="http://www.eclipse.org/xwt" xmlns:ppe="clr-namespace:org.eclipse.papyrus.properties.widgets" xmlns="http://www.eclipse.org/xwt/presentation" xmlns:ppel="clr-namespace:org.eclipse.papyrus.properties.widgets.layout"><Composite.layout><ppel:PropertiesLayout></ppel:PropertiesLayout></Composite.layout><Composite><Composite.layout><ppel:PropertiesLayout numColumns="1"></ppel:PropertiesLayout></Composite.layout><ppe:StringEditor input="{Binding}" property="properties:ui:WidgetAttribute:name"></ppe:StringEditor><ppe:StringEditor input="{Binding}" property="properties:ui:ValueAttribute:value"></ppe:StringEditor></Composite></Composite>
\ No newline at end of file diff --git a/incoming/org.eclipse.papyrus.properties.customization/Model/ui/SingleValueProperty.xwt b/incoming/org.eclipse.papyrus.properties.customization/Model/ui/SingleValueProperty.xwt index 1795c1299b0..0f6b8e43449 100644 --- a/incoming/org.eclipse.papyrus.properties.customization/Model/ui/SingleValueProperty.xwt +++ b/incoming/org.eclipse.papyrus.properties.customization/Model/ui/SingleValueProperty.xwt @@ -1,2 +1,2 @@ <?xml version="1.0" encoding="UTF-8"?>
-<Composite xmlns:x="http://www.eclipse.org/xwt" xmlns:ppe="clr-namespace:org.eclipse.papyrus.properties.widgets" xmlns:ppel="clr-namespace:org.eclipse.papyrus.properties.widgets.layout" xmlns="http://www.eclipse.org/xwt/presentation"><Composite.layout><ppel:PropertiesLayout></ppel:PropertiesLayout></Composite.layout><Composite><Composite.layout><ppel:PropertiesLayout numColumns="1"></ppel:PropertiesLayout></Composite.layout><ppe:StringEditor input="{Binding}" property="properties:contexts:ConfigProperty:name"></ppe:StringEditor><ppe:StringEditor input="{Binding}" property="properties:contexts:ValueProperty:value"></ppe:StringEditor></Composite></Composite>
\ No newline at end of file +<Composite xmlns:ppe="clr-namespace:org.eclipse.papyrus.properties.widgets" xmlns:ppel="clr-namespace:org.eclipse.papyrus.properties.widgets.layout" xmlns:x="http://www.eclipse.org/xwt" xmlns="http://www.eclipse.org/xwt/presentation"><Composite.layout><ppel:PropertiesLayout></ppel:PropertiesLayout></Composite.layout><Composite><Composite.layout><ppel:PropertiesLayout numColumns="1"></ppel:PropertiesLayout></Composite.layout><ppe:StringEditor input="{Binding}" property="properties:contexts:ConfigProperty:name"></ppe:StringEditor><ppe:StringEditor input="{Binding}" property="properties:contexts:ValueProperty:value"></ppe:StringEditor></Composite></Composite>
\ No newline at end of file diff --git a/incoming/org.eclipse.papyrus.properties.customization/Model/ui/SingleView.xwt b/incoming/org.eclipse.papyrus.properties.customization/Model/ui/SingleView.xwt index a5e8863d69f..fb1f785609a 100644 --- a/incoming/org.eclipse.papyrus.properties.customization/Model/ui/SingleView.xwt +++ b/incoming/org.eclipse.papyrus.properties.customization/Model/ui/SingleView.xwt @@ -1,2 +1,2 @@ <?xml version="1.0" encoding="UTF-8"?>
-<Composite xmlns:ppel="clr-namespace:org.eclipse.papyrus.properties.widgets.layout" xmlns:x="http://www.eclipse.org/xwt" xmlns:ppec="clr-namespace:org.eclipse.papyrus.properties.creation" xmlns="http://www.eclipse.org/xwt/presentation" xmlns:ppe="clr-namespace:org.eclipse.papyrus.properties.widgets"><Composite.layout><ppel:PropertiesLayout></ppel:PropertiesLayout></Composite.layout><Composite><Composite.layout><ppel:PropertiesLayout numColumns="1"></ppel:PropertiesLayout></Composite.layout><ppe:StringEditor input="{Binding}" property="properties:contexts:View:name"></ppe:StringEditor></Composite><Composite><Composite.layout><ppel:PropertiesLayout numColumns="2"></ppel:PropertiesLayout></Composite.layout><ppe:IntegerEditor input="{Binding}" property="properties:contexts:View:elementMultiplicity"></ppe:IntegerEditor></Composite><Composite><Composite.layout><ppel:PropertiesLayout numColumns="1"></ppel:PropertiesLayout></Composite.layout><ppe:MultiReference input="{Binding}" property="properties:contexts:DisplayUnit:constraints"><ppe:MultiReference.factory><ppec:EcorePropertyEditorFactory nsUri="http://www.eclipse.org/papyrus/properties/contexts" className="ConstraintDescriptor"></ppec:EcorePropertyEditorFactory></ppe:MultiReference.factory></ppe:MultiReference></Composite></Composite>
\ No newline at end of file +<Composite xmlns:ppe="clr-namespace:org.eclipse.papyrus.properties.widgets" xmlns:ppel="clr-namespace:org.eclipse.papyrus.properties.widgets.layout" xmlns:ppec="clr-namespace:org.eclipse.papyrus.properties.creation" xmlns="http://www.eclipse.org/xwt/presentation" xmlns:x="http://www.eclipse.org/xwt"><Composite.layout><ppel:PropertiesLayout></ppel:PropertiesLayout></Composite.layout><Composite><Composite.layout><ppel:PropertiesLayout numColumns="1"></ppel:PropertiesLayout></Composite.layout><ppe:StringEditor input="{Binding}" property="properties:contexts:View:name"></ppe:StringEditor></Composite><Composite><Composite.layout><ppel:PropertiesLayout numColumns="2"></ppel:PropertiesLayout></Composite.layout><ppe:IntegerEditor input="{Binding}" property="properties:contexts:View:elementMultiplicity"></ppe:IntegerEditor></Composite><Composite><Composite.layout><ppel:PropertiesLayout numColumns="1"></ppel:PropertiesLayout></Composite.layout><ppe:MultiReference input="{Binding}" property="properties:contexts:DisplayUnit:constraints"><ppe:MultiReference.factory><ppec:EcorePropertyEditorFactory nsUri="http://www.eclipse.org/papyrus/properties/contexts" className="ConstraintDescriptor"></ppec:EcorePropertyEditorFactory></ppe:MultiReference.factory></ppe:MultiReference></Composite></Composite>
\ No newline at end of file diff --git a/incoming/org.eclipse.papyrus.properties.customization/Model/ui/SingleWidget.xwt b/incoming/org.eclipse.papyrus.properties.customization/Model/ui/SingleWidget.xwt index a0866d6b854..708a18731b1 100644 --- a/incoming/org.eclipse.papyrus.properties.customization/Model/ui/SingleWidget.xwt +++ b/incoming/org.eclipse.papyrus.properties.customization/Model/ui/SingleWidget.xwt @@ -1,2 +1,2 @@ <?xml version="1.0" encoding="UTF-8"?>
-<Composite xmlns:ppe="clr-namespace:org.eclipse.papyrus.properties.widgets" xmlns:ppec="clr-namespace:org.eclipse.papyrus.properties.creation" xmlns:ppel="clr-namespace:org.eclipse.papyrus.properties.widgets.layout" xmlns:x="http://www.eclipse.org/xwt" xmlns="http://www.eclipse.org/xwt/presentation"><Composite.layout><ppel:PropertiesLayout></ppel:PropertiesLayout></Composite.layout></Composite>
\ No newline at end of file +<Composite xmlns:ppel="clr-namespace:org.eclipse.papyrus.properties.widgets.layout" xmlns:ppe="clr-namespace:org.eclipse.papyrus.properties.widgets" xmlns:x="http://www.eclipse.org/xwt" xmlns="http://www.eclipse.org/xwt/presentation" xmlns:ppec="clr-namespace:org.eclipse.papyrus.properties.creation"><Composite.layout><ppel:PropertiesLayout></ppel:PropertiesLayout></Composite.layout></Composite>
\ No newline at end of file diff --git a/incoming/org.eclipse.papyrus.properties.customization/Model/ui/SingleWidgetAttribute.xwt b/incoming/org.eclipse.papyrus.properties.customization/Model/ui/SingleWidgetAttribute.xwt index e4449c2c618..9bfc2d267d6 100644 --- a/incoming/org.eclipse.papyrus.properties.customization/Model/ui/SingleWidgetAttribute.xwt +++ b/incoming/org.eclipse.papyrus.properties.customization/Model/ui/SingleWidgetAttribute.xwt @@ -1,2 +1,2 @@ <?xml version="1.0" encoding="UTF-8"?>
-<Composite xmlns:ppe="clr-namespace:org.eclipse.papyrus.properties.widgets" xmlns="http://www.eclipse.org/xwt/presentation" xmlns:ppel="clr-namespace:org.eclipse.papyrus.properties.widgets.layout" xmlns:x="http://www.eclipse.org/xwt"><Composite.layout><ppel:PropertiesLayout></ppel:PropertiesLayout></Composite.layout><Composite><Composite.layout><ppel:PropertiesLayout numColumns="1"></ppel:PropertiesLayout></Composite.layout><ppe:StringEditor input="{Binding}" property="properties:ui:WidgetAttribute:name"></ppe:StringEditor></Composite></Composite>
\ No newline at end of file +<Composite xmlns="http://www.eclipse.org/xwt/presentation" xmlns:ppel="clr-namespace:org.eclipse.papyrus.properties.widgets.layout" xmlns:x="http://www.eclipse.org/xwt" xmlns:ppe="clr-namespace:org.eclipse.papyrus.properties.widgets"><Composite.layout><ppel:PropertiesLayout></ppel:PropertiesLayout></Composite.layout><Composite><Composite.layout><ppel:PropertiesLayout numColumns="1"></ppel:PropertiesLayout></Composite.layout><ppe:StringEditor input="{Binding}" property="properties:ui:WidgetAttribute:name"></ppe:StringEditor></Composite></Composite>
\ No newline at end of file diff --git a/incoming/org.eclipse.papyrus.properties.customization/Model/ui/SingleWidgetType.xwt b/incoming/org.eclipse.papyrus.properties.customization/Model/ui/SingleWidgetType.xwt index ca933c357f4..68e140c2af0 100644 --- a/incoming/org.eclipse.papyrus.properties.customization/Model/ui/SingleWidgetType.xwt +++ b/incoming/org.eclipse.papyrus.properties.customization/Model/ui/SingleWidgetType.xwt @@ -1,2 +1,2 @@ <?xml version="1.0" encoding="UTF-8"?>
-<Composite xmlns="http://www.eclipse.org/xwt/presentation" xmlns:ppel="clr-namespace:org.eclipse.papyrus.properties.widgets.layout" xmlns:ppe="clr-namespace:org.eclipse.papyrus.properties.widgets" xmlns:x="http://www.eclipse.org/xwt"><Composite.layout><ppel:PropertiesLayout></ppel:PropertiesLayout></Composite.layout><Composite><Composite.layout><ppel:PropertiesLayout numColumns="1"></ppel:PropertiesLayout></Composite.layout><ppe:StringEditor input="{Binding}" property="properties:environment:WidgetType:label"></ppe:StringEditor><ppe:StringEditor input="{Binding}" property="properties:environment:WidgetType:widgetClass"></ppe:StringEditor></Composite></Composite>
\ No newline at end of file +<Composite xmlns:ppel="clr-namespace:org.eclipse.papyrus.properties.widgets.layout" xmlns:ppe="clr-namespace:org.eclipse.papyrus.properties.widgets" xmlns:x="http://www.eclipse.org/xwt" xmlns="http://www.eclipse.org/xwt/presentation"><Composite.layout><ppel:PropertiesLayout></ppel:PropertiesLayout></Composite.layout><Composite><Composite.layout><ppel:PropertiesLayout numColumns="1"></ppel:PropertiesLayout></Composite.layout><ppe:StringEditor input="{Binding}" property="properties:environment:WidgetType:label"></ppe:StringEditor><ppe:StringEditor input="{Binding}" property="properties:environment:WidgetType:widgetClass"></ppe:StringEditor></Composite></Composite>
\ No newline at end of file diff --git a/incoming/org.eclipse.papyrus.properties.customization/Model/ui/Stereotype.xwt b/incoming/org.eclipse.papyrus.properties.customization/Model/ui/Stereotype.xwt index 3a926743a52..951492fd5d6 100644 --- a/incoming/org.eclipse.papyrus.properties.customization/Model/ui/Stereotype.xwt +++ b/incoming/org.eclipse.papyrus.properties.customization/Model/ui/Stereotype.xwt @@ -1,2 +1,2 @@ <?xml version="1.0" encoding="UTF-8"?>
-<Composite xmlns:ppel="clr-namespace:org.eclipse.papyrus.properties.widgets.layout" xmlns:ppe="clr-namespace:org.eclipse.papyrus.properties.widgets" xmlns:x="http://www.eclipse.org/xwt" xmlns="http://www.eclipse.org/xwt/presentation"><Composite.layout><ppel:PropertiesLayout></ppel:PropertiesLayout></Composite.layout><Composite><Composite.layout><ppel:PropertiesLayout></ppel:PropertiesLayout></Composite.layout><ppe:StringEditor input="{Binding}" property="Properties:Stereotype:stereotypeName"></ppe:StringEditor></Composite></Composite>
\ No newline at end of file +<Composite xmlns="http://www.eclipse.org/xwt/presentation" xmlns:ppel="clr-namespace:org.eclipse.papyrus.properties.widgets.layout" xmlns:ppe="clr-namespace:org.eclipse.papyrus.properties.widgets" xmlns:x="http://www.eclipse.org/xwt"><Composite.layout><ppel:PropertiesLayout></ppel:PropertiesLayout></Composite.layout><Composite><Composite.layout><ppel:PropertiesLayout></ppel:PropertiesLayout></Composite.layout><ppe:StringEditor input="{Binding}" property="Properties:Stereotype:stereotypeName"></ppe:StringEditor></Composite></Composite>
\ No newline at end of file diff --git a/incoming/org.eclipse.papyrus.properties.customization/Model/ui/UMLInstanceOf.xwt b/incoming/org.eclipse.papyrus.properties.customization/Model/ui/UMLInstanceOf.xwt index 83115a3945e..44f46aa1fc5 100644 --- a/incoming/org.eclipse.papyrus.properties.customization/Model/ui/UMLInstanceOf.xwt +++ b/incoming/org.eclipse.papyrus.properties.customization/Model/ui/UMLInstanceOf.xwt @@ -1,2 +1,2 @@ <?xml version="1.0" encoding="UTF-8"?>
-<Composite xmlns:x="http://www.eclipse.org/xwt" xmlns:ppel="clr-namespace:org.eclipse.papyrus.properties.widgets.layout" xmlns="http://www.eclipse.org/xwt/presentation" xmlns:ppe="clr-namespace:org.eclipse.papyrus.properties.widgets"><Composite.layout><ppel:PropertiesLayout></ppel:PropertiesLayout></Composite.layout><Composite><Composite.layout><ppel:PropertiesLayout></ppel:PropertiesLayout></Composite.layout><ppe:StringEditor input="{Binding}" property="Properties:UMLInstanceOf:umlClassName"></ppe:StringEditor></Composite></Composite>
\ No newline at end of file +<Composite xmlns:ppel="clr-namespace:org.eclipse.papyrus.properties.widgets.layout" xmlns="http://www.eclipse.org/xwt/presentation" xmlns:ppe="clr-namespace:org.eclipse.papyrus.properties.widgets" xmlns:x="http://www.eclipse.org/xwt"><Composite.layout><ppel:PropertiesLayout></ppel:PropertiesLayout></Composite.layout><Composite><Composite.layout><ppel:PropertiesLayout></ppel:PropertiesLayout></Composite.layout><ppe:StringEditor input="{Binding}" property="Properties:UMLInstanceOf:umlClassName"></ppe:StringEditor></Composite></Composite>
\ No newline at end of file diff --git a/incoming/org.eclipse.papyrus.properties.customization/OSGI-INF/l10n/bundle.properties b/incoming/org.eclipse.papyrus.properties.customization/OSGI-INF/l10n/bundle.properties index 1b91ed9cfd7..ebe241d42d0 100644 --- a/incoming/org.eclipse.papyrus.properties.customization/OSGI-INF/l10n/bundle.properties +++ b/incoming/org.eclipse.papyrus.properties.customization/OSGI-INF/l10n/bundle.properties @@ -6,4 +6,18 @@ customize.command.label = Customize Property view customize.command.mnemonic = C
customize.command.tooltip = Customize the content of the Property View
customize.command.description = This command allows customization of the content of the properties view
-customize.command.name = Customize properties view
\ No newline at end of file +customize.command.name = Customize properties view
+view.name = Customization preview
+perspective.name = Property view Customization
+page.name = Property view customization
+command.description = Customize the Property view
+command.name = Customize property view
+command.description.0 = Toggles the customization's Preview view
+command.name.0 = Toggle preview
+command.description.1 = Toggles the DataContext display
+command.name.1 = Toggle DataContext
+toolbar.label = Papyrus customization toolbar
+command.label = Toggle preview
+command.tooltip = Toggles the customization's Preview view
+command.label.0 = Toggle DataContext
+command.tooltip.0 = Toggles the display of DataContext in the UIEditor view
\ No newline at end of file diff --git a/incoming/org.eclipse.papyrus.properties.customization/Query/Contexts.querySet b/incoming/org.eclipse.papyrus.properties.customization/Query/Contexts.querySet index 805c71e3542..5abb56d82ab 100644 --- a/incoming/org.eclipse.papyrus.properties.customization/Query/Contexts.querySet +++ b/incoming/org.eclipse.papyrus.properties.customization/Query/Contexts.querySet @@ -42,4 +42,12 @@ <returnType xsi:type="ecore:EDataType" href="http://www.eclipse.org/emf/2002/Ecore#//EString"/>
<scope href="http://www.eclipse.org/papyrus/properties/contexts#//DataContextElement"/>
</queries>
+ <queries xsi:type="query:JavaModelQuery" name="showDataContext-j" description="Tests if the data contexts should be displayed" lowerBound="1" implementationClassName="org.eclipse.papyrus.properties.customization.query.ShowContextQuery">
+ <returnType xsi:type="ecore:EDataType" href="http://www.eclipse.org/emf/2002/Ecore#//EBoolean"/>
+ <scope href="http://www.eclipse.org/papyrus/properties/contexts#//Context"/>
+ </queries>
+ <queries xsi:type="query:OCLModelQuery" name="showDataContext" description="Blabla" lowerBound="1" query="true">
+ <returnType xsi:type="ecore:EDataType" href="http://www.eclipse.org/emf/2002/Ecore#//EBoolean"/>
+ <scope href="http://www.eclipse.org/papyrus/properties/contexts#//Context"/>
+ </queries>
</query:ModelQuerySet>
diff --git a/incoming/org.eclipse.papyrus.properties.customization/UICustom/context.uiCustom b/incoming/org.eclipse.papyrus.properties.customization/UICustom/context.uiCustom index 98af8dab26e..0c874d57aaa 100644 --- a/incoming/org.eclipse.papyrus.properties.customization/UICustom/context.uiCustom +++ b/incoming/org.eclipse.papyrus.properties.customization/UICustom/context.uiCustom @@ -31,7 +31,15 @@ </references>
<references referenceName="dataContexts">
<customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ <defaultValue xsi:type="uicustom:DerivedFeatureValue">
+ <valueCalculator xsi:type="query:JavaModelQuery" href="emffacet:/query/Contexts#showDataContext-j"/>
+ </defaultValue>
+ </customizedFeatures>
+ <customizedFeatures customizedFeature="icon">
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="/org.eclipse.papyrus.properties.customization/icons/DataContexts.gif"/>
+ </customizedFeatures>
+ <customizedFeatures customizedFeature="label">
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="Data contexts"/>
</customizedFeatures>
</references>
<references referenceName="dependencies">
@@ -57,16 +65,56 @@ <customizedFeatures customizedFeature="hideMetaclassName">
<defaultValue xsi:type="uicustom:StaticFeatureValue" value="true"/>
</customizedFeatures>
+ <attributes attributeName="name">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </attributes>
+ <references referenceName="properties">
+ <customizedFeatures customizedFeature="collapseLink">
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="true"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="package">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="supertypes">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
</types>
<types metaclassName="contexts.DataContextPackage">
<customizedFeatures customizedFeature="metaclassVisible">
<defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
</customizedFeatures>
+ <references referenceName="elements">
+ <customizedFeatures customizedFeature="collapseLink">
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="true"/>
+ </customizedFeatures>
+ </references>
</types>
<types metaclassName="contexts.DataContextRoot">
<customizedFeatures customizedFeature="metaclassVisible">
<defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
</customizedFeatures>
+ <attributes attributeName="label">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </attributes>
+ <attributes attributeName="name">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </attributes>
+ <references referenceName="modelElementFactory">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
</types>
<types metaclassName="contexts.Property">
<customizedFeatures customizedFeature="metaclassVisible">
@@ -80,6 +128,36 @@ <customizedFeatures customizedFeature="hideMetaclassName">
<defaultValue xsi:type="uicustom:StaticFeatureValue" value="true"/>
</customizedFeatures>
+ <attributes attributeName="description">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </attributes>
+ <attributes attributeName="label">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </attributes>
+ <attributes attributeName="multiplicity">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </attributes>
+ <attributes attributeName="name">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </attributes>
+ <attributes attributeName="type">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </attributes>
+ <references referenceName="contextElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
</types>
<types metaclassName="contexts.ReferenceProperty">
<customizedFeatures customizedFeature="metaclassVisible">
diff --git a/incoming/org.eclipse.papyrus.properties.customization/build.properties b/incoming/org.eclipse.papyrus.properties.customization/build.properties index 71fc403d24f..e9fda2059be 100644 --- a/incoming/org.eclipse.papyrus.properties.customization/build.properties +++ b/incoming/org.eclipse.papyrus.properties.customization/build.properties @@ -7,5 +7,6 @@ bin.includes = .,\ icons/,\
Query/,\
UICustom/,\
- Model/
+ Model/,\
+ OSGI-INF/l10n/bundle.properties
source.. = src/
diff --git a/incoming/org.eclipse.papyrus.properties.customization/icons/DataContext.gif b/incoming/org.eclipse.papyrus.properties.customization/icons/DataContext.gif Binary files differnew file mode 100644 index 00000000000..48581fa9451 --- /dev/null +++ b/incoming/org.eclipse.papyrus.properties.customization/icons/DataContext.gif diff --git a/incoming/org.eclipse.papyrus.properties.customization/icons/DataContexts.gif b/incoming/org.eclipse.papyrus.properties.customization/icons/DataContexts.gif Binary files differnew file mode 100644 index 00000000000..94b389f9da0 --- /dev/null +++ b/incoming/org.eclipse.papyrus.properties.customization/icons/DataContexts.gif diff --git a/incoming/org.eclipse.papyrus.properties.customization/plugin.xml b/incoming/org.eclipse.papyrus.properties.customization/plugin.xml index 07d4c5cadd9..0a5bd58514d 100644 --- a/incoming/org.eclipse.papyrus.properties.customization/plugin.xml +++ b/incoming/org.eclipse.papyrus.properties.customization/plugin.xml @@ -49,7 +49,7 @@ class="org.eclipse.papyrus.properties.customization.editor.preview.Preview"
icon="icons/preview.png"
id="org.eclipse.papyrus.properties.customization.preview"
- name="Customization preview"
+ name="%view.name"
restorable="true">
</view>
</extension>
@@ -59,7 +59,7 @@ class="org.eclipse.papyrus.properties.customization.perspective.CustomizationPerspectiveFactory"
icon="icons/Customization.gif"
id="org.eclipse.papyrus.properties.customization.perspective"
- name="Property view Customization">
+ name="%perspective.name">
</perspective>
</extension>
<extension
@@ -74,36 +74,49 @@ category="org.eclipse.papyrus.preferences.generalcategory"
class="org.eclipse.papyrus.properties.customization.preferences.CustomizationPreferencePage"
id="org.eclipse.papyrus.properties.customization.preferences"
- name="Property view customization">
+ name="%page.name">
</page>
</extension>
<extension
point="org.eclipse.ui.handlers">
<handler
class="org.eclipse.papyrus.properties.customization.ui.OpenCustomization"
- commandId="org.eclipse.papyrus.properties.tabbed.customize">
+ commandId="org.eclipse.papyrus.properties.customization.customize">
</handler>
<handler
class="org.eclipse.papyrus.properties.customization.editor.actions.TogglePreviewAction"
commandId="org.eclipse.papyrus.properties.customization.TogglePreview">
</handler>
+ <handler
+ class="org.eclipse.papyrus.properties.customization.editor.actions.ToggleDataContextAction"
+ commandId="org.eclipse.papyrus.properties.customization.ToggleDataContext">
+ </handler>
</extension>
<extension
point="org.eclipse.ui.commands">
<command
- description="Customize the Property view"
- id="org.eclipse.papyrus.properties.tabbed.customize"
- name="Customize property view">
+ description="%command.description"
+ id="org.eclipse.papyrus.properties.customization.customize"
+ name="%command.name">
</command>
<command
- description="Toggles the customization's Preview view"
+ description="%command.description.0"
id="org.eclipse.papyrus.properties.customization.TogglePreview"
- name="Toggle preview">
+ name="%command.name.0">
<state
class="org.eclipse.papyrus.properties.customization.editor.actions.TogglePreviewState"
id="org.eclipse.ui.commands.toggleState">
</state>
</command>
+ <command
+ description="%command.description.1"
+ id="org.eclipse.papyrus.properties.customization.ToggleDataContext"
+ name="%command.name.1">
+ <state
+ class="org.eclipse.papyrus.properties.customization.editor.actions.ToggleDataContextState"
+ id="org.eclipse.papyrus.properties.customization.displayContextState">
+ </state>
+ </command>
</extension>
<extension
point="org.eclipse.ui.menus">
@@ -111,9 +124,9 @@ allPopups="false"
locationURI="menu:org.eclipse.ui.views.PropertySheet">
<command
- commandId="org.eclipse.papyrus.properties.tabbed.customize"
+ commandId="org.eclipse.papyrus.properties.customization.customize"
icon="icons/Customization.gif"
- id="org.eclipse.papyrus.properties.tabbed.customizehandler"
+ id="org.eclipse.papyrus.properties.customization.customizehandler"
label="%customize.command.label"
mnemonic="%customize.command.mnemonic"
mode="FORCE_TEXT"
@@ -129,14 +142,30 @@ locationURI="toolbar:org.eclipse.ui.main.toolbar">
<toolbar
id="org.eclipes.papyrus.properties.customization"
- label="Papyrus customization toolbar">
+ label="%toolbar.label">
<command
commandId="org.eclipse.papyrus.properties.customization.TogglePreview"
icon="icons/preview.png"
id="org.eclipse.papyrus.properties.customization.togglePreview"
- label="Toggle preview"
+ label="%command.label"
+ style="toggle"
+ tooltip="%command.tooltip">
+ <visibleWhen>
+ <with
+ variable="activeEditorId">
+ <equals
+ value="org.eclipse.papyrus.property.customization.UIEditor">
+ </equals>
+ </with>
+ </visibleWhen>
+ </command>
+ <command
+ commandId="org.eclipse.papyrus.properties.customization.ToggleDataContext"
+ icon="icons/DataContexts.gif"
+ id="org.eclipse.papyrus.properties.customization.toggleDataContext"
+ label="%command.label.0"
style="toggle"
- tooltip="Toggles the customization's Preview view">
+ tooltip="%command.tooltip.0">
<visibleWhen>
<with
variable="activeEditorId">
diff --git a/incoming/org.eclipse.papyrus.properties.customization/src/org/eclipse/papyrus/properties/customization/Activator.java b/incoming/org.eclipse.papyrus.properties.customization/src/org/eclipse/papyrus/properties/customization/Activator.java index 8c2edb26e0a..a029c48212a 100644 --- a/incoming/org.eclipse.papyrus.properties.customization/src/org/eclipse/papyrus/properties/customization/Activator.java +++ b/incoming/org.eclipse.papyrus.properties.customization/src/org/eclipse/papyrus/properties/customization/Activator.java @@ -134,7 +134,7 @@ public class Activator extends AbstractUIPlugin { */ public Image getImage(String pluginId, String path) { final ImageRegistry registry = getImageRegistry(); - String key = pluginId + "/" + path; + String key = pluginId + "/" + path; //$NON-NLS-1$ Image image = registry.get(key); if(image == null) { registry.put(key, AbstractUIPlugin.imageDescriptorFromPlugin(pluginId, path)); diff --git a/incoming/org.eclipse.papyrus.properties.customization/src/org/eclipse/papyrus/properties/customization/editor/ContextEditorActionBarContributor.java b/incoming/org.eclipse.papyrus.properties.customization/src/org/eclipse/papyrus/properties/customization/editor/ContextEditorActionBarContributor.java index c62ce5b22b1..7d2d03ade42 100644 --- a/incoming/org.eclipse.papyrus.properties.customization/src/org/eclipse/papyrus/properties/customization/editor/ContextEditorActionBarContributor.java +++ b/incoming/org.eclipse.papyrus.properties.customization/src/org/eclipse/papyrus/properties/customization/editor/ContextEditorActionBarContributor.java @@ -37,6 +37,7 @@ import org.eclipse.papyrus.properties.customization.editor.actions.MoDiscoCopyAc import org.eclipse.papyrus.properties.customization.editor.actions.MoDiscoCutAction;
import org.eclipse.papyrus.properties.customization.editor.actions.MoDiscoDeleteAction;
import org.eclipse.papyrus.properties.customization.editor.actions.MoDiscoPasteAction;
+import org.eclipse.papyrus.properties.customization.editor.actions.ToggleDataContextAction;
import org.eclipse.papyrus.properties.customization.editor.actions.ValidationAction;
import org.eclipse.papyrus.properties.customization.util.ActionUtil;
@@ -142,8 +143,10 @@ public class ContextEditorActionBarContributor extends EcoreActionBarContributor IAction action = iterator.next();
if(action instanceof CreateChildAction) {
CreateChildAction createChildAction = (CreateChildAction)action;
- if(createChildAction.getText().equals("Data Context Root")) { //It's the only relevant property we have access to... //$NON-NLS-1$
- iterator.remove();
+ if(!ToggleDataContextAction.showDataContext) {
+ if(createChildAction.getText().equals("Data Context Root")) { //It's the only relevant property we have access to... //$NON-NLS-1$
+ iterator.remove();
+ }
}
}
}
diff --git a/incoming/org.eclipse.papyrus.properties.customization/src/org/eclipse/papyrus/properties/customization/editor/UIEditor.java b/incoming/org.eclipse.papyrus.properties.customization/src/org/eclipse/papyrus/properties/customization/editor/UIEditor.java index dffaa349d20..7b6d24031c1 100644 --- a/incoming/org.eclipse.papyrus.properties.customization/src/org/eclipse/papyrus/properties/customization/editor/UIEditor.java +++ b/incoming/org.eclipse.papyrus.properties.customization/src/org/eclipse/papyrus/properties/customization/editor/UIEditor.java @@ -43,6 +43,7 @@ import org.eclipse.jface.viewers.ViewerFilter; import org.eclipse.papyrus.properties.contexts.Context;
import org.eclipse.papyrus.properties.customization.Activator;
import org.eclipse.papyrus.properties.customization.editor.preview.Preview;
+import org.eclipse.papyrus.properties.customization.messages.Messages;
import org.eclipse.papyrus.properties.customization.preferences.CustomizationPreferencePage;
import org.eclipse.papyrus.properties.customization.providers.ContextContentProvider;
import org.eclipse.papyrus.properties.customization.providers.ContextLabelProvider;
@@ -76,7 +77,7 @@ import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetPage; /**
* A customization editor for Contexts from the Papyrus Property View.
- * The Editor is based on the Ecore reflexive editor and the EMF Facet
+ * The Editor is based on the Ecore reflective editor and the EMF Facet
* customizable content & label providers
*
* @author Camille Letavernier
@@ -113,7 +114,7 @@ public class UIEditor extends EcoreEditor implements ITabbedPropertySheetPageCon final ViewFilter filter = new ViewFilter();
- final StringEditor filterPattern = new StringEditor(parent, SWT.NONE, "Filter views :");
+ final StringEditor filterPattern = new StringEditor(parent, SWT.NONE, Messages.UIEditor_FilterViews);
filterPattern.addCommitListener(new ICommitListener() {
public void commit(AbstractEditor editor) {
@@ -195,7 +196,7 @@ public class UIEditor extends EcoreEditor implements ITabbedPropertySheetPageCon if(CustomizationPreferencePage.askForConfirmation()) {
int defaultIndex = CustomizationPreferencePage.openCustomizationPerspective() ? 0 : 1;
- MessageDialog confirmationDialog = new MessageDialog(getContainer().getShell(), "Change perspective ?", null, "This editor is associated to the Customization perspective. Do you want to open this perspective now ?", MessageDialog.QUESTION, new String[]{ "Yes", "No" }, defaultIndex);
+ MessageDialog confirmationDialog = new MessageDialog(getContainer().getShell(), Messages.UIEditor_ChangePerspective, null, Messages.UIEditor_ChangePerspectiveMessage, MessageDialog.QUESTION, new String[]{ Messages.UIEditor_Yes, Messages.UIEditor_No }, defaultIndex);
confirmationDialog.open();
openPerspective = confirmationDialog.getReturnCode() == 0;
} else {
@@ -237,7 +238,7 @@ public class UIEditor extends EcoreEditor implements ITabbedPropertySheetPageCon public void doSaveAs() {
SaveAsDialog saveAsDialog = new SaveAsDialog(getSite().getShell());
saveAsDialog.create();
- saveAsDialog.setMessage(EcoreEditorPlugin.INSTANCE.getString("_UI_SaveAs_message"));
+ saveAsDialog.setMessage(EcoreEditorPlugin.INSTANCE.getString("_UI_SaveAs_message")); //$NON-NLS-1$
saveAsDialog.open();
IPath path = saveAsDialog.getResult();
if(path != null) {
@@ -257,7 +258,7 @@ public class UIEditor extends EcoreEditor implements ITabbedPropertySheetPageCon resourceSet.getResources().remove(0);
resourceSet.getResources().move(0, newResource);
} else {
- System.out.println("Replace " + currentURI + " by " + newURI);
+ //System.out.println("Replace " + currentURI + " by " + newURI);
currentResource.setURI(newURI);
}
@@ -272,7 +273,7 @@ public class UIEditor extends EcoreEditor implements ITabbedPropertySheetPageCon if(resource != currentResource) {
if(isRelative(currentURI, resource)) {
URI newResourceURI = resource.getURI().deresolve(currentURI).resolve(newURI);
- System.out.println("Replace " + resource.getURI() + " by " + newResourceURI);
+ //System.out.println("Replace " + resource.getURI() + " by " + newResourceURI);
resource.setURI(newResourceURI);
}
}
@@ -288,7 +289,7 @@ public class UIEditor extends EcoreEditor implements ITabbedPropertySheetPageCon URI resourceURI = resource.getURI();
URI uri = resourceURI.deresolve(baseURI);
if(uri.isRelative()) {
- if(!(uri.toString().startsWith("..") || uri.toString().startsWith("/"))) {
+ if(!(uri.toString().startsWith("..") || uri.toString().startsWith("/"))) { //$NON-NLS-1$ //$NON-NLS-2$
return true;
}
}
@@ -340,7 +341,8 @@ public class UIEditor extends EcoreEditor implements ITabbedPropertySheetPageCon selectionViewer.removeSelectionChangedListener(preview);
}
previews.clear();
- iPropertySheetPage.dispose();
+ if(iPropertySheetPage != null)
+ iPropertySheetPage.dispose();
super.dispose();
}
diff --git a/incoming/org.eclipse.papyrus.properties.customization/src/org/eclipse/papyrus/properties/customization/editor/ViewFilter.java b/incoming/org.eclipse.papyrus.properties.customization/src/org/eclipse/papyrus/properties/customization/editor/ViewFilter.java index 2153d1408ba..118476a510d 100644 --- a/incoming/org.eclipse.papyrus.properties.customization/src/org/eclipse/papyrus/properties/customization/editor/ViewFilter.java +++ b/incoming/org.eclipse.papyrus.properties.customization/src/org/eclipse/papyrus/properties/customization/editor/ViewFilter.java @@ -15,6 +15,8 @@ import org.eclipse.core.runtime.IAdaptable; import org.eclipse.emf.ecore.EObject;
import org.eclipse.jface.viewers.Viewer;
import org.eclipse.jface.viewers.ViewerFilter;
+import org.eclipse.papyrus.properties.contexts.DataContextElement;
+import org.eclipse.papyrus.properties.contexts.DataContextPackage;
import org.eclipse.papyrus.properties.contexts.View;
import org.eclipse.ui.internal.misc.StringMatcher;
@@ -24,7 +26,7 @@ public class ViewFilter extends ViewerFilter { private StringMatcher matcher;
public void setPattern(String pattern) {
- matcher = new StringMatcher("*" + pattern + "*", true, false);
+ matcher = new StringMatcher("*" + pattern + "*", true, false); //$NON-NLS-1$ //$NON-NLS-2$
}
@Override
@@ -34,15 +36,74 @@ public class ViewFilter extends ViewerFilter { if(element instanceof IAdaptable) {
EObject eObject = (EObject)((IAdaptable)element).getAdapter(EObject.class);
- if(eObject != null && eObject instanceof View) {
- String viewName = (((View)eObject).getName());
- if(viewName == null) {
- return true;
+ if(eObject != null) {
+ if(eObject instanceof View) {
+ String viewName = ((View)eObject).getName();
+ if(viewName == null) {
+ return true;
+ }
+ return matcher.match(viewName);
+ } else if(eObject instanceof DataContextPackage) {
+ //FIXME : Le filtre ne fonctionne pas correctement pour afficher un DCElement dans un Package
+ return select((DataContextPackage)eObject);
+ } else if(eObject instanceof DataContextElement) {
+ return select((DataContextElement)eObject);
}
- return matcher.match(viewName);
}
}
return true;
}
+
+ /**
+ * An element is displayed if its name matches the filter, or if one of its
+ * children's or parent's name match it
+ *
+ * @param dataContextPackage
+ * @return
+ */
+ private boolean select(DataContextPackage dataContextPackage) {
+ if(dataContextPackage.getName() == null) {
+ return true;
+ }
+
+ if(matcher.match(dataContextPackage.getName())) {
+ return true;
+ }
+
+ for(DataContextElement subElement : dataContextPackage.getElements()) {
+ if(subElement instanceof DataContextPackage) {
+ if(select((DataContextPackage)subElement)) {
+ return true;
+ }
+ }
+
+ if(select(subElement)) {
+ return true;
+ }
+ }
+
+ return false;
+ }
+
+ private boolean select(DataContextElement dataContextElement) {
+ if(dataContextElement.getName() == null) {
+ return true;
+ }
+
+ if(matcher.match(dataContextElement.getName())) {
+ return true;
+ }
+
+ DataContextPackage dataContextPackage = dataContextElement.getPackage();
+ while(dataContextPackage != null) {
+ if(matcher.match(dataContextPackage.getName())) {
+ return true;
+ }
+
+ dataContextPackage = dataContextPackage.getPackage();
+ }
+
+ return false;
+ }
}
diff --git a/incoming/org.eclipse.papyrus.properties.customization/src/org/eclipse/papyrus/properties/customization/editor/actions/ToggleDataContextAction.java b/incoming/org.eclipse.papyrus.properties.customization/src/org/eclipse/papyrus/properties/customization/editor/actions/ToggleDataContextAction.java new file mode 100644 index 00000000000..e793a6edd44 --- /dev/null +++ b/incoming/org.eclipse.papyrus.properties.customization/src/org/eclipse/papyrus/properties/customization/editor/actions/ToggleDataContextAction.java @@ -0,0 +1,40 @@ +/*****************************************************************************
+ * 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.customization.editor.actions;
+
+import org.eclipse.core.commands.AbstractHandler;
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.commands.State;
+import org.eclipse.papyrus.properties.customization.editor.UIEditor;
+import org.eclipse.ui.IEditorPart;
+import org.eclipse.ui.PlatformUI;
+
+
+public class ToggleDataContextAction extends AbstractHandler {
+
+ public static boolean showDataContext = false;
+
+ public Object execute(ExecutionEvent event) throws ExecutionException {
+ showDataContext = !showDataContext;
+ IEditorPart editor = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor();
+ if(editor instanceof UIEditor) {
+ UIEditor uiEditor = (UIEditor)editor;
+ uiEditor.getViewer().refresh();
+ }
+
+ State state = event.getCommand().getState("org.eclipse.papyrus.properties.customization.displayContextState"); //$NON-NLS-1$
+ state.setValue(showDataContext);
+ return null;
+ }
+
+}
diff --git a/incoming/org.eclipse.papyrus.properties.customization/src/org/eclipse/papyrus/properties/customization/editor/actions/ToggleDataContextState.java b/incoming/org.eclipse.papyrus.properties.customization/src/org/eclipse/papyrus/properties/customization/editor/actions/ToggleDataContextState.java new file mode 100644 index 00000000000..71e6f2df02c --- /dev/null +++ b/incoming/org.eclipse.papyrus.properties.customization/src/org/eclipse/papyrus/properties/customization/editor/actions/ToggleDataContextState.java @@ -0,0 +1,19 @@ +/*****************************************************************************
+ * 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.customization.editor.actions;
+
+import org.eclipse.core.commands.State;
+
+
+public class ToggleDataContextState extends State {
+
+}
diff --git a/incoming/org.eclipse.papyrus.properties.customization/src/org/eclipse/papyrus/properties/customization/editor/actions/TogglePreviewAction.java b/incoming/org.eclipse.papyrus.properties.customization/src/org/eclipse/papyrus/properties/customization/editor/actions/TogglePreviewAction.java index d4e6b7ba3ec..668eb49cf1a 100644 --- a/incoming/org.eclipse.papyrus.properties.customization/src/org/eclipse/papyrus/properties/customization/editor/actions/TogglePreviewAction.java +++ b/incoming/org.eclipse.papyrus.properties.customization/src/org/eclipse/papyrus/properties/customization/editor/actions/TogglePreviewAction.java @@ -27,7 +27,7 @@ public class TogglePreviewAction extends AbstractHandler { //System.out.println("Toggle");
- event.getCommand().getState("org.eclipse.papyrus.properties.customization.previewstate");
+ event.getCommand().getState("org.eclipse.papyrus.properties.customization.previewstate"); //$NON-NLS-1$
IWorkbenchPage activePage = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
if(activePage == null) {
diff --git a/incoming/org.eclipse.papyrus.properties.customization/src/org/eclipse/papyrus/properties/customization/editor/preview/Preview.java b/incoming/org.eclipse.papyrus.properties.customization/src/org/eclipse/papyrus/properties/customization/editor/preview/Preview.java index 28a27c7cd6b..41557924f38 100644 --- a/incoming/org.eclipse.papyrus.properties.customization/src/org/eclipse/papyrus/properties/customization/editor/preview/Preview.java +++ b/incoming/org.eclipse.papyrus.properties.customization/src/org/eclipse/papyrus/properties/customization/editor/preview/Preview.java @@ -195,10 +195,10 @@ public class Preview extends ViewPart implements ISelectionChangedListener, IPar activePage.addPartListener(this);
} else {
- Activator.log.warn("There is no active page");
+ Activator.log.warn("There is no active page"); //$NON-NLS-1$
}
} else {
- Activator.log.warn("There is no current window");
+ Activator.log.warn("There is no current window"); //$NON-NLS-1$
}
}
@@ -265,12 +265,12 @@ public class Preview extends ViewPart implements ISelectionChangedListener, IPar this.currentView = view;
if(view != null) {
if(view.getName() == null) {
- previewTitle.setText("<<Unnamed>>");
+ previewTitle.setText(Messages.Preview_Unnamed);
} else {
previewTitle.setText(view.getName());
}
} else {
- previewTitle.setText("");
+ previewTitle.setText(""); //$NON-NLS-1$
}
previewTitle.getParent().layout();
@@ -388,7 +388,7 @@ public class Preview extends ViewPart implements ISelectionChangedListener, IPar private boolean isAfter(Tab tab1, Tab tab2, Set<Tab> checkedTabs) {
if(checkedTabs.contains(tab2)) {
- Activator.log.warn("Loop in the afterTabs");
+ Activator.log.warn("Loop in the afterTabs"); //$NON-NLS-1$
return false;
}
diff --git a/incoming/org.eclipse.papyrus.properties.customization/src/org/eclipse/papyrus/properties/customization/messages/Messages.java b/incoming/org.eclipse.papyrus.properties.customization/src/org/eclipse/papyrus/properties/customization/messages/Messages.java index a9ea4ccd04a..1963377510b 100644 --- a/incoming/org.eclipse.papyrus.properties.customization/src/org/eclipse/papyrus/properties/customization/messages/Messages.java +++ b/incoming/org.eclipse.papyrus.properties.customization/src/org/eclipse/papyrus/properties/customization/messages/Messages.java @@ -17,6 +17,14 @@ public class Messages extends NLS { private static final String BUNDLE_NAME = "org.eclipse.papyrus.properties.customization.messages.messages"; //$NON-NLS-1$
+ public static String CopyContextAction_Copying;
+
+ public static String CopyContextAction_InitializingTheCopyOf;
+
+ public static String CopyContextAction_ThisMayTakeSomeTime;
+
+ public static String CopyContextAction_To;
+
public static String CustomizationDialog_cancel;
public static String CustomizationDialog_cannotDeletePluginContext;
@@ -59,6 +67,12 @@ public class Messages extends NLS { public static String CustomizationDialog_yes;
+ public static String CustomizationPreferencePage_AskForConfirmation;
+
+ public static String CustomizationPreferencePage_OpenCustomizationPerspective;
+
+ public static String CustomizationPreferencePage_PropertyViewCustomizationPreferences;
+
public static String InputDialog_enterConfigurationName;
public static String Preview_disablePreview;
@@ -68,6 +82,17 @@ public class Messages extends NLS { public static String Preview_preview;
public static String Preview_previewIsDisabled;
+
+ public static String Preview_Unnamed;
+ public static String UIEditor_ChangePerspective;
+
+ public static String UIEditor_ChangePerspectiveMessage;
+
+ public static String UIEditor_FilterViews;
+
+ public static String UIEditor_No;
+
+ public static String UIEditor_Yes;
static {
// initialize resource bundle
NLS.initializeMessages(BUNDLE_NAME, Messages.class);
diff --git a/incoming/org.eclipse.papyrus.properties.customization/src/org/eclipse/papyrus/properties/customization/messages/messages.properties b/incoming/org.eclipse.papyrus.properties.customization/src/org/eclipse/papyrus/properties/customization/messages/messages.properties index 8bcd8ca4cd9..bfca077d831 100644 --- a/incoming/org.eclipse.papyrus.properties.customization/src/org/eclipse/papyrus/properties/customization/messages/messages.properties +++ b/incoming/org.eclipse.papyrus.properties.customization/src/org/eclipse/papyrus/properties/customization/messages/messages.properties @@ -1,3 +1,7 @@ +CopyContextAction_Copying=Copying
+CopyContextAction_InitializingTheCopyOf=Initializing the copy of
+CopyContextAction_ThisMayTakeSomeTime=. This may take some time
+CopyContextAction_To=\ to
CustomizationDialog_cancel=Cancel
CustomizationDialog_cannotDeletePluginContext=Plugin contexts cannot be deleted
CustomizationDialog_configurationName=Configuration name
@@ -19,8 +23,17 @@ CustomizationDialog_plugin=\ (Plugin) CustomizationDialog_removeSelectedContext=Removes the selected Context. This option is only available for non-plugin Contexts
CustomizationDialog_selectContextToEdit=Select a context to edit. Plugin contexts should be copied before they can be edited.
CustomizationDialog_yes=Yes
+CustomizationPreferencePage_AskForConfirmation=Ask for confirmation
+CustomizationPreferencePage_OpenCustomizationPerspective=Open customization perspective
+CustomizationPreferencePage_PropertyViewCustomizationPreferences=Property view customization preferences
InputDialog_enterConfigurationName=Enter the new configuration's name :
Preview_disablePreview=Disable preview
Preview_noSelectedView=There is no selected view to display
Preview_preview=Preview
Preview_previewIsDisabled=Preview is disabled
+Preview_Unnamed=<<Unnamed>>
+UIEditor_ChangePerspective=Change perspective ?
+UIEditor_ChangePerspectiveMessage=This editor is associated to the Customization perspective. Do you want to open this perspective now ?
+UIEditor_FilterViews=Filter views :
+UIEditor_No=No
+UIEditor_Yes=Yes
diff --git a/incoming/org.eclipse.papyrus.properties.customization/src/org/eclipse/papyrus/properties/customization/modelelement/CustomizationModelElement.java b/incoming/org.eclipse.papyrus.properties.customization/src/org/eclipse/papyrus/properties/customization/modelelement/CustomizationModelElement.java index f33b8d9ce04..f44cd7d2d90 100644 --- a/incoming/org.eclipse.papyrus.properties.customization/src/org/eclipse/papyrus/properties/customization/modelelement/CustomizationModelElement.java +++ b/incoming/org.eclipse.papyrus.properties.customization/src/org/eclipse/papyrus/properties/customization/modelelement/CustomizationModelElement.java @@ -15,12 +15,16 @@ import java.util.HashMap; import java.util.Map;
import org.eclipse.core.databinding.observable.IObservable;
+import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.EClassifier;
import org.eclipse.emf.ecore.EStructuralFeature;
import org.eclipse.jface.viewers.ILabelProvider;
import org.eclipse.papyrus.properties.contexts.ContextsPackage;
+import org.eclipse.papyrus.properties.contexts.DataContextElement;
import org.eclipse.papyrus.properties.contexts.Section;
+import org.eclipse.papyrus.properties.customization.providers.ConstraintDescriptorContentProvider;
import org.eclipse.papyrus.properties.customization.providers.ContextLabelProvider;
+import org.eclipse.papyrus.properties.customization.providers.DataContextElementContentProvider;
import org.eclipse.papyrus.properties.customization.providers.DependencyContentProvider;
import org.eclipse.papyrus.properties.customization.providers.EnvironmentContentProvider;
import org.eclipse.papyrus.properties.customization.providers.PropertyContentProvider;
@@ -29,6 +33,7 @@ import org.eclipse.papyrus.properties.environment.EnvironmentPackage; import org.eclipse.papyrus.properties.modelelement.AbstractModelElement;
import org.eclipse.papyrus.properties.modelelement.EMFModelElement;
import org.eclipse.papyrus.properties.modelelement.ModelElement;
+import org.eclipse.papyrus.widgets.creation.ReferenceValueFactory;
import org.eclipse.papyrus.widgets.providers.EmptyContentProvider;
import org.eclipse.papyrus.widgets.providers.IStaticContentProvider;
@@ -46,6 +51,9 @@ import org.eclipse.papyrus.widgets.providers.IStaticContentProvider; */
public class CustomizationModelElement extends AbstractModelElement {
+ //TODO : Support for ConstraintDescriptor content provider
+ //The provider relies on EMF, which loads the whole model (including XWT files)
+
private EMFModelElement delegate;
private static Map<EClassifier, IStaticContentProvider> providers;
@@ -98,11 +106,27 @@ public class CustomizationModelElement extends AbstractModelElement { //Sections can only be moved to tabs from non-plugin contexts
boolean editableTabsOnly = delegate.getSource() instanceof Section;
return new TabContentProvider(delegate.getSource(), editableTabsOnly);
+ } else if(classifier == ContextsPackage.eINSTANCE.getConstraintDescriptor()) {
+ return new ConstraintDescriptorContentProvider(delegate.getSource());
+ } else if(isDataContextElement(classifier)) {
+ return new DataContextElementContentProvider((DataContextElement)delegate.getSource());
} else {
return delegate.getContentProvider(propertyPath);
}
}
+ private boolean isDataContextElement(EClassifier classifier) {
+ if(classifier == ContextsPackage.eINSTANCE.getDataContextElement())
+ return true;
+
+ if(classifier instanceof EClass) {
+ EClass eClass = (EClass)classifier;
+ return eClass.getEAllSuperTypes().contains(ContextsPackage.eINSTANCE.getDataContextElement());
+ }
+
+ return false;
+ }
+
@Override
public ILabelProvider getLabelProvider(String propertyPath) {
return new ContextLabelProvider();
@@ -131,6 +155,11 @@ public class CustomizationModelElement extends AbstractModelElement { }
@Override
+ public ReferenceValueFactory getValueFactory(String propertyPath) {
+ return delegate.getValueFactory(propertyPath);
+ }
+
+ @Override
public boolean forceRefresh(String localPropertyPath) {
return false;
}
diff --git a/incoming/org.eclipse.papyrus.properties.customization/src/org/eclipse/papyrus/properties/customization/perspective/CustomizationPerspectiveFactory.java b/incoming/org.eclipse.papyrus.properties.customization/src/org/eclipse/papyrus/properties/customization/perspective/CustomizationPerspectiveFactory.java index 7f2177189d9..41e19a81aab 100644 --- a/incoming/org.eclipse.papyrus.properties.customization/src/org/eclipse/papyrus/properties/customization/perspective/CustomizationPerspectiveFactory.java +++ b/incoming/org.eclipse.papyrus.properties.customization/src/org/eclipse/papyrus/properties/customization/perspective/CustomizationPerspectiveFactory.java @@ -18,9 +18,9 @@ import org.eclipse.ui.IPerspectiveFactory; public class CustomizationPerspectiveFactory implements IPerspectiveFactory {
- private final static String PROPERTIES = "org.eclipse.ui.views.PropertySheet";
+ private final static String PROPERTIES = "org.eclipse.ui.views.PropertySheet"; //$NON-NLS-1$
- private final static String PROJECT_EXPLORER = "org.eclipse.ui.navigator.ProjectExplorer";
+ private final static String PROJECT_EXPLORER = "org.eclipse.ui.navigator.ProjectExplorer"; //$NON-NLS-1$
public void createInitialLayout(IPageLayout layout) {
layout.addView(PROJECT_EXPLORER, IPageLayout.LEFT, 0.20f, layout.getEditorArea());
diff --git a/incoming/org.eclipse.papyrus.properties.customization/src/org/eclipse/papyrus/properties/customization/preferences/CustomizationPreferencePage.java b/incoming/org.eclipse.papyrus.properties.customization/src/org/eclipse/papyrus/properties/customization/preferences/CustomizationPreferencePage.java index 0dbddfc2f8d..2df42e263f7 100644 --- a/incoming/org.eclipse.papyrus.properties.customization/src/org/eclipse/papyrus/properties/customization/preferences/CustomizationPreferencePage.java +++ b/incoming/org.eclipse.papyrus.properties.customization/src/org/eclipse/papyrus/properties/customization/preferences/CustomizationPreferencePage.java @@ -26,6 +26,7 @@ import org.eclipse.jface.preference.BooleanFieldEditor; import org.eclipse.jface.preference.FieldEditorPreferencePage;
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.papyrus.properties.customization.Activator;
+import org.eclipse.papyrus.properties.customization.messages.Messages;
import org.eclipse.ui.IWorkbench;
import org.eclipse.ui.IWorkbenchPreferencePage;
@@ -53,13 +54,13 @@ public class CustomizationPreferencePage extends FieldEditorPreferencePage imple public void init(IWorkbench workbench) {
setPreferenceStore(Activator.getDefault().getPreferenceStore());
- setDescription("Property view customization preferences");
+ setDescription(Messages.CustomizationPreferencePage_PropertyViewCustomizationPreferences);
}
@Override
protected void createFieldEditors() {
- addField(new BooleanFieldEditor(OPEN_CUSTOMIZATION_PERSPECTIVE, "Open customization perspective", getFieldEditorParent()));
- addField(new BooleanFieldEditor(ASK_FOR_CONFIRMATION, "Ask for confirmation", getFieldEditorParent()));
+ addField(new BooleanFieldEditor(OPEN_CUSTOMIZATION_PERSPECTIVE, Messages.CustomizationPreferencePage_OpenCustomizationPerspective, getFieldEditorParent()));
+ addField(new BooleanFieldEditor(ASK_FOR_CONFIRMATION, Messages.CustomizationPreferencePage_AskForConfirmation, getFieldEditorParent()));
}
public static boolean openCustomizationPerspective() {
diff --git a/incoming/org.eclipse.papyrus.properties.customization/src/org/eclipse/papyrus/properties/customization/providers/AbstractContextualContentProvider.java b/incoming/org.eclipse.papyrus.properties.customization/src/org/eclipse/papyrus/properties/customization/providers/AbstractContextualContentProvider.java index 028c39af8dc..3e6bde21d8c 100644 --- a/incoming/org.eclipse.papyrus.properties.customization/src/org/eclipse/papyrus/properties/customization/providers/AbstractContextualContentProvider.java +++ b/incoming/org.eclipse.papyrus.properties.customization/src/org/eclipse/papyrus/properties/customization/providers/AbstractContextualContentProvider.java @@ -58,11 +58,13 @@ public abstract class AbstractContextualContentProvider implements IStaticConten List<Context> contexts = new LinkedList<Context>();
Context rootContext = null;
- for(Resource resource : source.eResource().getResourceSet().getResources()) {
- if(!resource.getContents().isEmpty() && resource.getContents().get(0) instanceof Context) {
- rootContext = (Context)resource.getContents().get(0);
- contexts.add(rootContext);
- break;
+ if(source.eResource() != null) {
+ for(Resource resource : source.eResource().getResourceSet().getResources()) {
+ if(!resource.getContents().isEmpty() && resource.getContents().get(0) instanceof Context) {
+ rootContext = (Context)resource.getContents().get(0);
+ contexts.add(rootContext);
+ break;
+ }
}
}
diff --git a/incoming/org.eclipse.papyrus.properties.customization/src/org/eclipse/papyrus/properties/customization/providers/ConstraintDescriptorContentProvider.java b/incoming/org.eclipse.papyrus.properties.customization/src/org/eclipse/papyrus/properties/customization/providers/ConstraintDescriptorContentProvider.java new file mode 100644 index 00000000000..912fbabe2b7 --- /dev/null +++ b/incoming/org.eclipse.papyrus.properties.customization/src/org/eclipse/papyrus/properties/customization/providers/ConstraintDescriptorContentProvider.java @@ -0,0 +1,45 @@ +/*****************************************************************************
+ * 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.customization.providers;
+
+import java.util.LinkedList;
+import java.util.List;
+
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.papyrus.properties.contexts.ConstraintDescriptor;
+import org.eclipse.papyrus.properties.contexts.Context;
+import org.eclipse.papyrus.properties.contexts.Section;
+import org.eclipse.papyrus.properties.contexts.Tab;
+import org.eclipse.papyrus.properties.contexts.View;
+
+public class ConstraintDescriptorContentProvider extends AbstractContextualContentProvider {
+
+ public ConstraintDescriptorContentProvider(EObject source) {
+ super(source);
+ }
+
+ public Object[] getElements() {
+ List<ConstraintDescriptor> result = new LinkedList<ConstraintDescriptor>();
+ for(Context context : contexts) {
+ for(View view : context.getViews()) {
+ result.addAll(view.getConstraints());
+ }
+ for(Tab tab : context.getTabs()) {
+ for(Section section : tab.getSections()) {
+ result.addAll(section.getConstraints());
+ }
+ }
+ }
+ return result.toArray();
+ }
+
+}
diff --git a/incoming/org.eclipse.papyrus.properties.customization/src/org/eclipse/papyrus/properties/customization/providers/DataContextElementContentProvider.java b/incoming/org.eclipse.papyrus.properties.customization/src/org/eclipse/papyrus/properties/customization/providers/DataContextElementContentProvider.java new file mode 100644 index 00000000000..f2aad2bee1d --- /dev/null +++ b/incoming/org.eclipse.papyrus.properties.customization/src/org/eclipse/papyrus/properties/customization/providers/DataContextElementContentProvider.java @@ -0,0 +1,106 @@ +/*****************************************************************************
+ * 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.customization.providers;
+
+import java.text.Collator;
+import java.text.RuleBasedCollator;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.Comparator;
+import java.util.HashSet;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Set;
+
+import org.eclipse.papyrus.properties.contexts.Context;
+import org.eclipse.papyrus.properties.contexts.DataContextElement;
+import org.eclipse.papyrus.properties.contexts.DataContextPackage;
+import org.eclipse.papyrus.properties.contexts.DataContextRoot;
+import org.eclipse.papyrus.widgets.providers.AbstractStaticContentProvider;
+
+
+public class DataContextElementContentProvider extends AbstractStaticContentProvider {
+
+ private List<DataContextElement> elements;
+
+ public DataContextElementContentProvider(DataContextElement element) {
+ Context context = findContext(element);
+ Set<Context> allContexts = new HashSet<Context>();
+ getAllContexts(context, allContexts);
+
+ Set<DataContextElement> allElements = new HashSet<DataContextElement>();
+ for(Context ctx : allContexts) {
+ for(DataContextRoot root : ctx.getDataContexts()) {
+ getAllElements(root, allElements);
+ }
+ }
+
+ elements = new LinkedList<DataContextElement>(allElements);
+ Collections.sort(elements, new Comparator<DataContextElement>() {
+
+ private Collator collator = RuleBasedCollator.getInstance();
+
+ public int compare(DataContextElement element1, DataContextElement element2) {
+ String name1 = element1.getName();
+ String name2 = element2.getName();
+ if(name1 == null && name2 == null) {
+ return 0;
+ }
+ if(name1 == null) {
+ return -1;
+ }
+ if(name2 == null) {
+ return 1;
+ }
+ return collator.compare(name1, name2);
+ }
+
+ });
+ }
+
+ private void getAllElements(DataContextElement fromElement, Collection<DataContextElement> result) {
+ if(result.contains(fromElement)) {
+ return;
+ }
+
+ result.add(fromElement);
+ if(fromElement instanceof DataContextPackage) {
+ DataContextPackage fromPackage = (DataContextPackage)fromElement;
+ for(DataContextElement element : fromPackage.getElements()) {
+ getAllElements(element, result);
+ }
+ }
+ }
+
+ private void getAllContexts(Context fromContext, Collection<Context> result) {
+ if(result.contains(fromContext)) {
+ return;
+ }
+
+ result.add(fromContext);
+ for(Context context : fromContext.getDependencies()) {
+ getAllContexts(context, result);
+ }
+ }
+
+ private Context findContext(DataContextElement element) {
+ if(element.getPackage() == null) {
+ return (Context)element.eContainer();
+ }
+ return findContext(element.getPackage());
+ }
+
+ public Object[] getElements() {
+ return elements.toArray(new DataContextElement[elements.size()]);
+ }
+
+}
diff --git a/incoming/org.eclipse.papyrus.properties.customization/src/org/eclipse/papyrus/properties/customization/query/ShowContextQuery.java b/incoming/org.eclipse.papyrus.properties.customization/src/org/eclipse/papyrus/properties/customization/query/ShowContextQuery.java new file mode 100644 index 00000000000..823edf35c9c --- /dev/null +++ b/incoming/org.eclipse.papyrus.properties.customization/src/org/eclipse/papyrus/properties/customization/query/ShowContextQuery.java @@ -0,0 +1,28 @@ +/*****************************************************************************
+ * 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.customization.query;
+
+import org.eclipse.emf.facet.infra.query.core.exception.ModelQueryExecutionException;
+import org.eclipse.emf.facet.infra.query.core.java.IJavaModelQuery;
+import org.eclipse.emf.facet.infra.query.core.java.ParameterValueList;
+import org.eclipse.papyrus.properties.contexts.Context;
+import org.eclipse.papyrus.properties.customization.editor.actions.ToggleDataContextAction;
+
+
+public class ShowContextQuery implements IJavaModelQuery<Context, Boolean> {
+
+ public Boolean evaluate(Context context, ParameterValueList parameters) throws ModelQueryExecutionException {
+ Boolean result = ToggleDataContextAction.showDataContext;
+ return result;
+ }
+
+}
diff --git a/incoming/org.eclipse.papyrus.properties.customization/src/org/eclipse/papyrus/properties/customization/ui/CopyContextAction.java b/incoming/org.eclipse.papyrus.properties.customization/src/org/eclipse/papyrus/properties/customization/ui/CopyContextAction.java index e35fd2cece1..2fb9777b253 100644 --- a/incoming/org.eclipse.papyrus.properties.customization/src/org/eclipse/papyrus/properties/customization/ui/CopyContextAction.java +++ b/incoming/org.eclipse.papyrus.properties.customization/src/org/eclipse/papyrus/properties/customization/ui/CopyContextAction.java @@ -33,6 +33,7 @@ import org.eclipse.jface.dialogs.ProgressMonitorDialog; import org.eclipse.jface.operation.IRunnableWithProgress;
import org.eclipse.papyrus.properties.Activator;
import org.eclipse.papyrus.properties.contexts.Context;
+import org.eclipse.papyrus.properties.customization.messages.Messages;
import org.eclipse.papyrus.properties.runtime.ConfigurationManager;
import org.eclipse.papyrus.properties.util.EMFHelper;
import org.eclipse.swt.widgets.Display;
@@ -73,12 +74,12 @@ public class CopyContextAction { if(targetDirectory.exists()) {
throw new IOException("A context with this name already exists"); //$NON-NLS-1$
}
- URI targetModelUri = URI.createFileURI(targetDirectory.toString() + "/" + targetName + ".ctx");
+ URI targetModelUri = URI.createFileURI(targetDirectory.toString() + "/" + targetName + ".ctx"); //$NON-NLS-1$ //$NON-NLS-2$
ResourceSet resourceSet = new ResourceSetImpl();
Context sourceContext = (Context)EMFHelper.loadEMFModel(resourceSet, source.eResource().getURI());
- copyAll(sourceContext, new File(targetDirectory, targetName + ".ctx"));
+ copyAll(sourceContext, new File(targetDirectory, targetName + ".ctx")); //$NON-NLS-1$
if(result.getCode() == IStatus.OK) {
Context targetContext = ConfigurationManager.instance.getContext(targetModelUri);
@@ -103,7 +104,7 @@ public class CopyContextAction { dialog.run(true, false, new IRunnableWithProgress() {
public void run(IProgressMonitor monitor) {
- monitor.beginTask("Initializing the copy of " + source.getName() + ". This may take some time", IProgressMonitor.UNKNOWN);
+ monitor.beginTask(Messages.CopyContextAction_InitializingTheCopyOf + source.getName() + Messages.CopyContextAction_ThisMayTakeSomeTime, IProgressMonitor.UNKNOWN);
EcoreUtil.resolveAll(source);
monitor.done();
result = Status.OK_STATUS;
@@ -120,7 +121,7 @@ public class CopyContextAction { try {
targetDirectory.mkdirs();
- monitor.beginTask("Copying " + source.getName() + " to " + targetName, source.eResource().getResourceSet().getResources().size());
+ monitor.beginTask(Messages.CopyContextAction_Copying + source.getName() + Messages.CopyContextAction_To + targetName, source.eResource().getResourceSet().getResources().size());
//Copy of the context
copy(source.eResource(), target);
@@ -140,7 +141,7 @@ public class CopyContextAction { monitor.done();
} catch (IOException ex) {
Activator.log.error(ex);
- result = new Status(IStatus.ERROR, Activator.PLUGIN_ID, "An error occured during the copy of " + source.getName(), ex);
+ result = new Status(IStatus.ERROR, Activator.PLUGIN_ID, "An error occured during the copy of " + source.getName(), ex); //$NON-NLS-1$
return;
}
result = Status.OK_STATUS;
@@ -160,8 +161,8 @@ public class CopyContextAction { private void copy(Resource resource, File directory, EObject source, String targetName) throws IOException {
URI relativeURI = resource.getURI().deresolve(source.eResource().getURI());
- if(relativeURI.toString().equals("")) {
- relativeURI = URI.createURI(targetName + ".ctx");
+ if(relativeURI.toString().equals("")) { //$NON-NLS-1$
+ relativeURI = URI.createURI(targetName + ".ctx"); //$NON-NLS-1$
}
File target = new File(directory, relativeURI.toString());
copy(resource, target);
@@ -172,7 +173,7 @@ public class CopyContextAction { URI resourceURI = resource.getURI();
URI uri = resourceURI.deresolve(baseURI);
if(uri.isRelative()) {
- if(!(uri.toString().startsWith("..") || uri.toString().startsWith("/"))) {
+ if(!(uri.toString().startsWith("..") || uri.toString().startsWith("/"))) { //$NON-NLS-1$ //$NON-NLS-2$
return true;
}
}
diff --git a/incoming/org.eclipse.papyrus.properties.customization/src/org/eclipse/papyrus/properties/customization/ui/CustomizationDialog.java b/incoming/org.eclipse.papyrus.properties.customization/src/org/eclipse/papyrus/properties/customization/ui/CustomizationDialog.java index 3e8b4a0da7d..dd952cfc007 100644 --- a/incoming/org.eclipse.papyrus.properties.customization/src/org/eclipse/papyrus/properties/customization/ui/CustomizationDialog.java +++ b/incoming/org.eclipse.papyrus.properties.customization/src/org/eclipse/papyrus/properties/customization/ui/CustomizationDialog.java @@ -27,6 +27,7 @@ import org.eclipse.papyrus.properties.contexts.Context; import org.eclipse.papyrus.properties.customization.Activator;
import org.eclipse.papyrus.properties.customization.messages.Messages;
import org.eclipse.papyrus.properties.runtime.ConfigurationManager;
+import org.eclipse.papyrus.widgets.editors.InputDialog;
import org.eclipse.papyrus.widgets.providers.CollectionContentProvider;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.SelectionEvent;
@@ -90,14 +91,14 @@ public class CustomizationDialog extends TrayDialog { availableContexts.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
availableContextsViewer = new ListViewer(availableContexts);
- availableContextsViewer.setContentProvider(new CollectionContentProvider());
+ availableContextsViewer.setContentProvider(CollectionContentProvider.instance);
availableContextsViewer.setLabelProvider(new LabelProvider() {
@Override
public String getText(Object element) {
if(element != null && element instanceof Context) {
Context context = (Context)element;
- return context.getName() + (ConfigurationManager.instance.isPlugin(context) ? Messages.CustomizationDialog_plugin : ""); //$NON-NLS-2$
+ return context.getName() + (ConfigurationManager.instance.isPlugin(context) ? Messages.CustomizationDialog_plugin : ""); //$NON-NLS-2$ //$NON-NLS-1$
}
return super.getText(element);
}
@@ -124,7 +125,7 @@ public class CustomizationDialog extends TrayDialog { Context sourceContext = (Context)element;
try {
- InputDialog dialog = new InputDialog(getShell(), Messages.CustomizationDialog_enterConfigurationName, Messages.CustomizationDialog_copyOf + sourceContext.getName(), new IInputValidator() {
+ InputDialog dialog = new InputDialog(getShell(), Messages.CustomizationDialog_enterConfigurationName, Messages.CustomizationDialog_enterConfigurationName, Messages.CustomizationDialog_copyOf + sourceContext.getName(), new IInputValidator() {
public String isValid(String newText) {
if(newText.trim().equals("")) { //$NON-NLS-1$
diff --git a/incoming/org.eclipse.papyrus.properties.customization/src/org/eclipse/papyrus/properties/customization/util/ProjectUtil.java b/incoming/org.eclipse.papyrus.properties.customization/src/org/eclipse/papyrus/properties/customization/util/ProjectUtil.java index 8856476b100..67f58424af5 100644 --- a/incoming/org.eclipse.papyrus.properties.customization/src/org/eclipse/papyrus/properties/customization/util/ProjectUtil.java +++ b/incoming/org.eclipse.papyrus.properties.customization/src/org/eclipse/papyrus/properties/customization/util/ProjectUtil.java @@ -86,7 +86,7 @@ public class ProjectUtil { custom.open(null);
}
- custom.setHidden(true);
+ custom.setHidden(false);
workspace.getRoot().refreshLocal(IResource.DEPTH_INFINITE, null);
return custom;
diff --git a/plugins/core/org.eclipse.papyrus.properties.model.edit/plugin.properties b/plugins/core/org.eclipse.papyrus.properties.model.edit/plugin.properties index 6c61ee30765..be52f0772fe 100644 --- a/plugins/core/org.eclipse.papyrus.properties.model.edit/plugin.properties +++ b/plugins/core/org.eclipse.papyrus.properties.model.edit/plugin.properties @@ -173,3 +173,5 @@ _UI_Context_dependencies_feature = Dependencies _UI_Property_description_feature = Description
_UI_ContentProviderType_type = Content Provider Type
_UI_PropertyEditor_contentProviderClass_feature = Content Provider Class
+_UI_ConstraintDescriptor_overrideable_feature = Overrideable
+_UI_PropertyEditor_showLabel_feature = Show Label
diff --git a/plugins/core/org.eclipse.papyrus.properties.model.edit/src-gen/org/eclipse/papyrus/properties/contexts/provider/ConstraintDescriptorItemProvider.java b/plugins/core/org.eclipse.papyrus.properties.model.edit/src-gen/org/eclipse/papyrus/properties/contexts/provider/ConstraintDescriptorItemProvider.java index 33cb1a7af6c..8c5fc454829 100644 --- a/plugins/core/org.eclipse.papyrus.properties.model.edit/src-gen/org/eclipse/papyrus/properties/contexts/provider/ConstraintDescriptorItemProvider.java +++ b/plugins/core/org.eclipse.papyrus.properties.model.edit/src-gen/org/eclipse/papyrus/properties/contexts/provider/ConstraintDescriptorItemProvider.java @@ -72,6 +72,7 @@ public class ConstraintDescriptorItemProvider addNamePropertyDescriptor(object);
addConstraintTypePropertyDescriptor(object);
addOverriddenConstraintsPropertyDescriptor(object);
+ addOverrideablePropertyDescriptor(object);
}
return itemPropertyDescriptors;
}
@@ -143,6 +144,28 @@ public class ConstraintDescriptorItemProvider }
/**
+ * This adds a property descriptor for the Overrideable feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected void addOverrideablePropertyDescriptor(Object object) {
+ itemPropertyDescriptors.add
+ (createItemPropertyDescriptor
+ (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
+ getResourceLocator(),
+ getString("_UI_ConstraintDescriptor_overrideable_feature"),
+ getString("_UI_PropertyDescriptor_description", "_UI_ConstraintDescriptor_overrideable_feature", "_UI_ConstraintDescriptor_type"),
+ ContextsPackage.Literals.CONSTRAINT_DESCRIPTOR__OVERRIDEABLE,
+ true,
+ false,
+ false,
+ ItemPropertyDescriptor.BOOLEAN_VALUE_IMAGE,
+ null,
+ null));
+ }
+
+ /**
* This specifies how to implement {@link #getChildren} and is used to deduce an appropriate feature for an
* {@link org.eclipse.emf.edit.command.AddCommand}, {@link org.eclipse.emf.edit.command.RemoveCommand} or
* {@link org.eclipse.emf.edit.command.MoveCommand} in {@link #createCommand}.
@@ -211,6 +234,7 @@ public class ConstraintDescriptorItemProvider switch (notification.getFeatureID(ConstraintDescriptor.class)) {
case ContextsPackage.CONSTRAINT_DESCRIPTOR__NAME:
+ case ContextsPackage.CONSTRAINT_DESCRIPTOR__OVERRIDEABLE:
fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true));
return;
case ContextsPackage.CONSTRAINT_DESCRIPTOR__CONSTRAINTS:
diff --git a/plugins/core/org.eclipse.papyrus.properties.model.edit/src-gen/org/eclipse/papyrus/properties/ui/provider/PropertyEditorItemProvider.java b/plugins/core/org.eclipse.papyrus.properties.model.edit/src-gen/org/eclipse/papyrus/properties/ui/provider/PropertyEditorItemProvider.java index e9094ae4c13..83f7b66b970 100644 --- a/plugins/core/org.eclipse.papyrus.properties.model.edit/src-gen/org/eclipse/papyrus/properties/ui/provider/PropertyEditorItemProvider.java +++ b/plugins/core/org.eclipse.papyrus.properties.model.edit/src-gen/org/eclipse/papyrus/properties/ui/provider/PropertyEditorItemProvider.java @@ -67,6 +67,7 @@ public class PropertyEditorItemProvider addReadOnlyPropertyDescriptor(object);
addWidgetTypePropertyDescriptor(object);
addContentProviderClassPropertyDescriptor(object);
+ addShowLabelPropertyDescriptor(object);
}
return itemPropertyDescriptors;
}
@@ -160,6 +161,28 @@ public class PropertyEditorItemProvider }
/**
+ * This adds a property descriptor for the Show Label feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected void addShowLabelPropertyDescriptor(Object object) {
+ itemPropertyDescriptors.add
+ (createItemPropertyDescriptor
+ (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
+ getResourceLocator(),
+ getString("_UI_PropertyEditor_showLabel_feature"),
+ getString("_UI_PropertyDescriptor_description", "_UI_PropertyEditor_showLabel_feature", "_UI_PropertyEditor_type"),
+ UiPackage.Literals.PROPERTY_EDITOR__SHOW_LABEL,
+ true,
+ false,
+ false,
+ ItemPropertyDescriptor.BOOLEAN_VALUE_IMAGE,
+ null,
+ null));
+ }
+
+ /**
* This specifies how to implement {@link #getChildren} and is used to deduce an appropriate feature for an
* {@link org.eclipse.emf.edit.command.AddCommand}, {@link org.eclipse.emf.edit.command.RemoveCommand} or
* {@link org.eclipse.emf.edit.command.MoveCommand} in {@link #createCommand}.
@@ -226,6 +249,7 @@ public class PropertyEditorItemProvider switch (notification.getFeatureID(PropertyEditor.class)) {
case UiPackage.PROPERTY_EDITOR__READ_ONLY:
case UiPackage.PROPERTY_EDITOR__CONTENT_PROVIDER_CLASS:
+ case UiPackage.PROPERTY_EDITOR__SHOW_LABEL:
fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true));
return;
case UiPackage.PROPERTY_EDITOR__UNRESOLVED_PROPERTY:
diff --git a/plugins/core/org.eclipse.papyrus.properties.model.edit/src-gen/org/eclipse/papyrus/properties/ui/provider/ReferenceAttributeItemProvider.java b/plugins/core/org.eclipse.papyrus.properties.model.edit/src-gen/org/eclipse/papyrus/properties/ui/provider/ReferenceAttributeItemProvider.java index d850c42b230..49d185cbc9f 100644 --- a/plugins/core/org.eclipse.papyrus.properties.model.edit/src-gen/org/eclipse/papyrus/properties/ui/provider/ReferenceAttributeItemProvider.java +++ b/plugins/core/org.eclipse.papyrus.properties.model.edit/src-gen/org/eclipse/papyrus/properties/ui/provider/ReferenceAttributeItemProvider.java @@ -169,12 +169,12 @@ public class ReferenceAttributeItemProvider newChildDescriptors.add
(createChildParameter
(UiPackage.Literals.REFERENCE_ATTRIBUTE__VALUE,
- UiFactory.eINSTANCE.createLayout()));
+ UiFactory.eINSTANCE.createUnknownComponent()));
newChildDescriptors.add
(createChildParameter
(UiPackage.Literals.REFERENCE_ATTRIBUTE__VALUE,
- UiFactory.eINSTANCE.createUnknownComponent()));
+ UiFactory.eINSTANCE.createLayout()));
}
}
diff --git a/plugins/core/org.eclipse.papyrus.properties.model.edit/src-gen/org/eclipse/papyrus/properties/ui/provider/UiItemProviderAdapterFactory.java b/plugins/core/org.eclipse.papyrus.properties.model.edit/src-gen/org/eclipse/papyrus/properties/ui/provider/UiItemProviderAdapterFactory.java index 059653787d0..90ce3a7e72e 100644 --- a/plugins/core/org.eclipse.papyrus.properties.model.edit/src-gen/org/eclipse/papyrus/properties/ui/provider/UiItemProviderAdapterFactory.java +++ b/plugins/core/org.eclipse.papyrus.properties.model.edit/src-gen/org/eclipse/papyrus/properties/ui/provider/UiItemProviderAdapterFactory.java @@ -362,10 +362,10 @@ public class UiItemProviderAdapterFactory extends UiAdapterFactory implements Co if (standardWidgetItemProvider != null) standardWidgetItemProvider.dispose();
if (propertyEditorItemProvider != null) propertyEditorItemProvider.dispose();
if (compositeWidgetItemProvider != null) compositeWidgetItemProvider.dispose();
+ if (unknownComponentItemProvider != null) unknownComponentItemProvider.dispose();
if (layoutItemProvider != null) layoutItemProvider.dispose();
if (valueAttributeItemProvider != null) valueAttributeItemProvider.dispose();
if (referenceAttributeItemProvider != null) referenceAttributeItemProvider.dispose();
- if (unknownComponentItemProvider != null) unknownComponentItemProvider.dispose();
}
}
diff --git a/plugins/core/org.eclipse.papyrus.properties.model.xwt/Transformation/UIToXML.qvto b/plugins/core/org.eclipse.papyrus.properties.model.xwt/Transformation/UIToXML.qvto index 61e381ab789..2a9a83017ad 100644 --- a/plugins/core/org.eclipse.papyrus.properties.model.xwt/Transformation/UIToXML.qvto +++ b/plugins/core/org.eclipse.papyrus.properties.model.xwt/Transformation/UIToXML.qvto @@ -96,6 +96,9 @@ mapping PropertyEditor::toEditorXML() : XML::Element inherits Widget::toWidgetXM if self.readOnly then children := children->including(createAttribute("readOnly", "true")) endif; + if not self.showLabel then + children := children->including(createAttribute("showLabel", "false")) + endif; addNamespace(self.widgetType.namespace, self); } diff --git a/plugins/core/org.eclipse.papyrus.properties.model.xwt/Transformation/XMLToUI.qvto b/plugins/core/org.eclipse.papyrus.properties.model.xwt/Transformation/XMLToUI.qvto index 093e31fbb5a..0a6d0fc2c62 100644 --- a/plugins/core/org.eclipse.papyrus.properties.model.xwt/Transformation/XMLToUI.qvto +++ b/plugins/core/org.eclipse.papyrus.properties.model.xwt/Transformation/XMLToUI.qvto @@ -126,13 +126,15 @@ mapping XML::Element::toPropertyEditor() : PropertyEditor inherits XML::Element: endif; _property := prop; - //Remove the readOnlyAttribute, as it is an actual property (i.e. not generic) in the UI Model + //Remove the readOnly and showLabel Attributes, as they are actual properties (i.e. not generic) in the UI Model //Avoids dupplication of the attribute var readOnlyAttribute := result.attributes->any(e | e.name = "readOnly"); - result.attributes := result.attributes->excluding(readOnlyAttribute); + var showLabelAttribute := result.attributes->any(e | e.name = "showLabel"); + result.attributes := result.attributes->excluding(readOnlyAttribute)->excluding(showLabelAttribute); unresolvedProperty := prop.oclAsType(UnknownProperty); readOnly := self.children->exists(e | e.oclIsKindOf(XML::Attribute) and e.oclAsType(XML::Attribute).name = 'readOnly' and e.oclAsType(XML::Attribute).value='true'); + showLabel := self.children->exists(e | e.oclIsKindOf(XML::Attribute) and e.oclAsType(XML::Attribute).name = 'showLabel' and e.oclAsType(XML::Attribute).value='true'); } query XML::Element::getPropertyName() : String { diff --git a/plugins/core/org.eclipse.papyrus.properties.model.xwt/build.properties b/plugins/core/org.eclipse.papyrus.properties.model.xwt/build.properties index 2a289c74938..acc9d1f12f0 100644 --- a/plugins/core/org.eclipse.papyrus.properties.model.xwt/build.properties +++ b/plugins/core/org.eclipse.papyrus.properties.model.xwt/build.properties @@ -4,4 +4,5 @@ bin.includes = META-INF/,\ .,\
plugin.xml,\
Transformation/,\
- OSGI-INF/
+ OSGI-INF/,\
+ about.html
diff --git a/plugins/core/org.eclipse.papyrus.properties.model/Model/Properties.ecore b/plugins/core/org.eclipse.papyrus.properties.model/Model/Properties.ecore index a78c4125487..2e238bd10ec 100644 --- a/plugins/core/org.eclipse.papyrus.properties.model/Model/Properties.ecore +++ b/plugins/core/org.eclipse.papyrus.properties.model/Model/Properties.ecore @@ -173,6 +173,9 @@ eType="#//contexts/ConfigProperty" containment="true"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="overriddenConstraints"
upperBound="-1" eType="#//contexts/ConstraintDescriptor"/>
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="overrideable" lowerBound="1"
+ eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EBoolean"
+ defaultValueLiteral="true"/>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="ConfigProperty" abstract="true">
<eStructuralFeatures xsi:type="ecore:EAttribute" name="name" lowerBound="1"
@@ -210,6 +213,9 @@ containment="true"/>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="contentProviderClass"
eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="showLabel" lowerBound="1"
+ eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EBoolean"
+ defaultValueLiteral="true"/>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="CompositeWidget" eSuperTypes="#//ui/Widget">
<eStructuralFeatures xsi:type="ecore:EReference" name="layout" lowerBound="1"
diff --git a/plugins/core/org.eclipse.papyrus.properties.model/Model/Properties.genmodel b/plugins/core/org.eclipse.papyrus.properties.model/Model/Properties.genmodel index 74dfdb3fed6..623b9ee5433 100644 --- a/plugins/core/org.eclipse.papyrus.properties.model/Model/Properties.genmodel +++ b/plugins/core/org.eclipse.papyrus.properties.model/Model/Properties.genmodel @@ -134,6 +134,7 @@ <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference Properties.ecore#//contexts/ConstraintDescriptor/properties"/>
<genFeatures notify="false" createChild="false" propertySortChoices="true"
ecoreFeature="ecore:EReference Properties.ecore#//contexts/ConstraintDescriptor/overriddenConstraints"/>
+ <genFeatures createChild="false" ecoreFeature="ecore:EAttribute Properties.ecore#//contexts/ConstraintDescriptor/overrideable"/>
</genClasses>
<genClasses image="false" ecoreClass="Properties.ecore#//contexts/ConfigProperty">
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute Properties.ecore#//contexts/ConfigProperty/name"/>
@@ -165,6 +166,7 @@ ecoreFeature="ecore:EReference Properties.ecore#//ui/PropertyEditor/widgetType"/>
<genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference Properties.ecore#//ui/PropertyEditor/unresolvedProperty"/>
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute Properties.ecore#//ui/PropertyEditor/contentProviderClass"/>
+ <genFeatures createChild="false" ecoreFeature="ecore:EAttribute Properties.ecore#//ui/PropertyEditor/showLabel"/>
</genClasses>
<genClasses ecoreClass="Properties.ecore#//ui/CompositeWidget">
<genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference Properties.ecore#//ui/CompositeWidget/layout"/>
@@ -172,6 +174,9 @@ <genFeatures notify="false" createChild="false" propertySortChoices="true"
ecoreFeature="ecore:EReference Properties.ecore#//ui/CompositeWidget/widgetType"/>
</genClasses>
+ <genClasses ecoreClass="Properties.ecore#//ui/UnknownComponent">
+ <genFeatures createChild="false" ecoreFeature="ecore:EAttribute Properties.ecore#//ui/UnknownComponent/typeName"/>
+ </genClasses>
<genClasses ecoreClass="Properties.ecore#//ui/Layout">
<genFeatures notify="false" createChild="false" propertySortChoices="true"
ecoreFeature="ecore:EReference Properties.ecore#//ui/Layout/layoutType"/>
@@ -185,9 +190,6 @@ <genClasses ecoreClass="Properties.ecore#//ui/ReferenceAttribute">
<genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference Properties.ecore#//ui/ReferenceAttribute/value"/>
</genClasses>
- <genClasses ecoreClass="Properties.ecore#//ui/UnknownComponent">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute Properties.ecore#//ui/UnknownComponent/typeName"/>
- </genClasses>
</nestedGenPackages>
</genPackages>
</genmodel:GenModel>
diff --git a/plugins/core/org.eclipse.papyrus.properties.model/src-gen/org/eclipse/papyrus/properties/contexts/ConstraintDescriptor.java b/plugins/core/org.eclipse.papyrus.properties.model/src-gen/org/eclipse/papyrus/properties/contexts/ConstraintDescriptor.java index ef03e0164a0..55ba67d80e4 100644 --- a/plugins/core/org.eclipse.papyrus.properties.model/src-gen/org/eclipse/papyrus/properties/contexts/ConstraintDescriptor.java +++ b/plugins/core/org.eclipse.papyrus.properties.model/src-gen/org/eclipse/papyrus/properties/contexts/ConstraintDescriptor.java @@ -26,6 +26,7 @@ import org.eclipse.papyrus.properties.environment.ConstraintType; * <li>{@link org.eclipse.papyrus.properties.contexts.ConstraintDescriptor#getConstraints <em>Constraints</em>}</li>
* <li>{@link org.eclipse.papyrus.properties.contexts.ConstraintDescriptor#getProperties <em>Properties</em>}</li>
* <li>{@link org.eclipse.papyrus.properties.contexts.ConstraintDescriptor#getOverriddenConstraints <em>Overridden Constraints</em>}</li>
+ * <li>{@link org.eclipse.papyrus.properties.contexts.ConstraintDescriptor#isOverrideable <em>Overrideable</em>}</li>
* </ul>
* </p>
*
@@ -162,4 +163,31 @@ public interface ConstraintDescriptor extends EObject { */
EList<ConstraintDescriptor> getOverriddenConstraints();
+ /**
+ * Returns the value of the '<em><b>Overrideable</b></em>' attribute.
+ * The default value is <code>"true"</code>.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Overrideable</em>' attribute isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Overrideable</em>' attribute.
+ * @see #setOverrideable(boolean)
+ * @see org.eclipse.papyrus.properties.contexts.ContextsPackage#getConstraintDescriptor_Overrideable()
+ * @model default="true" required="true"
+ * @generated
+ */
+ boolean isOverrideable();
+
+ /**
+ * Sets the value of the '{@link org.eclipse.papyrus.properties.contexts.ConstraintDescriptor#isOverrideable <em>Overrideable</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param value the new value of the '<em>Overrideable</em>' attribute.
+ * @see #isOverrideable()
+ * @generated
+ */
+ void setOverrideable(boolean value);
+
} // ConstraintDescriptor
diff --git a/plugins/core/org.eclipse.papyrus.properties.model/src-gen/org/eclipse/papyrus/properties/contexts/ContextsPackage.java b/plugins/core/org.eclipse.papyrus.properties.model/src-gen/org/eclipse/papyrus/properties/contexts/ContextsPackage.java index 73f7ea71bf3..ca88cdd2296 100644 --- a/plugins/core/org.eclipse.papyrus.properties.model/src-gen/org/eclipse/papyrus/properties/contexts/ContextsPackage.java +++ b/plugins/core/org.eclipse.papyrus.properties.model/src-gen/org/eclipse/papyrus/properties/contexts/ContextsPackage.java @@ -791,13 +791,22 @@ public interface ContextsPackage extends EPackage { int CONSTRAINT_DESCRIPTOR__OVERRIDDEN_CONSTRAINTS = 5;
/**
+ * The feature id for the '<em><b>Overrideable</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int CONSTRAINT_DESCRIPTOR__OVERRIDEABLE = 6;
+
+ /**
* The number of structural features of the '<em>Constraint Descriptor</em>' class.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
- int CONSTRAINT_DESCRIPTOR_FEATURE_COUNT = 6;
+ int CONSTRAINT_DESCRIPTOR_FEATURE_COUNT = 7;
/**
* The meta object id for the '{@link org.eclipse.papyrus.properties.contexts.impl.ConfigPropertyImpl <em>Config Property</em>}' class.
@@ -1475,6 +1484,17 @@ public interface ContextsPackage extends EPackage { EReference getConstraintDescriptor_OverriddenConstraints();
/**
+ * Returns the meta object for the attribute '{@link org.eclipse.papyrus.properties.contexts.ConstraintDescriptor#isOverrideable <em>Overrideable</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for the attribute '<em>Overrideable</em>'.
+ * @see org.eclipse.papyrus.properties.contexts.ConstraintDescriptor#isOverrideable()
+ * @see #getConstraintDescriptor()
+ * @generated
+ */
+ EAttribute getConstraintDescriptor_Overrideable();
+
+ /**
* Returns the meta object for class '{@link org.eclipse.papyrus.properties.contexts.ConfigProperty <em>Config Property</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
@@ -2006,6 +2026,14 @@ public interface ContextsPackage extends EPackage { EReference CONSTRAINT_DESCRIPTOR__OVERRIDDEN_CONSTRAINTS = eINSTANCE.getConstraintDescriptor_OverriddenConstraints();
/**
+ * The meta object literal for the '<em><b>Overrideable</b></em>' attribute feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ EAttribute CONSTRAINT_DESCRIPTOR__OVERRIDEABLE = eINSTANCE.getConstraintDescriptor_Overrideable();
+
+ /**
* The meta object literal for the '{@link org.eclipse.papyrus.properties.contexts.impl.ConfigPropertyImpl <em>Config Property</em>}' class.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
diff --git a/plugins/core/org.eclipse.papyrus.properties.model/src-gen/org/eclipse/papyrus/properties/contexts/Tab.java b/plugins/core/org.eclipse.papyrus.properties.model/src-gen/org/eclipse/papyrus/properties/contexts/Tab.java index f0e81f997b3..14943c38b19 100644 --- a/plugins/core/org.eclipse.papyrus.properties.model/src-gen/org/eclipse/papyrus/properties/contexts/Tab.java +++ b/plugins/core/org.eclipse.papyrus.properties.model/src-gen/org/eclipse/papyrus/properties/contexts/Tab.java @@ -13,20 +13,20 @@ import org.eclipse.emf.ecore.EObject; * <!-- begin-user-doc -->
* A representation of the model object '<em><b>Tab</b></em>'.
* <!-- end-user-doc -->
- *
+ *
* <p>
* The following features are supported:
* <ul>
- * <li>{@link org.eclipse.papyrus.properties.contexts.Tab#getLabel <em>Label</em>}</li>
- * <li>{@link org.eclipse.papyrus.properties.contexts.Tab#getId <em>Id</em>}</li>
- * <li>{@link org.eclipse.papyrus.properties.contexts.Tab#getCategory <em>Category</em>}</li>
- * <li>{@link org.eclipse.papyrus.properties.contexts.Tab#getImage <em>Image</em>}</li>
- * <li>{@link org.eclipse.papyrus.properties.contexts.Tab#getAfterTab <em>After Tab</em>}</li>
- * <li>{@link org.eclipse.papyrus.properties.contexts.Tab#getSections <em>Sections</em>}</li>
- * <li>{@link org.eclipse.papyrus.properties.contexts.Tab#isIndented <em>Indented</em>}</li>
+ * <li>{@link org.eclipse.papyrus.properties.contexts.Tab#getLabel <em>Label</em>}</li>
+ * <li>{@link org.eclipse.papyrus.properties.contexts.Tab#getId <em>Id</em>}</li>
+ * <li>{@link org.eclipse.papyrus.properties.contexts.Tab#getCategory <em>Category</em>}</li>
+ * <li>{@link org.eclipse.papyrus.properties.contexts.Tab#getImage <em>Image</em>}</li>
+ * <li>{@link org.eclipse.papyrus.properties.contexts.Tab#getAfterTab <em>After Tab</em>}</li>
+ * <li>{@link org.eclipse.papyrus.properties.contexts.Tab#getSections <em>Sections</em>}</li>
+ * <li>{@link org.eclipse.papyrus.properties.contexts.Tab#isIndented <em>Indented</em>}</li>
* </ul>
* </p>
- *
+ *
* @see org.eclipse.papyrus.properties.contexts.ContextsPackage#getTab()
* @model
* @generated
@@ -40,7 +40,6 @@ public interface Tab extends EObject { * If the meaning of the '<em>Label</em>' attribute isn't clear, there really should be more of a description here...
* </p>
* <!-- end-user-doc -->
- *
* @return the value of the '<em>Label</em>' attribute.
* @see #setLabel(String)
* @see org.eclipse.papyrus.properties.contexts.ContextsPackage#getTab_Label()
@@ -53,9 +52,7 @@ public interface Tab extends EObject { * Sets the value of the '{@link org.eclipse.papyrus.properties.contexts.Tab#getLabel <em>Label</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
- *
- * @param value
- * the new value of the '<em>Label</em>' attribute.
+ * @param value the new value of the '<em>Label</em>' attribute.
* @see #getLabel()
* @generated
*/
@@ -68,7 +65,6 @@ public interface Tab extends EObject { * If the meaning of the '<em>Id</em>' attribute isn't clear, there really should be more of a description here...
* </p>
* <!-- end-user-doc -->
- *
* @return the value of the '<em>Id</em>' attribute.
* @see #setId(String)
* @see org.eclipse.papyrus.properties.contexts.ContextsPackage#getTab_Id()
@@ -81,9 +77,7 @@ public interface Tab extends EObject { * Sets the value of the '{@link org.eclipse.papyrus.properties.contexts.Tab#getId <em>Id</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
- *
- * @param value
- * the new value of the '<em>Id</em>' attribute.
+ * @param value the new value of the '<em>Id</em>' attribute.
* @see #getId()
* @generated
*/
@@ -96,7 +90,6 @@ public interface Tab extends EObject { * If the meaning of the '<em>Category</em>' attribute isn't clear, there really should be more of a description here...
* </p>
* <!-- end-user-doc -->
- *
* @return the value of the '<em>Category</em>' attribute.
* @see #setCategory(String)
* @see org.eclipse.papyrus.properties.contexts.ContextsPackage#getTab_Category()
@@ -109,9 +102,7 @@ public interface Tab extends EObject { * Sets the value of the '{@link org.eclipse.papyrus.properties.contexts.Tab#getCategory <em>Category</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
- *
- * @param value
- * the new value of the '<em>Category</em>' attribute.
+ * @param value the new value of the '<em>Category</em>' attribute.
* @see #getCategory()
* @generated
*/
@@ -124,7 +115,6 @@ public interface Tab extends EObject { * If the meaning of the '<em>Image</em>' attribute isn't clear, there really should be more of a description here...
* </p>
* <!-- end-user-doc -->
- *
* @return the value of the '<em>Image</em>' attribute.
* @see #setImage(String)
* @see org.eclipse.papyrus.properties.contexts.ContextsPackage#getTab_Image()
@@ -137,9 +127,7 @@ public interface Tab extends EObject { * Sets the value of the '{@link org.eclipse.papyrus.properties.contexts.Tab#getImage <em>Image</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
- *
- * @param value
- * the new value of the '<em>Image</em>' attribute.
+ * @param value the new value of the '<em>Image</em>' attribute.
* @see #getImage()
* @generated
*/
@@ -152,7 +140,6 @@ public interface Tab extends EObject { * If the meaning of the '<em>After Tab</em>' reference isn't clear, there really should be more of a description here...
* </p>
* <!-- end-user-doc -->
- *
* @return the value of the '<em>After Tab</em>' reference.
* @see #setAfterTab(Tab)
* @see org.eclipse.papyrus.properties.contexts.ContextsPackage#getTab_AfterTab()
@@ -165,9 +152,7 @@ public interface Tab extends EObject { * Sets the value of the '{@link org.eclipse.papyrus.properties.contexts.Tab#getAfterTab <em>After Tab</em>}' reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
- *
- * @param value
- * the new value of the '<em>After Tab</em>' reference.
+ * @param value the new value of the '<em>After Tab</em>' reference.
* @see #getAfterTab()
* @generated
*/
@@ -182,7 +167,6 @@ public interface Tab extends EObject { * If the meaning of the '<em>Sections</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>Sections</em>' containment reference list.
* @see org.eclipse.papyrus.properties.contexts.ContextsPackage#getTab_Sections()
* @see org.eclipse.papyrus.properties.contexts.Section#getTab
@@ -199,7 +183,6 @@ public interface Tab extends EObject { * If the meaning of the '<em>Indented</em>' attribute isn't clear, there really should be more of a description here...
* </p>
* <!-- end-user-doc -->
- *
* @return the value of the '<em>Indented</em>' attribute.
* @see #setIndented(boolean)
* @see org.eclipse.papyrus.properties.contexts.ContextsPackage#getTab_Indented()
@@ -212,9 +195,7 @@ public interface Tab extends EObject { * Sets the value of the '{@link org.eclipse.papyrus.properties.contexts.Tab#isIndented <em>Indented</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
- *
- * @param value
- * the new value of the '<em>Indented</em>' attribute.
+ * @param value the new value of the '<em>Indented</em>' attribute.
* @see #isIndented()
* @generated
*/
diff --git a/plugins/core/org.eclipse.papyrus.properties.model/src-gen/org/eclipse/papyrus/properties/contexts/impl/ConstraintDescriptorImpl.java b/plugins/core/org.eclipse.papyrus.properties.model/src-gen/org/eclipse/papyrus/properties/contexts/impl/ConstraintDescriptorImpl.java index 3970f166519..bb99888ea7a 100644 --- a/plugins/core/org.eclipse.papyrus.properties.model/src-gen/org/eclipse/papyrus/properties/contexts/impl/ConstraintDescriptorImpl.java +++ b/plugins/core/org.eclipse.papyrus.properties.model/src-gen/org/eclipse/papyrus/properties/contexts/impl/ConstraintDescriptorImpl.java @@ -44,6 +44,7 @@ import org.eclipse.papyrus.properties.environment.ConstraintType; * <li>{@link org.eclipse.papyrus.properties.contexts.impl.ConstraintDescriptorImpl#getConstraints <em>Constraints</em>}</li>
* <li>{@link org.eclipse.papyrus.properties.contexts.impl.ConstraintDescriptorImpl#getProperties <em>Properties</em>}</li>
* <li>{@link org.eclipse.papyrus.properties.contexts.impl.ConstraintDescriptorImpl#getOverriddenConstraints <em>Overridden Constraints</em>}</li>
+ * <li>{@link org.eclipse.papyrus.properties.contexts.impl.ConstraintDescriptorImpl#isOverrideable <em>Overrideable</em>}</li>
* </ul>
* </p>
*
@@ -111,6 +112,26 @@ public class ConstraintDescriptorImpl extends EObjectImpl implements ConstraintD protected EList<ConstraintDescriptor> overriddenConstraints;
/**
+ * The default value of the '{@link #isOverrideable() <em>Overrideable</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #isOverrideable()
+ * @generated
+ * @ordered
+ */
+ protected static final boolean OVERRIDEABLE_EDEFAULT = true;
+
+ /**
+ * The cached value of the '{@link #isOverrideable() <em>Overrideable</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #isOverrideable()
+ * @generated
+ * @ordered
+ */
+ protected boolean overrideable = OVERRIDEABLE_EDEFAULT;
+
+ /**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
@@ -270,6 +291,27 @@ public class ConstraintDescriptorImpl extends EObjectImpl implements ConstraintD * <!-- end-user-doc -->
* @generated
*/
+ public boolean isOverrideable() {
+ return overrideable;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setOverrideable(boolean newOverrideable) {
+ boolean oldOverrideable = overrideable;
+ overrideable = newOverrideable;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET, ContextsPackage.CONSTRAINT_DESCRIPTOR__OVERRIDEABLE, oldOverrideable, overrideable));
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
@Override
public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
switch (featureID) {
@@ -334,6 +376,8 @@ public class ConstraintDescriptorImpl extends EObjectImpl implements ConstraintD return getProperties();
case ContextsPackage.CONSTRAINT_DESCRIPTOR__OVERRIDDEN_CONSTRAINTS:
return getOverriddenConstraints();
+ case ContextsPackage.CONSTRAINT_DESCRIPTOR__OVERRIDEABLE:
+ return isOverrideable();
}
return super.eGet(featureID, resolve, coreType);
}
@@ -368,6 +412,9 @@ public class ConstraintDescriptorImpl extends EObjectImpl implements ConstraintD getOverriddenConstraints().clear();
getOverriddenConstraints().addAll((Collection<? extends ConstraintDescriptor>)newValue);
return;
+ case ContextsPackage.CONSTRAINT_DESCRIPTOR__OVERRIDEABLE:
+ setOverrideable((Boolean)newValue);
+ return;
}
super.eSet(featureID, newValue);
}
@@ -398,6 +445,9 @@ public class ConstraintDescriptorImpl extends EObjectImpl implements ConstraintD case ContextsPackage.CONSTRAINT_DESCRIPTOR__OVERRIDDEN_CONSTRAINTS:
getOverriddenConstraints().clear();
return;
+ case ContextsPackage.CONSTRAINT_DESCRIPTOR__OVERRIDEABLE:
+ setOverrideable(OVERRIDEABLE_EDEFAULT);
+ return;
}
super.eUnset(featureID);
}
@@ -422,6 +472,8 @@ public class ConstraintDescriptorImpl extends EObjectImpl implements ConstraintD return properties != null && !properties.isEmpty();
case ContextsPackage.CONSTRAINT_DESCRIPTOR__OVERRIDDEN_CONSTRAINTS:
return overriddenConstraints != null && !overriddenConstraints.isEmpty();
+ case ContextsPackage.CONSTRAINT_DESCRIPTOR__OVERRIDEABLE:
+ return overrideable != OVERRIDEABLE_EDEFAULT;
}
return super.eIsSet(featureID);
}
@@ -438,6 +490,8 @@ public class ConstraintDescriptorImpl extends EObjectImpl implements ConstraintD StringBuffer result = new StringBuffer(super.toString());
result.append(" (name: ");
result.append(name);
+ result.append(", overrideable: ");
+ result.append(overrideable);
result.append(')');
return result.toString();
}
diff --git a/plugins/core/org.eclipse.papyrus.properties.model/src-gen/org/eclipse/papyrus/properties/contexts/impl/ContextsPackageImpl.java b/plugins/core/org.eclipse.papyrus.properties.model/src-gen/org/eclipse/papyrus/properties/contexts/impl/ContextsPackageImpl.java index 1f8af1058be..c7d776d8ff6 100644 --- a/plugins/core/org.eclipse.papyrus.properties.model/src-gen/org/eclipse/papyrus/properties/contexts/impl/ContextsPackageImpl.java +++ b/plugins/core/org.eclipse.papyrus.properties.model/src-gen/org/eclipse/papyrus/properties/contexts/impl/ContextsPackageImpl.java @@ -694,6 +694,15 @@ public class ContextsPackageImpl extends EPackageImpl implements ContextsPackage * <!-- end-user-doc -->
* @generated
*/
+ public EAttribute getConstraintDescriptor_Overrideable() {
+ return (EAttribute)constraintDescriptorEClass.getEStructuralFeatures().get(6);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
public EClass getConfigProperty() {
return configPropertyEClass;
}
@@ -834,6 +843,7 @@ public class ContextsPackageImpl extends EPackageImpl implements ContextsPackage createEReference(constraintDescriptorEClass, CONSTRAINT_DESCRIPTOR__CONSTRAINTS);
createEReference(constraintDescriptorEClass, CONSTRAINT_DESCRIPTOR__PROPERTIES);
createEReference(constraintDescriptorEClass, CONSTRAINT_DESCRIPTOR__OVERRIDDEN_CONSTRAINTS);
+ createEAttribute(constraintDescriptorEClass, CONSTRAINT_DESCRIPTOR__OVERRIDEABLE);
configPropertyEClass = createEClass(CONFIG_PROPERTY);
createEAttribute(configPropertyEClass, CONFIG_PROPERTY__NAME);
@@ -949,6 +959,7 @@ public class ContextsPackageImpl extends EPackageImpl implements ContextsPackage initEReference(getConstraintDescriptor_Constraints(), this.getConstraintDescriptor(), null, "constraints", null, 0, -1, ConstraintDescriptor.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEReference(getConstraintDescriptor_Properties(), this.getConfigProperty(), null, "properties", null, 0, -1, ConstraintDescriptor.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEReference(getConstraintDescriptor_OverriddenConstraints(), this.getConstraintDescriptor(), null, "overriddenConstraints", null, 0, -1, ConstraintDescriptor.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEAttribute(getConstraintDescriptor_Overrideable(), ecorePackage.getEBoolean(), "overrideable", "true", 1, 1, ConstraintDescriptor.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEClass(configPropertyEClass, ConfigProperty.class, "ConfigProperty", IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
initEAttribute(getConfigProperty_Name(), ecorePackage.getEString(), "name", null, 1, 1, ConfigProperty.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
diff --git a/plugins/core/org.eclipse.papyrus.properties.model/src-gen/org/eclipse/papyrus/properties/contexts/impl/DataContextElementImpl.java b/plugins/core/org.eclipse.papyrus.properties.model/src-gen/org/eclipse/papyrus/properties/contexts/impl/DataContextElementImpl.java index f80a42e5d79..b5c8540a0fc 100644 --- a/plugins/core/org.eclipse.papyrus.properties.model/src-gen/org/eclipse/papyrus/properties/contexts/impl/DataContextElementImpl.java +++ b/plugins/core/org.eclipse.papyrus.properties.model/src-gen/org/eclipse/papyrus/properties/contexts/impl/DataContextElementImpl.java @@ -353,8 +353,14 @@ public class DataContextElementImpl extends EObjectImpl implements DataContextEl if(object.getClass() == getClass()) {
DataContextElement element = (DataContextElement)object;
- if(!getName().equals(element.getName())) {
- return false;
+ if(getName() == null) {
+ if(element.getName() != null) {
+ return false;
+ }
+ } else {
+ if(!getName().equals(element.getName())) {
+ return false;
+ }
}
if(getPackage() == null) {
diff --git a/plugins/core/org.eclipse.papyrus.properties.model/src-gen/org/eclipse/papyrus/properties/contexts/impl/TabImpl.java b/plugins/core/org.eclipse.papyrus.properties.model/src-gen/org/eclipse/papyrus/properties/contexts/impl/TabImpl.java index 3a3dfc4f492..37e8eb12597 100644 --- a/plugins/core/org.eclipse.papyrus.properties.model/src-gen/org/eclipse/papyrus/properties/contexts/impl/TabImpl.java +++ b/plugins/core/org.eclipse.papyrus.properties.model/src-gen/org/eclipse/papyrus/properties/contexts/impl/TabImpl.java @@ -28,16 +28,16 @@ import org.eclipse.papyrus.properties.contexts.Tab; * <p>
* The following features are implemented:
* <ul>
- * <li>{@link org.eclipse.papyrus.properties.contexts.impl.TabImpl#getLabel <em>Label</em>}</li>
- * <li>{@link org.eclipse.papyrus.properties.contexts.impl.TabImpl#getId <em>Id</em>}</li>
- * <li>{@link org.eclipse.papyrus.properties.contexts.impl.TabImpl#getCategory <em>Category</em>}</li>
- * <li>{@link org.eclipse.papyrus.properties.contexts.impl.TabImpl#getImage <em>Image</em>}</li>
- * <li>{@link org.eclipse.papyrus.properties.contexts.impl.TabImpl#getAfterTab <em>After Tab</em>}</li>
- * <li>{@link org.eclipse.papyrus.properties.contexts.impl.TabImpl#getSections <em>Sections</em>}</li>
- * <li>{@link org.eclipse.papyrus.properties.contexts.impl.TabImpl#isIndented <em>Indented</em>}</li>
+ * <li>{@link org.eclipse.papyrus.properties.contexts.impl.TabImpl#getLabel <em>Label</em>}</li>
+ * <li>{@link org.eclipse.papyrus.properties.contexts.impl.TabImpl#getId <em>Id</em>}</li>
+ * <li>{@link org.eclipse.papyrus.properties.contexts.impl.TabImpl#getCategory <em>Category</em>}</li>
+ * <li>{@link org.eclipse.papyrus.properties.contexts.impl.TabImpl#getImage <em>Image</em>}</li>
+ * <li>{@link org.eclipse.papyrus.properties.contexts.impl.TabImpl#getAfterTab <em>After Tab</em>}</li>
+ * <li>{@link org.eclipse.papyrus.properties.contexts.impl.TabImpl#getSections <em>Sections</em>}</li>
+ * <li>{@link org.eclipse.papyrus.properties.contexts.impl.TabImpl#isIndented <em>Indented</em>}</li>
* </ul>
* </p>
- *
+ *
* @generated
*/
public class TabImpl extends EObjectImpl implements Tab {
@@ -46,7 +46,6 @@ public class TabImpl extends EObjectImpl implements Tab { * The default value of the '{@link #getLabel() <em>Label</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
- *
* @see #getLabel()
* @generated
* @ordered
@@ -57,7 +56,6 @@ public class TabImpl extends EObjectImpl implements Tab { * The cached value of the '{@link #getLabel() <em>Label</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
- *
* @see #getLabel()
* @generated
* @ordered
@@ -68,7 +66,6 @@ public class TabImpl extends EObjectImpl implements Tab { * The default value of the '{@link #getId() <em>Id</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
- *
* @see #getId()
* @generated
* @ordered
@@ -79,7 +76,6 @@ public class TabImpl extends EObjectImpl implements Tab { * The cached value of the '{@link #getId() <em>Id</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
- *
* @see #getId()
* @generated
* @ordered
@@ -90,7 +86,6 @@ public class TabImpl extends EObjectImpl implements Tab { * The default value of the '{@link #getCategory() <em>Category</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
- *
* @see #getCategory()
* @generated
* @ordered
@@ -101,7 +96,6 @@ public class TabImpl extends EObjectImpl implements Tab { * The cached value of the '{@link #getCategory() <em>Category</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
- *
* @see #getCategory()
* @generated
* @ordered
@@ -112,7 +106,6 @@ public class TabImpl extends EObjectImpl implements Tab { * The default value of the '{@link #getImage() <em>Image</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
- *
* @see #getImage()
* @generated
* @ordered
@@ -123,7 +116,6 @@ public class TabImpl extends EObjectImpl implements Tab { * The cached value of the '{@link #getImage() <em>Image</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
- *
* @see #getImage()
* @generated
* @ordered
@@ -134,7 +126,6 @@ public class TabImpl extends EObjectImpl implements Tab { * The cached value of the '{@link #getAfterTab() <em>After Tab</em>}' reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
- *
* @see #getAfterTab()
* @generated
* @ordered
@@ -145,7 +136,6 @@ public class TabImpl extends EObjectImpl implements Tab { * The cached value of the '{@link #getSections() <em>Sections</em>}' containment reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
- *
* @see #getSections()
* @generated
* @ordered
@@ -156,7 +146,6 @@ public class TabImpl extends EObjectImpl implements Tab { * The default value of the '{@link #isIndented() <em>Indented</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
- *
* @see #isIndented()
* @generated
* @ordered
@@ -167,7 +156,6 @@ public class TabImpl extends EObjectImpl implements Tab { * The cached value of the '{@link #isIndented() <em>Indented</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
- *
* @see #isIndented()
* @generated
* @ordered
@@ -177,7 +165,6 @@ public class TabImpl extends EObjectImpl implements Tab { /**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
- *
* @generated
*/
protected TabImpl() {
@@ -187,7 +174,6 @@ public class TabImpl extends EObjectImpl implements Tab { /**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
- *
* @generated
*/
@Override
@@ -198,7 +184,6 @@ public class TabImpl extends EObjectImpl implements Tab { /**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
- *
* @generated
*/
public String getLabel() {
@@ -208,20 +193,18 @@ public class TabImpl extends EObjectImpl implements Tab { /**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
- *
* @generated
*/
public void setLabel(String newLabel) {
String oldLabel = label;
label = newLabel;
- if(eNotificationRequired())
+ if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, ContextsPackage.TAB__LABEL, oldLabel, label));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
- *
* @generated
*/
public String getId() {
@@ -231,20 +214,18 @@ public class TabImpl extends EObjectImpl implements Tab { /**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
- *
* @generated
*/
public void setId(String newId) {
String oldId = id;
id = newId;
- if(eNotificationRequired())
+ if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, ContextsPackage.TAB__ID, oldId, id));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
- *
* @generated
*/
public String getCategory() {
@@ -254,20 +235,18 @@ public class TabImpl extends EObjectImpl implements Tab { /**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
- *
* @generated
*/
public void setCategory(String newCategory) {
String oldCategory = category;
category = newCategory;
- if(eNotificationRequired())
+ if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, ContextsPackage.TAB__CATEGORY, oldCategory, category));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
- *
* @generated
*/
public String getImage() {
@@ -277,28 +256,26 @@ public class TabImpl extends EObjectImpl implements Tab { /**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
- *
* @generated
*/
public void setImage(String newImage) {
String oldImage = image;
image = newImage;
- if(eNotificationRequired())
+ if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, ContextsPackage.TAB__IMAGE, oldImage, image));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
- *
* @generated
*/
public Tab getAfterTab() {
- if(afterTab != null && afterTab.eIsProxy()) {
+ if (afterTab != null && afterTab.eIsProxy()) {
InternalEObject oldAfterTab = (InternalEObject)afterTab;
afterTab = (Tab)eResolveProxy(oldAfterTab);
- if(afterTab != oldAfterTab) {
- if(eNotificationRequired())
+ if (afterTab != oldAfterTab) {
+ if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.RESOLVE, ContextsPackage.TAB__AFTER_TAB, oldAfterTab, afterTab));
}
}
@@ -308,7 +285,6 @@ public class TabImpl extends EObjectImpl implements Tab { /**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
- *
* @generated
*/
public Tab basicGetAfterTab() {
@@ -318,24 +294,22 @@ public class TabImpl extends EObjectImpl implements Tab { /**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
- *
* @generated
*/
public void setAfterTab(Tab newAfterTab) {
Tab oldAfterTab = afterTab;
afterTab = newAfterTab;
- if(eNotificationRequired())
+ if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, ContextsPackage.TAB__AFTER_TAB, oldAfterTab, afterTab));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
- *
* @generated
*/
public EList<Section> getSections() {
- if(sections == null) {
+ if (sections == null) {
sections = new EObjectContainmentWithInverseEList<Section>(Section.class, this, ContextsPackage.TAB__SECTIONS, ContextsPackage.SECTION__TAB);
}
return sections;
@@ -344,7 +318,6 @@ public class TabImpl extends EObjectImpl implements Tab { /**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
- *
* @generated
*/
public boolean isIndented() {
@@ -354,28 +327,26 @@ public class TabImpl extends EObjectImpl implements Tab { /**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
- *
* @generated
*/
public void setIndented(boolean newIndented) {
boolean oldIndented = indented;
indented = newIndented;
- if(eNotificationRequired())
+ if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, ContextsPackage.TAB__INDENTED, oldIndented, indented));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
- *
* @generated
*/
@SuppressWarnings("unchecked")
@Override
public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
- switch(featureID) {
- case ContextsPackage.TAB__SECTIONS:
- return ((InternalEList<InternalEObject>)(InternalEList<?>)getSections()).basicAdd(otherEnd, msgs);
+ switch (featureID) {
+ case ContextsPackage.TAB__SECTIONS:
+ return ((InternalEList<InternalEObject>)(InternalEList<?>)getSections()).basicAdd(otherEnd, msgs);
}
return super.eInverseAdd(otherEnd, featureID, msgs);
}
@@ -383,14 +354,13 @@ public class TabImpl extends EObjectImpl implements Tab { /**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
- *
* @generated
*/
@Override
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
- switch(featureID) {
- case ContextsPackage.TAB__SECTIONS:
- return ((InternalEList<?>)getSections()).basicRemove(otherEnd, msgs);
+ switch (featureID) {
+ case ContextsPackage.TAB__SECTIONS:
+ return ((InternalEList<?>)getSections()).basicRemove(otherEnd, msgs);
}
return super.eInverseRemove(otherEnd, featureID, msgs);
}
@@ -398,28 +368,26 @@ public class TabImpl extends EObjectImpl implements Tab { /**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
- *
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType) {
- switch(featureID) {
- case ContextsPackage.TAB__LABEL:
- return getLabel();
- case ContextsPackage.TAB__ID:
- return getId();
- case ContextsPackage.TAB__CATEGORY:
- return getCategory();
- case ContextsPackage.TAB__IMAGE:
- return getImage();
- case ContextsPackage.TAB__AFTER_TAB:
- if(resolve)
- return getAfterTab();
- return basicGetAfterTab();
- case ContextsPackage.TAB__SECTIONS:
- return getSections();
- case ContextsPackage.TAB__INDENTED:
- return isIndented();
+ switch (featureID) {
+ case ContextsPackage.TAB__LABEL:
+ return getLabel();
+ case ContextsPackage.TAB__ID:
+ return getId();
+ case ContextsPackage.TAB__CATEGORY:
+ return getCategory();
+ case ContextsPackage.TAB__IMAGE:
+ return getImage();
+ case ContextsPackage.TAB__AFTER_TAB:
+ if (resolve) return getAfterTab();
+ return basicGetAfterTab();
+ case ContextsPackage.TAB__SECTIONS:
+ return getSections();
+ case ContextsPackage.TAB__INDENTED:
+ return isIndented();
}
return super.eGet(featureID, resolve, coreType);
}
@@ -427,35 +395,34 @@ public class TabImpl extends EObjectImpl implements Tab { /**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
- *
* @generated
*/
@SuppressWarnings("unchecked")
@Override
public void eSet(int featureID, Object newValue) {
- switch(featureID) {
- case ContextsPackage.TAB__LABEL:
- setLabel((String)newValue);
- return;
- case ContextsPackage.TAB__ID:
- setId((String)newValue);
- return;
- case ContextsPackage.TAB__CATEGORY:
- setCategory((String)newValue);
- return;
- case ContextsPackage.TAB__IMAGE:
- setImage((String)newValue);
- return;
- case ContextsPackage.TAB__AFTER_TAB:
- setAfterTab((Tab)newValue);
- return;
- case ContextsPackage.TAB__SECTIONS:
- getSections().clear();
- getSections().addAll((Collection<? extends Section>)newValue);
- return;
- case ContextsPackage.TAB__INDENTED:
- setIndented((Boolean)newValue);
- return;
+ switch (featureID) {
+ case ContextsPackage.TAB__LABEL:
+ setLabel((String)newValue);
+ return;
+ case ContextsPackage.TAB__ID:
+ setId((String)newValue);
+ return;
+ case ContextsPackage.TAB__CATEGORY:
+ setCategory((String)newValue);
+ return;
+ case ContextsPackage.TAB__IMAGE:
+ setImage((String)newValue);
+ return;
+ case ContextsPackage.TAB__AFTER_TAB:
+ setAfterTab((Tab)newValue);
+ return;
+ case ContextsPackage.TAB__SECTIONS:
+ getSections().clear();
+ getSections().addAll((Collection<? extends Section>)newValue);
+ return;
+ case ContextsPackage.TAB__INDENTED:
+ setIndented((Boolean)newValue);
+ return;
}
super.eSet(featureID, newValue);
}
@@ -463,33 +430,32 @@ public class TabImpl extends EObjectImpl implements Tab { /**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
- *
* @generated
*/
@Override
public void eUnset(int featureID) {
- switch(featureID) {
- case ContextsPackage.TAB__LABEL:
- setLabel(LABEL_EDEFAULT);
- return;
- case ContextsPackage.TAB__ID:
- setId(ID_EDEFAULT);
- return;
- case ContextsPackage.TAB__CATEGORY:
- setCategory(CATEGORY_EDEFAULT);
- return;
- case ContextsPackage.TAB__IMAGE:
- setImage(IMAGE_EDEFAULT);
- return;
- case ContextsPackage.TAB__AFTER_TAB:
- setAfterTab((Tab)null);
- return;
- case ContextsPackage.TAB__SECTIONS:
- getSections().clear();
- return;
- case ContextsPackage.TAB__INDENTED:
- setIndented(INDENTED_EDEFAULT);
- return;
+ switch (featureID) {
+ case ContextsPackage.TAB__LABEL:
+ setLabel(LABEL_EDEFAULT);
+ return;
+ case ContextsPackage.TAB__ID:
+ setId(ID_EDEFAULT);
+ return;
+ case ContextsPackage.TAB__CATEGORY:
+ setCategory(CATEGORY_EDEFAULT);
+ return;
+ case ContextsPackage.TAB__IMAGE:
+ setImage(IMAGE_EDEFAULT);
+ return;
+ case ContextsPackage.TAB__AFTER_TAB:
+ setAfterTab((Tab)null);
+ return;
+ case ContextsPackage.TAB__SECTIONS:
+ getSections().clear();
+ return;
+ case ContextsPackage.TAB__INDENTED:
+ setIndented(INDENTED_EDEFAULT);
+ return;
}
super.eUnset(featureID);
}
@@ -497,26 +463,25 @@ public class TabImpl extends EObjectImpl implements Tab { /**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
- *
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
- switch(featureID) {
- case ContextsPackage.TAB__LABEL:
- return LABEL_EDEFAULT == null ? label != null : !LABEL_EDEFAULT.equals(label);
- case ContextsPackage.TAB__ID:
- return ID_EDEFAULT == null ? id != null : !ID_EDEFAULT.equals(id);
- case ContextsPackage.TAB__CATEGORY:
- return CATEGORY_EDEFAULT == null ? category != null : !CATEGORY_EDEFAULT.equals(category);
- case ContextsPackage.TAB__IMAGE:
- return IMAGE_EDEFAULT == null ? image != null : !IMAGE_EDEFAULT.equals(image);
- case ContextsPackage.TAB__AFTER_TAB:
- return afterTab != null;
- case ContextsPackage.TAB__SECTIONS:
- return sections != null && !sections.isEmpty();
- case ContextsPackage.TAB__INDENTED:
- return indented != INDENTED_EDEFAULT;
+ switch (featureID) {
+ case ContextsPackage.TAB__LABEL:
+ return LABEL_EDEFAULT == null ? label != null : !LABEL_EDEFAULT.equals(label);
+ case ContextsPackage.TAB__ID:
+ return ID_EDEFAULT == null ? id != null : !ID_EDEFAULT.equals(id);
+ case ContextsPackage.TAB__CATEGORY:
+ return CATEGORY_EDEFAULT == null ? category != null : !CATEGORY_EDEFAULT.equals(category);
+ case ContextsPackage.TAB__IMAGE:
+ return IMAGE_EDEFAULT == null ? image != null : !IMAGE_EDEFAULT.equals(image);
+ case ContextsPackage.TAB__AFTER_TAB:
+ return afterTab != null;
+ case ContextsPackage.TAB__SECTIONS:
+ return sections != null && !sections.isEmpty();
+ case ContextsPackage.TAB__INDENTED:
+ return indented != INDENTED_EDEFAULT;
}
return super.eIsSet(featureID);
}
@@ -524,28 +489,25 @@ public class TabImpl extends EObjectImpl implements Tab { /**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
- *
* @generated
*/
@Override
public String toString() {
- if(eIsProxy())
- return super.toString();
-
- return getCategory() + ":" + getId();
- // StringBuffer result = new StringBuffer(super.toString());
- // result.append(" (label: ");
- // result.append(label);
- // result.append(", id: ");
- // result.append(id);
- // result.append(", category: ");
- // result.append(category);
- // result.append(", image: ");
- // result.append(image);
- // result.append(", indented: ");
- // result.append(indented);
- // result.append(')');
- // return result.toString();
+ if (eIsProxy()) return super.toString();
+
+ StringBuffer result = new StringBuffer(super.toString());
+ result.append(" (label: ");
+ result.append(label);
+ result.append(", id: ");
+ result.append(id);
+ result.append(", category: ");
+ result.append(category);
+ result.append(", image: ");
+ result.append(image);
+ result.append(", indented: ");
+ result.append(indented);
+ result.append(')');
+ return result.toString();
}
diff --git a/plugins/core/org.eclipse.papyrus.properties.model/src-gen/org/eclipse/papyrus/properties/ui/PropertyEditor.java b/plugins/core/org.eclipse.papyrus.properties.model/src-gen/org/eclipse/papyrus/properties/ui/PropertyEditor.java index 1b352de84ae..178981025df 100644 --- a/plugins/core/org.eclipse.papyrus.properties.model/src-gen/org/eclipse/papyrus/properties/ui/PropertyEditor.java +++ b/plugins/core/org.eclipse.papyrus.properties.model/src-gen/org/eclipse/papyrus/properties/ui/PropertyEditor.java @@ -24,6 +24,7 @@ import org.eclipse.papyrus.properties.environment.PropertyEditorType; * <li>{@link org.eclipse.papyrus.properties.ui.PropertyEditor#getWidgetType <em>Widget Type</em>}</li>
* <li>{@link org.eclipse.papyrus.properties.ui.PropertyEditor#getUnresolvedProperty <em>Unresolved Property</em>}</li>
* <li>{@link org.eclipse.papyrus.properties.ui.PropertyEditor#getContentProviderClass <em>Content Provider Class</em>}</li>
+ * <li>{@link org.eclipse.papyrus.properties.ui.PropertyEditor#isShowLabel <em>Show Label</em>}</li>
* </ul>
* </p>
*
@@ -163,4 +164,31 @@ public interface PropertyEditor extends Widget { */
void setContentProviderClass(String value);
+ /**
+ * Returns the value of the '<em><b>Show Label</b></em>' attribute.
+ * The default value is <code>"true"</code>.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Show Label</em>' attribute isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Show Label</em>' attribute.
+ * @see #setShowLabel(boolean)
+ * @see org.eclipse.papyrus.properties.ui.UiPackage#getPropertyEditor_ShowLabel()
+ * @model default="true" required="true"
+ * @generated
+ */
+ boolean isShowLabel();
+
+ /**
+ * Sets the value of the '{@link org.eclipse.papyrus.properties.ui.PropertyEditor#isShowLabel <em>Show Label</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param value the new value of the '<em>Show Label</em>' attribute.
+ * @see #isShowLabel()
+ * @generated
+ */
+ void setShowLabel(boolean value);
+
} // PropertyEditor
diff --git a/plugins/core/org.eclipse.papyrus.properties.model/src-gen/org/eclipse/papyrus/properties/ui/UiPackage.java b/plugins/core/org.eclipse.papyrus.properties.model/src-gen/org/eclipse/papyrus/properties/ui/UiPackage.java index f4f4426e175..e41206abea3 100644 --- a/plugins/core/org.eclipse.papyrus.properties.model/src-gen/org/eclipse/papyrus/properties/ui/UiPackage.java +++ b/plugins/core/org.eclipse.papyrus.properties.model/src-gen/org/eclipse/papyrus/properties/ui/UiPackage.java @@ -236,13 +236,22 @@ public interface UiPackage extends EPackage { int PROPERTY_EDITOR__CONTENT_PROVIDER_CLASS = WIDGET_FEATURE_COUNT + 4;
/**
+ * The feature id for the '<em><b>Show Label</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int PROPERTY_EDITOR__SHOW_LABEL = WIDGET_FEATURE_COUNT + 5;
+
+ /**
* The number of structural features of the '<em>Property Editor</em>' class.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
- int PROPERTY_EDITOR_FEATURE_COUNT = WIDGET_FEATURE_COUNT + 5;
+ int PROPERTY_EDITOR_FEATURE_COUNT = WIDGET_FEATURE_COUNT + 6;
/**
* The meta object id for the '{@link org.eclipse.papyrus.properties.ui.impl.CompositeWidgetImpl <em>Composite Widget</em>}' class.
@@ -307,173 +316,173 @@ public interface UiPackage extends EPackage { * @see org.eclipse.papyrus.properties.ui.impl.UiPackageImpl#getLayout()
* @generated
*/
- int LAYOUT = 6;
+ int LAYOUT = 7;
/**
- * The feature id for the '<em><b>Attributes</b></em>' containment reference list.
+ * The meta object id for the '{@link org.eclipse.papyrus.properties.ui.impl.WidgetAttributeImpl <em>Widget Attribute</em>}' class.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
+ * @see org.eclipse.papyrus.properties.ui.impl.WidgetAttributeImpl
+ * @see org.eclipse.papyrus.properties.ui.impl.UiPackageImpl#getWidgetAttribute()
* @generated
- * @ordered
*/
- int LAYOUT__ATTRIBUTES = UI_COMPONENT__ATTRIBUTES;
+ int WIDGET_ATTRIBUTE = 8;
/**
- * The feature id for the '<em><b>Layout Type</b></em>' reference.
+ * The meta object id for the '{@link org.eclipse.papyrus.properties.ui.impl.ValueAttributeImpl <em>Value Attribute</em>}' class.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
+ * @see org.eclipse.papyrus.properties.ui.impl.ValueAttributeImpl
+ * @see org.eclipse.papyrus.properties.ui.impl.UiPackageImpl#getValueAttribute()
* @generated
- * @ordered
*/
- int LAYOUT__LAYOUT_TYPE = UI_COMPONENT_FEATURE_COUNT + 0;
+ int VALUE_ATTRIBUTE = 9;
/**
- * The number of structural features of the '<em>Layout</em>' class.
+ * The meta object id for the '{@link org.eclipse.papyrus.properties.ui.impl.ReferenceAttributeImpl <em>Reference Attribute</em>}' class.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
+ * @see org.eclipse.papyrus.properties.ui.impl.ReferenceAttributeImpl
+ * @see org.eclipse.papyrus.properties.ui.impl.UiPackageImpl#getReferenceAttribute()
* @generated
- * @ordered
*/
- int LAYOUT_FEATURE_COUNT = UI_COMPONENT_FEATURE_COUNT + 1;
+ int REFERENCE_ATTRIBUTE = 10;
/**
- * The meta object id for the '{@link org.eclipse.papyrus.properties.ui.impl.WidgetAttributeImpl <em>Widget Attribute</em>}' class.
+ * The meta object id for the '{@link org.eclipse.papyrus.properties.ui.impl.UnknownComponentImpl <em>Unknown Component</em>}' class.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
- * @see org.eclipse.papyrus.properties.ui.impl.WidgetAttributeImpl
- * @see org.eclipse.papyrus.properties.ui.impl.UiPackageImpl#getWidgetAttribute()
+ * @see org.eclipse.papyrus.properties.ui.impl.UnknownComponentImpl
+ * @see org.eclipse.papyrus.properties.ui.impl.UiPackageImpl#getUnknownComponent()
* @generated
*/
- int WIDGET_ATTRIBUTE = 7;
+ int UNKNOWN_COMPONENT = 6;
/**
- * The feature id for the '<em><b>Name</b></em>' attribute.
+ * The feature id for the '<em><b>Attributes</b></em>' containment reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
- int WIDGET_ATTRIBUTE__NAME = ELEMENT_FEATURE_COUNT + 0;
+ int UNKNOWN_COMPONENT__ATTRIBUTES = WIDGET__ATTRIBUTES;
/**
- * The number of structural features of the '<em>Widget Attribute</em>' class.
+ * The feature id for the '<em><b>Type Name</b></em>' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
- int WIDGET_ATTRIBUTE_FEATURE_COUNT = ELEMENT_FEATURE_COUNT + 1;
+ int UNKNOWN_COMPONENT__TYPE_NAME = WIDGET_FEATURE_COUNT + 0;
/**
- * The meta object id for the '{@link org.eclipse.papyrus.properties.ui.impl.ValueAttributeImpl <em>Value Attribute</em>}' class.
+ * The number of structural features of the '<em>Unknown Component</em>' class.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
- * @see org.eclipse.papyrus.properties.ui.impl.ValueAttributeImpl
- * @see org.eclipse.papyrus.properties.ui.impl.UiPackageImpl#getValueAttribute()
* @generated
+ * @ordered
*/
- int VALUE_ATTRIBUTE = 8;
+ int UNKNOWN_COMPONENT_FEATURE_COUNT = WIDGET_FEATURE_COUNT + 1;
/**
- * The feature id for the '<em><b>Name</b></em>' attribute.
+ * The feature id for the '<em><b>Attributes</b></em>' containment reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
- int VALUE_ATTRIBUTE__NAME = WIDGET_ATTRIBUTE__NAME;
+ int LAYOUT__ATTRIBUTES = UI_COMPONENT__ATTRIBUTES;
/**
- * The feature id for the '<em><b>Value</b></em>' attribute.
+ * The feature id for the '<em><b>Layout Type</b></em>' reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
- int VALUE_ATTRIBUTE__VALUE = WIDGET_ATTRIBUTE_FEATURE_COUNT + 0;
+ int LAYOUT__LAYOUT_TYPE = UI_COMPONENT_FEATURE_COUNT + 0;
/**
- * The number of structural features of the '<em>Value Attribute</em>' class.
+ * The number of structural features of the '<em>Layout</em>' class.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
- int VALUE_ATTRIBUTE_FEATURE_COUNT = WIDGET_ATTRIBUTE_FEATURE_COUNT + 1;
+ int LAYOUT_FEATURE_COUNT = UI_COMPONENT_FEATURE_COUNT + 1;
/**
- * The meta object id for the '{@link org.eclipse.papyrus.properties.ui.impl.ReferenceAttributeImpl <em>Reference Attribute</em>}' class.
+ * The feature id for the '<em><b>Name</b></em>' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
- * @see org.eclipse.papyrus.properties.ui.impl.ReferenceAttributeImpl
- * @see org.eclipse.papyrus.properties.ui.impl.UiPackageImpl#getReferenceAttribute()
* @generated
+ * @ordered
*/
- int REFERENCE_ATTRIBUTE = 9;
+ int WIDGET_ATTRIBUTE__NAME = ELEMENT_FEATURE_COUNT + 0;
/**
- * The feature id for the '<em><b>Name</b></em>' attribute.
+ * The number of structural features of the '<em>Widget Attribute</em>' class.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
- int REFERENCE_ATTRIBUTE__NAME = WIDGET_ATTRIBUTE__NAME;
+ int WIDGET_ATTRIBUTE_FEATURE_COUNT = ELEMENT_FEATURE_COUNT + 1;
/**
- * The feature id for the '<em><b>Value</b></em>' containment reference.
+ * The feature id for the '<em><b>Name</b></em>' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
- int REFERENCE_ATTRIBUTE__VALUE = WIDGET_ATTRIBUTE_FEATURE_COUNT + 0;
+ int VALUE_ATTRIBUTE__NAME = WIDGET_ATTRIBUTE__NAME;
/**
- * The number of structural features of the '<em>Reference Attribute</em>' class.
+ * The feature id for the '<em><b>Value</b></em>' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
- int REFERENCE_ATTRIBUTE_FEATURE_COUNT = WIDGET_ATTRIBUTE_FEATURE_COUNT + 1;
+ int VALUE_ATTRIBUTE__VALUE = WIDGET_ATTRIBUTE_FEATURE_COUNT + 0;
/**
- * The meta object id for the '{@link org.eclipse.papyrus.properties.ui.impl.UnknownComponentImpl <em>Unknown Component</em>}' class.
+ * The number of structural features of the '<em>Value Attribute</em>' class.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
- * @see org.eclipse.papyrus.properties.ui.impl.UnknownComponentImpl
- * @see org.eclipse.papyrus.properties.ui.impl.UiPackageImpl#getUnknownComponent()
* @generated
+ * @ordered
*/
- int UNKNOWN_COMPONENT = 10;
+ int VALUE_ATTRIBUTE_FEATURE_COUNT = WIDGET_ATTRIBUTE_FEATURE_COUNT + 1;
/**
- * The feature id for the '<em><b>Attributes</b></em>' containment reference list.
+ * The feature id for the '<em><b>Name</b></em>' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
- int UNKNOWN_COMPONENT__ATTRIBUTES = WIDGET__ATTRIBUTES;
+ int REFERENCE_ATTRIBUTE__NAME = WIDGET_ATTRIBUTE__NAME;
/**
- * The feature id for the '<em><b>Type Name</b></em>' attribute.
+ * The feature id for the '<em><b>Value</b></em>' containment reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
- int UNKNOWN_COMPONENT__TYPE_NAME = WIDGET_FEATURE_COUNT + 0;
+ int REFERENCE_ATTRIBUTE__VALUE = WIDGET_ATTRIBUTE_FEATURE_COUNT + 0;
/**
- * The number of structural features of the '<em>Unknown Component</em>' class.
+ * The number of structural features of the '<em>Reference Attribute</em>' class.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
- int UNKNOWN_COMPONENT_FEATURE_COUNT = WIDGET_FEATURE_COUNT + 1;
+ int REFERENCE_ATTRIBUTE_FEATURE_COUNT = WIDGET_ATTRIBUTE_FEATURE_COUNT + 1;
/**
@@ -604,6 +613,17 @@ public interface UiPackage extends EPackage { EAttribute getPropertyEditor_ContentProviderClass();
/**
+ * Returns the meta object for the attribute '{@link org.eclipse.papyrus.properties.ui.PropertyEditor#isShowLabel <em>Show Label</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for the attribute '<em>Show Label</em>'.
+ * @see org.eclipse.papyrus.properties.ui.PropertyEditor#isShowLabel()
+ * @see #getPropertyEditor()
+ * @generated
+ */
+ EAttribute getPropertyEditor_ShowLabel();
+
+ /**
* Returns the meta object for class '{@link org.eclipse.papyrus.properties.ui.CompositeWidget <em>Composite Widget</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
@@ -880,6 +900,14 @@ public interface UiPackage extends EPackage { EAttribute PROPERTY_EDITOR__CONTENT_PROVIDER_CLASS = eINSTANCE.getPropertyEditor_ContentProviderClass();
/**
+ * The meta object literal for the '<em><b>Show Label</b></em>' attribute feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ EAttribute PROPERTY_EDITOR__SHOW_LABEL = eINSTANCE.getPropertyEditor_ShowLabel();
+
+ /**
* The meta object literal for the '{@link org.eclipse.papyrus.properties.ui.impl.CompositeWidgetImpl <em>Composite Widget</em>}' class.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
diff --git a/plugins/core/org.eclipse.papyrus.properties.model/src-gen/org/eclipse/papyrus/properties/ui/impl/PropertyEditorImpl.java b/plugins/core/org.eclipse.papyrus.properties.model/src-gen/org/eclipse/papyrus/properties/ui/impl/PropertyEditorImpl.java index 120d89fc5be..b57d7503be5 100644 --- a/plugins/core/org.eclipse.papyrus.properties.model/src-gen/org/eclipse/papyrus/properties/ui/impl/PropertyEditorImpl.java +++ b/plugins/core/org.eclipse.papyrus.properties.model/src-gen/org/eclipse/papyrus/properties/ui/impl/PropertyEditorImpl.java @@ -34,6 +34,7 @@ import org.eclipse.papyrus.properties.ui.UiPackage; * <li>{@link org.eclipse.papyrus.properties.ui.impl.PropertyEditorImpl#getWidgetType <em>Widget Type</em>}</li>
* <li>{@link org.eclipse.papyrus.properties.ui.impl.PropertyEditorImpl#getUnresolvedProperty <em>Unresolved Property</em>}</li>
* <li>{@link org.eclipse.papyrus.properties.ui.impl.PropertyEditorImpl#getContentProviderClass <em>Content Provider Class</em>}</li>
+ * <li>{@link org.eclipse.papyrus.properties.ui.impl.PropertyEditorImpl#isShowLabel <em>Show Label</em>}</li>
* </ul>
* </p>
*
@@ -111,6 +112,26 @@ public class PropertyEditorImpl extends WidgetImpl implements PropertyEditor { protected String contentProviderClass = CONTENT_PROVIDER_CLASS_EDEFAULT;
/**
+ * The default value of the '{@link #isShowLabel() <em>Show Label</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #isShowLabel()
+ * @generated
+ * @ordered
+ */
+ protected static final boolean SHOW_LABEL_EDEFAULT = true;
+
+ /**
+ * The cached value of the '{@link #isShowLabel() <em>Show Label</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #isShowLabel()
+ * @generated
+ * @ordered
+ */
+ protected boolean showLabel = SHOW_LABEL_EDEFAULT;
+
+ /**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
@@ -295,6 +316,27 @@ public class PropertyEditorImpl extends WidgetImpl implements PropertyEditor { * <!-- end-user-doc -->
* @generated
*/
+ public boolean isShowLabel() {
+ return showLabel;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setShowLabel(boolean newShowLabel) {
+ boolean oldShowLabel = showLabel;
+ showLabel = newShowLabel;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET, UiPackage.PROPERTY_EDITOR__SHOW_LABEL, oldShowLabel, showLabel));
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
@Override
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
switch (featureID) {
@@ -324,6 +366,8 @@ public class PropertyEditorImpl extends WidgetImpl implements PropertyEditor { return getUnresolvedProperty();
case UiPackage.PROPERTY_EDITOR__CONTENT_PROVIDER_CLASS:
return getContentProviderClass();
+ case UiPackage.PROPERTY_EDITOR__SHOW_LABEL:
+ return isShowLabel();
}
return super.eGet(featureID, resolve, coreType);
}
@@ -351,6 +395,9 @@ public class PropertyEditorImpl extends WidgetImpl implements PropertyEditor { case UiPackage.PROPERTY_EDITOR__CONTENT_PROVIDER_CLASS:
setContentProviderClass((String)newValue);
return;
+ case UiPackage.PROPERTY_EDITOR__SHOW_LABEL:
+ setShowLabel((Boolean)newValue);
+ return;
}
super.eSet(featureID, newValue);
}
@@ -378,6 +425,9 @@ public class PropertyEditorImpl extends WidgetImpl implements PropertyEditor { case UiPackage.PROPERTY_EDITOR__CONTENT_PROVIDER_CLASS:
setContentProviderClass(CONTENT_PROVIDER_CLASS_EDEFAULT);
return;
+ case UiPackage.PROPERTY_EDITOR__SHOW_LABEL:
+ setShowLabel(SHOW_LABEL_EDEFAULT);
+ return;
}
super.eUnset(featureID);
}
@@ -400,6 +450,8 @@ public class PropertyEditorImpl extends WidgetImpl implements PropertyEditor { return unresolvedProperty != null;
case UiPackage.PROPERTY_EDITOR__CONTENT_PROVIDER_CLASS:
return CONTENT_PROVIDER_CLASS_EDEFAULT == null ? contentProviderClass != null : !CONTENT_PROVIDER_CLASS_EDEFAULT.equals(contentProviderClass);
+ case UiPackage.PROPERTY_EDITOR__SHOW_LABEL:
+ return showLabel != SHOW_LABEL_EDEFAULT;
}
return super.eIsSet(featureID);
}
@@ -418,6 +470,8 @@ public class PropertyEditorImpl extends WidgetImpl implements PropertyEditor { result.append(readOnly);
result.append(", contentProviderClass: ");
result.append(contentProviderClass);
+ result.append(", showLabel: ");
+ result.append(showLabel);
result.append(')');
return result.toString();
}
diff --git a/plugins/core/org.eclipse.papyrus.properties.model/src-gen/org/eclipse/papyrus/properties/ui/impl/UiFactoryImpl.java b/plugins/core/org.eclipse.papyrus.properties.model/src-gen/org/eclipse/papyrus/properties/ui/impl/UiFactoryImpl.java index cdf75b4b9cf..1c8c0ce2878 100644 --- a/plugins/core/org.eclipse.papyrus.properties.model/src-gen/org/eclipse/papyrus/properties/ui/impl/UiFactoryImpl.java +++ b/plugins/core/org.eclipse.papyrus.properties.model/src-gen/org/eclipse/papyrus/properties/ui/impl/UiFactoryImpl.java @@ -64,10 +64,10 @@ public class UiFactoryImpl extends EFactoryImpl implements UiFactory { case UiPackage.STANDARD_WIDGET: return createStandardWidget();
case UiPackage.PROPERTY_EDITOR: return createPropertyEditor();
case UiPackage.COMPOSITE_WIDGET: return createCompositeWidget();
+ case UiPackage.UNKNOWN_COMPONENT: return createUnknownComponent();
case UiPackage.LAYOUT: return createLayout();
case UiPackage.VALUE_ATTRIBUTE: return createValueAttribute();
case UiPackage.REFERENCE_ATTRIBUTE: return createReferenceAttribute();
- case UiPackage.UNKNOWN_COMPONENT: return createUnknownComponent();
default:
throw new IllegalArgumentException("The class '" + eClass.getName() + "' is not a valid classifier");
}
diff --git a/plugins/core/org.eclipse.papyrus.properties.model/src-gen/org/eclipse/papyrus/properties/ui/impl/UiPackageImpl.java b/plugins/core/org.eclipse.papyrus.properties.model/src-gen/org/eclipse/papyrus/properties/ui/impl/UiPackageImpl.java index 6a35dcfd620..28064fbbe05 100644 --- a/plugins/core/org.eclipse.papyrus.properties.model/src-gen/org/eclipse/papyrus/properties/ui/impl/UiPackageImpl.java +++ b/plugins/core/org.eclipse.papyrus.properties.model/src-gen/org/eclipse/papyrus/properties/ui/impl/UiPackageImpl.java @@ -301,6 +301,15 @@ public class UiPackageImpl extends EPackageImpl implements UiPackage { * <!-- end-user-doc -->
* @generated
*/
+ public EAttribute getPropertyEditor_ShowLabel() {
+ return (EAttribute)propertyEditorEClass.getEStructuralFeatures().get(5);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
public EClass getCompositeWidget() {
return compositeWidgetEClass;
}
@@ -466,12 +475,16 @@ public class UiPackageImpl extends EPackageImpl implements UiPackage { createEReference(propertyEditorEClass, PROPERTY_EDITOR__WIDGET_TYPE);
createEReference(propertyEditorEClass, PROPERTY_EDITOR__UNRESOLVED_PROPERTY);
createEAttribute(propertyEditorEClass, PROPERTY_EDITOR__CONTENT_PROVIDER_CLASS);
+ createEAttribute(propertyEditorEClass, PROPERTY_EDITOR__SHOW_LABEL);
compositeWidgetEClass = createEClass(COMPOSITE_WIDGET);
createEReference(compositeWidgetEClass, COMPOSITE_WIDGET__LAYOUT);
createEReference(compositeWidgetEClass, COMPOSITE_WIDGET__WIDGETS);
createEReference(compositeWidgetEClass, COMPOSITE_WIDGET__WIDGET_TYPE);
+ unknownComponentEClass = createEClass(UNKNOWN_COMPONENT);
+ createEAttribute(unknownComponentEClass, UNKNOWN_COMPONENT__TYPE_NAME);
+
layoutEClass = createEClass(LAYOUT);
createEReference(layoutEClass, LAYOUT__LAYOUT_TYPE);
@@ -483,9 +496,6 @@ public class UiPackageImpl extends EPackageImpl implements UiPackage { referenceAttributeEClass = createEClass(REFERENCE_ATTRIBUTE);
createEReference(referenceAttributeEClass, REFERENCE_ATTRIBUTE__VALUE);
-
- unknownComponentEClass = createEClass(UNKNOWN_COMPONENT);
- createEAttribute(unknownComponentEClass, UNKNOWN_COMPONENT__TYPE_NAME);
}
/**
@@ -525,11 +535,11 @@ public class UiPackageImpl extends EPackageImpl implements UiPackage { standardWidgetEClass.getESuperTypes().add(this.getWidget());
propertyEditorEClass.getESuperTypes().add(this.getWidget());
compositeWidgetEClass.getESuperTypes().add(this.getWidget());
+ unknownComponentEClass.getESuperTypes().add(this.getWidget());
layoutEClass.getESuperTypes().add(this.getUIComponent());
widgetAttributeEClass.getESuperTypes().add(this.getElement());
valueAttributeEClass.getESuperTypes().add(this.getWidgetAttribute());
referenceAttributeEClass.getESuperTypes().add(this.getWidgetAttribute());
- unknownComponentEClass.getESuperTypes().add(this.getWidget());
// Initialize classes and features; add operations and parameters
initEClass(elementEClass, Element.class, "Element", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
@@ -548,12 +558,16 @@ public class UiPackageImpl extends EPackageImpl implements UiPackage { initEReference(getPropertyEditor_WidgetType(), theEnvironmentPackage.getPropertyEditorType(), null, "widgetType", null, 1, 1, PropertyEditor.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEReference(getPropertyEditor_UnresolvedProperty(), theContextsPackage.getUnknownProperty(), null, "unresolvedProperty", null, 0, 1, PropertyEditor.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEAttribute(getPropertyEditor_ContentProviderClass(), ecorePackage.getEString(), "contentProviderClass", null, 0, 1, PropertyEditor.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEAttribute(getPropertyEditor_ShowLabel(), ecorePackage.getEBoolean(), "showLabel", "true", 1, 1, PropertyEditor.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEClass(compositeWidgetEClass, CompositeWidget.class, "CompositeWidget", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
initEReference(getCompositeWidget_Layout(), this.getLayout(), null, "layout", null, 1, 1, CompositeWidget.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEReference(getCompositeWidget_Widgets(), this.getWidget(), null, "widgets", null, 0, -1, CompositeWidget.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEReference(getCompositeWidget_WidgetType(), theEnvironmentPackage.getCompositeWidgetType(), null, "widgetType", null, 1, 1, CompositeWidget.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEClass(unknownComponentEClass, UnknownComponent.class, "UnknownComponent", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
+ initEAttribute(getUnknownComponent_TypeName(), ecorePackage.getEString(), "typeName", null, 1, 1, UnknownComponent.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+
initEClass(layoutEClass, Layout.class, "Layout", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
initEReference(getLayout_LayoutType(), theEnvironmentPackage.getLayoutType(), null, "layoutType", null, 1, 1, Layout.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
@@ -566,9 +580,6 @@ public class UiPackageImpl extends EPackageImpl implements UiPackage { initEClass(referenceAttributeEClass, ReferenceAttribute.class, "ReferenceAttribute", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
initEReference(getReferenceAttribute_Value(), this.getUIComponent(), null, "value", null, 1, 1, ReferenceAttribute.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEClass(unknownComponentEClass, UnknownComponent.class, "UnknownComponent", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEAttribute(getUnknownComponent_TypeName(), ecorePackage.getEString(), "typeName", null, 1, 1, UnknownComponent.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
// Create resource
createResource(eNS_URI);
}
diff --git a/plugins/core/org.eclipse.papyrus.properties.model/src-gen/org/eclipse/papyrus/properties/ui/util/UiAdapterFactory.java b/plugins/core/org.eclipse.papyrus.properties.model/src-gen/org/eclipse/papyrus/properties/ui/util/UiAdapterFactory.java index 4ecfbcaa325..7e0de13e97b 100644 --- a/plugins/core/org.eclipse.papyrus.properties.model/src-gen/org/eclipse/papyrus/properties/ui/util/UiAdapterFactory.java +++ b/plugins/core/org.eclipse.papyrus.properties.model/src-gen/org/eclipse/papyrus/properties/ui/util/UiAdapterFactory.java @@ -96,6 +96,10 @@ public class UiAdapterFactory extends AdapterFactoryImpl { return createCompositeWidgetAdapter();
}
@Override
+ public Adapter caseUnknownComponent(UnknownComponent object) {
+ return createUnknownComponentAdapter();
+ }
+ @Override
public Adapter caseLayout(Layout object) {
return createLayoutAdapter();
}
@@ -112,10 +116,6 @@ public class UiAdapterFactory extends AdapterFactoryImpl { return createReferenceAttributeAdapter();
}
@Override
- public Adapter caseUnknownComponent(UnknownComponent object) {
- return createUnknownComponentAdapter();
- }
- @Override
public Adapter defaultCase(EObject object) {
return createEObjectAdapter();
}
diff --git a/plugins/core/org.eclipse.papyrus.properties.model/src-gen/org/eclipse/papyrus/properties/ui/util/UiSwitch.java b/plugins/core/org.eclipse.papyrus.properties.model/src-gen/org/eclipse/papyrus/properties/ui/util/UiSwitch.java index ac2ba266108..3817898f71b 100644 --- a/plugins/core/org.eclipse.papyrus.properties.model/src-gen/org/eclipse/papyrus/properties/ui/util/UiSwitch.java +++ b/plugins/core/org.eclipse.papyrus.properties.model/src-gen/org/eclipse/papyrus/properties/ui/util/UiSwitch.java @@ -120,6 +120,15 @@ public class UiSwitch<T> extends Switch<T> { if (result == null) result = defaultCase(theEObject);
return result;
}
+ case UiPackage.UNKNOWN_COMPONENT: {
+ UnknownComponent unknownComponent = (UnknownComponent)theEObject;
+ T result = caseUnknownComponent(unknownComponent);
+ if (result == null) result = caseWidget(unknownComponent);
+ if (result == null) result = caseUIComponent(unknownComponent);
+ if (result == null) result = caseElement(unknownComponent);
+ if (result == null) result = defaultCase(theEObject);
+ return result;
+ }
case UiPackage.LAYOUT: {
Layout layout = (Layout)theEObject;
T result = caseLayout(layout);
@@ -151,15 +160,6 @@ public class UiSwitch<T> extends Switch<T> { if (result == null) result = defaultCase(theEObject);
return result;
}
- case UiPackage.UNKNOWN_COMPONENT: {
- UnknownComponent unknownComponent = (UnknownComponent)theEObject;
- T result = caseUnknownComponent(unknownComponent);
- if (result == null) result = caseWidget(unknownComponent);
- if (result == null) result = caseUIComponent(unknownComponent);
- if (result == null) result = caseElement(unknownComponent);
- if (result == null) result = defaultCase(theEObject);
- return result;
- }
default: return defaultCase(theEObject);
}
}
diff --git a/plugins/core/org.eclipse.papyrus.properties/model/Environment.xmi b/plugins/core/org.eclipse.papyrus.properties/model/Environment.xmi index a5facaeb930..54717501441 100644 --- a/plugins/core/org.eclipse.papyrus.properties/model/Environment.xmi +++ b/plugins/core/org.eclipse.papyrus.properties/model/Environment.xmi @@ -4,6 +4,7 @@ <constraintTypes label="EMF Instance Of" constraintClass="org.eclipse.papyrus.properties.constraints.EMFInstanceOfConstraint"/>
<constraintTypes label="True Constraint" constraintClass="org.eclipse.papyrus.properties.constraints.TrueConstraint"/>
<constraintTypes label="EMF Query" constraintClass="org.eclipse.papyrus.properties.constraints.EMFQueryConstraint"/>
+ <constraintTypes label="Java Instance Of" constraintClass="org.eclipse.papyrus.properties.constraints.JavaInstanceOf"/>
<widgetTypes label="Label" widgetClass="Label"/>
<widgetTypes label="Text" widgetClass="Text"/>
<propertyEditorTypes label="StringEditor" widgetClass="StringEditor" namespace="//@namespaces.3"/>
@@ -24,6 +25,7 @@ <propertyEditorTypes label="MultiInteger" widgetClass="MultiInteger" namespace="//@namespaces.3" type="Integer" multiplicity="-1"/>
<propertyEditorTypes label="ViewEditor" widgetClass="ViewEditor" namespace="//@namespaces.3" type="Reference" multiplicity="-1"/>
<propertyEditorTypes label="InvalidWidget" widgetClass="InvalidWidget" namespace="//@namespaces.3"/>
+ <propertyEditorTypes label="FileSelector" widgetClass="StringFileSelector" namespace="//@namespaces.3"/>
<compositeWidgetTypes label="Composite" widgetClass="Composite"/>
<compositeWidgetTypes label="Group" widgetClass="Group"/>
<layoutTypes label="GridLayout" widgetClass="GridLayout"/>
diff --git a/plugins/core/org.eclipse.papyrus.properties/src-gen/org/eclipse/papyrus/properties/root/RootPackage.java b/plugins/core/org.eclipse.papyrus.properties/src-gen/org/eclipse/papyrus/properties/root/RootPackage.java index 92b06e99e5d..5148110b3af 100644 --- a/plugins/core/org.eclipse.papyrus.properties/src-gen/org/eclipse/papyrus/properties/root/RootPackage.java +++ b/plugins/core/org.eclipse.papyrus.properties/src-gen/org/eclipse/papyrus/properties/root/RootPackage.java @@ -35,7 +35,7 @@ public interface RootPackage extends EPackage { *
* @generated
*/
- String eNAME = "root";
+ String eNAME = "root"; //$NON-NLS-1$
/**
* The package namespace URI.
@@ -44,7 +44,7 @@ public interface RootPackage extends EPackage { *
* @generated
*/
- String eNS_URI = "http://www.eclipse.org/papyrus/properties/root";
+ String eNS_URI = "http://www.eclipse.org/papyrus/properties/root"; //$NON-NLS-1$
/**
* The package namespace name.
@@ -53,7 +53,7 @@ public interface RootPackage extends EPackage { *
* @generated
*/
- String eNS_PREFIX = "root";
+ String eNS_PREFIX = "root"; //$NON-NLS-1$
/**
* The singleton instance of the package.
diff --git a/plugins/core/org.eclipse.papyrus.properties/src-gen/org/eclipse/papyrus/properties/root/impl/RootFactoryImpl.java b/plugins/core/org.eclipse.papyrus.properties/src-gen/org/eclipse/papyrus/properties/root/impl/RootFactoryImpl.java index 6ebb5ef7688..0256b9d7430 100644 --- a/plugins/core/org.eclipse.papyrus.properties/src-gen/org/eclipse/papyrus/properties/root/impl/RootFactoryImpl.java +++ b/plugins/core/org.eclipse.papyrus.properties/src-gen/org/eclipse/papyrus/properties/root/impl/RootFactoryImpl.java @@ -34,7 +34,7 @@ public class RootFactoryImpl extends EFactoryImpl implements RootFactory { */
public static RootFactory init() {
try {
- RootFactory theRootFactory = (RootFactory)EPackage.Registry.INSTANCE.getEFactory("http://www.eclipse.org/papyrus/properties/root");
+ RootFactory theRootFactory = (RootFactory)EPackage.Registry.INSTANCE.getEFactory("http://www.eclipse.org/papyrus/properties/root"); //$NON-NLS-1$
if(theRootFactory != null) {
return theRootFactory;
}
@@ -67,7 +67,7 @@ public class RootFactoryImpl extends EFactoryImpl implements RootFactory { case RootPackage.PROPERTIES_ROOT:
return createPropertiesRoot();
default:
- throw new IllegalArgumentException("The class '" + eClass.getName() + "' is not a valid classifier");
+ throw new IllegalArgumentException("The class '" + eClass.getName() + "' is not a valid classifier"); //$NON-NLS-1$ //$NON-NLS-2$
}
}
diff --git a/plugins/core/org.eclipse.papyrus.properties/src-gen/org/eclipse/papyrus/properties/root/impl/RootPackageImpl.java b/plugins/core/org.eclipse.papyrus.properties/src-gen/org/eclipse/papyrus/properties/root/impl/RootPackageImpl.java index 9009192053f..d5c38c2c5a2 100644 --- a/plugins/core/org.eclipse.papyrus.properties/src-gen/org/eclipse/papyrus/properties/root/impl/RootPackageImpl.java +++ b/plugins/core/org.eclipse.papyrus.properties/src-gen/org/eclipse/papyrus/properties/root/impl/RootPackageImpl.java @@ -209,9 +209,9 @@ public class RootPackageImpl extends EPackageImpl implements RootPackage { // Add supertypes to classes
// Initialize classes and features; add operations and parameters
- initEClass(propertiesRootEClass, PropertiesRoot.class, "PropertiesRoot", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEReference(getPropertiesRoot_Environments(), theEnvironmentPackage.getEnvironment(), null, "environments", null, 0, -1, PropertiesRoot.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEReference(getPropertiesRoot_Contexts(), theContextsPackage.getContext(), null, "contexts", null, 0, -1, PropertiesRoot.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEClass(propertiesRootEClass, PropertiesRoot.class, "PropertiesRoot", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); //$NON-NLS-1$
+ initEReference(getPropertiesRoot_Environments(), theEnvironmentPackage.getEnvironment(), null, "environments", null, 0, -1, PropertiesRoot.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); //$NON-NLS-1$
+ initEReference(getPropertiesRoot_Contexts(), theContextsPackage.getContext(), null, "contexts", null, 0, -1, PropertiesRoot.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); //$NON-NLS-1$
// Create resource
createResource(eNS_URI);
diff --git a/plugins/core/org.eclipse.papyrus.properties/src/org/eclipse/papyrus/properties/Activator.java b/plugins/core/org.eclipse.papyrus.properties/src/org/eclipse/papyrus/properties/Activator.java index ae4c5100334..849a4ea2e30 100644 --- a/plugins/core/org.eclipse.papyrus.properties/src/org/eclipse/papyrus/properties/Activator.java +++ b/plugins/core/org.eclipse.papyrus.properties/src/org/eclipse/papyrus/properties/Activator.java @@ -107,7 +107,7 @@ public class Activator extends AbstractUIPlugin { */
public Image getImage(String pluginId, String path) {
final ImageRegistry registry = getImageRegistry();
- String key = pluginId + "/" + path;
+ String key = pluginId + "/" + path; //$NON-NLS-1$
Image image = registry.get(key);
if(image == null) {
registry.put(key, AbstractUIPlugin.imageDescriptorFromPlugin(pluginId, path));
@@ -125,11 +125,11 @@ public class Activator extends AbstractUIPlugin { * The Image at the given location, or null if none was found
*/
public Image getImageFromPlugin(String imagePath) {
- if(imagePath.startsWith("/")) {
+ if(imagePath.startsWith("/")) { //$NON-NLS-1$
String pluginId, path;
imagePath = imagePath.substring(1, imagePath.length());
- pluginId = imagePath.substring(0, imagePath.indexOf("/"));
- path = imagePath.substring(imagePath.indexOf("/"), imagePath.length());
+ pluginId = imagePath.substring(0, imagePath.indexOf("/")); //$NON-NLS-1$
+ path = imagePath.substring(imagePath.indexOf("/"), imagePath.length()); //$NON-NLS-1$
return getImage(pluginId, path);
} else {
return getImage(imagePath);
diff --git a/plugins/core/org.eclipse.papyrus.properties/src/org/eclipse/papyrus/properties/constraints/AbstractConstraint.java b/plugins/core/org.eclipse.papyrus.properties/src/org/eclipse/papyrus/properties/constraints/AbstractConstraint.java index 5e8188fade9..e0742b4afa7 100644 --- a/plugins/core/org.eclipse.papyrus.properties/src/org/eclipse/papyrus/properties/constraints/AbstractConstraint.java +++ b/plugins/core/org.eclipse.papyrus.properties/src/org/eclipse/papyrus/properties/constraints/AbstractConstraint.java @@ -62,9 +62,6 @@ public abstract class AbstractConstraint implements Constraint { }
}
- if(descriptor.getOverriddenConstraints().contains(constraint.getDescriptor()))
- return true;
-
return false;
}
diff --git a/plugins/core/org.eclipse.papyrus.properties/src/org/eclipse/papyrus/properties/constraints/JavaInstanceOf.java b/plugins/core/org.eclipse.papyrus.properties/src/org/eclipse/papyrus/properties/constraints/JavaInstanceOf.java new file mode 100644 index 00000000000..6c2e6c0f88b --- /dev/null +++ b/plugins/core/org.eclipse.papyrus.properties/src/org/eclipse/papyrus/properties/constraints/JavaInstanceOf.java @@ -0,0 +1,47 @@ +/*****************************************************************************
+ * 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.constraints;
+
+import org.eclipse.papyrus.properties.contexts.ConfigProperty;
+import org.eclipse.papyrus.properties.contexts.ConstraintDescriptor;
+import org.eclipse.papyrus.properties.contexts.ValueProperty;
+import org.eclipse.papyrus.properties.util.ClassLoader;
+
+public class JavaInstanceOf extends AbstractConstraint {
+
+ private Class<?> clazz;
+
+ @Override
+ public void setConstraintDescriptor(ConstraintDescriptor descriptor) {
+ super.setConstraintDescriptor(descriptor);
+ ClassLoader loader = new ClassLoader();
+ for(ConfigProperty property : descriptor.getProperties()) {
+ if(property.getName().equals("class") && property instanceof ValueProperty) { //$NON-NLS-1$
+ clazz = loader.loadClass(((ValueProperty)property).getValue());
+ }
+ }
+ }
+
+ public boolean match(Object selection) {
+ if(clazz == null) {
+ return false;
+ }
+
+ return clazz.isInstance(selection);
+ }
+
+ @Override
+ protected boolean equivalent(Constraint constraint) {
+ return false; //TODO
+ }
+
+}
diff --git a/plugins/core/org.eclipse.papyrus.properties/src/org/eclipse/papyrus/properties/creation/EcorePropertyEditorFactory.java b/plugins/core/org.eclipse.papyrus.properties/src/org/eclipse/papyrus/properties/creation/EcorePropertyEditorFactory.java index d49dda52b21..755aebb477a 100644 --- a/plugins/core/org.eclipse.papyrus.properties/src/org/eclipse/papyrus/properties/creation/EcorePropertyEditorFactory.java +++ b/plugins/core/org.eclipse.papyrus.properties/src/org/eclipse/papyrus/properties/creation/EcorePropertyEditorFactory.java @@ -12,10 +12,23 @@ package org.eclipse.papyrus.properties.creation;
import java.util.Collection;
+import java.util.List;
import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.EPackage;
import org.eclipse.papyrus.properties.Activator;
+import org.eclipse.papyrus.properties.messages.Messages;
+import org.eclipse.papyrus.properties.util.EMFHelper;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.MenuEvent;
+import org.eclipse.swt.events.MenuListener;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Menu;
+import org.eclipse.swt.widgets.MenuItem;
/**
@@ -29,12 +42,20 @@ import org.eclipse.papyrus.properties.Activator; */
public class EcorePropertyEditorFactory extends PropertyEditorFactory {
+ private EClass type;
+
private EClass eClass;
private String nsUri;
private String className;
+ private boolean menuVisible = false;
+
+ public EcorePropertyEditorFactory(EClass type) {
+ this.type = type;
+ }
+
/**
*
* Constructor.
@@ -44,18 +65,19 @@ public class EcorePropertyEditorFactory extends PropertyEditorFactory { }
- /**
+ /*
* Creates a new EcorePropertyEditorFactory. The given EClass is used to instantiate
* a new EObject when the {@link #createObject} method is called.
* Constructor.
*
* @param eClass
+ *
+ * public EcorePropertyEditorFactory(EClass eClass) {
+ * this.eClass = eClass;
+ * this.nsUri = eClass.getEPackage().getNsURI();
+ * this.className = eClass.getName();
+ * }
*/
- public EcorePropertyEditorFactory(EClass eClass) {
- this.eClass = eClass;
- this.nsUri = eClass.getEPackage().getNsURI();
- this.className = eClass.getName();
- }
/**
* @return the nsUri of the EClass used by this factory to instantiate new EObjects
@@ -114,8 +136,76 @@ public class EcorePropertyEditorFactory extends PropertyEditorFactory { }
@Override
- public Object createObject() {
- return eClass.getEPackage().getEFactoryInstance().create(eClass);
+ public Object createObject(Control widget) {
+ EClass eClass = chooseEClass(widget);
+ if(eClass == null) {
+ return null;
+ }
+
+ EObject instance = eClass.getEPackage().getEFactoryInstance().create(eClass);
+ return super.createObject(widget, instance);
+ }
+
+ private EClass chooseEClass(Control widget) {
+ if(eClass != null) {
+ return eClass;
+ }
+
+ List<EClass> availableClasses = EMFHelper.getSubclassesOf(type, true);
+
+ System.out.println(availableClasses);
+
+ final Menu menu = new Menu(widget);
+ for(EClass eClass : availableClasses) {
+ final MenuItem item = new MenuItem(menu, SWT.NONE);
+ item.setText(eClass.getName());
+ item.setData("eClass", eClass); //$NON-NLS-1$
+ item.addSelectionListener(new SelectionListener() {
+
+ public void widgetSelected(SelectionEvent e) {
+ EcorePropertyEditorFactory.this.eClass = (EClass)item.getData("eClass"); //$NON-NLS-1$
+ }
+
+ public void widgetDefaultSelected(SelectionEvent e) {
+ // Nothing
+ }
+
+ });
+ }
+
+ menu.addMenuListener(new MenuListener() {
+
+ public void menuHidden(MenuEvent e) {
+ menuVisible = false;
+ }
+
+ public void menuShown(MenuEvent e) {
+ //Nothing
+ }
+
+ });
+
+ menu.setVisible(true);
+ menuVisible = true;
+
+ //The menu is blocking the thread
+ Display display = widget.getDisplay();
+ while(menu.isVisible()) {
+ try {
+ if(!display.readAndDispatch()) {
+ display.sleep();
+ }
+ } catch (Throwable ex) {
+ Activator.log.error(ex);
+ }
+ }
+ if(!display.isDisposed())
+ display.update();
+
+ EClass eClass = this.eClass;
+ this.eClass = null;
+
+ return eClass;
}
@Override
@@ -125,6 +215,6 @@ public class EcorePropertyEditorFactory extends PropertyEditorFactory { @Override
public String getCreationDialogTitle() {
- return "Create a new " + className;
+ return Messages.EcorePropertyEditorFactory_CreateANew + className;
}
}
diff --git a/plugins/core/org.eclipse.papyrus.properties/src/org/eclipse/papyrus/properties/creation/EditionDialog.java b/plugins/core/org.eclipse.papyrus.properties/src/org/eclipse/papyrus/properties/creation/EditionDialog.java index 70e6be32a95..4ec2e3d03c4 100644 --- a/plugins/core/org.eclipse.papyrus.properties/src/org/eclipse/papyrus/properties/creation/EditionDialog.java +++ b/plugins/core/org.eclipse.papyrus.properties/src/org/eclipse/papyrus/properties/creation/EditionDialog.java @@ -20,6 +20,7 @@ import org.eclipse.jface.viewers.StructuredSelection; import org.eclipse.papyrus.properties.Activator;
import org.eclipse.papyrus.properties.contexts.Section;
import org.eclipse.papyrus.properties.contexts.View;
+import org.eclipse.papyrus.properties.messages.Messages;
import org.eclipse.papyrus.properties.runtime.DefaultDisplayEngine;
import org.eclipse.papyrus.properties.runtime.DisplayEngine;
import org.eclipse.papyrus.properties.xwt.XWTSection;
@@ -59,9 +60,9 @@ public class EditionDialog extends SelectionDialog { @Override
public void create() {
- setTitle("Create a new Element");
+ setTitle(Messages.EditionDialog_CreateANewElement);
super.create();
- getShell().setImage(Activator.getDefault().getImage("org.eclipse.papyrus.widgets", "/icons/papyrus.png")); //$NON-NLS-1$
+ getShell().setImage(Activator.getDefault().getImage("org.eclipse.papyrus.widgets", "/icons/papyrus.png")); //$NON-NLS-1$ //$NON-NLS-2$
getShell().addDisposeListener(new DisposeListener() {
public void widgetDisposed(DisposeEvent e) {
@@ -109,11 +110,6 @@ public class EditionDialog extends SelectionDialog { getShell().setSize(600, 400);
for(View view : views) {
-
- // if(getShell().getText() == null || getShell().getText().equals("")) {
- // getShell().setText(view.getName());
- // }
-
for(Section section : view.getSections()) {
XWTSection xwtSection = new XWTSection(section, view, display);
sections.add(xwtSection);
diff --git a/plugins/core/org.eclipse.papyrus.properties/src/org/eclipse/papyrus/properties/creation/PropertyEditorFactory.java b/plugins/core/org.eclipse.papyrus.properties/src/org/eclipse/papyrus/properties/creation/PropertyEditorFactory.java index d89730ffc14..a583aeee874 100644 --- a/plugins/core/org.eclipse.papyrus.properties/src/org/eclipse/papyrus/properties/creation/PropertyEditorFactory.java +++ b/plugins/core/org.eclipse.papyrus.properties/src/org/eclipse/papyrus/properties/creation/PropertyEditorFactory.java @@ -18,6 +18,7 @@ import org.eclipse.jface.viewers.IStructuredSelection; import org.eclipse.jface.viewers.StructuredSelection;
import org.eclipse.jface.window.Window;
import org.eclipse.papyrus.properties.contexts.View;
+import org.eclipse.papyrus.properties.messages.Messages;
import org.eclipse.papyrus.properties.runtime.ConfigurationManager;
import org.eclipse.papyrus.properties.runtime.ConstraintEngine;
import org.eclipse.papyrus.widgets.creation.ReferenceValueFactory;
@@ -46,10 +47,25 @@ public class PropertyEditorFactory implements ReferenceValueFactory { }
/**
- * {@inheritDoc}
+ * Return a null value. Implementors should override when object creation
+ * needs to be supported. Implementors may rely on {@link #createObject(Control, Object)}
+ *
+ * @see org.eclipse.papyrus.widgets.creation.ReferenceValueFactory#createObject(org.eclipse.swt.widgets.Control)
+ * @see #createObject(org.eclipse.swt.widgets.Control, Object)
+ *
+ * @param widget
+ * The widget from which this method is called. May be used to retrieve the current shell
+ * @return
+ * The newly created object
*/
public Object createObject(Control widget) {
- Object source = createObject();
+ return null;
+ }
+
+ /**
+ * Facility
+ */
+ protected Object createObject(Control widget, Object source) {
if(source == null)
return null;
@@ -97,7 +113,7 @@ public class PropertyEditorFactory implements ReferenceValueFactory { * @param source
* The object to edit
*/
- public void edit(Control widget, Object source) {
+ public Object edit(Control widget, Object source) {
IStructuredSelection selection = new StructuredSelection(source);
ConstraintEngine constraintEngine = ConfigurationManager.instance.constraintEngine;
@@ -110,24 +126,14 @@ public class PropertyEditorFactory implements ReferenceValueFactory { dialog.open();
}
- }
- /**
- * Creates a new empty instance. The instance will then be edited through
- * the matching property view, if any.
- * Subclasses should override this method if canCreateObject returns true
- *
- * @return
- * The newly created object
- */
- protected Object createObject() {
- return null;
+ return source;
}
/**
* The standard Property Editor Factory cannot instantiate new objects.
* However, subclasses may override this method to return true if they
- * implement {@link #createObject()}
+ * implement {@link #createObject(Control)}
*
* @see org.eclipse.papyrus.widgets.creation.ReferenceValueFactory#canCreateObject()
*
@@ -146,6 +152,6 @@ public class PropertyEditorFactory implements ReferenceValueFactory { * @see #createObject()
*/
public String getCreationDialogTitle() {
- return "Create a new element";
+ return Messages.PropertyEditorFactory_CreateANewElement;
}
}
diff --git a/plugins/core/org.eclipse.papyrus.properties/src/org/eclipse/papyrus/properties/databinding/EMFObservableList.java b/plugins/core/org.eclipse.papyrus.properties/src/org/eclipse/papyrus/properties/databinding/EMFObservableList.java index b5ee83788e8..e9af039ee91 100644 --- a/plugins/core/org.eclipse.papyrus.properties/src/org/eclipse/papyrus/properties/databinding/EMFObservableList.java +++ b/plugins/core/org.eclipse.papyrus.properties/src/org/eclipse/papyrus/properties/databinding/EMFObservableList.java @@ -15,7 +15,6 @@ import java.util.Collection; import java.util.LinkedList;
import java.util.List;
-import org.eclipse.core.databinding.observable.list.ListDiff;
import org.eclipse.core.databinding.observable.list.ObservableList;
import org.eclipse.emf.common.command.Command;
import org.eclipse.emf.common.command.CompoundCommand;
@@ -40,7 +39,7 @@ import org.eclipse.papyrus.widgets.editors.ICommitListener; public class EMFObservableList extends ObservableList implements ICommitListener {
/**
- * The list of commands that haven't been executed
+ * The list of commands that haven't been executed yet
*/
protected List<Command> commands = new LinkedList<Command>();
@@ -94,6 +93,10 @@ public class EMFObservableList extends ObservableList implements ICommitListener */
public void commit(AbstractEditor editor) {
+ if(commands.isEmpty()) {
+ return;
+ }
+
CompoundCommand compoundCommand = new CompoundCommand() {
@Override
@@ -142,11 +145,6 @@ public class EMFObservableList extends ObservableList implements ICommitListener commands.clear();
}
- @Override
- protected void fireListChange(ListDiff diff) {
- super.fireListChange(diff);
- }
-
/**
* Refresh the cached list by copying the real list
*/
@@ -158,7 +156,7 @@ public class EMFObservableList extends ObservableList implements ICommitListener @Override
public void add(int index, Object value) {
- Command command = AddCommand.create(editingDomain, source, feature, value, index);
+ Command command = getAddCommand(index, value);
commands.add(command);
wrappedList.add(index, value);
@@ -167,7 +165,7 @@ public class EMFObservableList extends ObservableList implements ICommitListener @Override
public void clear() {
- Command command = RemoveCommand.create(editingDomain, source, feature, new LinkedList<Object>(wrappedList));
+ Command command = getClearCommand();
commands.add(command);
wrappedList.clear();
@@ -176,7 +174,7 @@ public class EMFObservableList extends ObservableList implements ICommitListener @Override
public boolean add(Object o) {
- Command command = AddCommand.create(editingDomain, source, feature, o);
+ Command command = getAddCommand(o);
commands.add(command);
boolean result = wrappedList.add(o);
@@ -186,7 +184,7 @@ public class EMFObservableList extends ObservableList implements ICommitListener @Override
public boolean remove(Object o) {
- Command command = RemoveCommand.create(editingDomain, source, feature, o);
+ Command command = getRemoveCommand(o);
commands.add(command);
@@ -197,7 +195,7 @@ public class EMFObservableList extends ObservableList implements ICommitListener @Override
public boolean addAll(Collection c) {
- Command command = AddCommand.create(editingDomain, source, feature, c);
+ Command command = getAddAllCommand(c);
commands.add(command);
boolean result = wrappedList.addAll(c);
@@ -207,7 +205,7 @@ public class EMFObservableList extends ObservableList implements ICommitListener @Override
public boolean addAll(int index, Collection c) {
- Command command = AddCommand.create(editingDomain, source, feature, c, index);
+ Command command = getAddAllCommand(index, c);
commands.add(command);
boolean result = wrappedList.addAll(index, c);
@@ -217,7 +215,7 @@ public class EMFObservableList extends ObservableList implements ICommitListener @Override
public boolean removeAll(Collection c) {
- Command command = RemoveCommand.create(editingDomain, source, feature, c);
+ Command command = getRemoveCommand(c);
commands.add(command);
boolean result = wrappedList.removeAll(c);
@@ -227,17 +225,8 @@ public class EMFObservableList extends ObservableList implements ICommitListener @Override
public boolean retainAll(Collection c) {
- List<Object> objectsToRemove = new LinkedList<Object>();
- for(Object object : c) {
- if(!contains(object)) {
- objectsToRemove.add(object);
- }
- }
- if(!objectsToRemove.isEmpty()) {
- Command command = RemoveCommand.create(editingDomain, source, feature, objectsToRemove);
- commands.add(command);
-
- }
+ Command command = getRetainAllCommand(c);
+ commands.add(command);
boolean result = wrappedList.retainAll(c);
fireListChange(null);
@@ -246,7 +235,7 @@ public class EMFObservableList extends ObservableList implements ICommitListener @Override
public Object set(int index, Object element) {
- Command command = SetCommand.create(editingDomain, source, feature, element, index);
+ Command command = getSetCommand(index, element);
commands.add(command);
Object result = wrappedList.set(index, element);
@@ -256,18 +245,13 @@ public class EMFObservableList extends ObservableList implements ICommitListener @Override
public Object move(int oldIndex, int newIndex) {
- Object value = get(oldIndex);
- if(value != null) {
- Command remove = RemoveCommand.create(editingDomain, source, feature, value);
- Command add = AddCommand.create(editingDomain, source, feature, value, newIndex);
- commands.add(remove);
- commands.add(add);
+ commands.addAll(getMoveCommands(oldIndex, newIndex));
- wrappedList.remove(oldIndex);
- wrappedList.add(newIndex, value);
+ Object value = get(oldIndex);
+ wrappedList.remove(oldIndex);
+ wrappedList.add(newIndex, value);
- fireListChange(null);
- }
+ fireListChange(null);
return value;
}
@@ -276,7 +260,7 @@ public class EMFObservableList extends ObservableList implements ICommitListener public Object remove(int index) {
Object value = get(index);
if(value != null) {
- Command command = RemoveCommand.create(editingDomain, source, feature, value);
+ Command command = getRemoveCommand(index);
commands.add(command);
}
@@ -285,4 +269,63 @@ public class EMFObservableList extends ObservableList implements ICommitListener return result;
}
+ protected Command getAddCommand(int index, Object value) {
+ return AddCommand.create(editingDomain, source, feature, value, index);
+ }
+
+ protected Command getAddCommand(Object value) {
+ return AddCommand.create(editingDomain, source, feature, value);
+ }
+
+ protected Command getAddAllCommand(Collection<?> values) {
+ return AddCommand.create(editingDomain, source, feature, values);
+ }
+
+ protected Command getAddAllCommand(int index, Collection<?> values) {
+ return AddCommand.create(editingDomain, source, feature, values, index);
+ }
+
+ protected Command getClearCommand() {
+ return getRemoveAllCommand(new LinkedList<Object>(wrappedList));
+ }
+
+ protected Command getRemoveCommand(int index) {
+ Object value = get(index);
+ return getRemoveCommand(value);
+ }
+
+ protected Command getRemoveCommand(Object value) {
+ return RemoveCommand.create(editingDomain, source, feature, value);
+ }
+
+ protected Command getRemoveAllCommand(Collection<?> values) {
+ return RemoveCommand.create(editingDomain, source, feature, values);
+ }
+
+ protected List<Command> getMoveCommands(int oldIndex, int newIndex) {
+ Object value = get(oldIndex);
+ List<Command> commands = new LinkedList<Command>();
+ commands.add(getRemoveCommand(value));
+ commands.add(getAddCommand(newIndex, value));
+ return commands;
+ }
+
+ protected Command getRetainAllCommand(Collection<?> values) {
+ List<Object> objectsToRemove = new LinkedList<Object>();
+ for(Object object : values) {
+ if(!contains(object)) {
+ objectsToRemove.add(object);
+ }
+ }
+ if(!objectsToRemove.isEmpty()) {
+ return getRemoveAllCommand(objectsToRemove);
+ } else {
+ return null;
+ }
+ }
+
+ protected Command getSetCommand(int index, Object value) {
+ return SetCommand.create(editingDomain, source, feature, value, index);
+ }
+
}
diff --git a/plugins/core/org.eclipse.papyrus.properties/src/org/eclipse/papyrus/properties/databinding/MultipleObservable.java b/plugins/core/org.eclipse.papyrus.properties/src/org/eclipse/papyrus/properties/databinding/MultipleObservable.java new file mode 100644 index 00000000000..e045dc677f9 --- /dev/null +++ b/plugins/core/org.eclipse.papyrus.properties/src/org/eclipse/papyrus/properties/databinding/MultipleObservable.java @@ -0,0 +1,32 @@ +/*****************************************************************************
+ * 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.databinding;
+
+import org.eclipse.core.databinding.observable.IObservable;
+
+/**
+ * An interface for Composite IObservables
+ *
+ * @author Camille Letavernier
+ */
+public interface MultipleObservable extends IObservable {
+
+ /**
+ * Adds an IObservable to this composite Observable
+ *
+ * @param observable
+ * The IObservable to add
+ * @return
+ * true if the observable has been successfully added, false otherwise
+ */
+ public boolean add(IObservable observable);
+}
diff --git a/plugins/core/org.eclipse.papyrus.properties/src/org/eclipse/papyrus/properties/databinding/MultipleObservableList.java b/plugins/core/org.eclipse.papyrus.properties/src/org/eclipse/papyrus/properties/databinding/MultipleObservableList.java new file mode 100644 index 00000000000..70b41640c93 --- /dev/null +++ b/plugins/core/org.eclipse.papyrus.properties/src/org/eclipse/papyrus/properties/databinding/MultipleObservableList.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.databinding;
+
+import java.util.Collection;
+import java.util.LinkedList;
+import java.util.List;
+
+import org.eclipse.core.databinding.observable.IObservable;
+import org.eclipse.core.databinding.observable.list.IObservableList;
+import org.eclipse.core.databinding.observable.list.ObservableList;
+import org.eclipse.papyrus.widgets.editors.AbstractEditor;
+import org.eclipse.papyrus.widgets.editors.ICommitListener;
+
+//TODO : Implement the getters
+//The list may be either the union or the intersection of all sublists
+//Union : allows the "remove" and "removeAll" on a group of lists (Even if one of the sublists doesn't contain the given element)
+//Intersection : Closer to the behavior of the CompositeValue (The current value is displayed only if it is shared by all elements)
+//The Union is probably a better solution
+//Simple solution : bind read operations to the first sub-list
+
+/**
+ * A Composite ObservableList. Modifications are forwarded to each sublist
+ * The read operations are not supported. This list behaves as if it were empty
+ *
+ * @author Camille Letavernier
+ */
+public class MultipleObservableList extends ObservableList implements ICommitListener, MultipleObservable {
+
+ List<IObservableList> observableLists = new LinkedList<IObservableList>();
+
+ public MultipleObservableList() {
+ super(new LinkedList<Object>(), Object.class);
+ }
+
+ @Override
+ public void add(int index, Object element) {
+ for(IObservableList observableList : observableLists) {
+ observableList.add(index, element);
+ }
+ }
+
+ @Override
+ public void clear() {
+ for(IObservableList observableList : observableLists) {
+ observableList.clear();
+ }
+ }
+
+ @Override
+ public boolean contains(Object o) {
+ boolean contains = false;
+
+ for(IObservableList observableList : observableLists) {
+ if(observableList.contains(o)) {
+ contains = true;
+ } else {
+ return false;
+ }
+ }
+
+ return contains;
+ }
+
+ @Override
+ public boolean add(Object o) {
+ for(IObservableList observableList : observableLists) {
+ observableList.add(o);
+ }
+ return true;
+ }
+
+ @Override
+ public boolean remove(Object o) {
+ for(IObservableList observableList : observableLists) {
+ observableList.remove(o);
+ }
+ return true;
+ }
+
+ @Override
+ public boolean containsAll(Collection c) {
+ boolean containsAll = false;
+ for(IObservableList observableList : observableLists) {
+ containsAll = containsAll && observableList.containsAll(c);
+ }
+ return containsAll;
+ }
+
+ @Override
+ public boolean addAll(Collection c) {
+ for(IObservableList observableList : observableLists) {
+ observableList.addAll(c);
+ }
+ return true;
+ }
+
+ @Override
+ public boolean addAll(int index, Collection c) {
+ for(IObservableList observableList : observableLists) {
+ observableList.addAll(index, c);
+ }
+ return true;
+ }
+
+ @Override
+ public boolean removeAll(Collection c) {
+ for(IObservableList observableList : observableLists) {
+ observableList.removeAll(c);
+ }
+ return true;
+ }
+
+ @Override
+ public boolean retainAll(Collection c) {
+ for(IObservableList observableList : observableLists) {
+ observableList.retainAll(c);
+ }
+ return true;
+ }
+
+ @Override
+ public Object set(int index, Object element) {
+ for(IObservableList observableList : observableLists) {
+ observableList.set(index, element);
+ }
+ return null;
+ }
+
+ @Override
+ public Object move(int oldIndex, int newIndex) {
+ for(IObservableList observableList : observableLists) {
+ observableList.move(oldIndex, newIndex);
+ }
+ return null;
+ }
+
+ @Override
+ public Object remove(int index) {
+ for(IObservableList observableList : observableLists) {
+ observableList.remove(index);
+ }
+ return null;
+ }
+
+ public void commit(AbstractEditor editor) {
+ for(IObservableList observableList : observableLists) {
+ if(observableList instanceof ICommitListener) {
+ ((ICommitListener)observableList).commit(editor);
+ }
+ }
+ }
+
+ public boolean add(IObservable observable) {
+ if(observable instanceof IObservableList) {
+ observableLists.add((IObservableList)observable);
+ return true;
+ }
+
+ return false;
+ }
+
+}
diff --git a/plugins/core/org.eclipse.papyrus.properties/src/org/eclipse/papyrus/properties/databinding/MultipleObservableValue.java b/plugins/core/org.eclipse.papyrus.properties/src/org/eclipse/papyrus/properties/databinding/MultipleObservableValue.java index 5638aaf9cd2..0f8b56062ef 100644 --- a/plugins/core/org.eclipse.papyrus.properties/src/org/eclipse/papyrus/properties/databinding/MultipleObservableValue.java +++ b/plugins/core/org.eclipse.papyrus.properties/src/org/eclipse/papyrus/properties/databinding/MultipleObservableValue.java @@ -15,6 +15,7 @@ import java.util.Collection; import java.util.LinkedList;
import java.util.List;
+import org.eclipse.core.databinding.observable.IObservable;
import org.eclipse.core.databinding.observable.value.AbstractObservableValue;
import org.eclipse.core.databinding.observable.value.IObservableValue;
@@ -27,18 +28,7 @@ import org.eclipse.core.databinding.observable.value.IObservableValue; *
* All sub-elements will be edited at the same time, with the same value.
*/
-public class MultipleObservableValue extends AbstractObservableValue {
-
- /**
- *
- * Constructs an instance of MultipleObservableValue with a single sub-element
- *
- * @param observable
- *
- */
- public MultipleObservableValue(IObservableValue observable) {
- observableValues.add(observable);
- }
+public class MultipleObservableValue extends AbstractObservableValue implements MultipleObservable {
/**
*
@@ -135,14 +125,12 @@ public class MultipleObservableValue extends AbstractObservableValue { }
}
- /**
- * Adds an observableValue to the list of sub-elements
- *
- * @param observableValue
- * The observableValue to add
- */
- public void addObservable(IObservableValue observableValue) {
- observableValues.add(observableValue);
+ public boolean add(IObservable observable) {
+ if(observable instanceof MultipleObservableValue) {
+ observableValues.add((IObservableValue)observable);
+ return true;
+ }
+ return false;
}
private List<IObservableValue> observableValues = new LinkedList<IObservableValue>();
diff --git a/plugins/core/org.eclipse.papyrus.properties/src/org/eclipse/papyrus/properties/databinding/PapyrusObservableList.java b/plugins/core/org.eclipse.papyrus.properties/src/org/eclipse/papyrus/properties/databinding/PapyrusObservableList.java deleted file mode 100644 index 08a5c7fafa0..00000000000 --- a/plugins/core/org.eclipse.papyrus.properties/src/org/eclipse/papyrus/properties/databinding/PapyrusObservableList.java +++ /dev/null @@ -1,309 +0,0 @@ -/*****************************************************************************
- * 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.databinding;
-
-import java.util.Collection;
-import java.util.Collections;
-import java.util.LinkedList;
-import java.util.List;
-
-import org.eclipse.core.databinding.observable.Realm;
-import org.eclipse.emf.common.command.Command;
-import org.eclipse.emf.databinding.EObjectObservableList;
-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 ObservableList used to edit collections of EObjects through
- * Papyrus commands
- *
- * @author Camille Letavernier
- *
- */
-@SuppressWarnings({ "unchecked", "rawtypes" })
-public class PapyrusObservableList extends EObjectObservableList {
-
- private 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 PapyrusObservableList(EObject eObject, EStructuralFeature eStructuralFeature, EditingDomain domain) {
- super(eObject, eStructuralFeature);
- this.domain = 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 PapyrusObservableList(Realm realm, EObject eObject, EStructuralFeature eStructuralFeature, EditingDomain domain) {
- super(realm, eObject, eStructuralFeature);
- this.domain = domain;
- }
-
- @Override
- public void add(int index, Object value) {
- try {
- IElementEditService provider = ElementEditServiceUtils.getCommandProvider(getObserved());
- if(provider != null) {
- List<Object> values = new LinkedList<Object>(this);
- values.add(index, value);
- SetRequest request = new SetRequest(eObject, eStructuralFeature, values);
- ICommand createGMFCommand = provider.getEditCommand(request);
-
- Command emfCommand = new GMFtoEMFCommandWrapper(createGMFCommand);
-
- domain.getCommandStack().execute(emfCommand);
- }
- } catch (Exception ex) {
- Activator.log.error(ex);
- }
- }
-
- @Override
- public void clear() {
- try {
- IElementEditService provider = ElementEditServiceUtils.getCommandProvider(getObserved());
- if(provider != null) {
- SetRequest request = new SetRequest(eObject, eStructuralFeature, Collections.EMPTY_LIST);
- ICommand createGMFCommand = provider.getEditCommand(request);
-
- Command emfCommand = new GMFtoEMFCommandWrapper(createGMFCommand);
-
- domain.getCommandStack().execute(emfCommand);
- }
- } catch (Exception ex) {
- Activator.log.error(ex);
- }
- }
-
- @Override
- public boolean add(Object o) {
- boolean result = false;
- try {
- IElementEditService provider = ElementEditServiceUtils.getCommandProvider(getObserved());
- if(provider != null) {
- List<Object> values = new LinkedList<Object>(this);
- result = values.add(o);
- SetRequest request = new SetRequest(eObject, eStructuralFeature, values);
- ICommand createGMFCommand = provider.getEditCommand(request);
-
- Command emfCommand = new GMFtoEMFCommandWrapper(createGMFCommand);
-
- domain.getCommandStack().execute(emfCommand);
- }
- } catch (Exception ex) {
- Activator.log.error(ex);
- }
- return result;
- }
-
- @Override
- public boolean remove(Object o) {
- boolean result = false;
- try {
- IElementEditService provider = ElementEditServiceUtils.getCommandProvider(getObserved());
- if(provider != null) {
- List<Object> values = new LinkedList<Object>(this);
- result = values.remove(o);
- SetRequest request = new SetRequest(eObject, eStructuralFeature, values);
- ICommand createGMFCommand = provider.getEditCommand(request);
-
- Command emfCommand = new GMFtoEMFCommandWrapper(createGMFCommand);
-
- domain.getCommandStack().execute(emfCommand);
- }
- } catch (Exception ex) {
- Activator.log.error(ex);
- }
- return result;
- }
-
- @Override
- public boolean addAll(Collection c) {
- boolean result = false;
- try {
- IElementEditService provider = ElementEditServiceUtils.getCommandProvider(getObserved());
- if(provider != null) {
- List<Object> values = new LinkedList<Object>(this);
- result = values.addAll(c);
-
- SetRequest request = new SetRequest(eObject, eStructuralFeature, values);
- ICommand createGMFCommand = provider.getEditCommand(request);
-
- Command emfCommand = new GMFtoEMFCommandWrapper(createGMFCommand);
-
- domain.getCommandStack().execute(emfCommand);
- }
- } catch (Exception ex) {
- Activator.log.error(ex);
- }
- return result;
- }
-
- @Override
- public boolean addAll(int index, Collection c) {
- boolean result = false;
- try {
- IElementEditService provider = ElementEditServiceUtils.getCommandProvider(getObserved());
- if(provider != null) {
- List<Object> values = new LinkedList<Object>(this);
- result = values.addAll(index, c);
- SetRequest request = new SetRequest(eObject, eStructuralFeature, values);
- ICommand createGMFCommand = provider.getEditCommand(request);
-
- Command emfCommand = new GMFtoEMFCommandWrapper(createGMFCommand);
-
- domain.getCommandStack().execute(emfCommand);
- }
- } catch (Exception ex) {
- Activator.log.error(ex);
- }
- return result;
- }
-
- @Override
- public boolean removeAll(Collection c) {
- boolean result = false;
- try {
- IElementEditService provider = ElementEditServiceUtils.getCommandProvider(getObserved());
- if(provider != null) {
- List<Object> values = new LinkedList<Object>(this);
- result = values.removeAll(c);
- SetRequest request = new SetRequest(eObject, eStructuralFeature, values);
- ICommand createGMFCommand = provider.getEditCommand(request);
-
- Command emfCommand = new GMFtoEMFCommandWrapper(createGMFCommand);
-
- domain.getCommandStack().execute(emfCommand);
- }
- } catch (Exception ex) {
- Activator.log.error(ex);
- }
- return result;
- }
-
- @Override
- public boolean retainAll(Collection c) {
- List<Object> objectsToRemove = new LinkedList<Object>();
- for(Object object : c) {
- if(!contains(object)) {
- objectsToRemove.add(object);
- }
- }
-
- boolean result = false;
- try {
- IElementEditService provider = ElementEditServiceUtils.getCommandProvider(getObserved());
- if(provider != null) {
- List<Object> values = new LinkedList<Object>(this);
- result = values.removeAll(objectsToRemove);
- SetRequest request = new SetRequest(eObject, eStructuralFeature, values);
- ICommand createGMFCommand = provider.getEditCommand(request);
-
- Command emfCommand = new GMFtoEMFCommandWrapper(createGMFCommand);
-
- domain.getCommandStack().execute(emfCommand);
- }
- } catch (Exception ex) {
- Activator.log.error(ex);
- }
- return result;
- }
-
- @Override
- public Object set(int index, Object element) {
- Object result = null;
- try {
- IElementEditService provider = ElementEditServiceUtils.getCommandProvider(getObserved());
- if(provider != null) {
- List<Object> values = new LinkedList<Object>(this);
- result = values.set(index, element);
- SetRequest request = new SetRequest(eObject, eStructuralFeature, values);
- ICommand createGMFCommand = provider.getEditCommand(request);
-
- Command emfCommand = new GMFtoEMFCommandWrapper(createGMFCommand);
-
- domain.getCommandStack().execute(emfCommand);
- }
- } catch (Exception ex) {
- Activator.log.error(ex);
- }
- return result;
- }
-
- @Override
- public Object move(int oldIndex, int newIndex) {
- Object result = null;
- try {
- IElementEditService provider = ElementEditServiceUtils.getCommandProvider(getObserved());
- if(provider != null) {
- List<Object> values = new LinkedList<Object>(this);
- result = values.remove(oldIndex);
- values.add(newIndex, result);
- SetRequest request = new SetRequest(eObject, eStructuralFeature, values);
- ICommand createGMFCommand = provider.getEditCommand(request);
-
- Command emfCommand = new GMFtoEMFCommandWrapper(createGMFCommand);
-
- domain.getCommandStack().execute(emfCommand);
- }
- } catch (Exception ex) {
- Activator.log.error(ex);
- }
- return result;
- }
-
- @Override
- public Object remove(int index) {
- Object result = null;
- try {
- IElementEditService provider = ElementEditServiceUtils.getCommandProvider(getObserved());
- if(provider != null) {
- List<Object> values = new LinkedList<Object>(this);
- result = values.remove(index);
- SetRequest request = new SetRequest(eObject, eStructuralFeature, values);
- ICommand createGMFCommand = provider.getEditCommand(request);
-
- Command emfCommand = new GMFtoEMFCommandWrapper(createGMFCommand);
-
- domain.getCommandStack().execute(emfCommand);
- }
- } catch (Exception ex) {
- Activator.log.error(ex);
- }
- return result;
- }
-}
diff --git a/plugins/core/org.eclipse.papyrus.properties/src/org/eclipse/papyrus/properties/messages/Messages.java b/plugins/core/org.eclipse.papyrus.properties/src/org/eclipse/papyrus/properties/messages/Messages.java index cd0991a1898..e2156f041e6 100644 --- a/plugins/core/org.eclipse.papyrus.properties/src/org/eclipse/papyrus/properties/messages/Messages.java +++ b/plugins/core/org.eclipse.papyrus.properties/src/org/eclipse/papyrus/properties/messages/Messages.java @@ -17,11 +17,17 @@ public class Messages extends NLS { private static final String BUNDLE_NAME = "org.eclipse.papyrus.properties.messages.messages"; //$NON-NLS-1$
+ public static String EcorePropertyEditorFactory_CreateANew;
+
+ public static String EditionDialog_CreateANewElement;
+
public static String Preferences_Contexts;
public static String Preferences_Custom;
public static String Preferences_Plugin;
+
+ public static String PropertyEditorFactory_CreateANewElement;
static {
// initialize resource bundle
NLS.initializeMessages(BUNDLE_NAME, Messages.class);
diff --git a/plugins/core/org.eclipse.papyrus.properties/src/org/eclipse/papyrus/properties/messages/messages.properties b/plugins/core/org.eclipse.papyrus.properties/src/org/eclipse/papyrus/properties/messages/messages.properties index 31132838baf..2cbbfb20f7e 100644 --- a/plugins/core/org.eclipse.papyrus.properties/src/org/eclipse/papyrus/properties/messages/messages.properties +++ b/plugins/core/org.eclipse.papyrus.properties/src/org/eclipse/papyrus/properties/messages/messages.properties @@ -1,3 +1,6 @@ +EcorePropertyEditorFactory_CreateANew=Create a new
+EditionDialog_CreateANewElement=Create a new Element
Preferences_Contexts=Contexts :
Preferences_Custom=custom
Preferences_Plugin=plugin
+PropertyEditorFactory_CreateANewElement=Create a new element
diff --git a/plugins/core/org.eclipse.papyrus.properties/src/org/eclipse/papyrus/properties/modelelement/AbstractModelElement.java b/plugins/core/org.eclipse.papyrus.properties/src/org/eclipse/papyrus/properties/modelelement/AbstractModelElement.java index 42460c5598f..9c128b088af 100644 --- a/plugins/core/org.eclipse.papyrus.properties/src/org/eclipse/papyrus/properties/modelelement/AbstractModelElement.java +++ b/plugins/core/org.eclipse.papyrus.properties/src/org/eclipse/papyrus/properties/modelelement/AbstractModelElement.java @@ -13,7 +13,9 @@ package org.eclipse.papyrus.properties.modelelement; import org.eclipse.jface.viewers.ILabelProvider;
import org.eclipse.papyrus.properties.contexts.Property;
+import org.eclipse.papyrus.properties.creation.PropertyEditorFactory;
import org.eclipse.papyrus.properties.runtime.ConfigurationManager;
+import org.eclipse.papyrus.widgets.creation.ReferenceValueFactory;
import org.eclipse.papyrus.widgets.providers.EmptyContentProvider;
import org.eclipse.papyrus.widgets.providers.IStaticContentProvider;
@@ -63,4 +65,15 @@ public abstract class AbstractModelElement implements ModelElement { return ConfigurationManager.instance.getProperty(propertyPath, dataSource.getView().getContext());
}
+ /**
+ * @see org.eclipse.papyrus.properties.modelelement.ModelElement#getValueFactory(java.lang.String)
+ *
+ * @param propertyPath
+ * @return a default factory based on the property view configuration to
+ * edit objects, as if they were selected in an editor
+ */
+ public ReferenceValueFactory getValueFactory(String propertyPath) {
+ return new PropertyEditorFactory();
+ }
+
}
diff --git a/plugins/core/org.eclipse.papyrus.properties/src/org/eclipse/papyrus/properties/modelelement/CompositeModelElement.java b/plugins/core/org.eclipse.papyrus.properties/src/org/eclipse/papyrus/properties/modelelement/CompositeModelElement.java index 5a9bebbf5a8..d889468bdde 100644 --- a/plugins/core/org.eclipse.papyrus.properties/src/org/eclipse/papyrus/properties/modelelement/CompositeModelElement.java +++ b/plugins/core/org.eclipse.papyrus.properties/src/org/eclipse/papyrus/properties/modelelement/CompositeModelElement.java @@ -14,8 +14,10 @@ package org.eclipse.papyrus.properties.modelelement; import java.util.LinkedList;
import java.util.List;
+import org.eclipse.core.databinding.observable.IObservable;
import org.eclipse.core.databinding.observable.value.IObservableValue;
import org.eclipse.jface.viewers.ILabelProvider;
+import org.eclipse.papyrus.properties.databinding.MultipleObservable;
import org.eclipse.papyrus.properties.databinding.MultipleObservableValue;
import org.eclipse.papyrus.widgets.providers.EmptyContentProvider;
import org.eclipse.papyrus.widgets.providers.IStaticContentProvider;
@@ -32,12 +34,30 @@ import org.eclipse.papyrus.widgets.providers.IStaticContentProvider; */
public class CompositeModelElement extends AbstractModelElement {
- public IObservableValue getObservable(String propertyPath) {
- MultipleObservableValue observableValue = new MultipleObservableValue();
+ public IObservable getObservable(String propertyPath) {
+
+ MultipleObservable observableComposite = null;
+
for(ModelElement element : elements) {
- observableValue.addObservable((IObservableValue)element.getObservable(propertyPath));
+ IObservable observable = element.getObservable(propertyPath);
+
+ if(observableComposite == null) {
+ if(observable instanceof IObservableValue) {
+ observableComposite = new MultipleObservableValue();
+ } else {
+ return null; //The support for CompositeObservableList is too complicated.
+ //There are too many non-trivial choices (Union or Intersection display,
+ //unadapted behavior of MultipleValueEditors, ...)
+ //observableComposite = new MultipleObservableList();
+ }
+ }
+
+ if(!observableComposite.add(observable)) {
+ return null;
+ }
}
- return observableValue;
+
+ return observableComposite;
}
/**
diff --git a/plugins/core/org.eclipse.papyrus.properties/src/org/eclipse/papyrus/properties/modelelement/DataSource.java b/plugins/core/org.eclipse.papyrus.properties/src/org/eclipse/papyrus/properties/modelelement/DataSource.java index 327d4cbedec..34b75fc4347 100644 --- a/plugins/core/org.eclipse.papyrus.properties/src/org/eclipse/papyrus/properties/modelelement/DataSource.java +++ b/plugins/core/org.eclipse.papyrus.properties/src/org/eclipse/papyrus/properties/modelelement/DataSource.java @@ -25,6 +25,7 @@ import org.eclipse.jface.viewers.ILabelProvider; import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.papyrus.properties.Activator;
import org.eclipse.papyrus.properties.contexts.View;
+import org.eclipse.papyrus.widgets.creation.ReferenceValueFactory;
import org.eclipse.papyrus.widgets.providers.EmptyContentProvider;
import org.eclipse.papyrus.widgets.providers.IStaticContentProvider;
@@ -72,7 +73,7 @@ public class DataSource implements IChangeListener { this.selection = selection;
}
- private ModelElement getModelElement(String propertyPath) {
+ public ModelElement getModelElement(String propertyPath) {
//ConfigurationManager.instance.getProperty(propertyPath)
String key = propertyPath.substring(0, propertyPath.lastIndexOf(":")); //$NON-NLS-1$
ModelElement element = elements.get(key);
@@ -253,4 +254,11 @@ public class DataSource implements IChangeListener { return false;
return element.forceRefresh(getLocalPropertyPath(propertyPath));
}
+
+ public ReferenceValueFactory getValueFactory(String propertyPath) {
+ ModelElement element = getModelElement(propertyPath);
+ if(element == null)
+ return null;
+ return element.getValueFactory(getLocalPropertyPath(propertyPath));
+ }
}
diff --git a/plugins/core/org.eclipse.papyrus.properties/src/org/eclipse/papyrus/properties/modelelement/EMFModelElement.java b/plugins/core/org.eclipse.papyrus.properties/src/org/eclipse/papyrus/properties/modelelement/EMFModelElement.java index df7da8b9916..4ddfcd09dfd 100644 --- a/plugins/core/org.eclipse.papyrus.properties/src/org/eclipse/papyrus/properties/modelelement/EMFModelElement.java +++ b/plugins/core/org.eclipse.papyrus.properties/src/org/eclipse/papyrus/properties/modelelement/EMFModelElement.java @@ -25,11 +25,13 @@ import org.eclipse.emf.ecore.EStructuralFeature; import org.eclipse.emf.edit.domain.EditingDomain;
import org.eclipse.jface.viewers.ILabelProvider;
import org.eclipse.papyrus.properties.Activator;
+import org.eclipse.papyrus.properties.creation.EcorePropertyEditorFactory;
import org.eclipse.papyrus.properties.databinding.EMFObservableList;
import org.eclipse.papyrus.properties.databinding.EMFObservableValue;
import org.eclipse.papyrus.properties.providers.EMFObjectLabelProvider;
import org.eclipse.papyrus.properties.providers.EcoreEnumeratorContentProvider;
import org.eclipse.papyrus.properties.providers.EcoreReferenceContentProvider;
+import org.eclipse.papyrus.widgets.creation.ReferenceValueFactory;
import org.eclipse.papyrus.widgets.providers.EmptyContentProvider;
import org.eclipse.papyrus.widgets.providers.IStaticContentProvider;
@@ -238,4 +240,19 @@ public class EMFModelElement extends AbstractModelElement { return false;
return feature.isDerived();
}
+
+ @Override
+ public ReferenceValueFactory getValueFactory(String propertyPath) {
+ EStructuralFeature feature = getFeature(propertyPath);
+ if(feature != null) {
+ if(feature instanceof EReference) {
+ EReference reference = (EReference)feature;
+ if(reference.isContainment()) {
+ return new EcorePropertyEditorFactory(reference.getEReferenceType());
+ }
+ }
+ }
+
+ return super.getValueFactory(propertyPath);
+ }
}
diff --git a/plugins/core/org.eclipse.papyrus.properties/src/org/eclipse/papyrus/properties/modelelement/ModelElement.java b/plugins/core/org.eclipse.papyrus.properties/src/org/eclipse/papyrus/properties/modelelement/ModelElement.java index 5a45c5cf9c4..cfb6234eb00 100644 --- a/plugins/core/org.eclipse.papyrus.properties/src/org/eclipse/papyrus/properties/modelelement/ModelElement.java +++ b/plugins/core/org.eclipse.papyrus.properties/src/org/eclipse/papyrus/properties/modelelement/ModelElement.java @@ -13,6 +13,7 @@ package org.eclipse.papyrus.properties.modelelement; import org.eclipse.core.databinding.observable.IObservable;
import org.eclipse.jface.viewers.ILabelProvider;
+import org.eclipse.papyrus.widgets.creation.ReferenceValueFactory;
import org.eclipse.papyrus.widgets.providers.EmptyContentProvider;
import org.eclipse.papyrus.widgets.providers.IStaticContentProvider;
@@ -103,7 +104,21 @@ public interface ModelElement { * @param localPropertyPath
* @return
*/
- public boolean forceRefresh(String localPropertyPath);
+ public boolean forceRefresh(String propertyPath);
+ /**
+ * Sets the DataSource associated to this model element
+ *
+ * @param source
+ * The DataSource to associate to this model element
+ */
public void setDataSource(DataSource source);
+
+ /**
+ * @return the default factory used to handle operations such as object
+ * creation or edition, or null if these operations are not supported.
+ * This factory will typically be used by Multiple value editors, to
+ * create or edit a single entry.
+ */
+ public ReferenceValueFactory getValueFactory(String propertyPath);
}
diff --git a/plugins/core/org.eclipse.papyrus.properties/src/org/eclipse/papyrus/properties/preferences/Preferences.java b/plugins/core/org.eclipse.papyrus.properties/src/org/eclipse/papyrus/properties/preferences/Preferences.java index d4aa7febed4..4ba54b910bc 100644 --- a/plugins/core/org.eclipse.papyrus.properties/src/org/eclipse/papyrus/properties/preferences/Preferences.java +++ b/plugins/core/org.eclipse.papyrus.properties/src/org/eclipse/papyrus/properties/preferences/Preferences.java @@ -105,7 +105,7 @@ public class Preferences extends PreferencePage implements IWorkbenchPreferenceP }
private String getLabel(Context context) {
- return context.getName() + " (" + (ConfigurationManager.instance.isPlugin(context) ? Messages.Preferences_Plugin : Messages.Preferences_Custom) + ")"; //$NON-NLS-1$ //$NON-NLS-4$
+ return context.getName() + " (" + (ConfigurationManager.instance.isPlugin(context) ? Messages.Preferences_Plugin : Messages.Preferences_Custom) + ")"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-4$
}
private final ContextState contextState = new ContextState();
diff --git a/plugins/core/org.eclipse.papyrus.properties/src/org/eclipse/papyrus/properties/runtime/ConfigurationManager.java b/plugins/core/org.eclipse.papyrus.properties/src/org/eclipse/papyrus/properties/runtime/ConfigurationManager.java index 1fccebbf64a..5c38237789d 100644 --- a/plugins/core/org.eclipse.papyrus.properties/src/org/eclipse/papyrus/properties/runtime/ConfigurationManager.java +++ b/plugins/core/org.eclipse.papyrus.properties/src/org/eclipse/papyrus/properties/runtime/ConfigurationManager.java @@ -566,8 +566,8 @@ public class ConfigurationManager { }
public Property getProperty(String propertyPath, Context context) {
- String elementName = propertyPath.substring(0, propertyPath.lastIndexOf(":"));
- String propertyName = propertyPath.substring(propertyPath.lastIndexOf(":") + 1, propertyPath.length());
+ String elementName = propertyPath.substring(0, propertyPath.lastIndexOf(":")); //$NON-NLS-1$
+ String propertyName = propertyPath.substring(propertyPath.lastIndexOf(":") + 1, propertyPath.length()); //$NON-NLS-1$
Set<DataContextElement> elements = new HashSet<DataContextElement>();
Collection<Context> allContexts;
diff --git a/plugins/core/org.eclipse.papyrus.properties/src/org/eclipse/papyrus/properties/runtime/DefaultConstraintEngine.java b/plugins/core/org.eclipse.papyrus.properties/src/org/eclipse/papyrus/properties/runtime/DefaultConstraintEngine.java index 74290988069..754d62b9f5f 100644 --- a/plugins/core/org.eclipse.papyrus.properties/src/org/eclipse/papyrus/properties/runtime/DefaultConstraintEngine.java +++ b/plugins/core/org.eclipse.papyrus.properties/src/org/eclipse/papyrus/properties/runtime/DefaultConstraintEngine.java @@ -55,7 +55,7 @@ public class DefaultConstraintEngine implements ConstraintEngine { constraint.setConstraintDescriptor(descriptor);
constraints.add(constraint);
} catch (Exception ex) {
- Activator.log.error(ex);
+ Activator.log.error("Cannot load constraint " + descriptor.getName(), ex); //$NON-NLS-1$
}
}
}
@@ -103,9 +103,9 @@ public class DefaultConstraintEngine implements ConstraintEngine { }
}
- //Activator.log.debug("Filtered Constraints : " + matchedConstraints); //$NON-NLS-1$
+ Activator.log.warn("Filtered Constraints : " + matchedConstraints); //$NON-NLS-1$
resolveConstraintConflicts(matchedConstraints);
- Activator.log.debug("Filtered Constraints : " + matchedConstraints); //$NON-NLS-1$
+ Activator.log.warn("Filtered Constraints : " + matchedConstraints); //$NON-NLS-1$
return matchedConstraints;
}
@@ -117,8 +117,14 @@ public class DefaultConstraintEngine implements ConstraintEngine { if(c == c2)
continue;
- if(c.overrides(c2)) {
+ if(c.getDescriptor().getOverriddenConstraints().contains(c2.getDescriptor())) {
matchedConstraints.remove(c2);
+ continue;
+ }
+
+ if(c2.getDescriptor().isOverrideable() && c.overrides(c2)) {
+ matchedConstraints.remove(c2);
+ continue;
}
}
}
diff --git a/plugins/core/org.eclipse.papyrus.properties/src/org/eclipse/papyrus/properties/runtime/DefaultDisplayEngine.java b/plugins/core/org.eclipse.papyrus.properties/src/org/eclipse/papyrus/properties/runtime/DefaultDisplayEngine.java index cb90073821b..a2d1227823c 100644 --- a/plugins/core/org.eclipse.papyrus.properties/src/org/eclipse/papyrus/properties/runtime/DefaultDisplayEngine.java +++ b/plugins/core/org.eclipse.papyrus.properties/src/org/eclipse/papyrus/properties/runtime/DefaultDisplayEngine.java @@ -183,7 +183,7 @@ public class DefaultDisplayEngine implements DisplayEngine { Context context = (Context)tab.eContainer();
if(context.eResource() == null) {
context = ConfigurationManager.instance.getContext(context.getName());
- Activator.log.warn("No resource for Context : " + context + " ; refreshing the model"); //$NON-NLS-1$
+ Activator.log.warn("No resource for Context : " + context + " ; refreshing the model"); //$NON-NLS-1$ //$NON-NLS-2$
}
URI sectionURI = URI.createURI(section.getSectionFile());
diff --git a/plugins/core/org.eclipse.papyrus.properties/src/org/eclipse/papyrus/properties/runtime/StereotypeModelElement.java b/plugins/core/org.eclipse.papyrus.properties/src/org/eclipse/papyrus/properties/runtime/StereotypeModelElement.java deleted file mode 100644 index c0fe0be2e0c..00000000000 --- a/plugins/core/org.eclipse.papyrus.properties/src/org/eclipse/papyrus/properties/runtime/StereotypeModelElement.java +++ /dev/null @@ -1,39 +0,0 @@ -/*****************************************************************************
- * 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.runtime;
-
-import org.eclipse.core.databinding.observable.IObservable;
-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;
-
-public class StereotypeModelElement extends EMFModelElement {
-
- public StereotypeModelElement(EObject source, EditingDomain domain) {
- super(source, domain);
- }
-
- @Override
- public IObservable getObservable(String propertyPath) {
- FeaturePath featurePath = getFeaturePath(propertyPath);
- EStructuralFeature feature = getFeature(featurePath);
- if(feature.getUpperBound() != 1) {
- return new PapyrusObservableList(getSource(featurePath), feature, domain);
- }
-
- return new PapyrusObservableValue(getSource(featurePath), feature, domain);
- }
-}
diff --git a/plugins/core/org.eclipse.papyrus.properties/src/org/eclipse/papyrus/properties/util/EMFHelper.java b/plugins/core/org.eclipse.papyrus.properties/src/org/eclipse/papyrus/properties/util/EMFHelper.java index ebc651e7e88..9de810f7c68 100644 --- a/plugins/core/org.eclipse.papyrus.properties/src/org/eclipse/papyrus/properties/util/EMFHelper.java +++ b/plugins/core/org.eclipse.papyrus.properties/src/org/eclipse/papyrus/properties/util/EMFHelper.java @@ -12,6 +12,7 @@ package org.eclipse.papyrus.properties.util;
import java.io.IOException;
+import java.util.LinkedList;
import java.util.List;
import org.eclipse.core.runtime.IAdaptable;
@@ -203,5 +204,55 @@ public class EMFHelper { return null;
}
+ /**
+ * Return the root package containing the given package, or the package
+ * itself if it is already the root
+ *
+ * @param ePackage
+ * @return
+ */
+ public static EPackage getRootPackage(EPackage ePackage) {
+ if(ePackage.getESuperPackage() == null) {
+ return ePackage;
+ }
+ return getRootPackage(ePackage.getESuperPackage());
+ }
+
+
+ /**
+ * Return the list of Concrete (ie. non-abstract) that are subtypes
+ * of the given EClass
+ *
+ * @param type
+ * @return
+ */
+ public static List<EClass> getSubclassesOf(EClass type, boolean concreteClassesOnly) {
+ List<EClass> result = new LinkedList<EClass>();
+ if(concreteClassesOnly || !type.isAbstract()) {
+ result.add(type);
+ }
+
+ EPackage ePackage = getRootPackage(type.getEPackage());
+ getSubclassesOf(type, ePackage, result, concreteClassesOnly);
+ return result;
+ }
+
+ private static void getSubclassesOf(EClass type, EPackage fromPackage, List<EClass> result, boolean concreteClassesOnly) {
+ for(EClassifier classifier : fromPackage.getEClassifiers()) {
+ if(classifier instanceof EClass) {
+ EClass eClass = (EClass)classifier;
+ if(eClass.getEAllSuperTypes().contains(type)) {
+ if(concreteClassesOnly || !eClass.isAbstract()) {
+ result.add(eClass);
+ }
+ }
+ }
+ }
+
+ for(EPackage subPackage : fromPackage.getESubpackages()) {
+ getSubclassesOf(type, subPackage, result, concreteClassesOnly);
+ }
+ }
+
}
diff --git a/plugins/core/org.eclipse.papyrus.properties/src/org/eclipse/papyrus/properties/util/Util.java b/plugins/core/org.eclipse.papyrus.properties/src/org/eclipse/papyrus/properties/util/Util.java index f7e620af964..d1325223e08 100644 --- a/plugins/core/org.eclipse.papyrus.properties/src/org/eclipse/papyrus/properties/util/Util.java +++ b/plugins/core/org.eclipse.papyrus.properties/src/org/eclipse/papyrus/properties/util/Util.java @@ -222,14 +222,14 @@ public class Util { return string.trim();
}
- String[] stringChunks = string.split("\n|\r|\r\n|\n\r");
+ String[] stringChunks = string.split("\n|\r|\r\n|\n\r"); //$NON-NLS-1$
List<String> chunks = new LinkedList<String>();
for(String chunk : stringChunks) {
chunk = chunk.trim();
if(chunk.length() > maxCharPerLine) {
- Matcher matcher = Pattern.compile("(.{0," + maxCharPerLine + "}\\b\\p{Punct}?)").matcher(chunk);
+ Matcher matcher = Pattern.compile("(.{0," + maxCharPerLine + "}\\b\\p{Punct}?)").matcher(chunk); //$NON-NLS-1$ //$NON-NLS-2$
while(matcher.find()) {
String group = matcher.group(1);
chunks.add(group);
@@ -239,9 +239,9 @@ public class Util { }
}
- String result = "";
+ String result = ""; //$NON-NLS-1$
for(String chunk : chunks) {
- result += chunk.trim() + "\n";
+ result += chunk.trim() + "\n"; //$NON-NLS-1$
}
return result.trim();
diff --git a/plugins/core/org.eclipse.papyrus.properties/src/org/eclipse/papyrus/properties/widgets/AbstractPropertyEditor.java b/plugins/core/org.eclipse.papyrus.properties/src/org/eclipse/papyrus/properties/widgets/AbstractPropertyEditor.java index 8941d171336..0efc3b45c38 100644 --- a/plugins/core/org.eclipse.papyrus.properties/src/org/eclipse/papyrus/properties/widgets/AbstractPropertyEditor.java +++ b/plugins/core/org.eclipse.papyrus.properties/src/org/eclipse/papyrus/properties/widgets/AbstractPropertyEditor.java @@ -15,6 +15,7 @@ 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.value.IObservableValue;
+import org.eclipse.papyrus.properties.Activator;
import org.eclipse.papyrus.properties.contexts.Context;
import org.eclipse.papyrus.properties.contexts.Property;
import org.eclipse.papyrus.properties.modelelement.DataSource;
@@ -71,6 +72,11 @@ public abstract class AbstractPropertyEditor implements IChangeListener { */
protected IObservableValue observableValue;
+ /**
+ * Indicates if the editor's label should be displayed
+ */
+ protected boolean showLabel = true;
+
public static int descriptionMaxCharPerLine = 200;
/**
@@ -161,15 +167,25 @@ public abstract class AbstractPropertyEditor implements IChangeListener { valueEditor.setModelObservable(inputObservableValue);
}
- AbstractEditor editor = getEditor();
- if(editor != null)
- editor.setReadOnly(isReadOnly);
+ applyReadOnly(isReadOnly);
if(input.forceRefresh(propertyPath)) {
input.addChangeListener(this);
}
}
+ /**
+ * Applies the readOnly state to the editor
+ *
+ * @param readOnly
+ * Indicates if this widget should be read-only
+ */
+ protected void applyReadOnly(boolean readOnly) {
+ AbstractEditor editor = getEditor();
+ if(editor != null)
+ editor.setReadOnly(readOnly);
+ }
+
public void handleChange(ChangeEvent event) {
AbstractEditor editor = getEditor();
if(editor != null) {
@@ -200,10 +216,12 @@ public abstract class AbstractPropertyEditor implements IChangeListener { label += " *"; //$NON-NLS-1$
}
- if(valueEditor != null) {
- valueEditor.setLabel(label);
- } else if(listEditor != null) {
- listEditor.setLabel(label);
+ if(showLabel) {
+ if(valueEditor != null) {
+ valueEditor.setLabel(label);
+ } else if(listEditor != null) {
+ listEditor.setLabel(label);
+ }
}
}
@@ -236,7 +254,7 @@ public abstract class AbstractPropertyEditor implements IChangeListener { */
protected String getLabel() {
Property property = getModelProperty();
- if(property == null || property.getLabel() == null || property.getLabel().trim().equals(""))
+ if(property == null || property.getLabel() == null || property.getLabel().trim().equals("")) //$NON-NLS-1$
return Util.getLabel(getLocalPropertyPath());
return property.getLabel();
@@ -247,12 +265,12 @@ public abstract class AbstractPropertyEditor implements IChangeListener { * The description is the widget's ToolTipText
*/
protected void updateDescription() {
- String description = "";
+ String description = ""; //$NON-NLS-1$
Property property = getModelProperty();
if(property != null)
description = property.getDescription();
- if(description == null || description.trim().equals("")) {
+ if(description == null || description.trim().equals("")) { //$NON-NLS-1$
return;
}
@@ -312,8 +330,13 @@ public abstract class AbstractPropertyEditor implements IChangeListener { * available
*/
protected IObservableList getInputObservableList() {
- if(observableList == null)
- observableList = (IObservableList)input.getObservable(propertyPath);
+ if(observableList == null) {
+ try {
+ observableList = (IObservableList)input.getObservable(propertyPath);
+ } catch (Exception ex) {
+ Activator.log.error("Cannot find a valid IObservable for " + propertyPath, ex); //$NON-NLS-1$
+ }
+ }
return observableList;
}
@@ -323,8 +346,13 @@ public abstract class AbstractPropertyEditor implements IChangeListener { * available
*/
protected IObservableValue getInputObservableValue() {
- if(observableValue == null)
- observableValue = (IObservableValue)input.getObservable(propertyPath);
+ if(observableValue == null) {
+ try {
+ observableValue = (IObservableValue)input.getObservable(propertyPath);
+ } catch (Exception ex) {
+ Activator.log.error("Cannot find a valid IObservable for " + propertyPath, ex); //$NON-NLS-1$
+ }
+ }
return observableValue;
}
@@ -335,4 +363,46 @@ public abstract class AbstractPropertyEditor implements IChangeListener { protected String getLocalPropertyPath() {
return propertyPath.substring(propertyPath.lastIndexOf(":") + 1); //$NON-NLS-1$
}
+
+ /**
+ * Sets the editor's Layout Data
+ *
+ * @param data
+ */
+ public void setLayoutData(Object data) {
+ if(getEditor() != null)
+ getEditor().setLayoutData(data);
+ }
+
+ /**
+ * Returns the editor's Layout Data
+ *
+ * @param data
+ * @return
+ */
+ public Object getLayoutData() {
+ return getEditor() == null ? null : getEditor().getLayoutData();
+ }
+
+ /**
+ * Indicates whether the editor's label should be displayed or not
+ *
+ * @param showLabel
+ */
+ public void setShowLabel(boolean showLabel) {
+ AbstractEditor editor = getEditor();
+ this.showLabel = showLabel;
+ if(editor != null) {
+ editor.setDisplayLabel(showLabel);
+ }
+ }
+
+ /**
+ * Indicates whether the editor's label is displayed or not
+ *
+ * @return
+ */
+ public boolean getShowLabel() {
+ return this.showLabel;
+ }
}
diff --git a/plugins/core/org.eclipse.papyrus.properties/src/org/eclipse/papyrus/properties/widgets/EnumRadio.java b/plugins/core/org.eclipse.papyrus.properties/src/org/eclipse/papyrus/properties/widgets/EnumRadio.java index f387e6b045f..ad3e86c202f 100644 --- a/plugins/core/org.eclipse.papyrus.properties/src/org/eclipse/papyrus/properties/widgets/EnumRadio.java +++ b/plugins/core/org.eclipse.papyrus.properties/src/org/eclipse/papyrus/properties/widgets/EnumRadio.java @@ -55,7 +55,7 @@ public class EnumRadio extends AbstractPropertyEditor { @Override
protected void doBinding() {
- enumRadio.setProviders(input.getContentProvider(propertyPath), null);
+ enumRadio.setProviders(input.getContentProvider(propertyPath), input.getLabelProvider(propertyPath));
super.doBinding();
}
diff --git a/plugins/core/org.eclipse.papyrus.properties/src/org/eclipse/papyrus/properties/widgets/InvalidWidget.java b/plugins/core/org.eclipse.papyrus.properties/src/org/eclipse/papyrus/properties/widgets/InvalidWidget.java index 5de9ec0ef8b..d7c3f968a77 100644 --- a/plugins/core/org.eclipse.papyrus.properties/src/org/eclipse/papyrus/properties/widgets/InvalidWidget.java +++ b/plugins/core/org.eclipse.papyrus.properties/src/org/eclipse/papyrus/properties/widgets/InvalidWidget.java @@ -38,8 +38,8 @@ public class InvalidWidget extends AbstractPropertyEditor { StringLabel editor = new StringLabel(parent, style);
setEditor(editor);
- editor.getValueLabel().setText("Property view Error : invalid widget type");
- editor.getValueLabel().setImage(Activator.getDefault().getImage("icons/error.gif"));
+ editor.getValueLabel().setText("Property view Error : invalid widget type"); //$NON-NLS-1$
+ editor.getValueLabel().setImage(Activator.getDefault().getImage("icons/error.gif")); //$NON-NLS-1$
}
@Override
diff --git a/plugins/core/org.eclipse.papyrus.properties/src/org/eclipse/papyrus/properties/widgets/MultiInteger.java b/plugins/core/org.eclipse.papyrus.properties/src/org/eclipse/papyrus/properties/widgets/MultiInteger.java index dcdfd7d854f..3a271a4985e 100644 --- a/plugins/core/org.eclipse.papyrus.properties/src/org/eclipse/papyrus/properties/widgets/MultiInteger.java +++ b/plugins/core/org.eclipse.papyrus.properties/src/org/eclipse/papyrus/properties/widgets/MultiInteger.java @@ -11,6 +11,7 @@ *****************************************************************************/
package org.eclipse.papyrus.properties.widgets;
+import org.eclipse.papyrus.widgets.editors.ICommitListener;
import org.eclipse.papyrus.widgets.editors.MultipleIntegerEditor;
import org.eclipse.swt.widgets.Composite;
@@ -46,6 +47,10 @@ public class MultiInteger extends AbstractPropertyEditor { editor.setOrdered(input.isOrdered(propertyPath));
editor.setUnique(input.isUnique(propertyPath));
+ if(getInputObservableList() instanceof ICommitListener) {
+ editor.addCommitListener((ICommitListener)getInputObservableList());
+ }
+
super.doBinding();
}
}
diff --git a/plugins/core/org.eclipse.papyrus.properties/src/org/eclipse/papyrus/properties/widgets/MultiReference.java b/plugins/core/org.eclipse.papyrus.properties/src/org/eclipse/papyrus/properties/widgets/MultiReference.java index b26e6169c06..3b206804e24 100644 --- a/plugins/core/org.eclipse.papyrus.properties/src/org/eclipse/papyrus/properties/widgets/MultiReference.java +++ b/plugins/core/org.eclipse.papyrus.properties/src/org/eclipse/papyrus/properties/widgets/MultiReference.java @@ -12,7 +12,6 @@ package org.eclipse.papyrus.properties.widgets;
import org.eclipse.jface.viewers.ILabelProvider;
-import org.eclipse.papyrus.properties.creation.PropertyEditorFactory;
import org.eclipse.papyrus.widgets.creation.ReferenceValueFactory;
import org.eclipse.papyrus.widgets.editors.ICommitListener;
import org.eclipse.papyrus.widgets.editors.MultipleReferenceEditor;
@@ -48,8 +47,6 @@ public class MultiReference extends AbstractPropertyEditor { */
public MultiReference(Composite parent, int style) {
editor = new MultipleReferenceEditor(parent, style);
- factory = new PropertyEditorFactory();
- editor.setFactory(factory);
super.setEditor(editor);
}
@@ -65,6 +62,11 @@ public class MultiReference extends AbstractPropertyEditor { editor.setProviders(contentProvider, labelProvider);
editor.setOrdered(input.isOrdered(propertyPath));
editor.setUnique(input.isUnique(propertyPath));
+ if(factory == null) {
+ editor.setFactory(input.getValueFactory(propertyPath));
+ } else {
+ editor.setFactory(factory);
+ }
super.doBinding();
}
diff --git a/plugins/core/org.eclipse.papyrus.properties/src/org/eclipse/papyrus/properties/widgets/MultiString.java b/plugins/core/org.eclipse.papyrus.properties/src/org/eclipse/papyrus/properties/widgets/MultiString.java index db01d12f452..1e5a96aac50 100644 --- a/plugins/core/org.eclipse.papyrus.properties/src/org/eclipse/papyrus/properties/widgets/MultiString.java +++ b/plugins/core/org.eclipse.papyrus.properties/src/org/eclipse/papyrus/properties/widgets/MultiString.java @@ -11,6 +11,8 @@ *****************************************************************************/
package org.eclipse.papyrus.properties.widgets;
+import org.eclipse.jface.viewers.ListViewer;
+import org.eclipse.papyrus.widgets.editors.ICommitListener;
import org.eclipse.papyrus.widgets.editors.MultipleStringEditor;
import org.eclipse.swt.widgets.Composite;
@@ -46,6 +48,14 @@ public class MultiString extends AbstractPropertyEditor { editor.setOrdered(input.isOrdered(propertyPath));
editor.setUnique(input.isUnique(propertyPath));
+ if(getInputObservableList() instanceof ICommitListener) {
+ editor.addCommitListener((ICommitListener)getInputObservableList());
+ }
+
super.doBinding();
}
+
+ public ListViewer getViewer() {
+ return editor.getViewer();
+ }
}
diff --git a/plugins/core/org.eclipse.papyrus.properties/src/org/eclipse/papyrus/properties/widgets/ReferenceDialog.java b/plugins/core/org.eclipse.papyrus.properties/src/org/eclipse/papyrus/properties/widgets/ReferenceDialog.java index 82574fd6813..b6bcd805bf3 100644 --- a/plugins/core/org.eclipse.papyrus.properties/src/org/eclipse/papyrus/properties/widgets/ReferenceDialog.java +++ b/plugins/core/org.eclipse.papyrus.properties/src/org/eclipse/papyrus/properties/widgets/ReferenceDialog.java @@ -11,6 +11,7 @@ *****************************************************************************/
package org.eclipse.papyrus.properties.widgets;
+import org.eclipse.papyrus.widgets.creation.ReferenceValueFactory;
import org.eclipse.papyrus.widgets.providers.IStaticContentProvider;
import org.eclipse.swt.widgets.Composite;
@@ -29,6 +30,12 @@ public class ReferenceDialog extends AbstractPropertyEditor { protected org.eclipse.papyrus.widgets.editors.ReferenceDialog editor;
/**
+ * The ValueFactory used to create or edit Objects directly from
+ * this editor
+ */
+ protected ReferenceValueFactory factory;
+
+ /**
* Constructor.
*
* @param parent
@@ -46,7 +53,32 @@ public class ReferenceDialog extends AbstractPropertyEditor { IStaticContentProvider provider = input.getContentProvider(propertyPath);
editor.setLabelProvider(input.getLabelProvider(propertyPath));
editor.setContentProvider(provider);
+ if(factory == null) { //Use the default factory from the DataSource
+ editor.setValueFactory(input.getValueFactory(propertyPath));
+ } else { //Use the factory explicitly specified
+ editor.setValueFactory(factory);
+ }
+
super.doBinding();
}
+ /**
+ * Sets the ValueFactory used to create or edit Objects directly from
+ * this editor
+ *
+ * @param factory
+ */
+ public void setFactory(ReferenceValueFactory factory) {
+ this.factory = factory;
+ editor.setValueFactory(factory);
+ }
+
+ /**
+ * @return The ValueFactory used to create or edit Objects directly from
+ * this editor
+ */
+ public ReferenceValueFactory getFactory() {
+ return factory;
+ }
+
}
diff --git a/plugins/core/org.eclipse.papyrus.properties/src/org/eclipse/papyrus/properties/widgets/StringFileSelector.java b/plugins/core/org.eclipse.papyrus.properties/src/org/eclipse/papyrus/properties/widgets/StringFileSelector.java new file mode 100644 index 00000000000..5bdf5dfa422 --- /dev/null +++ b/plugins/core/org.eclipse.papyrus.properties/src/org/eclipse/papyrus/properties/widgets/StringFileSelector.java @@ -0,0 +1,63 @@ +/*****************************************************************************
+ * 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.widgets;
+
+import org.eclipse.swt.widgets.Composite;
+
+
+public class StringFileSelector extends AbstractPropertyEditor {
+
+ protected org.eclipse.papyrus.widgets.editors.StringFileSelector selector;
+
+ protected String[] filterExtensions, filterNames;
+
+ protected boolean allowWorkspace = true, allowFileSystem = true;
+
+ public StringFileSelector(Composite parent, int style) {
+ selector = new org.eclipse.papyrus.widgets.editors.StringFileSelector(parent, style);
+ super.setEditor(selector);
+ }
+
+ public void setFilterExtensions(String[] filterExtensions) {
+ this.filterExtensions = filterExtensions;
+ checkFilters();
+ }
+
+ public void setFilterNames(String[] filterNames) {
+ this.filterNames = filterNames;
+ checkFilters();
+ }
+
+ protected void checkFilters() {
+ if(filterExtensions != null && filterNames != null) {
+
+ }
+ }
+
+ public void setAllowWorkspace(boolean allowWorkspace) {
+ this.allowWorkspace = allowWorkspace;
+ selector.setAllowWorkspace(allowWorkspace);
+ }
+
+ public boolean getAllowWorkspace() {
+ return allowWorkspace;
+ }
+
+ public void setAllowFileSystem(boolean allowFileSystem) {
+ this.allowFileSystem = allowFileSystem;
+ selector.setAllowFileSystem(allowFileSystem);
+ }
+
+ public boolean getAllowFileSystem() {
+ return allowFileSystem;
+ }
+}
diff --git a/plugins/core/org.eclipse.papyrus.properties/src/org/eclipse/papyrus/properties/xwt/XWTTabDescriptor.java b/plugins/core/org.eclipse.papyrus.properties/src/org/eclipse/papyrus/properties/xwt/XWTTabDescriptor.java index 02eccbda9bb..9a29612ac3e 100644 --- a/plugins/core/org.eclipse.papyrus.properties/src/org/eclipse/papyrus/properties/xwt/XWTTabDescriptor.java +++ b/plugins/core/org.eclipse.papyrus.properties/src/org/eclipse/papyrus/properties/xwt/XWTTabDescriptor.java @@ -56,7 +56,7 @@ public class XWTTabDescriptor extends AbstractTabDescriptor { public String getCategory() {
String category = tab.getCategory();
- return category == null ? "" : category;
+ return category == null ? "" : category; //$NON-NLS-1$
}
public String getId() {
diff --git a/plugins/core/org.eclipse.papyrus.widgets/META-INF/MANIFEST.MF b/plugins/core/org.eclipse.papyrus.widgets/META-INF/MANIFEST.MF index ddc5c4ec18b..7d901254c96 100644 --- a/plugins/core/org.eclipse.papyrus.widgets/META-INF/MANIFEST.MF +++ b/plugins/core/org.eclipse.papyrus.widgets/META-INF/MANIFEST.MF @@ -11,12 +11,15 @@ Require-Bundle: org.eclipse.ui, org.eclipse.core.databinding, org.eclipse.jface.databinding, org.eclipse.papyrus.log;bundle-version="0.8.0", - org.eclipse.ui.views.properties.tabbed;bundle-version="3.5.100" + org.eclipse.ui.views.properties.tabbed;bundle-version="3.5.100", + org.eclipse.core.resources;bundle-version="3.7.100", + org.eclipse.ui.ide;bundle-version="3.7.0" Bundle-RequiredExecutionEnvironment: J2SE-1.5 Bundle-ActivationPolicy: lazy -Export-Package: org.eclipse.papyrus.widgets, - org.eclipse.papyrus.widgets.editors, +Export-Package: org.eclipse.papyrus.widgets, org.eclipse.papyrus.widgets.creation, + org.eclipse.papyrus.widgets.editors, org.eclipse.papyrus.widgets.providers, - org.eclipse.papyrus.widgets.selectors + org.eclipse.papyrus.widgets.selectors, + org.eclipse.papyrus.widgets.util Bundle-Localization: plugin diff --git a/plugins/core/org.eclipse.papyrus.widgets/src/org/eclipse/papyrus/widgets/Activator.java b/plugins/core/org.eclipse.papyrus.widgets/src/org/eclipse/papyrus/widgets/Activator.java index 505db2eee72..a4d8e916a65 100644 --- a/plugins/core/org.eclipse.papyrus.widgets/src/org/eclipse/papyrus/widgets/Activator.java +++ b/plugins/core/org.eclipse.papyrus.widgets/src/org/eclipse/papyrus/widgets/Activator.java @@ -98,7 +98,7 @@ public class Activator extends AbstractUIPlugin { */
public Image getImage(String pluginId, String path) {
final ImageRegistry registry = getImageRegistry();
- String key = pluginId + "/" + path;
+ String key = pluginId + "/" + path; //$NON-NLS-1$
Image image = registry.get(key);
if(image == null) {
registry.put(key, AbstractUIPlugin.imageDescriptorFromPlugin(pluginId, path));
diff --git a/plugins/core/org.eclipse.papyrus.widgets/src/org/eclipse/papyrus/widgets/creation/ReferenceValueFactory.java b/plugins/core/org.eclipse.papyrus.widgets/src/org/eclipse/papyrus/widgets/creation/ReferenceValueFactory.java index d82bc70d6f2..8d30f6d7f83 100644 --- a/plugins/core/org.eclipse.papyrus.widgets/src/org/eclipse/papyrus/widgets/creation/ReferenceValueFactory.java +++ b/plugins/core/org.eclipse.papyrus.widgets/src/org/eclipse/papyrus/widgets/creation/ReferenceValueFactory.java @@ -85,6 +85,7 @@ public interface ReferenceValueFactory { * The widget calling the factory. May be used for example to retrieve the shell for opening a Dialog.
* @param object
* The object to edit
+ * @return the edited object, or null if the object has been edited "in place"
*/
- public void edit(Control widget, Object object);
+ public Object edit(Control widget, Object object);
}
diff --git a/plugins/core/org.eclipse.papyrus.widgets/src/org/eclipse/papyrus/widgets/creation/StringEditionFactory.java b/plugins/core/org.eclipse.papyrus.widgets/src/org/eclipse/papyrus/widgets/creation/StringEditionFactory.java new file mode 100644 index 00000000000..1064cdc824a --- /dev/null +++ b/plugins/core/org.eclipse.papyrus.widgets/src/org/eclipse/papyrus/widgets/creation/StringEditionFactory.java @@ -0,0 +1,84 @@ +/*****************************************************************************
+ * 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.widgets.creation;
+
+import java.util.Collection;
+
+import org.eclipse.jface.dialogs.IInputValidator;
+import org.eclipse.jface.window.Window;
+import org.eclipse.papyrus.widgets.editors.InputDialog;
+import org.eclipse.papyrus.widgets.messages.Messages;
+import org.eclipse.swt.widgets.Control;
+
+
+public class StringEditionFactory implements ReferenceValueFactory {
+
+ private String title = Messages.StringEditionFactory_EnterANewValue;
+
+ private String label = Messages.StringEditionFactory_EnterANewValue;
+
+ private IInputValidator validator;
+
+ public StringEditionFactory() {
+ }
+
+ public StringEditionFactory(String title, String label) {
+ this.title = title;
+ this.label = label;
+ }
+
+ public StringEditionFactory(IInputValidator validator) {
+ this.validator = validator;
+ }
+
+ public StringEditionFactory(String title, String label, IInputValidator validator) {
+ this.title = title;
+ this.label = label;
+ this.validator = validator;
+ }
+
+ public boolean canCreateObject() {
+ return false;
+ }
+
+ public Object createObject(Control widget) {
+ return null;
+ }
+
+ public Collection<Object> validateObjects(Collection<Object> objectsToValidate) {
+ return objectsToValidate;
+ }
+
+ public boolean canEdit() {
+ return true;
+ }
+
+ public Object edit(Control widget, Object object) {
+ if(!(object instanceof String)) {
+ return object;
+ }
+
+ InputDialog dialog = new InputDialog(widget.getShell(), title, label, (String)object, validator);
+
+ int result = dialog.open();
+ if(result == Window.OK) {
+ String newValue = dialog.getText();
+ return newValue;
+ }
+
+ return object;
+ }
+
+ public void setValidator(IInputValidator validator) {
+ this.validator = validator;
+ }
+}
diff --git a/plugins/core/org.eclipse.papyrus.widgets/src/org/eclipse/papyrus/widgets/editors/AbstractEditor.java b/plugins/core/org.eclipse.papyrus.widgets/src/org/eclipse/papyrus/widgets/editors/AbstractEditor.java index bcdeed5323f..2e008261989 100644 --- a/plugins/core/org.eclipse.papyrus.widgets/src/org/eclipse/papyrus/widgets/editors/AbstractEditor.java +++ b/plugins/core/org.eclipse.papyrus.widgets/src/org/eclipse/papyrus/widgets/editors/AbstractEditor.java @@ -44,6 +44,11 @@ public abstract class AbstractEditor extends Composite { protected Label label;
/**
+ * The label value for this editor
+ */
+ protected String labelText;
+
+ /**
* The set of elements listening on changes from this editor
*/
protected Set<ICommitListener> commitListeners = new HashSet<ICommitListener>();
@@ -169,6 +174,8 @@ public abstract class AbstractEditor extends Composite { * The new text for this editor's label
*/
public void setLabel(String label) {
+ this.labelText = label;
+
if(this.label != null) {
this.label.setText(label);
} else {
@@ -178,6 +185,21 @@ public abstract class AbstractEditor extends Composite { }
/**
+ * Show or delete the Label Widget.
+ *
+ * @param displayLabel
+ */
+ public void setDisplayLabel(boolean displayLabel) {
+ if(displayLabel) {
+ setLabel(labelText);
+ } else {
+ if(this.label != null) {
+ this.label.dispose();
+ }
+ }
+ }
+
+ /**
* Adds a commit listener to this editor. A Commit event is
* fired when a modification occures on this editor.
*
diff --git a/plugins/core/org.eclipse.papyrus.widgets/src/org/eclipse/papyrus/widgets/editors/IElementSelectionListener.java b/plugins/core/org.eclipse.papyrus.widgets/src/org/eclipse/papyrus/widgets/editors/IElementSelectionListener.java new file mode 100644 index 00000000000..ac44710a12d --- /dev/null +++ b/plugins/core/org.eclipse.papyrus.widgets/src/org/eclipse/papyrus/widgets/editors/IElementSelectionListener.java @@ -0,0 +1,18 @@ +/*****************************************************************************
+ * 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.widgets.editors;
+
+
+public interface IElementSelectionListener {
+
+ public void addElements(Object[] elements);
+}
diff --git a/plugins/core/org.eclipse.papyrus.widgets/src/org/eclipse/papyrus/widgets/editors/IElementSelector.java b/plugins/core/org.eclipse.papyrus.widgets/src/org/eclipse/papyrus/widgets/editors/IElementSelector.java index b2d1107b39d..3503c05a8b2 100644 --- a/plugins/core/org.eclipse.papyrus.widgets/src/org/eclipse/papyrus/widgets/editors/IElementSelector.java +++ b/plugins/core/org.eclipse.papyrus.widgets/src/org/eclipse/papyrus/widgets/editors/IElementSelector.java @@ -63,4 +63,13 @@ public interface IElementSelector { */
public void clearTemporaryElements();
+ /**
+ * Adds a new listener to this selector.
+ * The selector can inform the listener that new elements have
+ * been selected
+ *
+ * @param listener
+ */
+ public void addElementSelectionListener(IElementSelectionListener listener);
+
}
diff --git a/incoming/org.eclipse.papyrus.properties.customization/src/org/eclipse/papyrus/properties/customization/ui/InputDialog.java b/plugins/core/org.eclipse.papyrus.widgets/src/org/eclipse/papyrus/widgets/editors/InputDialog.java index 55d1da7c9f4..352c81b66cf 100644 --- a/incoming/org.eclipse.papyrus.properties.customization/src/org/eclipse/papyrus/properties/customization/ui/InputDialog.java +++ b/plugins/core/org.eclipse.papyrus.widgets/src/org/eclipse/papyrus/widgets/editors/InputDialog.java @@ -9,14 +9,13 @@ * Contributors:
* Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Initial API and implementation
*****************************************************************************/
-package org.eclipse.papyrus.properties.customization.ui;
+package org.eclipse.papyrus.widgets.editors;
import java.util.Collections;
import org.eclipse.jface.dialogs.IInputValidator;
-import org.eclipse.papyrus.properties.customization.Activator;
-import org.eclipse.papyrus.properties.customization.messages.Messages;
+import org.eclipse.papyrus.widgets.Activator;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.KeyEvent;
import org.eclipse.swt.events.KeyListener;
@@ -62,6 +61,16 @@ public class InputDialog extends SelectionDialog { protected Text input;
/**
+ * The dialog's title
+ */
+ protected String title;
+
+ /**
+ * The label describing the kind of text to input
+ */
+ protected String labelText;
+
+ /**
*
* Constructor.
*
@@ -74,10 +83,12 @@ public class InputDialog extends SelectionDialog { * @param validator
* The validator used to check the input string
*/
- public InputDialog(Shell parentShell, String title, String initialValue, IInputValidator validator) {
+ public InputDialog(Shell parentShell, String title, String label, String initialValue, IInputValidator validator) {
super(parentShell);
this.initialValue = initialValue;
this.validator = validator;
+ this.title = title;
+ this.labelText = label;
}
@Override
@@ -98,7 +109,8 @@ public class InputDialog extends SelectionDialog { errorLabel.setVisible(false);
Label label = new Label(getDialogArea(), SWT.None);
- label.setText(Messages.InputDialog_enterConfigurationName);
+ if(labelText != null)
+ label.setText(labelText);
label.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false, 2, 1));
input = new Text(getDialogArea(), SWT.BORDER);
@@ -119,6 +131,9 @@ public class InputDialog extends SelectionDialog { getShell().setImage(Activator.getDefault().getImage("/icons/papyrus.png")); //$NON-NLS-1$
+ if(title != null)
+ getShell().setText(title);
+
validate();
getShell().pack();
}
@@ -128,6 +143,13 @@ public class InputDialog extends SelectionDialog { * and error message will be displayed.
*/
protected void validate() {
+ if(validator == null) {
+ errorLabel.setVisible(false);
+ errorImage.setVisible(false);
+ getOkButton().setEnabled(true);
+ return;
+ }
+
String errorMessage = validator.isValid(input.getText());
if(errorMessage == null) {
errorLabel.setVisible(false);
diff --git a/plugins/core/org.eclipse.papyrus.widgets/src/org/eclipse/papyrus/widgets/editors/MultipleStringEditor.java b/plugins/core/org.eclipse.papyrus.widgets/src/org/eclipse/papyrus/widgets/editors/MultipleStringEditor.java index d69ff39f7d2..737646587fc 100644 --- a/plugins/core/org.eclipse.papyrus.widgets/src/org/eclipse/papyrus/widgets/editors/MultipleStringEditor.java +++ b/plugins/core/org.eclipse.papyrus.widgets/src/org/eclipse/papyrus/widgets/editors/MultipleStringEditor.java @@ -11,6 +11,7 @@ *****************************************************************************/
package org.eclipse.papyrus.widgets.editors;
+import org.eclipse.papyrus.widgets.creation.StringEditionFactory;
import org.eclipse.papyrus.widgets.selectors.StringSelector;
import org.eclipse.swt.widgets.Composite;
@@ -35,6 +36,7 @@ public class MultipleStringEditor extends MultipleValueEditor { */
public MultipleStringEditor(Composite parent, int style) {
super(parent, style, new StringSelector());
+ setFactory(new StringEditionFactory());
}
/**
diff --git a/plugins/core/org.eclipse.papyrus.widgets/src/org/eclipse/papyrus/widgets/editors/MultipleValueEditor.java b/plugins/core/org.eclipse.papyrus.widgets/src/org/eclipse/papyrus/widgets/editors/MultipleValueEditor.java index a707e22c599..5ab92ef4b74 100644 --- a/plugins/core/org.eclipse.papyrus.widgets/src/org/eclipse/papyrus/widgets/editors/MultipleValueEditor.java +++ b/plugins/core/org.eclipse.papyrus.widgets/src/org/eclipse/papyrus/widgets/editors/MultipleValueEditor.java @@ -16,6 +16,7 @@ import java.util.LinkedList; 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.runtime.Assert;
import org.eclipse.jface.viewers.ILabelProvider;
import org.eclipse.jface.viewers.IStructuredSelection;
@@ -31,6 +32,7 @@ import org.eclipse.swt.SWT; import org.eclipse.swt.events.DisposeListener;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.layout.FillLayout;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
@@ -152,13 +154,15 @@ public class MultipleValueEditor extends AbstractListEditor implements Selection listData.minimumHeight = 80;
list.setLayoutData(listData);
+ list.addSelectionListener(this);
+
listViewer = new ListViewer(list);
- listViewer.setContentProvider(new CollectionContentProvider());
+ listViewer.setContentProvider(CollectionContentProvider.instance);
createListControls();
this.selector = selector;
- dialog = new MultipleValueSelectorDialog(parent.getShell(), selector, label, unique);
+ dialog = new MultipleValueSelectorDialog(parent.getShell(), selector, label, unique, ordered);
if(label != null)
dialog.setTitle(label);
@@ -169,7 +173,7 @@ public class MultipleValueEditor extends AbstractListEditor implements Selection updateControls();
}
- private void updateControls() {
+ protected void updateControls() {
add.setEnabled(!readOnly);
remove.setEnabled(!readOnly);
up.setEnabled(ordered && !readOnly);
@@ -275,30 +279,19 @@ public class MultipleValueEditor extends AbstractListEditor implements Selection * @param ordered
*/
protected void createListControls() {
- up = new Button(controlsSection, SWT.PUSH);
- up.setImage(Activator.getDefault().getImage("/icons/Up_12x12.gif")); //$NON-NLS-1$
- up.addSelectionListener(this);
- up.setToolTipText(Messages.MultipleValueEditor_MoveSelectedElementsUp);
-
- down = new Button(controlsSection, SWT.PUSH);
- down.setImage(Activator.getDefault().getImage("/icons/Down_12x12.gif")); //$NON-NLS-1$
- down.addSelectionListener(this);
- down.setToolTipText(Messages.MultipleValueEditor_MoveSelectedElementsDown);
-
- add = new Button(controlsSection, SWT.PUSH);
- add.setImage(Activator.getDefault().getImage("/icons/Add_12x12.gif")); //$NON-NLS-1$
- add.addSelectionListener(this);
- add.setToolTipText(Messages.MultipleValueEditor_AddElements);
-
- remove = new Button(controlsSection, SWT.PUSH);
- remove.setImage(Activator.getDefault().getImage("/icons/Delete_12x12.gif")); //$NON-NLS-1$
- remove.addSelectionListener(this);
- remove.setToolTipText(Messages.MultipleValueEditor_RemoveSelectedElements);
-
- edit = new Button(controlsSection, SWT.PUSH);
- edit.setImage(Activator.getDefault().getImage("/icons/Edit_12x12.gif")); //$NON-NLS-1$
- edit.addSelectionListener(this);
- edit.setToolTipText(Messages.MultipleValueEditor_EditSelectedValue);
+ up = createButton(Activator.getDefault().getImage("/icons/Up_12x12.gif"), Messages.MultipleValueEditor_MoveSelectedElementsUp); //$NON-NLS-1$
+ down = createButton(Activator.getDefault().getImage("/icons/Down_12x12.gif"), Messages.MultipleValueEditor_MoveSelectedElementsDown); //$NON-NLS-1$
+ add = createButton(Activator.getDefault().getImage("/icons/Add_12x12.gif"), Messages.MultipleValueEditor_AddElements); //$NON-NLS-1$
+ remove = createButton(Activator.getDefault().getImage("/icons/Delete_12x12.gif"), Messages.MultipleValueEditor_RemoveSelectedElements); //$NON-NLS-1$
+ edit = createButton(Activator.getDefault().getImage("/icons/Edit_12x12.gif"), Messages.MultipleValueEditor_EditSelectedValue); //$NON-NLS-1$
+ }
+
+ protected Button createButton(Image image, String toolTipText) {
+ Button button = new Button(controlsSection, SWT.PUSH);
+ button.setImage(image); //$NON-NLS-1$
+ button.addSelectionListener(this);
+ button.setToolTipText(toolTipText);
+ return button;
}
@Override
@@ -360,6 +353,12 @@ public class MultipleValueEditor extends AbstractListEditor implements Selection commit();
}
+ @Override
+ protected void commit() {
+ super.commit();
+ listViewer.refresh();
+ }
+
/**
* Handle remove Action
*/
@@ -422,7 +421,19 @@ public class MultipleValueEditor extends AbstractListEditor implements Selection return;
}
- referenceFactory.edit(this, selection.getFirstElement());
+ int index = listViewer.getList().getSelectionIndex();
+
+ Object currentValue = selection.getFirstElement();
+ Object newValue = referenceFactory.edit(this.edit, selection.getFirstElement());
+
+ if(newValue != currentValue && newValue != null) {
+ modelProperty.remove(index);
+ modelProperty.add(index, newValue);
+
+ //commit(); // The commit only occurs in the case where we modify the list (We don't commit direct edition on objects)
+ }
+
+ commit();
}
/**
@@ -442,7 +453,9 @@ public class MultipleValueEditor extends AbstractListEditor implements Selection * {@inheritDoc}
*/
public void widgetDefaultSelected(SelectionEvent e) {
- //Nothing
+ if(e.widget == list && edit.isEnabled()) {
+ editAction();
+ }
}
/**
@@ -456,13 +469,15 @@ public class MultipleValueEditor extends AbstractListEditor implements Selection /**
* Refreshes the viewer when a change occurs on the ObservableList
+ * TODO : Problem : a change occurring on an element of the list is not sent here
+ * TODO : When undoing a command, the change event is not received (Although it modifies the list itself)
*
* @see org.eclipse.core.databinding.observable.IChangeListener#handleChange(org.eclipse.core.databinding.observable.ChangeEvent)
*
* @param event
*/
public void handleChange(ChangeEvent event) {
- listViewer.refresh(true);
+ listViewer.refresh();
}
/**
@@ -508,4 +523,10 @@ public class MultipleValueEditor extends AbstractListEditor implements Selection list.setToolTipText(text);
super.setLabelToolTipText(text);
}
+
+ @Override
+ public void setModelObservable(IObservableList modelProperty) {
+ super.setModelObservable(modelProperty);
+ updateControls();
+ }
}
diff --git a/plugins/core/org.eclipse.papyrus.widgets/src/org/eclipse/papyrus/widgets/editors/MultipleValueSelectorDialog.java b/plugins/core/org.eclipse.papyrus.widgets/src/org/eclipse/papyrus/widgets/editors/MultipleValueSelectorDialog.java index 68da2e45c89..60c2956afda 100644 --- a/plugins/core/org.eclipse.papyrus.widgets/src/org/eclipse/papyrus/widgets/editors/MultipleValueSelectorDialog.java +++ b/plugins/core/org.eclipse.papyrus.widgets/src/org/eclipse/papyrus/widgets/editors/MultipleValueSelectorDialog.java @@ -47,7 +47,7 @@ import org.eclipse.ui.dialogs.SelectionDialog; * @author Camille Letavernier
*
*/
-public class MultipleValueSelectorDialog extends SelectionDialog implements SelectionListener {
+public class MultipleValueSelectorDialog extends SelectionDialog implements SelectionListener, IElementSelectionListener {
/**
* The object selector
@@ -158,7 +158,7 @@ public class MultipleValueSelectorDialog extends SelectionDialog implements Sele * The element selector used by this dialog
*/
public MultipleValueSelectorDialog(Shell parentShell, IElementSelector selector) {
- this(parentShell, selector, null, false);
+ this(parentShell, selector, null, false, false);
}
/**
@@ -172,7 +172,7 @@ public class MultipleValueSelectorDialog extends SelectionDialog implements Sele * The title of this dialog
*/
public MultipleValueSelectorDialog(Shell parentShell, IElementSelector selector, String title) {
- this(parentShell, selector, title, false);
+ this(parentShell, selector, title, false, false);
}
/**
@@ -187,7 +187,7 @@ public class MultipleValueSelectorDialog extends SelectionDialog implements Sele * True if the values returned by this dialog should be unique
*/
public MultipleValueSelectorDialog(Shell parentShell, IElementSelector selector, boolean unique) {
- this(parentShell, selector, null, unique);
+ this(parentShell, selector, null, unique, false);
}
/**
@@ -203,7 +203,7 @@ public class MultipleValueSelectorDialog extends SelectionDialog implements Sele * @param unique
* True if the values returned by this dialog should be unique
*/
- public MultipleValueSelectorDialog(Shell parentShell, IElementSelector selector, String title, boolean unique) {
+ public MultipleValueSelectorDialog(Shell parentShell, IElementSelector selector, String title, boolean unique, boolean ordered) {
super(parentShell);
Assert.isNotNull(selector, "The element selector should be defined"); //$NON-NLS-1$
this.selector = selector;
@@ -211,6 +211,9 @@ public class MultipleValueSelectorDialog extends SelectionDialog implements Sele setHelpAvailable(false);
setTitle(title);
this.unique = unique;
+ this.ordered = ordered;
+
+ selector.addElementSelectionListener(this);
}
/**
@@ -222,18 +225,24 @@ public class MultipleValueSelectorDialog extends SelectionDialog implements Sele Composite parent = getDialogArea();
GridLayout layout = (GridLayout)parent.getLayout();
- layout.numColumns = 4;
- layout.makeColumnsEqualWidth = false;
+ layout.numColumns = 2;
+ layout.makeColumnsEqualWidth = true;
- createSelectorSection(parent);
- createControlsSection(parent);
- createListSection(parent);
- createRightButtonsSection(parent);
+ Composite selectorPane = new Composite(parent, SWT.NONE);
+ selectorPane.setLayout(new GridLayout(2, false));
+ selectorPane.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
- getShell().setSize(400, 300);
- getShell().layout();
+ Composite selectedPane = new Composite(parent, SWT.NONE);
+ selectedPane.setLayout(new GridLayout(2, false));
+ selectedPane.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
- setResult(new LinkedList<Object>(allElements));
+ createSelectorSection(selectorPane);
+ createControlsSection(selectorPane);
+ createListSection(selectedPane);
+ createRightButtonsSection(selectedPane);
+
+ getShell().setSize(600, 400);
+ getShell().layout();
super.getShell().setImage(Activator.getDefault().getImage("/icons/papyrus.png")); //$NON-NLS-1$
@@ -305,7 +314,7 @@ public class MultipleValueSelectorDialog extends SelectionDialog implements Sele selectedElements.setLayoutData(data);
selectedElementsViewer = new ListViewer(selectedElements);
- selectedElementsViewer.setContentProvider(new CollectionContentProvider());
+ selectedElementsViewer.setContentProvider(CollectionContentProvider.instance);
if(labelProvider != null)
selectedElementsViewer.setLabelProvider(labelProvider);
@@ -468,7 +477,7 @@ public class MultipleValueSelectorDialog extends SelectionDialog implements Sele if(factory == null)
return;
- Object newObject = factory.createObject(getShell());
+ Object newObject = factory.createObject(this.create);
if(newObject == null)
return;
@@ -515,8 +524,6 @@ public class MultipleValueSelectorDialog extends SelectionDialog implements Sele selector.setSelectedElements(allElements.toArray());
selectedElementsViewer.setSelection(null);
selectedElementsViewer.refresh();
-
- setResult(new LinkedList<Object>(allElements));
}
/**
@@ -532,7 +539,6 @@ public class MultipleValueSelectorDialog extends SelectionDialog implements Sele protected void removeAllAction() {
allElements.clear();
selector.setSelectedElements(new Object[0]);
- setResult(new LinkedList<Object>());
selectedElementsViewer.setSelection(null);
selectedElementsViewer.refresh();
}
@@ -552,12 +558,10 @@ public class MultipleValueSelectorDialog extends SelectionDialog implements Sele * @param elements
* The elements to be added
*/
- private void addElements(Object[] elements) {
+ public void addElements(Object[] elements) {
if(elements != null) {
allElements.addAll(Arrays.asList(elements));
selectedElementsViewer.refresh();
-
- setResult(new LinkedList<Object>(allElements));
}
}
@@ -573,6 +577,9 @@ public class MultipleValueSelectorDialog extends SelectionDialog implements Sele factory.validateObjects(objectsToValidate);
selector.clearTemporaryElements();
}
+
+ setResult(new LinkedList<Object>(allElements));
+
super.okPressed();
}
diff --git a/plugins/core/org.eclipse.papyrus.widgets/src/org/eclipse/papyrus/widgets/editors/ReferenceDialog.java b/plugins/core/org.eclipse.papyrus.widgets/src/org/eclipse/papyrus/widgets/editors/ReferenceDialog.java index e7664b5e726..b82579d0395 100644 --- a/plugins/core/org.eclipse.papyrus.widgets/src/org/eclipse/papyrus/widgets/editors/ReferenceDialog.java +++ b/plugins/core/org.eclipse.papyrus.widgets/src/org/eclipse/papyrus/widgets/editors/ReferenceDialog.java @@ -15,9 +15,11 @@ import java.util.Collections; import org.eclipse.core.databinding.observable.ChangeEvent;
import org.eclipse.core.databinding.observable.IChangeListener;
+import org.eclipse.core.databinding.observable.value.IObservableValue;
import org.eclipse.jface.viewers.ILabelProvider;
import org.eclipse.jface.window.Window;
import org.eclipse.papyrus.widgets.Activator;
+import org.eclipse.papyrus.widgets.creation.ReferenceValueFactory;
import org.eclipse.papyrus.widgets.messages.Messages;
import org.eclipse.papyrus.widgets.providers.EncapsulatedContentProvider;
import org.eclipse.papyrus.widgets.providers.IStaticContentProvider;
@@ -28,9 +30,12 @@ import org.eclipse.swt.events.DisposeListener; import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.events.SelectionListener;
import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Widget;
/**
* An editor representing a single reference as a Label
@@ -42,7 +47,7 @@ import org.eclipse.swt.widgets.Composite; * @author Camille Letavernier
*
*/
-public class ReferenceDialog extends AbstractValueEditor implements IChangeListener, DisposeListener {
+public class ReferenceDialog extends AbstractValueEditor implements IChangeListener, DisposeListener, SelectionListener {
/**
* The CLabel displaying the current value
@@ -50,9 +55,19 @@ public class ReferenceDialog extends AbstractValueEditor implements IChangeListe protected final CLabel currentValueLabel;
/**
- * The Button used to edit the current value
+ * The Button used to browse the available values
*/
- protected final Button openDialogButton;
+ protected final Button browseValuesButton;
+
+ /**
+ * The Button used to create a new instance
+ */
+ protected final Button createInstanceButton;
+
+ /**
+ * The Button used to edit the current object
+ */
+ protected final Button editInstanceButton;
/**
* The Button used to unset the current value
@@ -81,6 +96,11 @@ public class ReferenceDialog extends AbstractValueEditor implements IChangeListe protected Object value;
/**
+ * The factory used to create or edit objects directly from this editor
+ */
+ protected ReferenceValueFactory valueFactory;
+
+ /**
*
* Constructs a new ReferenceDialog in the given parent Composite.
* The style will be applied to the CLabel displaying the current value.
@@ -91,56 +111,91 @@ public class ReferenceDialog extends AbstractValueEditor implements IChangeListe public ReferenceDialog(Composite parent, int style) {
super(parent, style);
- ((GridLayout)getLayout()).numColumns = 4;
+ ((GridLayout)getLayout()).numColumns = 6;
currentValueLabel = factory.createCLabel(this, null, SWT.BORDER | style);
currentValueLabel.setLayoutData(getDefaultLayoutData());
dialog = new TreeSelectorDialog(parent.getShell());
- openDialogButton = factory.createButton(this, null, SWT.PUSH);
- openDialogButton.setImage(Activator.getDefault().getImage("/icons/browse_12x12.gif")); //$NON-NLS-1$
- openDialogButton.setToolTipText(Messages.ReferenceDialog_EditValue);
- openDialogButton.addSelectionListener(new SelectionListener() {
-
- public void widgetSelected(SelectionEvent e) {
- dialog.setInitialElementSelections(Collections.singletonList(getValue()));
- int result = dialog.open();
- if(result == Window.OK) {
- Object[] newValue = dialog.getResult();
- if(newValue.length == 0) {
- modelProperty.setValue(null);
- } else {
- modelProperty.setValue(newValue[0]);
- }
- updateLabel();
- }
- }
-
- public void widgetDefaultSelected(SelectionEvent e) {
- // Nothing
- }
-
- });
+ browseValuesButton = factory.createButton(this, null, SWT.PUSH);
+ browseValuesButton.setImage(Activator.getDefault().getImage("/icons/browse_12x12.gif")); //$NON-NLS-1$
+ browseValuesButton.setToolTipText(Messages.ReferenceDialog_EditValue);
+ browseValuesButton.addSelectionListener(this);
unsetButton = factory.createButton(this, null, SWT.PUSH);
unsetButton.setImage(Activator.getDefault().getImage("/icons/Delete_12x12.gif")); //$NON-NLS-1$
unsetButton.setToolTipText(Messages.ReferenceDialog_UnsetValue);
- unsetButton.addSelectionListener(new SelectionListener() {
-
- public void widgetSelected(SelectionEvent e) {
- if(modelProperty != null) {
- modelProperty.setValue(null);
- } else {
- handleChange(null);
- }
- }
+ unsetButton.addSelectionListener(this);
- public void widgetDefaultSelected(SelectionEvent e) {
- //Nothing
+ createInstanceButton = factory.createButton(this, null, SWT.PUSH);
+ createInstanceButton.setImage(Activator.getDefault().getImage("/icons/Add_12x12.gif")); //$NON-NLS-1$
+ createInstanceButton.setToolTipText(Messages.ReferenceDialog_CreateANewObject);
+ createInstanceButton.addSelectionListener(this);
+
+ editInstanceButton = factory.createButton(this, null, SWT.PUSH);
+ editInstanceButton.setImage(Activator.getDefault().getImage("/icons/Edit_12x12.gif")); //$NON-NLS-1$
+ editInstanceButton.setToolTipText(Messages.ReferenceDialog_EditTheCurrentValue);
+ editInstanceButton.addSelectionListener(this);
+
+ updateControls();
+ }
+
+ /**
+ * The action executed when the "browse" button is selected
+ * Choose a value from a selection of already created objects
+ */
+ protected void browseAction() {
+ dialog.setInitialElementSelections(Collections.singletonList(getValue()));
+ int result = dialog.open();
+ if(result == Window.OK) {
+ Object[] newValue = dialog.getResult();
+ if(newValue.length == 0) {
+ modelProperty.setValue(null);
+ } else {
+ modelProperty.setValue(newValue[0]);
}
+ updateLabel();
+ }
+ }
- });
+ /**
+ * The action executed when the "create" button is selected
+ * Create a new instance and assign it to this reference
+ */
+ protected void createAction() {
+ if(valueFactory != null && valueFactory.canCreateObject()) {
+ Object value = valueFactory.createObject(createInstanceButton);
+ if(value == null)
+ return;
+ valueFactory.validateObjects(Collections.singleton(value));
+ modelProperty.setValue(value);
+ }
+ }
+
+ /**
+ * The action executed when the "edit" button is selected
+ * Edits the object that is currently selected
+ */
+ protected void editAction() {
+ Object currentValue = modelProperty.getValue();
+ if(currentValue != null && valueFactory != null && valueFactory.canEdit()) {
+ Object newValue = valueFactory.edit(editInstanceButton, modelProperty.getValue());
+ if(newValue != currentValue)
+ modelProperty.setValue(value);
+ }
+ }
+
+ /**
+ * The action executed when the "unset" button is selected
+ * Sets the current reference to null
+ */
+ protected void unsetAction() {
+ if(modelProperty != null) {
+ modelProperty.setValue(null);
+ } else {
+ handleChange(null);
+ }
}
/**
@@ -227,7 +282,7 @@ public class ReferenceDialog extends AbstractValueEditor implements IChangeListe @Override
public void setReadOnly(boolean readOnly) {
currentValueLabel.setEnabled(!readOnly);
- openDialogButton.setEnabled(!readOnly);
+ browseValuesButton.setEnabled(!readOnly);
unsetButton.setEnabled(!readOnly);
}
@@ -281,9 +336,65 @@ public class ReferenceDialog extends AbstractValueEditor implements IChangeListe }
@Override
+ public void setModelObservable(IObservableValue modelProperty) {
+ super.setModelObservable(modelProperty);
+ updateControls();
+ }
+
+ @Override
public void setToolTipText(String text) {
super.setLabelToolTipText(text);
currentValueLabel.setToolTipText(text);
}
+ public void setValueFactory(ReferenceValueFactory factory) {
+ valueFactory = factory;
+ updateControls();
+ }
+
+ public void widgetSelected(SelectionEvent e) {
+ Widget widget = e.widget;
+ if(widget == browseValuesButton) {
+ browseAction();
+ } else if(widget == createInstanceButton) {
+ createAction();
+ } else if(widget == editInstanceButton) {
+ editAction();
+ } else if(widget == unsetButton) {
+ unsetAction();
+ }
+ updateControls();
+ }
+
+ public void widgetDefaultSelected(SelectionEvent e) {
+ //Nothing
+ }
+
+ /**
+ * Updates the buttons' status
+ */
+ protected void updateControls() {
+ //Check if the edit & create buttons should be displayed
+ boolean exclude = valueFactory == null || !valueFactory.canCreateObject();
+ setExclusion(editInstanceButton, exclude);
+ setExclusion(createInstanceButton, exclude);
+
+ //If they are displayed, check if they should be enabled
+ if(!exclude) {
+ editInstanceButton.setEnabled(valueFactory != null && valueFactory.canEdit() && modelProperty != null && modelProperty.getValue() != null);
+ createInstanceButton.setEnabled(valueFactory != null && valueFactory.canCreateObject());
+ }
+ }
+
+ private void setExclusion(Control control, boolean exclude) {
+ if(control.getLayoutData() == null) {
+ GridData data = new GridData();
+ data.exclude = exclude;
+ control.setLayoutData(data);
+ } else {
+ GridData data = (GridData)control.getLayoutData();
+ data.exclude = exclude;
+ }
+ }
+
}
diff --git a/plugins/core/org.eclipse.papyrus.widgets/src/org/eclipse/papyrus/widgets/editors/SelectionEditor.java b/plugins/core/org.eclipse.papyrus.widgets/src/org/eclipse/papyrus/widgets/editors/SelectionEditor.java index 3272f8c2ced..0acd6c5c2b8 100644 --- a/plugins/core/org.eclipse.papyrus.widgets/src/org/eclipse/papyrus/widgets/editors/SelectionEditor.java +++ b/plugins/core/org.eclipse.papyrus.widgets/src/org/eclipse/papyrus/widgets/editors/SelectionEditor.java @@ -279,7 +279,7 @@ public class SelectionEditor extends Composite implements SelectionListener { selectedElementsViewer = new ListViewer(selectedElements);
- selectedElementsViewer.setContentProvider(new CollectionContentProvider());
+ selectedElementsViewer.setContentProvider(CollectionContentProvider.instance);
if(labelProvider != null)
selectedElementsViewer.setLabelProvider(labelProvider);
diff --git a/plugins/core/org.eclipse.papyrus.widgets/src/org/eclipse/papyrus/widgets/editors/StringEditor.java b/plugins/core/org.eclipse.papyrus.widgets/src/org/eclipse/papyrus/widgets/editors/StringEditor.java index 9019a3583d6..3a260ee0726 100644 --- a/plugins/core/org.eclipse.papyrus.widgets/src/org/eclipse/papyrus/widgets/editors/StringEditor.java +++ b/plugins/core/org.eclipse.papyrus.widgets/src/org/eclipse/papyrus/widgets/editors/StringEditor.java @@ -65,15 +65,17 @@ public class StringEditor extends AbstractValueEditor implements KeyListener { super(parent, label);
GridData data = getDefaultLayoutData();
- text = factory.createText(this, null, style);
- text.setLayoutData(data);
if((style & SWT.MULTI) != 0) {
data.heightHint = 55;
style = style | SWT.V_SCROLL;
- if(label != null) {
- super.label.setLayoutData(getLabelLayoutData());
- }
+ }
+
+ text = factory.createText(this, null, style);
+ text.setLayoutData(data);
+
+ if(label != null) {
+ super.label.setLayoutData(getLabelLayoutData());
}
//We listen on Carriage Return only if the editor isn't multiline
@@ -113,7 +115,7 @@ public class StringEditor extends AbstractValueEditor implements KeyListener { */
public void keyReleased(KeyEvent e) {
if((e.keyCode == SWT.CR || e.keyCode == SWT.KEYPAD_CR) && e.stateMask == SWT.NONE) {
- text.notifyListeners(SWT.FocusOut, new Event());
+ notifyChange();
}
}
@@ -143,6 +145,11 @@ public class StringEditor extends AbstractValueEditor implements KeyListener { return !text.isEnabled();
}
+ protected void notifyChange() {
+ text.notifyListeners(SWT.FocusOut, new Event());
+ commit();
+ }
+
@Override
public void setToolTipText(String tooltip) {
text.setToolTipText(tooltip);
diff --git a/plugins/core/org.eclipse.papyrus.widgets/src/org/eclipse/papyrus/widgets/editors/StringFileSelector.java b/plugins/core/org.eclipse.papyrus.widgets/src/org/eclipse/papyrus/widgets/editors/StringFileSelector.java new file mode 100644 index 00000000000..c4d4ad70147 --- /dev/null +++ b/plugins/core/org.eclipse.papyrus.widgets/src/org/eclipse/papyrus/widgets/editors/StringFileSelector.java @@ -0,0 +1,175 @@ +/*****************************************************************************
+ * 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.widgets.editors;
+
+import java.io.File;
+import java.util.Arrays;
+import java.util.LinkedList;
+import java.util.List;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IWorkspaceRoot;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.jface.window.Window;
+import org.eclipse.papyrus.widgets.messages.Messages;
+import org.eclipse.papyrus.widgets.util.FileUtil;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.FileDialog;
+import org.eclipse.ui.dialogs.ResourceSelectionDialog;
+
+
+public class StringFileSelector extends StringEditor {
+
+ private Button browse;
+
+ private Button browseWorkspace;
+
+ private List<String> filterNames;
+
+ private List<String> filterExtensions;
+
+ public StringFileSelector(Composite parent, int style) {
+ super(parent, style);
+ ((GridLayout)getLayout()).numColumns = 5;
+
+ browse = factory.createButton(this, Messages.StringFileSelector_Browse, SWT.PUSH);
+ browse.setLayoutData(new GridData());
+ browseWorkspace = factory.createButton(this, Messages.StringFileSelector_BrowseWorkspace, SWT.PUSH);
+ browseWorkspace.setLayoutData(new GridData());
+
+ browse.addSelectionListener(new SelectionListener() {
+
+ public void widgetSelected(SelectionEvent e) {
+ File file = FileUtil.getFile(text.getText());
+
+ FileDialog dialog = new FileDialog(getShell());
+ dialog.setFileName(file.getAbsolutePath());
+ dialog.setFilterExtensions(filterExtensions.toArray(new String[filterExtensions.size()]));
+ dialog.setFilterNames(filterNames.toArray(new String[filterNames.size()]));
+ String result = dialog.open();
+ if(result == null) { //Cancel
+ return;
+ }
+ setResult(result);
+ }
+
+ public void widgetDefaultSelected(SelectionEvent e) {
+ //Nothing
+ }
+
+ });
+
+ filterNames = new LinkedList<String>();
+ filterExtensions = new LinkedList<String>();
+
+
+ browseWorkspace.addSelectionListener(new SelectionListener() {
+
+ public void widgetSelected(SelectionEvent e) {
+ IWorkspaceRoot workspace = ResourcesPlugin.getWorkspace().getRoot();
+ IFile currentFile = FileUtil.getIFile(text.getText());
+
+ ResourceSelectionDialog dialog = new ResourceSelectionDialog(getShell(), workspace, ""); //$NON-NLS-1$
+
+ if(currentFile != null && currentFile.exists()) {
+ dialog.setInitialSelections(new IFile[]{ currentFile });
+ }
+
+ int code = dialog.open();
+ if(code == Window.OK) {
+ Object[] result = dialog.getResult();
+ if(result.length > 0) {
+ Object file = result[0];
+ if(file instanceof IFile) {
+ setResult((IFile)file);
+ }
+ }
+ }
+ }
+
+ public void widgetDefaultSelected(SelectionEvent e) {
+ //Nothing
+ }
+
+ });
+ }
+
+ protected void setResult(IFile file) {
+ text.setText(file.getFullPath().toString());
+ notifyChange();
+ }
+
+ protected void setResult(File file) {
+ text.setText(file.getAbsolutePath());
+ notifyChange();
+ }
+
+ protected void setResult(String path) {
+ text.setText(path);
+ notifyChange();
+ }
+
+ public void setFilters(String[] filterExtensions, String[] filterNames) {
+ setFilterNames(filterNames);
+ setFilterExtensions(filterExtensions);
+ }
+
+ public void setFilterExtensions(String[] filterExtensions) {
+ this.filterExtensions = Arrays.asList(filterExtensions);
+ }
+
+ public void setFilterNames(String[] filterNames) {
+ this.filterNames = Arrays.asList(filterNames);
+ }
+
+ public void addFilteredExtension(String filteredExtension, String filterName) {
+ if(filteredExtension != null) {
+ if(filterName == null) {
+ filterName = filteredExtension;
+ }
+
+ filterExtensions.add(filteredExtension);
+ filterNames.add(filterName);
+ }
+ }
+
+ @Override
+ public Object getEditableType() {
+ return String.class;
+ }
+
+ @Override
+ public void setReadOnly(boolean readOnly) {
+ super.setReadOnly(readOnly);
+ browse.setEnabled(!readOnly);
+ browseWorkspace.setEnabled(!readOnly);
+ }
+
+ public void setAllowWorkspace(boolean allowWorkspace) {
+ //((GridData)browseWorkspace.getLayoutData()).exclude = !allowWorkspace;
+ browseWorkspace.setEnabled(allowWorkspace);
+ layout();
+ }
+
+ public void setAllowFileSystem(boolean allowFileSystem) {
+ //((GridData)browse.getLayoutData()).exclude = !allowFileSystem;
+ browse.setEnabled(allowFileSystem);
+ layout();
+ }
+
+}
diff --git a/plugins/core/org.eclipse.papyrus.widgets/src/org/eclipse/papyrus/widgets/editors/StringLabel.java b/plugins/core/org.eclipse.papyrus.widgets/src/org/eclipse/papyrus/widgets/editors/StringLabel.java index 31e51388a5c..5c1aa42f9c6 100644 --- a/plugins/core/org.eclipse.papyrus.widgets/src/org/eclipse/papyrus/widgets/editors/StringLabel.java +++ b/plugins/core/org.eclipse.papyrus.widgets/src/org/eclipse/papyrus/widgets/editors/StringLabel.java @@ -41,7 +41,7 @@ public class StringLabel extends AbstractValueEditor implements IChangeListener */
public StringLabel(Composite parent, int style) {
super(parent, style);
- valueLabel = factory.createCLabel(this, "", style);
+ valueLabel = factory.createCLabel(this, "", style); //$NON-NLS-1$
valueLabel.setLayoutData(getDefaultLayoutData());
labelProvider = new LabelProvider();
}
diff --git a/plugins/core/org.eclipse.papyrus.widgets/src/org/eclipse/papyrus/widgets/messages/Messages.java b/plugins/core/org.eclipse.papyrus.widgets/src/org/eclipse/papyrus/widgets/messages/Messages.java index 85259bc4ed2..918851714ce 100644 --- a/plugins/core/org.eclipse.papyrus.widgets/src/org/eclipse/papyrus/widgets/messages/Messages.java +++ b/plugins/core/org.eclipse.papyrus.widgets/src/org/eclipse/papyrus/widgets/messages/Messages.java @@ -51,6 +51,10 @@ public class Messages extends NLS { /** The Multiple value selector dialog_ remove all elements. */
public static String MultipleValueSelectorDialog_RemoveAllElements;
+ public static String ReferenceDialog_CreateANewObject;
+
+ public static String ReferenceDialog_EditTheCurrentValue;
+
/** The Reference dialog_ edit value */
public static String ReferenceDialog_EditValue;
@@ -66,6 +70,12 @@ public class Messages extends NLS { /** the Enum radio_ no value */
public static String EnumRadio_NoValue;
+ public static String StringEditionFactory_EnterANewValue;
+
+ public static String StringFileSelector_Browse;
+
+ public static String StringFileSelector_BrowseWorkspace;
+
static {
// initialize resource bundle
NLS.initializeMessages(BUNDLE_NAME, Messages.class);
diff --git a/plugins/core/org.eclipse.papyrus.widgets/src/org/eclipse/papyrus/widgets/messages/messages.properties b/plugins/core/org.eclipse.papyrus.widgets/src/org/eclipse/papyrus/widgets/messages/messages.properties index 973772b5f2f..66b1dd3bf4f 100644 --- a/plugins/core/org.eclipse.papyrus.widgets/src/org/eclipse/papyrus/widgets/messages/messages.properties +++ b/plugins/core/org.eclipse.papyrus.widgets/src/org/eclipse/papyrus/widgets/messages/messages.properties @@ -8,8 +8,13 @@ MultipleValueSelectorDialog_AddSelectedElements=Add selected elements MultipleValueSelectorDialog_RemoveAllElements=Remove all elements
MultipleValueSelectorDialog_CreateNewElement=Create a new element
MultipleValueSelectorDialog_DeleteNewElement=Deletes a newly created element
+ReferenceDialog_CreateANewObject=Create a new object
+ReferenceDialog_EditTheCurrentValue=Edit the current value
ReferenceDialog_EditValue=Edit the reference value
ReferenceDialog_SelectValue=Select the value for this reference
ReferenceDialog_Unset=<Unset>
ReferenceDialog_UnsetValue=Unset the reference value
-EnumRadio_NoValue=There is no value to select
\ No newline at end of file +EnumRadio_NoValue=There is no value to select
+StringEditionFactory_EnterANewValue=Enter the new value
+StringFileSelector_Browse=Browse
+StringFileSelector_BrowseWorkspace=Browse workspace
diff --git a/plugins/core/org.eclipse.papyrus.widgets/src/org/eclipse/papyrus/widgets/providers/CollectionContentProvider.java b/plugins/core/org.eclipse.papyrus.widgets/src/org/eclipse/papyrus/widgets/providers/CollectionContentProvider.java index 6e6202995fd..f00f0ac0f2b 100644 --- a/plugins/core/org.eclipse.papyrus.widgets/src/org/eclipse/papyrus/widgets/providers/CollectionContentProvider.java +++ b/plugins/core/org.eclipse.papyrus.widgets/src/org/eclipse/papyrus/widgets/providers/CollectionContentProvider.java @@ -24,6 +24,10 @@ import org.eclipse.jface.viewers.Viewer; */
public class CollectionContentProvider implements IStructuredContentProvider {
+ private CollectionContentProvider() {
+
+ }
+
/**
* {@inheritDoc}
*/
@@ -56,4 +60,6 @@ public class CollectionContentProvider implements IStructuredContentProvider { return new Object[]{};
}
+
+ public static CollectionContentProvider instance = new CollectionContentProvider();
}
diff --git a/plugins/core/org.eclipse.papyrus.widgets/src/org/eclipse/papyrus/widgets/selectors/ReferenceSelector.java b/plugins/core/org.eclipse.papyrus.widgets/src/org/eclipse/papyrus/widgets/selectors/ReferenceSelector.java index fe6e53a40a2..8e88feffa34 100644 --- a/plugins/core/org.eclipse.papyrus.widgets/src/org/eclipse/papyrus/widgets/selectors/ReferenceSelector.java +++ b/plugins/core/org.eclipse.papyrus.widgets/src/org/eclipse/papyrus/widgets/selectors/ReferenceSelector.java @@ -21,10 +21,13 @@ import org.eclipse.jface.viewers.IStructuredSelection; import org.eclipse.jface.viewers.StructuredSelection;
import org.eclipse.jface.viewers.Viewer;
import org.eclipse.jface.viewers.ViewerFilter;
+import org.eclipse.papyrus.widgets.editors.IElementSelectionListener;
import org.eclipse.papyrus.widgets.editors.IElementSelector;
import org.eclipse.papyrus.widgets.providers.EncapsulatedContentProvider;
import org.eclipse.papyrus.widgets.providers.IStaticContentProvider;
import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Composite;
@@ -71,6 +74,9 @@ public class ReferenceSelector implements IElementSelector { */
protected boolean multiSelection;
+
+ private Set<IElementSelectionListener> elementSelectionListeners = new HashSet<IElementSelectionListener>();
+
/**
* The set of selected elements. If the selector is marked as "unique",
* these elements will be filtered in the Tree.
@@ -201,7 +207,7 @@ public class ReferenceSelector implements IElementSelector { this.contentProvider = new EncapsulatedContentProvider(staticContentProvider);
if(fTree != null) {
fTree.getViewer().setContentProvider(contentProvider);
- fTree.getViewer().setInput("");
+ fTree.getViewer().setInput(""); //$NON-NLS-1$
}
}
@@ -216,7 +222,7 @@ public class ReferenceSelector implements IElementSelector { // filter.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
final PatternFilter filter = new PatternFilter();
- filter.setPattern("*");
+ filter.setPattern("*"); //$NON-NLS-1$
fTree = new FilteredTree(content, SWT.MULTI | SWT.BORDER, new PatternFilter(), true);
@@ -224,7 +230,7 @@ public class ReferenceSelector implements IElementSelector { fTree.getViewer().getTree().setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
if(contentProvider != null) {
fTree.getViewer().setContentProvider(contentProvider);
- fTree.getViewer().setInput("");
+ fTree.getViewer().setInput(""); //$NON-NLS-1$
}
if(labelProvider != null) {
fTree.getViewer().setLabelProvider(labelProvider);
@@ -248,12 +254,34 @@ public class ReferenceSelector implements IElementSelector { }
}
});
+
+ //Adds double-click support
+ fTree.getViewer().getTree().addSelectionListener(new SelectionListener() {
+
+ public void widgetSelected(SelectionEvent e) {
+ // Nothing
+ }
+
+ public void widgetDefaultSelected(SelectionEvent e) {
+ if(!elementSelectionListeners.isEmpty()) {
+ Object[] selectedElements = getSelectedElements();
+ for(IElementSelectionListener listener : elementSelectionListeners) {
+ listener.addElements(selectedElements);
+ }
+ }
+ }
+
+ });
}
public void setUnique(boolean unique) {
this.unique = unique;
}
+ public void addElementSelectionListener(IElementSelectionListener listener) {
+ elementSelectionListeners.add(listener);
+ }
+
// /**
// * A Text field to let the user type its own filter
// *
diff --git a/plugins/core/org.eclipse.papyrus.widgets/src/org/eclipse/papyrus/widgets/selectors/StandardSelector.java b/plugins/core/org.eclipse.papyrus.widgets/src/org/eclipse/papyrus/widgets/selectors/StandardSelector.java index 2c36accdd80..359427ac86d 100644 --- a/plugins/core/org.eclipse.papyrus.widgets/src/org/eclipse/papyrus/widgets/selectors/StandardSelector.java +++ b/plugins/core/org.eclipse.papyrus.widgets/src/org/eclipse/papyrus/widgets/selectors/StandardSelector.java @@ -12,10 +12,15 @@ package org.eclipse.papyrus.widgets.selectors;
import java.lang.reflect.Constructor;
+import java.util.HashSet;
+import java.util.Set;
import org.eclipse.core.runtime.Assert;
import org.eclipse.papyrus.widgets.Activator;
+import org.eclipse.papyrus.widgets.editors.AbstractEditor;
import org.eclipse.papyrus.widgets.editors.AbstractValueEditor;
+import org.eclipse.papyrus.widgets.editors.ICommitListener;
+import org.eclipse.papyrus.widgets.editors.IElementSelectionListener;
import org.eclipse.papyrus.widgets.editors.IElementSelector;
import org.eclipse.swt.SWT;
import org.eclipse.swt.widgets.Composite;
@@ -35,10 +40,12 @@ public class StandardSelector implements IElementSelector { private Class<? extends AbstractValueEditor> editorClass;
/**
- * The AbstractValueEditor used by this selecotr
+ * The AbstractValueEditor used by this selector
*/
private AbstractValueEditor editor;
+ private Set<IElementSelectionListener> elementSelectionListeners = new HashSet<IElementSelectionListener>();
+
/**
* Instantiates this selector, using the specified editor class
*
@@ -85,6 +92,18 @@ public class StandardSelector implements IElementSelector { try {
Constructor<? extends AbstractValueEditor> construct = editorClass.getDeclaredConstructor(Composite.class, Integer.TYPE);
editor = construct.newInstance(parent, SWT.BORDER);
+ editor.addCommitListener(new ICommitListener() {
+
+ public void commit(AbstractEditor editor) {
+ if(!elementSelectionListeners.isEmpty()) {
+ Object value = StandardSelector.this.editor.getValue();
+ for(IElementSelectionListener listener : elementSelectionListeners) {
+ listener.addElements(new Object[]{ value });
+ }
+ }
+ }
+
+ });
} catch (Exception ex) {
Activator.log.error(ex);
}
@@ -98,4 +117,8 @@ public class StandardSelector implements IElementSelector { //Ignored
}
+ public void addElementSelectionListener(IElementSelectionListener listener) {
+ elementSelectionListeners.add(listener);
+ }
+
}
diff --git a/plugins/core/org.eclipse.papyrus.widgets/src/org/eclipse/papyrus/widgets/selectors/StringSelector.java b/plugins/core/org.eclipse.papyrus.widgets/src/org/eclipse/papyrus/widgets/selectors/StringSelector.java index 94b40eb000b..af98b04fba8 100644 --- a/plugins/core/org.eclipse.papyrus.widgets/src/org/eclipse/papyrus/widgets/selectors/StringSelector.java +++ b/plugins/core/org.eclipse.papyrus.widgets/src/org/eclipse/papyrus/widgets/selectors/StringSelector.java @@ -11,8 +11,14 @@ *****************************************************************************/
package org.eclipse.papyrus.widgets.selectors;
+import java.util.HashSet;
+import java.util.Set;
+
+import org.eclipse.papyrus.widgets.editors.IElementSelectionListener;
import org.eclipse.papyrus.widgets.editors.IElementSelector;
import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.KeyEvent;
+import org.eclipse.swt.events.KeyListener;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Text;
@@ -37,6 +43,8 @@ public class StringSelector implements IElementSelector { */
protected boolean multiline;
+ protected Set<IElementSelectionListener> elementSelectionListeners = new HashSet<IElementSelectionListener>();
+
/**
* Constructs a single-line String Selector
*/
@@ -77,6 +85,28 @@ public class StringSelector implements IElementSelector { */
public void createControls(Composite parent) {
text = new Text(parent, (multiline ? SWT.MULTI : SWT.NONE) | SWT.BORDER);
+ if(!multiline) {
+ text.addKeyListener(new KeyListener() {
+
+ public void keyPressed(KeyEvent e) {
+ //Nothing
+ }
+
+ public void keyReleased(KeyEvent e) {
+ if((e.keyCode == SWT.CR || e.keyCode == SWT.KEYPAD_CR) && e.stateMask == SWT.NONE) {
+ if(!elementSelectionListeners.isEmpty()) {
+ Object[] result = getSelectedElements();
+ if(!result[0].equals("")) { //$NON-NLS-1$
+ for(IElementSelectionListener listener : elementSelectionListeners) {
+ listener.addElements(result);
+ }
+ }
+ }
+ }
+ }
+
+ });
+ }
}
/**
@@ -101,4 +131,8 @@ public class StringSelector implements IElementSelector { public void clearTemporaryElements() {
//Ignored
}
+
+ public void addElementSelectionListener(IElementSelectionListener listener) {
+ elementSelectionListeners.add(listener);
+ }
}
diff --git a/plugins/core/org.eclipse.papyrus.widgets/src/org/eclipse/papyrus/widgets/util/FileUtil.java b/plugins/core/org.eclipse.papyrus.widgets/src/org/eclipse/papyrus/widgets/util/FileUtil.java new file mode 100644 index 00000000000..de096645357 --- /dev/null +++ b/plugins/core/org.eclipse.papyrus.widgets/src/org/eclipse/papyrus/widgets/util/FileUtil.java @@ -0,0 +1,74 @@ +/*****************************************************************************
+ * 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.widgets.util;
+
+import java.io.File;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IWorkspaceRoot;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.papyrus.widgets.Activator;
+
+
+public class FileUtil {
+
+ public static String getPath(IFile file, boolean absolute) {
+ if(absolute) {
+ return file.getLocation().toString();
+ }
+ return file.getFullPath().toString();
+ }
+
+ public static IFile getIFile(String location) {
+ //Search the file in the workspace
+ IWorkspaceRoot workspace = ResourcesPlugin.getWorkspace().getRoot();
+ IPath path = new Path(location);
+ IFile currentFile = null;
+ try {
+ currentFile = workspace.getFile(path);
+ } catch (IllegalArgumentException ex) {
+ //Ignore
+ }
+
+ //Then search it on the disk
+ if(currentFile == null || !currentFile.exists()) {
+ currentFile = workspace.getFileForLocation(path);
+ }
+
+ return currentFile;
+ }
+
+ public static File getFile(String location) {
+ IFile iFile = getIFile(location);
+ if(iFile == null || !iFile.exists()) {
+ return new File(location);
+ }
+
+ return new File(iFile.getLocationURI());
+ }
+
+ public static File getWorkspaceFile(String location) {
+ IWorkspaceRoot workspace = ResourcesPlugin.getWorkspace().getRoot();
+ IPath path = new Path(location);
+ IFile currentFile = null;
+ try {
+ currentFile = workspace.getFile(path);
+ } catch (IllegalArgumentException ex) {
+ Activator.log.error(ex);
+ return null;
+ }
+
+ return currentFile.getLocation().toFile();
+ }
+}
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 Binary files differnew file mode 100644 index 00000000000..8493df40dfe --- /dev/null +++ b/plugins/uml/org.eclipse.papyrus.properties.uml/icons/AddReg.gif 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/core/org.eclipse.papyrus.properties/src/org/eclipse/papyrus/properties/databinding/PapyrusObservableValue.java b/plugins/uml/org.eclipse.papyrus.properties.uml/src/org/eclipse/papyrus/properties/uml/databinding/PapyrusObservableValue.java index 3f2277de714..699814d34da 100644 --- a/plugins/core/org.eclipse.papyrus.properties/src/org/eclipse/papyrus/properties/databinding/PapyrusObservableValue.java +++ b/plugins/uml/org.eclipse.papyrus.properties.uml/src/org/eclipse/papyrus/properties/uml/databinding/PapyrusObservableValue.java @@ -9,7 +9,7 @@ * Contributors:
* Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Initial API and implementation
*****************************************************************************/
-package org.eclipse.papyrus.properties.databinding;
+package org.eclipse.papyrus.properties.uml.databinding;
import org.eclipse.core.databinding.observable.Realm;
import org.eclipse.emf.common.command.Command;
@@ -33,7 +33,7 @@ import org.eclipse.papyrus.service.edit.service.IElementEditService; */
public class PapyrusObservableValue extends EObjectObservableValue {
- private EditingDomain domain;
+ protected EditingDomain domain;
/**
*
@@ -71,6 +71,7 @@ public class PapyrusObservableValue extends EObjectObservableValue { 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);
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;
|