diff options
author | Gabriel Pascual | 2014-04-29 16:24:08 +0000 |
---|---|---|
committer | Gabriel Pascual | 2014-04-30 12:54:50 +0000 |
commit | a174352dd68d69367bcb468722a0bd0938802e2a (patch) | |
tree | 14fc0e595c8b9bdb1528dda11783bd4e8f994509 /plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css.properties/model | |
parent | e770c8764a6f9a9c60315a689d5fc583286616c1 (diff) | |
download | org.eclipse.papyrus-a174352dd68d69367bcb468722a0bd0938802e2a.tar.gz org.eclipse.papyrus-a174352dd68d69367bcb468722a0bd0938802e2a.tar.xz org.eclipse.papyrus-a174352dd68d69367bcb468722a0bd0938802e2a.zip |
430079: [CSS] Papyrus shall provide features to define local theme
https://bugs.eclipse.org/bugs/show_bug.cgi?id=430079
Patch 3 :
- Fix major issue
- Fix comment's remarks
Patch 2 :
- Rebase to pass hudson verification
Pathch 1 :
- Use workspace relative path for selected css files during CSS theme
edition
- Fix "restore default" button action in CSS preference page
- Harmonisation of all UI for theme icon selection
- Add dialog to confirm theme deletion
- Refactor to resolve some dependency problems
- Creation of widget for XWT theme view
- Add embedded style sheets in CSS Workspace engine working
- Fix problems of label provider for CSS themes properties view
- Add workspace themes preference page
- Add definition of theme property view
- Fix saving step of an edited theme from workspace
- Fix loading of theme icon in label provider - Fix behavior of theme
edition dialog fields
- Add edition action on style sheets list
- Add move up and move down actions in edition dialog
- Add actions (add and delete) to dialog
- Resolution staying conflicts after last merge
- Add edition theme dialog from project explorer
- Minor modification of Style sheet metamodel
- Modify CSS engine and theme manager to look at workspace theme
contributions
- Add theme creation by selecting one or more CSS files
- Add dialog to define theme from CSS file in workspace
- Create one menu for two actions to manage local theme
- Manage command ID in handler
- Fix containment relationship in model
- Add draft of theme creation from a CSS selection
- Modification of style sheets model
- Add popup menu on CSS file
Change-Id: Ie46281e334252bfbed727c18a431677761db2a45
Signed-off-by: Gabriel Pascual <gabriel.pascual@all4tec.net>
Diffstat (limited to 'plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css.properties/model')
3 files changed, 146 insertions, 107 deletions
diff --git a/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css.properties/model/Environment.xmi b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css.properties/model/Environment.xmi index 4f5fe3cf2fa..d610db8ed4e 100644 --- a/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css.properties/model/Environment.xmi +++ b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css.properties/model/Environment.xmi @@ -1,19 +1,8 @@ -<?xml version="1.0" encoding="ASCII"?>
-<environment:Environment
- xmi:version="2.0"
- xmlns:xmi="http://www.omg.org/XMI"
- xmlns:environment="http://www.eclipse.org/papyrus/properties/environment/0.9">
- <modelElementFactories
- name="CSS CustomStyle Factory"
- factoryClass="org.eclipse.papyrus.infra.gmfdiag.css.properties.modelelement.CSSModelElementFactory"/>
- <modelElementFactories
- name="CSS Preferences"
- factoryClass="org.eclipse.papyrus.infra.gmfdiag.css.properties.modelelement.CSSPreferencesModelElementFactory"/>
- <widgetTypes
- label="CSS ResetStyle Button"
- widgetClass="ResetStyleWidget"
- namespace="//@namespaces.0"/>
- <namespaces
- name="css"
- value="org.eclipse.papyrus.infra.gmfdiag.css.properties.widgets"/>
-</environment:Environment>
+<?xml version="1.0" encoding="ASCII"?> +<environment:Environment xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:environment="http://www.eclipse.org/papyrus/properties/environment/0.9"> + <modelElementFactories name="CSS CustomStyle Factory" factoryClass="org.eclipse.papyrus.infra.gmfdiag.css.properties.modelelement.CSSModelElementFactory"/> + <modelElementFactories name="CSS Preferences" factoryClass="org.eclipse.papyrus.infra.gmfdiag.css.properties.modelelement.CSSPreferencesModelElementFactory"/> + <modelElementFactories name="CSS Themes" factoryClass="org.eclipse.papyrus.infra.gmfdiag.css.properties.modelelement.CSSThemesModelElementFactory"/> + <widgetTypes label="CSS ResetStyle Button" widgetClass="ResetStyleWidget" namespace="//@namespaces.0"/> + <namespaces name="css" value="org.eclipse.papyrus.infra.gmfdiag.css.properties.widgets"/> +</environment:Environment> diff --git a/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css.properties/model/properties/css.ctx b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css.properties/model/properties/css.ctx index 6b4fb350795..f8cbcf7a6f6 100644 --- a/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css.properties/model/properties/css.ctx +++ b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css.properties/model/properties/css.ctx @@ -1,88 +1,106 @@ -<?xml version="1.0" encoding="UTF-8"?>
-<contexts:Context xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:constraints="http://www.eclipse.org/papyrus/constraints/0.9" xmlns:contexts="http://www.eclipse.org/papyrus/properties/contexts/0.9" name="CSS">
- <tabs label="Style" id="style" category="org.eclipse.papyrus" image="" priority="70">
- <sections name="SingleStylableElement" sectionFile="ui/SingleStylableElement.xwt">
- <widget href="ui/SingleStylableElement.xwt#/"/>
- </sections>
- <sections name="MultipleStylableElement" sectionFile="ui/MultipleStylableElement.xwt">
- <widget href="ui/MultipleStylableElement.xwt#/"/>
- </sections>
- <sections name="SingleDiagram" sectionFile="ui/SingleDiagram.xwt">
- <widget href="ui/SingleDiagram.xwt#/"/>
- </sections>
- <sections name="SingleStyleSheetReference" sectionFile="ui/SingleStyleSheetReference.xwt">
- <widget href="ui/SingleStyleSheetReference.xwt#//@widgets.0"/>
- </sections>
- <sections name="SingleEmbeddedStyleSheet" sectionFile="ui/SingleEmbeddedStyleSheet.xwt">
- <widget href="ui/SingleEmbeddedStyleSheet.xwt#//@widgets.0"/>
- </sections>
- </tabs>
- <views name="SingleStylableElement" sections="//@tabs.0/@sections.0">
- <constraints xsi:type="constraints:SimpleConstraint" name="isSingleStylableElement" overrideable="false" overriddenConstraints="//@views.1/@constraints.0">
- <constraintType href="ppe:/environment/org.eclipse.papyrus.infra.gmfdiag.properties/model/Environment.xmi#//@constraintTypes.0"/>
- <properties xsi:type="constraints:ValueProperty" name="nsUri" value="http://www.eclipse.org/gmf/runtime/1.0.2/notation"/>
- <properties xsi:type="constraints:ValueProperty" name="className" value="View"/>
- </constraints>
- </views>
- <views elementMultiplicity="-1" name="MultipleStylableElement" sections="//@tabs.0/@sections.1">
- <constraints xsi:type="constraints:SimpleConstraint" name="isMultipleStylableElement" overrideable="false">
- <constraintType href="ppe:/environment/org.eclipse.papyrus.infra.gmfdiag.properties/model/Environment.xmi#//@constraintTypes.0"/>
- <properties xsi:type="constraints:ValueProperty" name="nsUri" value="http://www.eclipse.org/gmf/runtime/1.0.2/notation"/>
- <properties xsi:type="constraints:ValueProperty" name="className" value="View"/>
- </constraints>
- </views>
- <views name="Diagram" sections="//@tabs.0/@sections.2">
- <constraints xsi:type="constraints:SimpleConstraint" name="isDiagram" overrideable="false" overriddenConstraints="//@views.0/@constraints.0 //@views.1/@constraints.0">
- <constraintType href="ppe:/environment/org.eclipse.papyrus.infra.gmfdiag.properties/model/Environment.xmi#//@constraintTypes.0"/>
- <properties xsi:type="constraints:ValueProperty" name="nsUri" value="http://www.eclipse.org/gmf/runtime/1.0.2/notation"/>
- <properties xsi:type="constraints:ValueProperty" name="className" value="Diagram"/>
- </constraints>
- </views>
- <views name="SingleStyleSheetReference" sections="//@tabs.0/@sections.3">
- <constraints xsi:type="constraints:SimpleConstraint" name="isStyleSheetReference">
- <constraintType href="ppe:/environment/org.eclipse.papyrus.infra.constraints/Model/ConstraintEnvironment.xmi#//@constraintTypes.0"/>
- <properties xsi:type="constraints:ValueProperty" name="nsUri" value="http://www.eclipse.org/papyrus/infra/gmfdiag/css"/>
- <properties xsi:type="constraints:ValueProperty" name="className" value="StyleSheetReference"/>
- </constraints>
- </views>
- <views name="SingleEmbeddedStyleSheet" sections="//@tabs.0/@sections.4">
- <constraints xsi:type="constraints:SimpleConstraint" name="isEmbeddedStyleSheet">
- <constraintType href="ppe:/environment/org.eclipse.papyrus.infra.constraints/Model/ConstraintEnvironment.xmi#//@constraintTypes.0"/>
- <properties xsi:type="constraints:ValueProperty" name="nsUri" value="http://www.eclipse.org/papyrus/infra/gmfdiag/css"/>
- <properties xsi:type="constraints:ValueProperty" name="className" value="EmbeddedStyleSheet"/>
- </constraints>
- </views>
- <dataContexts name="CSS" label="CSS">
- <elements name="PapyrusCSSStyle">
- <properties name="cssId" label="CSS ID" description="The CSS ID of this element. The ID should be unique within a Diagram. It can be used to retrieve the style properties applied to this element."/>
- <properties name="cssClass" label="CSS Classes" multiplicity="-1" description="The list of CSS Classes associated to this element. Classes are string identifiers, used by the CSS Stylesheets to identify a set of elements on which styles should be applied."/>
- <properties name="cssStyle" label="CSS Style" description="The list of CSS properties applied to this element. This is a local style, which will only be applied on the selected element."/>
- </elements>
- <elements name="DiagramStyle" supertypes="//@dataContexts.0/@elements.0">
- <properties name="css_stylesheets" label="Diagram style sheets" type="Reference" multiplicity="-1" description="The style sheets associated to this diagram"/>
- </elements>
- <elements name="ModelStyle">
- <properties name="modelStyleSheets" label="Model style sheets" type="Reference" multiplicity="-1" description="The style sheets associated to this model"/>
- </elements>
- <modelElementFactory href="ppe:/environment/org.eclipse.papyrus.infra.gmfdiag.css.properties/model/Environment.xmi#//@modelElementFactories.0"/>
- </dataContexts>
- <dataContexts name="modelstylesheets" label="StyleSheets">
- <elements name="StyleSheetReference">
- <properties name="path" label="Path" description="The path to an external style sheet file"/>
- </elements>
- <elements name="EmbeddedStyleSheet">
- <properties name="label" label="" description="The stylesheet's label"/>
- <properties name="content" label="Contents" description="The style sheet contents"/>
- </elements>
- <elements name="ModelStyleSheet">
- <properties name="stylesheets" label="Model style sheets" type="Reference" multiplicity="-1" description="The style sheets associated to the model"/>
- </elements>
- <modelElementFactory href="ppe:/environment/org.eclipse.papyrus.views.properties/model/Environment.xmi#//@modelElementFactories.0"/>
- </dataContexts>
- <dataContexts name="Preferences" label="Preferences">
- <elements name="org.eclipse.papyrus.infra.gmfdiag.css">
- <properties name="currentTheme" label="" description="The theme currently applied to all Papyrus Diagrams in your workspace. The theme can be changed in the preferences."/>
- </elements>
- <modelElementFactory href="ppe:/environment/org.eclipse.papyrus.infra.gmfdiag.css.properties/model/Environment.xmi#//@modelElementFactories.1"/>
- </dataContexts>
-</contexts:Context>
+<?xml version="1.0" encoding="UTF-8"?> +<contexts:Context xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:constraints="http://www.eclipse.org/papyrus/constraints/0.9" xmlns:contexts="http://www.eclipse.org/papyrus/properties/contexts/0.9" name="CSS"> + <tabs label="Style" id="style" category="org.eclipse.papyrus" image="" priority="70"> + <sections name="SingleStylableElement" sectionFile="ui/SingleStylableElement.xwt"> + <widget href="ui/SingleStylableElement.xwt#/"/> + </sections> + <sections name="MultipleStylableElement" sectionFile="ui/MultipleStylableElement.xwt"> + <widget href="ui/MultipleStylableElement.xwt#/"/> + </sections> + <sections name="SingleDiagram" sectionFile="ui/SingleDiagram.xwt"> + <widget href="ui/SingleDiagram.xwt#/"/> + </sections> + <sections name="SingleStyleSheetReference" sectionFile="ui/SingleStyleSheetReference.xwt"> + <widget href="ui/SingleStyleSheetReference.xwt#//@widgets.0"/> + </sections> + <sections name="SingleEmbeddedStyleSheet" sectionFile="ui/SingleEmbeddedStyleSheet.xwt"> + <widget href="ui/SingleEmbeddedStyleSheet.xwt#//@widgets.0"/> + </sections> + <sections name="SingleTheme" sectionFile="ui/SingleTheme.xwt"> + <widget href="ui/SingleTheme.xwt#/"/> + </sections> + </tabs> + <views name="SingleStylableElement" sections="//@tabs.0/@sections.0"> + <constraints xsi:type="constraints:SimpleConstraint" name="isSingleStylableElement" overrideable="false" overriddenConstraints="//@views.1/@constraints.0"> + <constraintType href="ppe:/environment/org.eclipse.papyrus.infra.gmfdiag.properties/model/Environment.xmi#//@constraintTypes.0"/> + <properties xsi:type="constraints:ValueProperty" name="nsUri" value="http://www.eclipse.org/gmf/runtime/1.0.2/notation"/> + <properties xsi:type="constraints:ValueProperty" name="className" value="View"/> + </constraints> + </views> + <views elementMultiplicity="-1" name="MultipleStylableElement" sections="//@tabs.0/@sections.1"> + <constraints xsi:type="constraints:SimpleConstraint" name="isMultipleStylableElement" overrideable="false"> + <constraintType href="ppe:/environment/org.eclipse.papyrus.infra.gmfdiag.properties/model/Environment.xmi#//@constraintTypes.0"/> + <properties xsi:type="constraints:ValueProperty" name="nsUri" value="http://www.eclipse.org/gmf/runtime/1.0.2/notation"/> + <properties xsi:type="constraints:ValueProperty" name="className" value="View"/> + </constraints> + </views> + <views name="Diagram" sections="//@tabs.0/@sections.2"> + <constraints xsi:type="constraints:SimpleConstraint" name="isDiagram" overrideable="false" overriddenConstraints="//@views.0/@constraints.0 //@views.1/@constraints.0"> + <constraintType href="ppe:/environment/org.eclipse.papyrus.infra.gmfdiag.properties/model/Environment.xmi#//@constraintTypes.0"/> + <properties xsi:type="constraints:ValueProperty" name="nsUri" value="http://www.eclipse.org/gmf/runtime/1.0.2/notation"/> + <properties xsi:type="constraints:ValueProperty" name="className" value="Diagram"/> + </constraints> + </views> + <views name="SingleStyleSheetReference" sections="//@tabs.0/@sections.3"> + <constraints xsi:type="constraints:SimpleConstraint" name="isStyleSheetReference"> + <constraintType href="ppe:/environment/org.eclipse.papyrus.infra.constraints/Model/ConstraintEnvironment.xmi#//@constraintTypes.0"/> + <properties xsi:type="constraints:ValueProperty" name="nsUri" value="http://www.eclipse.org/papyrus/infra/gmfdiag/css"/> + <properties xsi:type="constraints:ValueProperty" name="className" value="StyleSheetReference"/> + </constraints> + </views> + <views name="SingleEmbeddedStyleSheet" sections="//@tabs.0/@sections.4"> + <constraints xsi:type="constraints:SimpleConstraint" name="isEmbeddedStyleSheet"> + <constraintType href="ppe:/environment/org.eclipse.papyrus.infra.constraints/Model/ConstraintEnvironment.xmi#//@constraintTypes.0"/> + <properties xsi:type="constraints:ValueProperty" name="nsUri" value="http://www.eclipse.org/papyrus/infra/gmfdiag/css"/> + <properties xsi:type="constraints:ValueProperty" name="className" value="EmbeddedStyleSheet"/> + </constraints> + </views> + <views name="SingleTheme" sections="//@tabs.0/@sections.5"> + <constraints xsi:type="constraints:SimpleConstraint" name="isTheme"> + <constraintType href="ppe:/environment/org.eclipse.papyrus.infra.constraints/Model/ConstraintEnvironment.xmi#//@constraintTypes.0"/> + <properties xsi:type="constraints:ValueProperty" name="nsUri" value="http://www.eclipse.org/papyrus/infra/gmfdiag/css"/> + <properties xsi:type="constraints:ValueProperty" name="className" value="Theme"/> + </constraints> + </views> + <dataContexts name="CSS" label="CSS"> + <elements name="PapyrusCSSStyle"> + <properties name="cssId" label="CSS ID" description="The CSS ID of this element. The ID should be unique within a Diagram. It can be used to retrieve the style properties applied to this element."/> + <properties name="cssClass" label="CSS Classes" multiplicity="-1" description="The list of CSS Classes associated to this element. Classes are string identifiers, used by the CSS Stylesheets to identify a set of elements on which styles should be applied."/> + <properties name="cssStyle" label="CSS Style" description="The list of CSS properties applied to this element. This is a local style, which will only be applied on the selected element."/> + </elements> + <elements name="DiagramStyle" supertypes="//@dataContexts.0/@elements.0"> + <properties name="css_stylesheets" label="Diagram style sheets" type="Reference" multiplicity="-1" description="The style sheets associated to this diagram"/> + </elements> + <elements name="ModelStyle"> + <properties name="modelStyleSheets" label="Model style sheets" type="Reference" multiplicity="-1" description="The style sheets associated to this model"/> + </elements> + <modelElementFactory href="ppe:/environment/org.eclipse.papyrus.infra.gmfdiag.css.properties/model/Environment.xmi#//@modelElementFactories.0"/> + </dataContexts> + <dataContexts name="WorkspaceThemes" label="Themes"> + <elements name="Theme"> + <properties name="label" label="Label" description="Theme label"/> + <properties name="icon" label="Icon" description="Theme icon"/> + <properties name="stylesheets" label="Theme style sheets" type="Reference" multiplicity="-1"/> + </elements> + <modelElementFactory href="ppe:/environment/org.eclipse.papyrus.infra.gmfdiag.css.properties/model/Environment.xmi#//@modelElementFactories.2"/> + </dataContexts> + <dataContexts name="modelstylesheets" label="StyleSheets"> + <elements name="StyleSheetReference"> + <properties name="path" label="Path" description="The path to an external style sheet file"/> + </elements> + <elements name="EmbeddedStyleSheet"> + <properties name="label" label="" description="The stylesheet's label"/> + <properties name="content" label="Contents" description="The style sheet contents"/> + </elements> + <elements name="ModelStyleSheet"> + <properties name="stylesheets" label="Model style sheets" type="Reference" multiplicity="-1" description="The style sheets associated to the model"/> + </elements> + <modelElementFactory href="ppe:/environment/org.eclipse.papyrus.views.properties/model/Environment.xmi#//@modelElementFactories.0"/> + </dataContexts> + <dataContexts name="Preferences" label="Preferences"> + <elements name="org.eclipse.papyrus.infra.gmfdiag.css"> + <properties name="currentTheme" label="" description="The theme currently applied to all Papyrus Diagrams in your workspace. The theme can be changed in the preferences."/> + </elements> + <modelElementFactory href="ppe:/environment/org.eclipse.papyrus.infra.gmfdiag.css.properties/model/Environment.xmi#//@modelElementFactories.1"/> + </dataContexts> +</contexts:Context> diff --git a/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css.properties/model/properties/ui/SingleTheme.xwt b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css.properties/model/properties/ui/SingleTheme.xwt new file mode 100644 index 00000000000..ddcb484a7ef --- /dev/null +++ b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css.properties/model/properties/ui/SingleTheme.xwt @@ -0,0 +1,32 @@ +<?xml version="1.0" encoding="UTF-8"?> +<Composite xmlns="http://www.eclipse.org/xwt/presentation" + xmlns:css="clr-namespace:org.eclipse.papyrus.infra.gmfdiag.css.properties.widgets" + xmlns:ppel="clr-namespace:org.eclipse.papyrus.views.properties.widgets.layout" + xmlns:j="clr-namespace:java.lang" xmlns:ppe="clr-namespace:org.eclipse.papyrus.views.properties.widgets" + xmlns:x="http://www.eclipse.org/xwt"> + <Composite.layout> + <ppel:PropertiesLayout numColumns="1"></ppel:PropertiesLayout> + </Composite.layout> + <ppe:StringEditor input="{Binding}" property="WorkspaceThemes:Theme:label"></ppe:StringEditor> + <ppe:BrowseFilePropertyEditor input="{Binding}" + buttonLabel="Browse..." property="WorkspaceThemes:Theme:icon"> + <ppe:BrowseFilePropertyEditor.filterNames> + <x:Array Type="j:String"> + <j:String>All images</j:String> + <j:String>PNG Icon</j:String> + <j:String>GIF Icon</j:String> + <j:String>JPEG Icon</j:String> + </x:Array> + </ppe:BrowseFilePropertyEditor.filterNames> + <ppe:BrowseFilePropertyEditor.filterExtensions> + <x:Array Type="j:String"> + <j:String>*.gif;*.png;*.jpeg</j:String> + <j:String>*.png</j:String> + <j:String>*.gif</j:String> + <j:String>*.jpeg</j:String> + </x:Array> + </ppe:BrowseFilePropertyEditor.filterExtensions> + </ppe:BrowseFilePropertyEditor> + <ppe:MultiReference input="{Binding}" + property="WorkspaceThemes:Theme:stylesheets"></ppe:MultiReference> +</Composite>
\ No newline at end of file |