Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorcletavernie2012-03-02 12:45:43 +0000
committercletavernie2012-03-02 12:45:43 +0000
commit701daeca6f87e427f00bbb873e900149b8d364c2 (patch)
tree4094cb05a9d57e1dd6c35cf1910d43ffc9d520ed
parent7942f674a6de75f50c4b0f05a92f4fd00da2b2aa (diff)
downloadorg.eclipse.papyrus-701daeca6f87e427f00bbb873e900149b8d364c2.tar.gz
org.eclipse.papyrus-701daeca6f87e427f00bbb873e900149b8d364c2.tar.xz
org.eclipse.papyrus-701daeca6f87e427f00bbb873e900149b8d364c2.zip
370797: [Theme] Papyrus should provide a support for CSS files on its diagrams
https://bugs.eclipse.org/bugs/show_bug.cgi?id=370797
-rw-r--r--incoming/org.eclipse.papyrus.infra.gmfdiag.css.model/.classpath8
-rw-r--r--incoming/org.eclipse.papyrus.infra.gmfdiag.css.model/.project28
-rw-r--r--incoming/org.eclipse.papyrus.infra.gmfdiag.css.model/.settings/org.eclipse.jdt.core.prefs7
-rw-r--r--incoming/org.eclipse.papyrus.infra.gmfdiag.css.model/META-INF/MANIFEST.MF18
-rw-r--r--incoming/org.eclipse.papyrus.infra.gmfdiag.css.model/Model/StyleSheets.ecore (renamed from incoming/org.eclipse.papyrus.infra.gmfdiag.css/model/ModelStyleSheets.ecore)3
-rw-r--r--incoming/org.eclipse.papyrus.infra.gmfdiag.css.model/Model/StyleSheets.genmodel23
-rw-r--r--incoming/org.eclipse.papyrus.infra.gmfdiag.css.model/about.html28
-rw-r--r--incoming/org.eclipse.papyrus.infra.gmfdiag.css.model/build.properties13
-rw-r--r--incoming/org.eclipse.papyrus.infra.gmfdiag.css.model/plugin.properties4
-rw-r--r--incoming/org.eclipse.papyrus.infra.gmfdiag.css.model/plugin.xml16
-rw-r--r--incoming/org.eclipse.papyrus.infra.gmfdiag.css.model/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/stylesheets/EmbeddedStyleSheet.java76
-rw-r--r--incoming/org.eclipse.papyrus.infra.gmfdiag.css.model/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/stylesheets/ModelStyleSheets.java (renamed from incoming/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/modelstylesheets/ModelStyleSheets.java)14
-rw-r--r--incoming/org.eclipse.papyrus.infra.gmfdiag.css.model/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/stylesheets/StyleSheet.java (renamed from incoming/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/modelstylesheets/StyleSheet.java)8
-rw-r--r--incoming/org.eclipse.papyrus.infra.gmfdiag.css.model/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/stylesheets/StyleSheetReference.java (renamed from incoming/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/modelstylesheets/StyleSheetReference.java)14
-rw-r--r--incoming/org.eclipse.papyrus.infra.gmfdiag.css.model/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/stylesheets/StylesheetsFactory.java (renamed from incoming/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/modelstylesheets/ModelStyleSheetsFactory.java)16
-rw-r--r--incoming/org.eclipse.papyrus.infra.gmfdiag.css.model/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/stylesheets/StylesheetsPackage.java (renamed from incoming/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/modelstylesheets/ModelStyleSheetsPackage.java)126
-rw-r--r--incoming/org.eclipse.papyrus.infra.gmfdiag.css.model/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/stylesheets/impl/EmbeddedStyleSheetImpl.java (renamed from incoming/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/modelstylesheets/impl/EmbeddedStyleSheetImpl.java)85
-rw-r--r--incoming/org.eclipse.papyrus.infra.gmfdiag.css.model/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/stylesheets/impl/ModelStyleSheetsImpl.java (renamed from incoming/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/modelstylesheets/impl/ModelStyleSheetsImpl.java)28
-rw-r--r--incoming/org.eclipse.papyrus.infra.gmfdiag.css.model/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/stylesheets/impl/StyleSheetReferenceImpl.java (renamed from incoming/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/modelstylesheets/impl/StyleSheetReferenceImpl.java)29
-rw-r--r--incoming/org.eclipse.papyrus.infra.gmfdiag.css.model/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/stylesheets/impl/StylesheetsFactoryImpl.java (renamed from incoming/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/modelstylesheets/impl/ModelStyleSheetsFactoryImpl.java)38
-rw-r--r--incoming/org.eclipse.papyrus.infra.gmfdiag.css.model/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/stylesheets/impl/StylesheetsPackageImpl.java (renamed from incoming/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/modelstylesheets/impl/ModelStyleSheetsPackageImpl.java)63
-rw-r--r--incoming/org.eclipse.papyrus.infra.gmfdiag.css.model/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/stylesheets/util/StylesheetsAdapterFactory.java (renamed from incoming/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/modelstylesheets/util/ModelStyleSheetsAdapterFactory.java)40
-rw-r--r--incoming/org.eclipse.papyrus.infra.gmfdiag.css.model/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/stylesheets/util/StylesheetsSwitch.java (renamed from incoming/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/modelstylesheets/util/ModelStyleSheetsSwitch.java)28
-rw-r--r--incoming/org.eclipse.papyrus.infra.gmfdiag.css.model/src/org/eclipse/papyrus/infra/gmfdiag/css/model/Activator.java58
-rw-r--r--incoming/org.eclipse.papyrus.infra.gmfdiag.css.properties/META-INF/MANIFEST.MF3
-rw-r--r--incoming/org.eclipse.papyrus.infra.gmfdiag.css.properties/model/Environment.xmi3
-rw-r--r--incoming/org.eclipse.papyrus.infra.gmfdiag.css.properties/model/properties/css.ctx9
-rw-r--r--incoming/org.eclipse.papyrus.infra.gmfdiag.css.properties/model/properties/ui/SingleEmbeddedStyleSheet.xwt8
-rw-r--r--incoming/org.eclipse.papyrus.infra.gmfdiag.css.properties/src/org/eclipse/papyrus/infra/gmfdiag/css/properties/creation/StyleSheetFactory.java4
-rw-r--r--incoming/org.eclipse.papyrus.infra.gmfdiag.css.properties/src/org/eclipse/papyrus/infra/gmfdiag/css/properties/modelelement/CSSPreferencesModelElement.java35
-rw-r--r--incoming/org.eclipse.papyrus.infra.gmfdiag.css.properties/src/org/eclipse/papyrus/infra/gmfdiag/css/properties/modelelement/CSSPreferencesModelElementFactory.java25
-rw-r--r--incoming/org.eclipse.papyrus.infra.gmfdiag.css.properties/src/org/eclipse/papyrus/infra/gmfdiag/css/properties/provider/CSSStyleSheetContentProvider.java6
-rw-r--r--incoming/org.eclipse.papyrus.infra.gmfdiag.css.properties/src/org/eclipse/papyrus/infra/gmfdiag/css/properties/provider/CSSStyleSheetLabelProvider.java10
-rw-r--r--incoming/org.eclipse.papyrus.infra.gmfdiag.css.properties/src/org/eclipse/papyrus/infra/gmfdiag/css/properties/provider/CSSThemeLabelProvider.java48
-rw-r--r--incoming/org.eclipse.papyrus.infra.gmfdiag.css/META-INF/MANIFEST.MF11
-rw-r--r--incoming/org.eclipse.papyrus.infra.gmfdiag.css/icons/papyrus.pngbin0 -> 602 bytes
-rw-r--r--incoming/org.eclipse.papyrus.infra.gmfdiag.css/model/ModelStyleSheets.genmodel22
-rw-r--r--incoming/org.eclipse.papyrus.infra.gmfdiag.css/plugin.xml11
-rw-r--r--incoming/org.eclipse.papyrus.infra.gmfdiag.css/resources/papyrus_theme.css7
-rw-r--r--incoming/org.eclipse.papyrus.infra.gmfdiag.css/schema/theme.exsd43
-rw-r--r--incoming/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/modelstylesheets/EmbeddedStyleSheet.java53
-rw-r--r--incoming/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/modelstylesheets/impl/StyleSheetImpl.java45
-rw-r--r--incoming/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/dom/GMFElementAdapter.java12
-rw-r--r--incoming/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/engine/DiagramCSSEngine.java4
-rw-r--r--incoming/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/engine/ExtendedCSSEngineImpl.java6
-rw-r--r--incoming/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/engine/ModelCSSEngine.java6
-rw-r--r--incoming/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/engine/WorkspaceCSSEngine.java4
-rw-r--r--incoming/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/notation/CSSDiagram.java2
-rw-r--r--incoming/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/notation/CSSDiagramImpl.java2
-rw-r--r--incoming/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/preferences/ThemePreferences.java21
-rw-r--r--incoming/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/preferences/ThemePreferencesPage.java153
-rw-r--r--incoming/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/theme/Theme.java63
-rw-r--r--incoming/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/theme/ThemeManager.java189
53 files changed, 1045 insertions, 531 deletions
diff --git a/incoming/org.eclipse.papyrus.infra.gmfdiag.css.model/.classpath b/incoming/org.eclipse.papyrus.infra.gmfdiag.css.model/.classpath
new file mode 100644
index 00000000000..9c0318f0fd2
--- /dev/null
+++ b/incoming/org.eclipse.papyrus.infra.gmfdiag.css.model/.classpath
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="src" path="src-gen"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
diff --git a/incoming/org.eclipse.papyrus.infra.gmfdiag.css.model/.project b/incoming/org.eclipse.papyrus.infra.gmfdiag.css.model/.project
new file mode 100644
index 00000000000..1c5d4a73430
--- /dev/null
+++ b/incoming/org.eclipse.papyrus.infra.gmfdiag.css.model/.project
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.papyrus.infra.gmfdiag.css.model</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
diff --git a/incoming/org.eclipse.papyrus.infra.gmfdiag.css.model/.settings/org.eclipse.jdt.core.prefs b/incoming/org.eclipse.papyrus.infra.gmfdiag.css.model/.settings/org.eclipse.jdt.core.prefs
new file mode 100644
index 00000000000..44217f8c068
--- /dev/null
+++ b/incoming/org.eclipse.papyrus.infra.gmfdiag.css.model/.settings/org.eclipse.jdt.core.prefs
@@ -0,0 +1,7 @@
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
+org.eclipse.jdt.core.compiler.compliance=1.5
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.5
diff --git a/incoming/org.eclipse.papyrus.infra.gmfdiag.css.model/META-INF/MANIFEST.MF b/incoming/org.eclipse.papyrus.infra.gmfdiag.css.model/META-INF/MANIFEST.MF
new file mode 100644
index 00000000000..104f7afb766
--- /dev/null
+++ b/incoming/org.eclipse.papyrus.infra.gmfdiag.css.model/META-INF/MANIFEST.MF
@@ -0,0 +1,18 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: %pluginName
+Bundle-SymbolicName: org.eclipse.papyrus.infra.gmfdiag.css.model;singleton:=true
+Bundle-Version: 0.9.0.qualifier
+Bundle-ClassPath: .
+Bundle-Vendor: %providerName
+Bundle-Localization: plugin
+Bundle-RequiredExecutionEnvironment: J2SE-1.5
+Export-Package: org.eclipse.papyrus.infra.gmfdiag.css.model,
+ org.eclipse.papyrus.infra.gmfdiag.css.stylesheets,
+ org.eclipse.papyrus.infra.gmfdiag.css.stylesheets.impl,
+ org.eclipse.papyrus.infra.gmfdiag.css.stylesheets.util
+Require-Bundle: org.eclipse.core.runtime,
+ org.eclipse.emf.ecore;visibility:=reexport,
+ org.eclipse.papyrus.infra.core.log;bundle-version="0.9.0",
+ org.eclipse.ui;bundle-version="3.102.0"
+Bundle-ActivationPolicy: lazy
diff --git a/incoming/org.eclipse.papyrus.infra.gmfdiag.css/model/ModelStyleSheets.ecore b/incoming/org.eclipse.papyrus.infra.gmfdiag.css.model/Model/StyleSheets.ecore
index 9a441a75567..933548c12b1 100644
--- a/incoming/org.eclipse.papyrus.infra.gmfdiag.css/model/ModelStyleSheets.ecore
+++ b/incoming/org.eclipse.papyrus.infra.gmfdiag.css.model/Model/StyleSheets.ecore
@@ -1,6 +1,6 @@
<?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="modelstylesheets" nsURI="http://www.eclipse.org/papyrus/infra/gmfdiag/css"
+ xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" name="stylesheets" nsURI="http://www.eclipse.org/papyrus/infra/gmfdiag/css"
nsPrefix="css">
<eClassifiers xsi:type="ecore:EClass" name="ModelStyleSheets" eSuperTypes="platform:/plugin/org.eclipse.emf.ecore/model/Ecore.ecore#//EModelElement">
<eStructuralFeatures xsi:type="ecore:EReference" name="stylesheets" upperBound="-1"
@@ -11,6 +11,7 @@
<eStructuralFeatures xsi:type="ecore:EAttribute" name="path" lowerBound="1" eType="ecore:EDataType platform:/plugin/org.eclipse.emf.ecore/model/Ecore.ecore#//EString"/>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="EmbeddedStyleSheet" eSuperTypes="#//StyleSheet">
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="label" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="content" lowerBound="1"
eType="ecore:EDataType platform:/plugin/org.eclipse.emf.ecore/model/Ecore.ecore#//EString"/>
</eClassifiers>
diff --git a/incoming/org.eclipse.papyrus.infra.gmfdiag.css.model/Model/StyleSheets.genmodel b/incoming/org.eclipse.papyrus.infra.gmfdiag.css.model/Model/StyleSheets.genmodel
new file mode 100644
index 00000000000..720a70cd78a
--- /dev/null
+++ b/incoming/org.eclipse.papyrus.infra.gmfdiag.css.model/Model/StyleSheets.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.infra.gmfdiag.css.model/src-gen"
+ editDirectory="/org.eclipse.papyrus.infra.gmfdiag.css.model.edit/src-gen" editorDirectory="/org.eclipse.papyrus.infra.gmfdiag.css.model.editor/src-gen"
+ modelPluginID="org.eclipse.papyrus.infra.gmfdiag.css.model" modelName="StyleSheets"
+ testsDirectory="/org.eclipse.papyrus.infra.gmfdiag.css.model.tests/src-gen" importerID="org.eclipse.emf.importer.ecore"
+ complianceLevel="5.0" copyrightFields="false" usedGenPackages="platform:/plugin/org.eclipse.emf.ecore/model/Ecore.genmodel#//ecore">
+ <foreignModel>StyleSheets.ecore</foreignModel>
+ <genPackages prefix="Stylesheets" basePackage="org.eclipse.papyrus.infra.gmfdiag.css"
+ disposableProviderFactory="true" ecorePackage="StyleSheets.ecore#/">
+ <genClasses ecoreClass="StyleSheets.ecore#//ModelStyleSheets">
+ <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference StyleSheets.ecore#//ModelStyleSheets/stylesheets"/>
+ </genClasses>
+ <genClasses image="false" ecoreClass="StyleSheets.ecore#//StyleSheet"/>
+ <genClasses ecoreClass="StyleSheets.ecore#//StyleSheetReference">
+ <genFeatures createChild="false" ecoreFeature="ecore:EAttribute StyleSheets.ecore#//StyleSheetReference/path"/>
+ </genClasses>
+ <genClasses ecoreClass="StyleSheets.ecore#//EmbeddedStyleSheet">
+ <genFeatures createChild="false" ecoreFeature="ecore:EAttribute StyleSheets.ecore#//EmbeddedStyleSheet/label"/>
+ <genFeatures createChild="false" ecoreFeature="ecore:EAttribute StyleSheets.ecore#//EmbeddedStyleSheet/content"/>
+ </genClasses>
+ </genPackages>
+</genmodel:GenModel>
diff --git a/incoming/org.eclipse.papyrus.infra.gmfdiag.css.model/about.html b/incoming/org.eclipse.papyrus.infra.gmfdiag.css.model/about.html
new file mode 100644
index 00000000000..209103075a7
--- /dev/null
+++ b/incoming/org.eclipse.papyrus.infra.gmfdiag.css.model/about.html
@@ -0,0 +1,28 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/>
+<title>About</title>
+</head>
+<body lang="EN-US">
+<h2>About This Content</h2>
+
+<p>November 14, 2008</p>
+<h3>License</h3>
+
+<p>The Eclipse Foundation makes available all content in this plug-in (&quot;Content&quot;). Unless otherwise
+indicated below, the Content is provided to you under the terms and conditions of the
+Eclipse Public License Version 1.0 (&quot;EPL&quot;). A copy of the EPL is available
+at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
+For purposes of the EPL, &quot;Program&quot; will mean the Content.</p>
+
+<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is
+being redistributed by another party (&quot;Redistributor&quot;) and different terms and conditions may
+apply to your use of any object code in the Content. Check the Redistributor's license that was
+provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise
+indicated below, the terms and conditions of the EPL still apply to any source code in the Content
+and such source code may be obtained at <a href="http://www.eclipse.org">http://www.eclipse.org</a>.</p>
+
+</body>
+</html> \ No newline at end of file
diff --git a/incoming/org.eclipse.papyrus.infra.gmfdiag.css.model/build.properties b/incoming/org.eclipse.papyrus.infra.gmfdiag.css.model/build.properties
new file mode 100644
index 00000000000..d7d6ea77552
--- /dev/null
+++ b/incoming/org.eclipse.papyrus.infra.gmfdiag.css.model/build.properties
@@ -0,0 +1,13 @@
+#
+
+bin.includes = .,\
+ model/,\
+ META-INF/,\
+ plugin.xml,\
+ plugin.properties,\
+ Model/,\
+ about.html
+jars.compile.order = .
+source.. = src-gen/
+output.. = bin/
+src.includes = about.html
diff --git a/incoming/org.eclipse.papyrus.infra.gmfdiag.css.model/plugin.properties b/incoming/org.eclipse.papyrus.infra.gmfdiag.css.model/plugin.properties
new file mode 100644
index 00000000000..49e6409cb50
--- /dev/null
+++ b/incoming/org.eclipse.papyrus.infra.gmfdiag.css.model/plugin.properties
@@ -0,0 +1,4 @@
+#
+
+pluginName = StyleSheets Model
+providerName = Eclipse Modeling Project
diff --git a/incoming/org.eclipse.papyrus.infra.gmfdiag.css.model/plugin.xml b/incoming/org.eclipse.papyrus.infra.gmfdiag.css.model/plugin.xml
new file mode 100644
index 00000000000..05d78e59164
--- /dev/null
+++ b/incoming/org.eclipse.papyrus.infra.gmfdiag.css.model/plugin.xml
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.0"?>
+
+<!--
+-->
+
+<plugin>
+
+ <extension point="org.eclipse.emf.ecore.generated_package">
+ <package
+ uri="http://www.eclipse.org/papyrus/infra/gmfdiag/css"
+ class="org.eclipse.papyrus.infra.gmfdiag.css.stylesheets.StylesheetsPackage"
+ genModel="Model/StyleSheets.genmodel"/>
+ </extension>
+
+</plugin>
diff --git a/incoming/org.eclipse.papyrus.infra.gmfdiag.css.model/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/stylesheets/EmbeddedStyleSheet.java b/incoming/org.eclipse.papyrus.infra.gmfdiag.css.model/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/stylesheets/EmbeddedStyleSheet.java
new file mode 100644
index 00000000000..d6a00b3609d
--- /dev/null
+++ b/incoming/org.eclipse.papyrus.infra.gmfdiag.css.model/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/stylesheets/EmbeddedStyleSheet.java
@@ -0,0 +1,76 @@
+/**
+ */
+package org.eclipse.papyrus.infra.gmfdiag.css.stylesheets;
+
+
+/**
+ * <!-- begin-user-doc -->
+ * A representation of the model object '<em><b>Embedded Style Sheet</b></em>'.
+ * <!-- end-user-doc -->
+ *
+ * <p>
+ * The following features are supported:
+ * <ul>
+ * <li>{@link org.eclipse.papyrus.infra.gmfdiag.css.stylesheets.EmbeddedStyleSheet#getLabel <em>Label</em>}</li>
+ * <li>{@link org.eclipse.papyrus.infra.gmfdiag.css.stylesheets.EmbeddedStyleSheet#getContent <em>Content</em>}</li>
+ * </ul>
+ * </p>
+ *
+ * @see org.eclipse.papyrus.infra.gmfdiag.css.stylesheets.StylesheetsPackage#getEmbeddedStyleSheet()
+ * @model
+ * @generated
+ */
+public interface EmbeddedStyleSheet extends StyleSheet {
+ /**
+ * Returns the value of the '<em><b>Label</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <p>
+ * 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.infra.gmfdiag.css.stylesheets.StylesheetsPackage#getEmbeddedStyleSheet_Label()
+ * @model
+ * @generated
+ */
+ String getLabel();
+
+ /**
+ * Sets the value of the '{@link org.eclipse.papyrus.infra.gmfdiag.css.stylesheets.EmbeddedStyleSheet#getLabel <em>Label</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param value the new value of the '<em>Label</em>' attribute.
+ * @see #getLabel()
+ * @generated
+ */
+ void setLabel(String value);
+
+ /**
+ * Returns the value of the '<em><b>Content</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Content</em>' attribute isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Content</em>' attribute.
+ * @see #setContent(String)
+ * @see org.eclipse.papyrus.infra.gmfdiag.css.stylesheets.StylesheetsPackage#getEmbeddedStyleSheet_Content()
+ * @model required="true"
+ * @generated
+ */
+ String getContent();
+
+ /**
+ * Sets the value of the '{@link org.eclipse.papyrus.infra.gmfdiag.css.stylesheets.EmbeddedStyleSheet#getContent <em>Content</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param value the new value of the '<em>Content</em>' attribute.
+ * @see #getContent()
+ * @generated
+ */
+ void setContent(String value);
+
+} // EmbeddedStyleSheet
diff --git a/incoming/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/modelstylesheets/ModelStyleSheets.java b/incoming/org.eclipse.papyrus.infra.gmfdiag.css.model/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/stylesheets/ModelStyleSheets.java
index cab154744d0..78fa8760616 100644
--- a/incoming/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/modelstylesheets/ModelStyleSheets.java
+++ b/incoming/org.eclipse.papyrus.infra.gmfdiag.css.model/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/stylesheets/ModelStyleSheets.java
@@ -1,10 +1,6 @@
/**
- * <copyright>
- * </copyright>
- *
- * $Id$
*/
-package org.eclipse.papyrus.infra.gmfdiag.css.modelstylesheets;
+package org.eclipse.papyrus.infra.gmfdiag.css.stylesheets;
import org.eclipse.emf.common.util.EList;
@@ -18,18 +14,18 @@ import org.eclipse.emf.ecore.EModelElement;
* <p>
* The following features are supported:
* <ul>
- * <li>{@link org.eclipse.papyrus.infra.gmfdiag.css.modelstylesheets.ModelStyleSheets#getStylesheets <em>Stylesheets</em>}</li>
+ * <li>{@link org.eclipse.papyrus.infra.gmfdiag.css.stylesheets.ModelStyleSheets#getStylesheets <em>Stylesheets</em>}</li>
* </ul>
* </p>
*
- * @see org.eclipse.papyrus.infra.gmfdiag.css.modelstylesheets.ModelStyleSheetsPackage#getModelStyleSheets()
+ * @see org.eclipse.papyrus.infra.gmfdiag.css.stylesheets.StylesheetsPackage#getModelStyleSheets()
* @model
* @generated
*/
public interface ModelStyleSheets extends EModelElement {
/**
* Returns the value of the '<em><b>Stylesheets</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.papyrus.infra.gmfdiag.css.modelstylesheets.StyleSheet}.
+ * The list contents are of type {@link org.eclipse.papyrus.infra.gmfdiag.css.stylesheets.StyleSheet}.
* <!-- begin-user-doc -->
* <p>
* If the meaning of the '<em>Stylesheets</em>' containment reference list isn't clear,
@@ -37,7 +33,7 @@ public interface ModelStyleSheets extends EModelElement {
* </p>
* <!-- end-user-doc -->
* @return the value of the '<em>Stylesheets</em>' containment reference list.
- * @see org.eclipse.papyrus.infra.gmfdiag.css.modelstylesheets.ModelStyleSheetsPackage#getModelStyleSheets_Stylesheets()
+ * @see org.eclipse.papyrus.infra.gmfdiag.css.stylesheets.StylesheetsPackage#getModelStyleSheets_Stylesheets()
* @model containment="true"
* @generated
*/
diff --git a/incoming/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/modelstylesheets/StyleSheet.java b/incoming/org.eclipse.papyrus.infra.gmfdiag.css.model/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/stylesheets/StyleSheet.java
index 67bca2f9ddb..3cf8a284036 100644
--- a/incoming/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/modelstylesheets/StyleSheet.java
+++ b/incoming/org.eclipse.papyrus.infra.gmfdiag.css.model/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/stylesheets/StyleSheet.java
@@ -1,10 +1,6 @@
/**
- * <copyright>
- * </copyright>
- *
- * $Id$
*/
-package org.eclipse.papyrus.infra.gmfdiag.css.modelstylesheets;
+package org.eclipse.papyrus.infra.gmfdiag.css.stylesheets;
import org.eclipse.emf.ecore.EObject;
@@ -14,7 +10,7 @@ import org.eclipse.emf.ecore.EObject;
* <!-- end-user-doc -->
*
*
- * @see org.eclipse.papyrus.infra.gmfdiag.css.modelstylesheets.ModelStyleSheetsPackage#getStyleSheet()
+ * @see org.eclipse.papyrus.infra.gmfdiag.css.stylesheets.StylesheetsPackage#getStyleSheet()
* @model interface="true" abstract="true"
* @generated
*/
diff --git a/incoming/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/modelstylesheets/StyleSheetReference.java b/incoming/org.eclipse.papyrus.infra.gmfdiag.css.model/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/stylesheets/StyleSheetReference.java
index 62ef45d0bf1..c6d5e15a57e 100644
--- a/incoming/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/modelstylesheets/StyleSheetReference.java
+++ b/incoming/org.eclipse.papyrus.infra.gmfdiag.css.model/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/stylesheets/StyleSheetReference.java
@@ -1,10 +1,6 @@
/**
- * <copyright>
- * </copyright>
- *
- * $Id$
*/
-package org.eclipse.papyrus.infra.gmfdiag.css.modelstylesheets;
+package org.eclipse.papyrus.infra.gmfdiag.css.stylesheets;
/**
@@ -15,11 +11,11 @@ package org.eclipse.papyrus.infra.gmfdiag.css.modelstylesheets;
* <p>
* The following features are supported:
* <ul>
- * <li>{@link org.eclipse.papyrus.infra.gmfdiag.css.modelstylesheets.StyleSheetReference#getPath <em>Path</em>}</li>
+ * <li>{@link org.eclipse.papyrus.infra.gmfdiag.css.stylesheets.StyleSheetReference#getPath <em>Path</em>}</li>
* </ul>
* </p>
*
- * @see org.eclipse.papyrus.infra.gmfdiag.css.modelstylesheets.ModelStyleSheetsPackage#getStyleSheetReference()
+ * @see org.eclipse.papyrus.infra.gmfdiag.css.stylesheets.StylesheetsPackage#getStyleSheetReference()
* @model
* @generated
*/
@@ -34,14 +30,14 @@ public interface StyleSheetReference extends StyleSheet {
* <!-- end-user-doc -->
* @return the value of the '<em>Path</em>' attribute.
* @see #setPath(String)
- * @see org.eclipse.papyrus.infra.gmfdiag.css.modelstylesheets.ModelStyleSheetsPackage#getStyleSheetReference_Path()
+ * @see org.eclipse.papyrus.infra.gmfdiag.css.stylesheets.StylesheetsPackage#getStyleSheetReference_Path()
* @model required="true"
* @generated
*/
String getPath();
/**
- * Sets the value of the '{@link org.eclipse.papyrus.infra.gmfdiag.css.modelstylesheets.StyleSheetReference#getPath <em>Path</em>}' attribute.
+ * Sets the value of the '{@link org.eclipse.papyrus.infra.gmfdiag.css.stylesheets.StyleSheetReference#getPath <em>Path</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @param value the new value of the '<em>Path</em>' attribute.
diff --git a/incoming/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/modelstylesheets/ModelStyleSheetsFactory.java b/incoming/org.eclipse.papyrus.infra.gmfdiag.css.model/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/stylesheets/StylesheetsFactory.java
index 4ea6bdbb807..27b6b2da365 100644
--- a/incoming/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/modelstylesheets/ModelStyleSheetsFactory.java
+++ b/incoming/org.eclipse.papyrus.infra.gmfdiag.css.model/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/stylesheets/StylesheetsFactory.java
@@ -1,10 +1,6 @@
/**
- * <copyright>
- * </copyright>
- *
- * $Id$
*/
-package org.eclipse.papyrus.infra.gmfdiag.css.modelstylesheets;
+package org.eclipse.papyrus.infra.gmfdiag.css.stylesheets;
import org.eclipse.emf.ecore.EFactory;
@@ -13,17 +9,17 @@ import org.eclipse.emf.ecore.EFactory;
* 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.infra.gmfdiag.css.modelstylesheets.ModelStyleSheetsPackage
+ * @see org.eclipse.papyrus.infra.gmfdiag.css.stylesheets.StylesheetsPackage
* @generated
*/
-public interface ModelStyleSheetsFactory extends EFactory {
+public interface StylesheetsFactory extends EFactory {
/**
* The singleton instance of the factory.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
- ModelStyleSheetsFactory eINSTANCE = org.eclipse.papyrus.infra.gmfdiag.css.modelstylesheets.impl.ModelStyleSheetsFactoryImpl.init();
+ StylesheetsFactory eINSTANCE = org.eclipse.papyrus.infra.gmfdiag.css.stylesheets.impl.StylesheetsFactoryImpl.init();
/**
* Returns a new object of class '<em>Model Style Sheets</em>'.
@@ -59,6 +55,6 @@ public interface ModelStyleSheetsFactory extends EFactory {
* @return the package supported by this factory.
* @generated
*/
- ModelStyleSheetsPackage getModelStyleSheetsPackage();
+ StylesheetsPackage getStylesheetsPackage();
-} //ModelStyleSheetsFactory
+} //StylesheetsFactory
diff --git a/incoming/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/modelstylesheets/ModelStyleSheetsPackage.java b/incoming/org.eclipse.papyrus.infra.gmfdiag.css.model/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/stylesheets/StylesheetsPackage.java
index 17c16b5ce6f..60b633b60e6 100644
--- a/incoming/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/modelstylesheets/ModelStyleSheetsPackage.java
+++ b/incoming/org.eclipse.papyrus.infra.gmfdiag.css.model/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/stylesheets/StylesheetsPackage.java
@@ -1,10 +1,6 @@
/**
- * <copyright>
- * </copyright>
- *
- * $Id$
*/
-package org.eclipse.papyrus.infra.gmfdiag.css.modelstylesheets;
+package org.eclipse.papyrus.infra.gmfdiag.css.stylesheets;
import org.eclipse.emf.ecore.EAttribute;
import org.eclipse.emf.ecore.EClass;
@@ -23,18 +19,18 @@ import org.eclipse.emf.ecore.EcorePackage;
* <li>and each data type</li>
* </ul>
* <!-- end-user-doc -->
- * @see org.eclipse.papyrus.infra.gmfdiag.css.modelstylesheets.ModelStyleSheetsFactory
+ * @see org.eclipse.papyrus.infra.gmfdiag.css.stylesheets.StylesheetsFactory
* @model kind="package"
* @generated
*/
-public interface ModelStyleSheetsPackage extends EPackage {
+public interface StylesheetsPackage extends EPackage {
/**
* The package name.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
- String eNAME = "modelstylesheets";
+ String eNAME = "stylesheets";
/**
* The package namespace URI.
@@ -58,14 +54,14 @@ public interface ModelStyleSheetsPackage extends EPackage {
* <!-- end-user-doc -->
* @generated
*/
- ModelStyleSheetsPackage eINSTANCE = org.eclipse.papyrus.infra.gmfdiag.css.modelstylesheets.impl.ModelStyleSheetsPackageImpl.init();
+ StylesheetsPackage eINSTANCE = org.eclipse.papyrus.infra.gmfdiag.css.stylesheets.impl.StylesheetsPackageImpl.init();
/**
- * The meta object id for the '{@link org.eclipse.papyrus.infra.gmfdiag.css.modelstylesheets.impl.ModelStyleSheetsImpl <em>Model Style Sheets</em>}' class.
+ * The meta object id for the '{@link org.eclipse.papyrus.infra.gmfdiag.css.stylesheets.impl.ModelStyleSheetsImpl <em>Model Style Sheets</em>}' class.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
- * @see org.eclipse.papyrus.infra.gmfdiag.css.modelstylesheets.impl.ModelStyleSheetsImpl
- * @see org.eclipse.papyrus.infra.gmfdiag.css.modelstylesheets.impl.ModelStyleSheetsPackageImpl#getModelStyleSheets()
+ * @see org.eclipse.papyrus.infra.gmfdiag.css.stylesheets.impl.ModelStyleSheetsImpl
+ * @see org.eclipse.papyrus.infra.gmfdiag.css.stylesheets.impl.StylesheetsPackageImpl#getModelStyleSheets()
* @generated
*/
int MODEL_STYLE_SHEETS = 0;
@@ -98,11 +94,11 @@ public interface ModelStyleSheetsPackage extends EPackage {
int MODEL_STYLE_SHEETS_FEATURE_COUNT = EcorePackage.EMODEL_ELEMENT_FEATURE_COUNT + 1;
/**
- * The meta object id for the '{@link org.eclipse.papyrus.infra.gmfdiag.css.modelstylesheets.StyleSheet <em>Style Sheet</em>}' class.
+ * The meta object id for the '{@link org.eclipse.papyrus.infra.gmfdiag.css.stylesheets.StyleSheet <em>Style Sheet</em>}' class.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
- * @see org.eclipse.papyrus.infra.gmfdiag.css.modelstylesheets.StyleSheet
- * @see org.eclipse.papyrus.infra.gmfdiag.css.modelstylesheets.impl.ModelStyleSheetsPackageImpl#getStyleSheet()
+ * @see org.eclipse.papyrus.infra.gmfdiag.css.stylesheets.StyleSheet
+ * @see org.eclipse.papyrus.infra.gmfdiag.css.stylesheets.impl.StylesheetsPackageImpl#getStyleSheet()
* @generated
*/
int STYLE_SHEET = 1;
@@ -117,11 +113,11 @@ public interface ModelStyleSheetsPackage extends EPackage {
int STYLE_SHEET_FEATURE_COUNT = 0;
/**
- * The meta object id for the '{@link org.eclipse.papyrus.infra.gmfdiag.css.modelstylesheets.impl.StyleSheetReferenceImpl <em>Style Sheet Reference</em>}' class.
+ * The meta object id for the '{@link org.eclipse.papyrus.infra.gmfdiag.css.stylesheets.impl.StyleSheetReferenceImpl <em>Style Sheet Reference</em>}' class.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
- * @see org.eclipse.papyrus.infra.gmfdiag.css.modelstylesheets.impl.StyleSheetReferenceImpl
- * @see org.eclipse.papyrus.infra.gmfdiag.css.modelstylesheets.impl.ModelStyleSheetsPackageImpl#getStyleSheetReference()
+ * @see org.eclipse.papyrus.infra.gmfdiag.css.stylesheets.impl.StyleSheetReferenceImpl
+ * @see org.eclipse.papyrus.infra.gmfdiag.css.stylesheets.impl.StylesheetsPackageImpl#getStyleSheetReference()
* @generated
*/
int STYLE_SHEET_REFERENCE = 2;
@@ -145,23 +141,32 @@ public interface ModelStyleSheetsPackage extends EPackage {
int STYLE_SHEET_REFERENCE_FEATURE_COUNT = STYLE_SHEET_FEATURE_COUNT + 1;
/**
- * The meta object id for the '{@link org.eclipse.papyrus.infra.gmfdiag.css.modelstylesheets.impl.EmbeddedStyleSheetImpl <em>Embedded Style Sheet</em>}' class.
+ * The meta object id for the '{@link org.eclipse.papyrus.infra.gmfdiag.css.stylesheets.impl.EmbeddedStyleSheetImpl <em>Embedded Style Sheet</em>}' class.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
- * @see org.eclipse.papyrus.infra.gmfdiag.css.modelstylesheets.impl.EmbeddedStyleSheetImpl
- * @see org.eclipse.papyrus.infra.gmfdiag.css.modelstylesheets.impl.ModelStyleSheetsPackageImpl#getEmbeddedStyleSheet()
+ * @see org.eclipse.papyrus.infra.gmfdiag.css.stylesheets.impl.EmbeddedStyleSheetImpl
+ * @see org.eclipse.papyrus.infra.gmfdiag.css.stylesheets.impl.StylesheetsPackageImpl#getEmbeddedStyleSheet()
* @generated
*/
int EMBEDDED_STYLE_SHEET = 3;
/**
+ * The feature id for the '<em><b>Label</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int EMBEDDED_STYLE_SHEET__LABEL = STYLE_SHEET_FEATURE_COUNT + 0;
+
+ /**
* The feature id for the '<em><b>Content</b></em>' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
- int EMBEDDED_STYLE_SHEET__CONTENT = STYLE_SHEET_FEATURE_COUNT + 0;
+ int EMBEDDED_STYLE_SHEET__CONTENT = STYLE_SHEET_FEATURE_COUNT + 1;
/**
* The number of structural features of the '<em>Embedded Style Sheet</em>' class.
@@ -170,77 +175,88 @@ public interface ModelStyleSheetsPackage extends EPackage {
* @generated
* @ordered
*/
- int EMBEDDED_STYLE_SHEET_FEATURE_COUNT = STYLE_SHEET_FEATURE_COUNT + 1;
+ int EMBEDDED_STYLE_SHEET_FEATURE_COUNT = STYLE_SHEET_FEATURE_COUNT + 2;
/**
- * Returns the meta object for class '{@link org.eclipse.papyrus.infra.gmfdiag.css.modelstylesheets.ModelStyleSheets <em>Model Style Sheets</em>}'.
+ * Returns the meta object for class '{@link org.eclipse.papyrus.infra.gmfdiag.css.stylesheets.ModelStyleSheets <em>Model Style Sheets</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return the meta object for class '<em>Model Style Sheets</em>'.
- * @see org.eclipse.papyrus.infra.gmfdiag.css.modelstylesheets.ModelStyleSheets
+ * @see org.eclipse.papyrus.infra.gmfdiag.css.stylesheets.ModelStyleSheets
* @generated
*/
EClass getModelStyleSheets();
/**
- * Returns the meta object for the containment reference list '{@link org.eclipse.papyrus.infra.gmfdiag.css.modelstylesheets.ModelStyleSheets#getStylesheets <em>Stylesheets</em>}'.
+ * Returns the meta object for the containment reference list '{@link org.eclipse.papyrus.infra.gmfdiag.css.stylesheets.ModelStyleSheets#getStylesheets <em>Stylesheets</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return the meta object for the containment reference list '<em>Stylesheets</em>'.
- * @see org.eclipse.papyrus.infra.gmfdiag.css.modelstylesheets.ModelStyleSheets#getStylesheets()
+ * @see org.eclipse.papyrus.infra.gmfdiag.css.stylesheets.ModelStyleSheets#getStylesheets()
* @see #getModelStyleSheets()
* @generated
*/
EReference getModelStyleSheets_Stylesheets();
/**
- * Returns the meta object for class '{@link org.eclipse.papyrus.infra.gmfdiag.css.modelstylesheets.StyleSheet <em>Style Sheet</em>}'.
+ * Returns the meta object for class '{@link org.eclipse.papyrus.infra.gmfdiag.css.stylesheets.StyleSheet <em>Style Sheet</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return the meta object for class '<em>Style Sheet</em>'.
- * @see org.eclipse.papyrus.infra.gmfdiag.css.modelstylesheets.StyleSheet
+ * @see org.eclipse.papyrus.infra.gmfdiag.css.stylesheets.StyleSheet
* @generated
*/
EClass getStyleSheet();
/**
- * Returns the meta object for class '{@link org.eclipse.papyrus.infra.gmfdiag.css.modelstylesheets.StyleSheetReference <em>Style Sheet Reference</em>}'.
+ * Returns the meta object for class '{@link org.eclipse.papyrus.infra.gmfdiag.css.stylesheets.StyleSheetReference <em>Style Sheet Reference</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return the meta object for class '<em>Style Sheet Reference</em>'.
- * @see org.eclipse.papyrus.infra.gmfdiag.css.modelstylesheets.StyleSheetReference
+ * @see org.eclipse.papyrus.infra.gmfdiag.css.stylesheets.StyleSheetReference
* @generated
*/
EClass getStyleSheetReference();
/**
- * Returns the meta object for the attribute '{@link org.eclipse.papyrus.infra.gmfdiag.css.modelstylesheets.StyleSheetReference#getPath <em>Path</em>}'.
+ * Returns the meta object for the attribute '{@link org.eclipse.papyrus.infra.gmfdiag.css.stylesheets.StyleSheetReference#getPath <em>Path</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return the meta object for the attribute '<em>Path</em>'.
- * @see org.eclipse.papyrus.infra.gmfdiag.css.modelstylesheets.StyleSheetReference#getPath()
+ * @see org.eclipse.papyrus.infra.gmfdiag.css.stylesheets.StyleSheetReference#getPath()
* @see #getStyleSheetReference()
* @generated
*/
EAttribute getStyleSheetReference_Path();
/**
- * Returns the meta object for class '{@link org.eclipse.papyrus.infra.gmfdiag.css.modelstylesheets.EmbeddedStyleSheet <em>Embedded Style Sheet</em>}'.
+ * Returns the meta object for class '{@link org.eclipse.papyrus.infra.gmfdiag.css.stylesheets.EmbeddedStyleSheet <em>Embedded Style Sheet</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return the meta object for class '<em>Embedded Style Sheet</em>'.
- * @see org.eclipse.papyrus.infra.gmfdiag.css.modelstylesheets.EmbeddedStyleSheet
+ * @see org.eclipse.papyrus.infra.gmfdiag.css.stylesheets.EmbeddedStyleSheet
* @generated
*/
EClass getEmbeddedStyleSheet();
/**
- * Returns the meta object for the attribute '{@link org.eclipse.papyrus.infra.gmfdiag.css.modelstylesheets.EmbeddedStyleSheet#getContent <em>Content</em>}'.
+ * Returns the meta object for the attribute '{@link org.eclipse.papyrus.infra.gmfdiag.css.stylesheets.EmbeddedStyleSheet#getLabel <em>Label</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for the attribute '<em>Label</em>'.
+ * @see org.eclipse.papyrus.infra.gmfdiag.css.stylesheets.EmbeddedStyleSheet#getLabel()
+ * @see #getEmbeddedStyleSheet()
+ * @generated
+ */
+ EAttribute getEmbeddedStyleSheet_Label();
+
+ /**
+ * Returns the meta object for the attribute '{@link org.eclipse.papyrus.infra.gmfdiag.css.stylesheets.EmbeddedStyleSheet#getContent <em>Content</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return the meta object for the attribute '<em>Content</em>'.
- * @see org.eclipse.papyrus.infra.gmfdiag.css.modelstylesheets.EmbeddedStyleSheet#getContent()
+ * @see org.eclipse.papyrus.infra.gmfdiag.css.stylesheets.EmbeddedStyleSheet#getContent()
* @see #getEmbeddedStyleSheet()
* @generated
*/
@@ -253,7 +269,7 @@ public interface ModelStyleSheetsPackage extends EPackage {
* @return the factory that creates the instances of the model.
* @generated
*/
- ModelStyleSheetsFactory getModelStyleSheetsFactory();
+ StylesheetsFactory getStylesheetsFactory();
/**
* <!-- begin-user-doc -->
@@ -269,11 +285,11 @@ public interface ModelStyleSheetsPackage extends EPackage {
*/
interface Literals {
/**
- * The meta object literal for the '{@link org.eclipse.papyrus.infra.gmfdiag.css.modelstylesheets.impl.ModelStyleSheetsImpl <em>Model Style Sheets</em>}' class.
+ * The meta object literal for the '{@link org.eclipse.papyrus.infra.gmfdiag.css.stylesheets.impl.ModelStyleSheetsImpl <em>Model Style Sheets</em>}' class.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
- * @see org.eclipse.papyrus.infra.gmfdiag.css.modelstylesheets.impl.ModelStyleSheetsImpl
- * @see org.eclipse.papyrus.infra.gmfdiag.css.modelstylesheets.impl.ModelStyleSheetsPackageImpl#getModelStyleSheets()
+ * @see org.eclipse.papyrus.infra.gmfdiag.css.stylesheets.impl.ModelStyleSheetsImpl
+ * @see org.eclipse.papyrus.infra.gmfdiag.css.stylesheets.impl.StylesheetsPackageImpl#getModelStyleSheets()
* @generated
*/
EClass MODEL_STYLE_SHEETS = eINSTANCE.getModelStyleSheets();
@@ -287,21 +303,21 @@ public interface ModelStyleSheetsPackage extends EPackage {
EReference MODEL_STYLE_SHEETS__STYLESHEETS = eINSTANCE.getModelStyleSheets_Stylesheets();
/**
- * The meta object literal for the '{@link org.eclipse.papyrus.infra.gmfdiag.css.modelstylesheets.StyleSheet <em>Style Sheet</em>}' class.
+ * The meta object literal for the '{@link org.eclipse.papyrus.infra.gmfdiag.css.stylesheets.StyleSheet <em>Style Sheet</em>}' class.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
- * @see org.eclipse.papyrus.infra.gmfdiag.css.modelstylesheets.StyleSheet
- * @see org.eclipse.papyrus.infra.gmfdiag.css.modelstylesheets.impl.ModelStyleSheetsPackageImpl#getStyleSheet()
+ * @see org.eclipse.papyrus.infra.gmfdiag.css.stylesheets.StyleSheet
+ * @see org.eclipse.papyrus.infra.gmfdiag.css.stylesheets.impl.StylesheetsPackageImpl#getStyleSheet()
* @generated
*/
EClass STYLE_SHEET = eINSTANCE.getStyleSheet();
/**
- * The meta object literal for the '{@link org.eclipse.papyrus.infra.gmfdiag.css.modelstylesheets.impl.StyleSheetReferenceImpl <em>Style Sheet Reference</em>}' class.
+ * The meta object literal for the '{@link org.eclipse.papyrus.infra.gmfdiag.css.stylesheets.impl.StyleSheetReferenceImpl <em>Style Sheet Reference</em>}' class.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
- * @see org.eclipse.papyrus.infra.gmfdiag.css.modelstylesheets.impl.StyleSheetReferenceImpl
- * @see org.eclipse.papyrus.infra.gmfdiag.css.modelstylesheets.impl.ModelStyleSheetsPackageImpl#getStyleSheetReference()
+ * @see org.eclipse.papyrus.infra.gmfdiag.css.stylesheets.impl.StyleSheetReferenceImpl
+ * @see org.eclipse.papyrus.infra.gmfdiag.css.stylesheets.impl.StylesheetsPackageImpl#getStyleSheetReference()
* @generated
*/
EClass STYLE_SHEET_REFERENCE = eINSTANCE.getStyleSheetReference();
@@ -315,16 +331,24 @@ public interface ModelStyleSheetsPackage extends EPackage {
EAttribute STYLE_SHEET_REFERENCE__PATH = eINSTANCE.getStyleSheetReference_Path();
/**
- * The meta object literal for the '{@link org.eclipse.papyrus.infra.gmfdiag.css.modelstylesheets.impl.EmbeddedStyleSheetImpl <em>Embedded Style Sheet</em>}' class.
+ * The meta object literal for the '{@link org.eclipse.papyrus.infra.gmfdiag.css.stylesheets.impl.EmbeddedStyleSheetImpl <em>Embedded Style Sheet</em>}' class.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
- * @see org.eclipse.papyrus.infra.gmfdiag.css.modelstylesheets.impl.EmbeddedStyleSheetImpl
- * @see org.eclipse.papyrus.infra.gmfdiag.css.modelstylesheets.impl.ModelStyleSheetsPackageImpl#getEmbeddedStyleSheet()
+ * @see org.eclipse.papyrus.infra.gmfdiag.css.stylesheets.impl.EmbeddedStyleSheetImpl
+ * @see org.eclipse.papyrus.infra.gmfdiag.css.stylesheets.impl.StylesheetsPackageImpl#getEmbeddedStyleSheet()
* @generated
*/
EClass EMBEDDED_STYLE_SHEET = eINSTANCE.getEmbeddedStyleSheet();
/**
+ * The meta object literal for the '<em><b>Label</b></em>' attribute feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ EAttribute EMBEDDED_STYLE_SHEET__LABEL = eINSTANCE.getEmbeddedStyleSheet_Label();
+
+ /**
* The meta object literal for the '<em><b>Content</b></em>' attribute feature.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
@@ -334,4 +358,4 @@ public interface ModelStyleSheetsPackage extends EPackage {
}
-} //ModelStyleSheetsPackage
+} //StylesheetsPackage
diff --git a/incoming/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/modelstylesheets/impl/EmbeddedStyleSheetImpl.java b/incoming/org.eclipse.papyrus.infra.gmfdiag.css.model/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/stylesheets/impl/EmbeddedStyleSheetImpl.java
index 116ac79b92d..dd520fddd26 100644
--- a/incoming/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/modelstylesheets/impl/EmbeddedStyleSheetImpl.java
+++ b/incoming/org.eclipse.papyrus.infra.gmfdiag.css.model/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/stylesheets/impl/EmbeddedStyleSheetImpl.java
@@ -1,20 +1,16 @@
/**
- * <copyright>
- * </copyright>
- *
- * $Id$
*/
-package org.eclipse.papyrus.infra.gmfdiag.css.modelstylesheets.impl;
+package org.eclipse.papyrus.infra.gmfdiag.css.stylesheets.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.infra.gmfdiag.css.modelstylesheets.EmbeddedStyleSheet;
-import org.eclipse.papyrus.infra.gmfdiag.css.modelstylesheets.ModelStyleSheetsPackage;
+
+import org.eclipse.papyrus.infra.gmfdiag.css.stylesheets.EmbeddedStyleSheet;
+import org.eclipse.papyrus.infra.gmfdiag.css.stylesheets.StylesheetsPackage;
/**
* <!-- begin-user-doc -->
@@ -23,14 +19,34 @@ import org.eclipse.papyrus.infra.gmfdiag.css.modelstylesheets.ModelStyleSheetsPa
* <p>
* The following features are implemented:
* <ul>
- * <li>{@link org.eclipse.papyrus.infra.gmfdiag.css.modelstylesheets.impl.EmbeddedStyleSheetImpl#getContent <em>Content</em>}</li>
+ * <li>{@link org.eclipse.papyrus.infra.gmfdiag.css.stylesheets.impl.EmbeddedStyleSheetImpl#getLabel <em>Label</em>}</li>
+ * <li>{@link org.eclipse.papyrus.infra.gmfdiag.css.stylesheets.impl.EmbeddedStyleSheetImpl#getContent <em>Content</em>}</li>
* </ul>
* </p>
*
* @generated
*/
-public class EmbeddedStyleSheetImpl extends
-EObjectImpl implements EmbeddedStyleSheet {
+public class EmbeddedStyleSheetImpl extends EObjectImpl implements EmbeddedStyleSheet {
+ /**
+ * The default value of the '{@link #getLabel() <em>Label</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getLabel()
+ * @generated
+ * @ordered
+ */
+ protected static final String LABEL_EDEFAULT = null;
+
+ /**
+ * The cached value of the '{@link #getLabel() <em>Label</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getLabel()
+ * @generated
+ * @ordered
+ */
+ protected String label = LABEL_EDEFAULT;
+
/**
* The default value of the '{@link #getContent() <em>Content</em>}' attribute.
* <!-- begin-user-doc -->
@@ -67,7 +83,28 @@ EObjectImpl implements EmbeddedStyleSheet {
*/
@Override
protected EClass eStaticClass() {
- return ModelStyleSheetsPackage.Literals.EMBEDDED_STYLE_SHEET;
+ return StylesheetsPackage.Literals.EMBEDDED_STYLE_SHEET;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public String getLabel() {
+ return label;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setLabel(String newLabel) {
+ String oldLabel = label;
+ label = newLabel;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET, StylesheetsPackage.EMBEDDED_STYLE_SHEET__LABEL, oldLabel, label));
}
/**
@@ -88,7 +125,7 @@ EObjectImpl implements EmbeddedStyleSheet {
String oldContent = content;
content = newContent;
if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, ModelStyleSheetsPackage.EMBEDDED_STYLE_SHEET__CONTENT, oldContent, content));
+ eNotify(new ENotificationImpl(this, Notification.SET, StylesheetsPackage.EMBEDDED_STYLE_SHEET__CONTENT, oldContent, content));
}
/**
@@ -99,7 +136,9 @@ EObjectImpl implements EmbeddedStyleSheet {
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
- case ModelStyleSheetsPackage.EMBEDDED_STYLE_SHEET__CONTENT:
+ case StylesheetsPackage.EMBEDDED_STYLE_SHEET__LABEL:
+ return getLabel();
+ case StylesheetsPackage.EMBEDDED_STYLE_SHEET__CONTENT:
return getContent();
}
return super.eGet(featureID, resolve, coreType);
@@ -113,7 +152,10 @@ EObjectImpl implements EmbeddedStyleSheet {
@Override
public void eSet(int featureID, Object newValue) {
switch (featureID) {
- case ModelStyleSheetsPackage.EMBEDDED_STYLE_SHEET__CONTENT:
+ case StylesheetsPackage.EMBEDDED_STYLE_SHEET__LABEL:
+ setLabel((String)newValue);
+ return;
+ case StylesheetsPackage.EMBEDDED_STYLE_SHEET__CONTENT:
setContent((String)newValue);
return;
}
@@ -128,7 +170,10 @@ EObjectImpl implements EmbeddedStyleSheet {
@Override
public void eUnset(int featureID) {
switch (featureID) {
- case ModelStyleSheetsPackage.EMBEDDED_STYLE_SHEET__CONTENT:
+ case StylesheetsPackage.EMBEDDED_STYLE_SHEET__LABEL:
+ setLabel(LABEL_EDEFAULT);
+ return;
+ case StylesheetsPackage.EMBEDDED_STYLE_SHEET__CONTENT:
setContent(CONTENT_EDEFAULT);
return;
}
@@ -143,7 +188,9 @@ EObjectImpl implements EmbeddedStyleSheet {
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
- case ModelStyleSheetsPackage.EMBEDDED_STYLE_SHEET__CONTENT:
+ case StylesheetsPackage.EMBEDDED_STYLE_SHEET__LABEL:
+ return LABEL_EDEFAULT == null ? label != null : !LABEL_EDEFAULT.equals(label);
+ case StylesheetsPackage.EMBEDDED_STYLE_SHEET__CONTENT:
return CONTENT_EDEFAULT == null ? content != null : !CONTENT_EDEFAULT.equals(content);
}
return super.eIsSet(featureID);
@@ -159,7 +206,9 @@ EObjectImpl implements EmbeddedStyleSheet {
if (eIsProxy()) return super.toString();
StringBuffer result = new StringBuffer(super.toString());
- result.append(" (content: ");
+ result.append(" (label: ");
+ result.append(label);
+ result.append(", content: ");
result.append(content);
result.append(')');
return result.toString();
diff --git a/incoming/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/modelstylesheets/impl/ModelStyleSheetsImpl.java b/incoming/org.eclipse.papyrus.infra.gmfdiag.css.model/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/stylesheets/impl/ModelStyleSheetsImpl.java
index bd5bdf18933..0d2ebe59d7e 100644
--- a/incoming/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/modelstylesheets/impl/ModelStyleSheetsImpl.java
+++ b/incoming/org.eclipse.papyrus.infra.gmfdiag.css.model/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/stylesheets/impl/ModelStyleSheetsImpl.java
@@ -1,10 +1,6 @@
/**
- * <copyright>
- * </copyright>
- *
- * $Id$
*/
-package org.eclipse.papyrus.infra.gmfdiag.css.modelstylesheets.impl;
+package org.eclipse.papyrus.infra.gmfdiag.css.stylesheets.impl;
import java.util.Collection;
@@ -20,9 +16,9 @@ import org.eclipse.emf.ecore.impl.EModelElementImpl;
import org.eclipse.emf.ecore.util.EObjectContainmentEList;
import org.eclipse.emf.ecore.util.InternalEList;
-import org.eclipse.papyrus.infra.gmfdiag.css.modelstylesheets.ModelStyleSheets;
-import org.eclipse.papyrus.infra.gmfdiag.css.modelstylesheets.ModelStyleSheetsPackage;
-import org.eclipse.papyrus.infra.gmfdiag.css.modelstylesheets.StyleSheet;
+import org.eclipse.papyrus.infra.gmfdiag.css.stylesheets.ModelStyleSheets;
+import org.eclipse.papyrus.infra.gmfdiag.css.stylesheets.StyleSheet;
+import org.eclipse.papyrus.infra.gmfdiag.css.stylesheets.StylesheetsPackage;
/**
* <!-- begin-user-doc -->
@@ -31,7 +27,7 @@ import org.eclipse.papyrus.infra.gmfdiag.css.modelstylesheets.StyleSheet;
* <p>
* The following features are implemented:
* <ul>
- * <li>{@link org.eclipse.papyrus.infra.gmfdiag.css.modelstylesheets.impl.ModelStyleSheetsImpl#getStylesheets <em>Stylesheets</em>}</li>
+ * <li>{@link org.eclipse.papyrus.infra.gmfdiag.css.stylesheets.impl.ModelStyleSheetsImpl#getStylesheets <em>Stylesheets</em>}</li>
* </ul>
* </p>
*
@@ -64,7 +60,7 @@ public class ModelStyleSheetsImpl extends EModelElementImpl implements ModelStyl
*/
@Override
protected EClass eStaticClass() {
- return ModelStyleSheetsPackage.Literals.MODEL_STYLE_SHEETS;
+ return StylesheetsPackage.Literals.MODEL_STYLE_SHEETS;
}
/**
@@ -74,7 +70,7 @@ public class ModelStyleSheetsImpl extends EModelElementImpl implements ModelStyl
*/
public EList<StyleSheet> getStylesheets() {
if (stylesheets == null) {
- stylesheets = new EObjectContainmentEList<StyleSheet>(StyleSheet.class, this, ModelStyleSheetsPackage.MODEL_STYLE_SHEETS__STYLESHEETS);
+ stylesheets = new EObjectContainmentEList<StyleSheet>(StyleSheet.class, this, StylesheetsPackage.MODEL_STYLE_SHEETS__STYLESHEETS);
}
return stylesheets;
}
@@ -87,7 +83,7 @@ public class ModelStyleSheetsImpl extends EModelElementImpl implements ModelStyl
@Override
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
switch (featureID) {
- case ModelStyleSheetsPackage.MODEL_STYLE_SHEETS__STYLESHEETS:
+ case StylesheetsPackage.MODEL_STYLE_SHEETS__STYLESHEETS:
return ((InternalEList<?>)getStylesheets()).basicRemove(otherEnd, msgs);
}
return super.eInverseRemove(otherEnd, featureID, msgs);
@@ -101,7 +97,7 @@ public class ModelStyleSheetsImpl extends EModelElementImpl implements ModelStyl
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
- case ModelStyleSheetsPackage.MODEL_STYLE_SHEETS__STYLESHEETS:
+ case StylesheetsPackage.MODEL_STYLE_SHEETS__STYLESHEETS:
return getStylesheets();
}
return super.eGet(featureID, resolve, coreType);
@@ -116,7 +112,7 @@ public class ModelStyleSheetsImpl extends EModelElementImpl implements ModelStyl
@Override
public void eSet(int featureID, Object newValue) {
switch (featureID) {
- case ModelStyleSheetsPackage.MODEL_STYLE_SHEETS__STYLESHEETS:
+ case StylesheetsPackage.MODEL_STYLE_SHEETS__STYLESHEETS:
getStylesheets().clear();
getStylesheets().addAll((Collection<? extends StyleSheet>)newValue);
return;
@@ -132,7 +128,7 @@ public class ModelStyleSheetsImpl extends EModelElementImpl implements ModelStyl
@Override
public void eUnset(int featureID) {
switch (featureID) {
- case ModelStyleSheetsPackage.MODEL_STYLE_SHEETS__STYLESHEETS:
+ case StylesheetsPackage.MODEL_STYLE_SHEETS__STYLESHEETS:
getStylesheets().clear();
return;
}
@@ -147,7 +143,7 @@ public class ModelStyleSheetsImpl extends EModelElementImpl implements ModelStyl
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
- case ModelStyleSheetsPackage.MODEL_STYLE_SHEETS__STYLESHEETS:
+ case StylesheetsPackage.MODEL_STYLE_SHEETS__STYLESHEETS:
return stylesheets != null && !stylesheets.isEmpty();
}
return super.eIsSet(featureID);
diff --git a/incoming/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/modelstylesheets/impl/StyleSheetReferenceImpl.java b/incoming/org.eclipse.papyrus.infra.gmfdiag.css.model/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/stylesheets/impl/StyleSheetReferenceImpl.java
index 4b181e3e169..ebf496ee84a 100644
--- a/incoming/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/modelstylesheets/impl/StyleSheetReferenceImpl.java
+++ b/incoming/org.eclipse.papyrus.infra.gmfdiag.css.model/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/stylesheets/impl/StyleSheetReferenceImpl.java
@@ -1,20 +1,16 @@
/**
- * <copyright>
- * </copyright>
- *
- * $Id$
*/
-package org.eclipse.papyrus.infra.gmfdiag.css.modelstylesheets.impl;
+package org.eclipse.papyrus.infra.gmfdiag.css.stylesheets.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.infra.gmfdiag.css.modelstylesheets.ModelStyleSheetsPackage;
-import org.eclipse.papyrus.infra.gmfdiag.css.modelstylesheets.StyleSheetReference;
+
+import org.eclipse.papyrus.infra.gmfdiag.css.stylesheets.StyleSheetReference;
+import org.eclipse.papyrus.infra.gmfdiag.css.stylesheets.StylesheetsPackage;
/**
* <!-- begin-user-doc -->
@@ -23,14 +19,13 @@ import org.eclipse.papyrus.infra.gmfdiag.css.modelstylesheets.StyleSheetReferenc
* <p>
* The following features are implemented:
* <ul>
- * <li>{@link org.eclipse.papyrus.infra.gmfdiag.css.modelstylesheets.impl.StyleSheetReferenceImpl#getPath <em>Path</em>}</li>
+ * <li>{@link org.eclipse.papyrus.infra.gmfdiag.css.stylesheets.impl.StyleSheetReferenceImpl#getPath <em>Path</em>}</li>
* </ul>
* </p>
*
* @generated
*/
-public class StyleSheetReferenceImpl extends
-EObjectImpl implements StyleSheetReference {
+public class StyleSheetReferenceImpl extends EObjectImpl implements StyleSheetReference {
/**
* The default value of the '{@link #getPath() <em>Path</em>}' attribute.
* <!-- begin-user-doc -->
@@ -67,7 +62,7 @@ EObjectImpl implements StyleSheetReference {
*/
@Override
protected EClass eStaticClass() {
- return ModelStyleSheetsPackage.Literals.STYLE_SHEET_REFERENCE;
+ return StylesheetsPackage.Literals.STYLE_SHEET_REFERENCE;
}
/**
@@ -88,7 +83,7 @@ EObjectImpl implements StyleSheetReference {
String oldPath = path;
path = newPath;
if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, ModelStyleSheetsPackage.STYLE_SHEET_REFERENCE__PATH, oldPath, path));
+ eNotify(new ENotificationImpl(this, Notification.SET, StylesheetsPackage.STYLE_SHEET_REFERENCE__PATH, oldPath, path));
}
/**
@@ -99,7 +94,7 @@ EObjectImpl implements StyleSheetReference {
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
- case ModelStyleSheetsPackage.STYLE_SHEET_REFERENCE__PATH:
+ case StylesheetsPackage.STYLE_SHEET_REFERENCE__PATH:
return getPath();
}
return super.eGet(featureID, resolve, coreType);
@@ -113,7 +108,7 @@ EObjectImpl implements StyleSheetReference {
@Override
public void eSet(int featureID, Object newValue) {
switch (featureID) {
- case ModelStyleSheetsPackage.STYLE_SHEET_REFERENCE__PATH:
+ case StylesheetsPackage.STYLE_SHEET_REFERENCE__PATH:
setPath((String)newValue);
return;
}
@@ -128,7 +123,7 @@ EObjectImpl implements StyleSheetReference {
@Override
public void eUnset(int featureID) {
switch (featureID) {
- case ModelStyleSheetsPackage.STYLE_SHEET_REFERENCE__PATH:
+ case StylesheetsPackage.STYLE_SHEET_REFERENCE__PATH:
setPath(PATH_EDEFAULT);
return;
}
@@ -143,7 +138,7 @@ EObjectImpl implements StyleSheetReference {
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
- case ModelStyleSheetsPackage.STYLE_SHEET_REFERENCE__PATH:
+ case StylesheetsPackage.STYLE_SHEET_REFERENCE__PATH:
return PATH_EDEFAULT == null ? path != null : !PATH_EDEFAULT.equals(path);
}
return super.eIsSet(featureID);
diff --git a/incoming/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/modelstylesheets/impl/ModelStyleSheetsFactoryImpl.java b/incoming/org.eclipse.papyrus.infra.gmfdiag.css.model/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/stylesheets/impl/StylesheetsFactoryImpl.java
index be74e7baf6a..d2c515a3bae 100644
--- a/incoming/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/modelstylesheets/impl/ModelStyleSheetsFactoryImpl.java
+++ b/incoming/org.eclipse.papyrus.infra.gmfdiag.css.model/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/stylesheets/impl/StylesheetsFactoryImpl.java
@@ -1,10 +1,6 @@
/**
- * <copyright>
- * </copyright>
- *
- * $Id$
*/
-package org.eclipse.papyrus.infra.gmfdiag.css.modelstylesheets.impl;
+package org.eclipse.papyrus.infra.gmfdiag.css.stylesheets.impl;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.EObject;
@@ -14,7 +10,7 @@ import org.eclipse.emf.ecore.impl.EFactoryImpl;
import org.eclipse.emf.ecore.plugin.EcorePlugin;
-import org.eclipse.papyrus.infra.gmfdiag.css.modelstylesheets.*;
+import org.eclipse.papyrus.infra.gmfdiag.css.stylesheets.*;
/**
* <!-- begin-user-doc -->
@@ -22,24 +18,24 @@ import org.eclipse.papyrus.infra.gmfdiag.css.modelstylesheets.*;
* <!-- end-user-doc -->
* @generated
*/
-public class ModelStyleSheetsFactoryImpl extends EFactoryImpl implements ModelStyleSheetsFactory {
+public class StylesheetsFactoryImpl extends EFactoryImpl implements StylesheetsFactory {
/**
* Creates the default factory implementation.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
- public static ModelStyleSheetsFactory init() {
+ public static StylesheetsFactory init() {
try {
- ModelStyleSheetsFactory theModelStyleSheetsFactory = (ModelStyleSheetsFactory)EPackage.Registry.INSTANCE.getEFactory("http://www.eclipse.org/papyrus/infra/gmfdiag/css");
- if (theModelStyleSheetsFactory != null) {
- return theModelStyleSheetsFactory;
+ StylesheetsFactory theStylesheetsFactory = (StylesheetsFactory)EPackage.Registry.INSTANCE.getEFactory("http://www.eclipse.org/papyrus/infra/gmfdiag/css");
+ if (theStylesheetsFactory != null) {
+ return theStylesheetsFactory;
}
}
catch (Exception exception) {
EcorePlugin.INSTANCE.log(exception);
}
- return new ModelStyleSheetsFactoryImpl();
+ return new StylesheetsFactoryImpl();
}
/**
@@ -48,7 +44,7 @@ public class ModelStyleSheetsFactoryImpl extends EFactoryImpl implements ModelSt
* <!-- end-user-doc -->
* @generated
*/
- public ModelStyleSheetsFactoryImpl() {
+ public StylesheetsFactoryImpl() {
super();
}
@@ -60,9 +56,9 @@ public class ModelStyleSheetsFactoryImpl extends EFactoryImpl implements ModelSt
@Override
public EObject create(EClass eClass) {
switch (eClass.getClassifierID()) {
- case ModelStyleSheetsPackage.MODEL_STYLE_SHEETS: return createModelStyleSheets();
- case ModelStyleSheetsPackage.STYLE_SHEET_REFERENCE: return createStyleSheetReference();
- case ModelStyleSheetsPackage.EMBEDDED_STYLE_SHEET: return createEmbeddedStyleSheet();
+ case StylesheetsPackage.MODEL_STYLE_SHEETS: return createModelStyleSheets();
+ case StylesheetsPackage.STYLE_SHEET_REFERENCE: return createStyleSheetReference();
+ case StylesheetsPackage.EMBEDDED_STYLE_SHEET: return createEmbeddedStyleSheet();
default:
throw new IllegalArgumentException("The class '" + eClass.getName() + "' is not a valid classifier");
}
@@ -103,8 +99,8 @@ public class ModelStyleSheetsFactoryImpl extends EFactoryImpl implements ModelSt
* <!-- end-user-doc -->
* @generated
*/
- public ModelStyleSheetsPackage getModelStyleSheetsPackage() {
- return (ModelStyleSheetsPackage)getEPackage();
+ public StylesheetsPackage getStylesheetsPackage() {
+ return (StylesheetsPackage)getEPackage();
}
/**
@@ -114,8 +110,8 @@ public class ModelStyleSheetsFactoryImpl extends EFactoryImpl implements ModelSt
* @generated
*/
@Deprecated
- public static ModelStyleSheetsPackage getPackage() {
- return ModelStyleSheetsPackage.eINSTANCE;
+ public static StylesheetsPackage getPackage() {
+ return StylesheetsPackage.eINSTANCE;
}
-} //ModelStyleSheetsFactoryImpl
+} //StylesheetsFactoryImpl
diff --git a/incoming/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/modelstylesheets/impl/ModelStyleSheetsPackageImpl.java b/incoming/org.eclipse.papyrus.infra.gmfdiag.css.model/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/stylesheets/impl/StylesheetsPackageImpl.java
index c254bbd5cab..7c5e26c4a89 100644
--- a/incoming/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/modelstylesheets/impl/ModelStyleSheetsPackageImpl.java
+++ b/incoming/org.eclipse.papyrus.infra.gmfdiag.css.model/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/stylesheets/impl/StylesheetsPackageImpl.java
@@ -1,10 +1,6 @@
/**
- * <copyright>
- * </copyright>
- *
- * $Id$
*/
-package org.eclipse.papyrus.infra.gmfdiag.css.modelstylesheets.impl;
+package org.eclipse.papyrus.infra.gmfdiag.css.stylesheets.impl;
import org.eclipse.emf.ecore.EAttribute;
import org.eclipse.emf.ecore.EClass;
@@ -14,12 +10,12 @@ import org.eclipse.emf.ecore.EcorePackage;
import org.eclipse.emf.ecore.impl.EPackageImpl;
-import org.eclipse.papyrus.infra.gmfdiag.css.modelstylesheets.EmbeddedStyleSheet;
-import org.eclipse.papyrus.infra.gmfdiag.css.modelstylesheets.ModelStyleSheets;
-import org.eclipse.papyrus.infra.gmfdiag.css.modelstylesheets.ModelStyleSheetsFactory;
-import org.eclipse.papyrus.infra.gmfdiag.css.modelstylesheets.ModelStyleSheetsPackage;
-import org.eclipse.papyrus.infra.gmfdiag.css.modelstylesheets.StyleSheet;
-import org.eclipse.papyrus.infra.gmfdiag.css.modelstylesheets.StyleSheetReference;
+import org.eclipse.papyrus.infra.gmfdiag.css.stylesheets.EmbeddedStyleSheet;
+import org.eclipse.papyrus.infra.gmfdiag.css.stylesheets.ModelStyleSheets;
+import org.eclipse.papyrus.infra.gmfdiag.css.stylesheets.StyleSheet;
+import org.eclipse.papyrus.infra.gmfdiag.css.stylesheets.StyleSheetReference;
+import org.eclipse.papyrus.infra.gmfdiag.css.stylesheets.StylesheetsFactory;
+import org.eclipse.papyrus.infra.gmfdiag.css.stylesheets.StylesheetsPackage;
/**
* <!-- begin-user-doc -->
@@ -27,7 +23,7 @@ import org.eclipse.papyrus.infra.gmfdiag.css.modelstylesheets.StyleSheetReferenc
* <!-- end-user-doc -->
* @generated
*/
-public class ModelStyleSheetsPackageImpl extends EPackageImpl implements ModelStyleSheetsPackage {
+public class StylesheetsPackageImpl extends EPackageImpl implements StylesheetsPackage {
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
@@ -67,12 +63,12 @@ public class ModelStyleSheetsPackageImpl extends EPackageImpl implements ModelSt
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see org.eclipse.emf.ecore.EPackage.Registry
- * @see org.eclipse.papyrus.infra.gmfdiag.css.modelstylesheets.ModelStyleSheetsPackage#eNS_URI
+ * @see org.eclipse.papyrus.infra.gmfdiag.css.stylesheets.StylesheetsPackage#eNS_URI
* @see #init()
* @generated
*/
- private ModelStyleSheetsPackageImpl() {
- super(eNS_URI, ModelStyleSheetsFactory.eINSTANCE);
+ private StylesheetsPackageImpl() {
+ super(eNS_URI, StylesheetsFactory.eINSTANCE);
}
/**
@@ -85,7 +81,7 @@ public class ModelStyleSheetsPackageImpl extends EPackageImpl implements ModelSt
/**
* 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 ModelStyleSheetsPackage#eINSTANCE} when that field is accessed.
+ * <p>This method is used to initialize {@link StylesheetsPackage#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 -->
@@ -94,11 +90,11 @@ public class ModelStyleSheetsPackageImpl extends EPackageImpl implements ModelSt
* @see #initializePackageContents()
* @generated
*/
- public static ModelStyleSheetsPackage init() {
- if (isInited) return (ModelStyleSheetsPackage)EPackage.Registry.INSTANCE.getEPackage(ModelStyleSheetsPackage.eNS_URI);
+ public static StylesheetsPackage init() {
+ if (isInited) return (StylesheetsPackage)EPackage.Registry.INSTANCE.getEPackage(StylesheetsPackage.eNS_URI);
// Obtain or create and register package
- ModelStyleSheetsPackageImpl theModelStyleSheetsPackage = (ModelStyleSheetsPackageImpl)(EPackage.Registry.INSTANCE.get(eNS_URI) instanceof ModelStyleSheetsPackageImpl ? EPackage.Registry.INSTANCE.get(eNS_URI) : new ModelStyleSheetsPackageImpl());
+ StylesheetsPackageImpl theStylesheetsPackage = (StylesheetsPackageImpl)(EPackage.Registry.INSTANCE.get(eNS_URI) instanceof StylesheetsPackageImpl ? EPackage.Registry.INSTANCE.get(eNS_URI) : new StylesheetsPackageImpl());
isInited = true;
@@ -106,18 +102,18 @@ public class ModelStyleSheetsPackageImpl extends EPackageImpl implements ModelSt
EcorePackage.eINSTANCE.eClass();
// Create package meta-data objects
- theModelStyleSheetsPackage.createPackageContents();
+ theStylesheetsPackage.createPackageContents();
// Initialize created meta-data
- theModelStyleSheetsPackage.initializePackageContents();
+ theStylesheetsPackage.initializePackageContents();
// Mark meta-data to indicate it can't be changed
- theModelStyleSheetsPackage.freeze();
+ theStylesheetsPackage.freeze();
// Update the registry and return the package
- EPackage.Registry.INSTANCE.put(ModelStyleSheetsPackage.eNS_URI, theModelStyleSheetsPackage);
- return theModelStyleSheetsPackage;
+ EPackage.Registry.INSTANCE.put(StylesheetsPackage.eNS_URI, theStylesheetsPackage);
+ return theStylesheetsPackage;
}
/**
@@ -179,7 +175,7 @@ public class ModelStyleSheetsPackageImpl extends EPackageImpl implements ModelSt
* <!-- end-user-doc -->
* @generated
*/
- public EAttribute getEmbeddedStyleSheet_Content() {
+ public EAttribute getEmbeddedStyleSheet_Label() {
return (EAttribute)embeddedStyleSheetEClass.getEStructuralFeatures().get(0);
}
@@ -188,8 +184,17 @@ public class ModelStyleSheetsPackageImpl extends EPackageImpl implements ModelSt
* <!-- end-user-doc -->
* @generated
*/
- public ModelStyleSheetsFactory getModelStyleSheetsFactory() {
- return (ModelStyleSheetsFactory)getEFactoryInstance();
+ public EAttribute getEmbeddedStyleSheet_Content() {
+ return (EAttribute)embeddedStyleSheetEClass.getEStructuralFeatures().get(1);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public StylesheetsFactory getStylesheetsFactory() {
+ return (StylesheetsFactory)getEFactoryInstance();
}
/**
@@ -220,6 +225,7 @@ public class ModelStyleSheetsPackageImpl extends EPackageImpl implements ModelSt
createEAttribute(styleSheetReferenceEClass, STYLE_SHEET_REFERENCE__PATH);
embeddedStyleSheetEClass = createEClass(EMBEDDED_STYLE_SHEET);
+ createEAttribute(embeddedStyleSheetEClass, EMBEDDED_STYLE_SHEET__LABEL);
createEAttribute(embeddedStyleSheetEClass, EMBEDDED_STYLE_SHEET__CONTENT);
}
@@ -268,10 +274,11 @@ public class ModelStyleSheetsPackageImpl extends EPackageImpl implements ModelSt
initEAttribute(getStyleSheetReference_Path(), theEcorePackage.getEString(), "path", null, 1, 1, StyleSheetReference.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEClass(embeddedStyleSheetEClass, EmbeddedStyleSheet.class, "EmbeddedStyleSheet", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
+ initEAttribute(getEmbeddedStyleSheet_Label(), ecorePackage.getEString(), "label", null, 0, 1, EmbeddedStyleSheet.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEAttribute(getEmbeddedStyleSheet_Content(), theEcorePackage.getEString(), "content", null, 1, 1, EmbeddedStyleSheet.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
// Create resource
createResource(eNS_URI);
}
-} //ModelStyleSheetsPackageImpl
+} //StylesheetsPackageImpl
diff --git a/incoming/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/modelstylesheets/util/ModelStyleSheetsAdapterFactory.java b/incoming/org.eclipse.papyrus.infra.gmfdiag.css.model/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/stylesheets/util/StylesheetsAdapterFactory.java
index dbe05f74bc3..1985cc0ade4 100644
--- a/incoming/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/modelstylesheets/util/ModelStyleSheetsAdapterFactory.java
+++ b/incoming/org.eclipse.papyrus.infra.gmfdiag.css.model/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/stylesheets/util/StylesheetsAdapterFactory.java
@@ -1,10 +1,6 @@
/**
- * <copyright>
- * </copyright>
- *
- * $Id$
*/
-package org.eclipse.papyrus.infra.gmfdiag.css.modelstylesheets.util;
+package org.eclipse.papyrus.infra.gmfdiag.css.stylesheets.util;
import org.eclipse.emf.common.notify.Adapter;
import org.eclipse.emf.common.notify.Notifier;
@@ -14,24 +10,24 @@ import org.eclipse.emf.common.notify.impl.AdapterFactoryImpl;
import org.eclipse.emf.ecore.EModelElement;
import org.eclipse.emf.ecore.EObject;
-import org.eclipse.papyrus.infra.gmfdiag.css.modelstylesheets.*;
+import org.eclipse.papyrus.infra.gmfdiag.css.stylesheets.*;
/**
* <!-- 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.infra.gmfdiag.css.modelstylesheets.ModelStyleSheetsPackage
+ * @see org.eclipse.papyrus.infra.gmfdiag.css.stylesheets.StylesheetsPackage
* @generated
*/
-public class ModelStyleSheetsAdapterFactory extends AdapterFactoryImpl {
+public class StylesheetsAdapterFactory extends AdapterFactoryImpl {
/**
* The cached model package.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
- protected static ModelStyleSheetsPackage modelPackage;
+ protected static StylesheetsPackage modelPackage;
/**
* Creates an instance of the adapter factory.
@@ -39,9 +35,9 @@ public class ModelStyleSheetsAdapterFactory extends AdapterFactoryImpl {
* <!-- end-user-doc -->
* @generated
*/
- public ModelStyleSheetsAdapterFactory() {
+ public StylesheetsAdapterFactory() {
if (modelPackage == null) {
- modelPackage = ModelStyleSheetsPackage.eINSTANCE;
+ modelPackage = StylesheetsPackage.eINSTANCE;
}
}
@@ -70,8 +66,8 @@ public class ModelStyleSheetsAdapterFactory extends AdapterFactoryImpl {
* <!-- end-user-doc -->
* @generated
*/
- protected ModelStyleSheetsSwitch<Adapter> modelSwitch =
- new ModelStyleSheetsSwitch<Adapter>() {
+ protected StylesheetsSwitch<Adapter> modelSwitch =
+ new StylesheetsSwitch<Adapter>() {
@Override
public Adapter caseModelStyleSheets(ModelStyleSheets object) {
return createModelStyleSheetsAdapter();
@@ -113,13 +109,13 @@ public class ModelStyleSheetsAdapterFactory extends AdapterFactoryImpl {
/**
- * Creates a new adapter for an object of class '{@link org.eclipse.papyrus.infra.gmfdiag.css.modelstylesheets.ModelStyleSheets <em>Model Style Sheets</em>}'.
+ * Creates a new adapter for an object of class '{@link org.eclipse.papyrus.infra.gmfdiag.css.stylesheets.ModelStyleSheets <em>Model Style Sheets</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.infra.gmfdiag.css.modelstylesheets.ModelStyleSheets
+ * @see org.eclipse.papyrus.infra.gmfdiag.css.stylesheets.ModelStyleSheets
* @generated
*/
public Adapter createModelStyleSheetsAdapter() {
@@ -127,13 +123,13 @@ public class ModelStyleSheetsAdapterFactory extends AdapterFactoryImpl {
}
/**
- * Creates a new adapter for an object of class '{@link org.eclipse.papyrus.infra.gmfdiag.css.modelstylesheets.StyleSheet <em>Style Sheet</em>}'.
+ * Creates a new adapter for an object of class '{@link org.eclipse.papyrus.infra.gmfdiag.css.stylesheets.StyleSheet <em>Style Sheet</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.infra.gmfdiag.css.modelstylesheets.StyleSheet
+ * @see org.eclipse.papyrus.infra.gmfdiag.css.stylesheets.StyleSheet
* @generated
*/
public Adapter createStyleSheetAdapter() {
@@ -141,13 +137,13 @@ public class ModelStyleSheetsAdapterFactory extends AdapterFactoryImpl {
}
/**
- * Creates a new adapter for an object of class '{@link org.eclipse.papyrus.infra.gmfdiag.css.modelstylesheets.StyleSheetReference <em>Style Sheet Reference</em>}'.
+ * Creates a new adapter for an object of class '{@link org.eclipse.papyrus.infra.gmfdiag.css.stylesheets.StyleSheetReference <em>Style Sheet Reference</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.infra.gmfdiag.css.modelstylesheets.StyleSheetReference
+ * @see org.eclipse.papyrus.infra.gmfdiag.css.stylesheets.StyleSheetReference
* @generated
*/
public Adapter createStyleSheetReferenceAdapter() {
@@ -155,13 +151,13 @@ public class ModelStyleSheetsAdapterFactory extends AdapterFactoryImpl {
}
/**
- * Creates a new adapter for an object of class '{@link org.eclipse.papyrus.infra.gmfdiag.css.modelstylesheets.EmbeddedStyleSheet <em>Embedded Style Sheet</em>}'.
+ * Creates a new adapter for an object of class '{@link org.eclipse.papyrus.infra.gmfdiag.css.stylesheets.EmbeddedStyleSheet <em>Embedded Style Sheet</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.infra.gmfdiag.css.modelstylesheets.EmbeddedStyleSheet
+ * @see org.eclipse.papyrus.infra.gmfdiag.css.stylesheets.EmbeddedStyleSheet
* @generated
*/
public Adapter createEmbeddedStyleSheetAdapter() {
@@ -194,4 +190,4 @@ public class ModelStyleSheetsAdapterFactory extends AdapterFactoryImpl {
return null;
}
-} //ModelStyleSheetsAdapterFactory
+} //StylesheetsAdapterFactory
diff --git a/incoming/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/modelstylesheets/util/ModelStyleSheetsSwitch.java b/incoming/org.eclipse.papyrus.infra.gmfdiag.css.model/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/stylesheets/util/StylesheetsSwitch.java
index 2c9aad3dbd8..1a59196ccfd 100644
--- a/incoming/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/modelstylesheets/util/ModelStyleSheetsSwitch.java
+++ b/incoming/org.eclipse.papyrus.infra.gmfdiag.css.model/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/stylesheets/util/StylesheetsSwitch.java
@@ -1,10 +1,6 @@
/**
- * <copyright>
- * </copyright>
- *
- * $Id$
*/
-package org.eclipse.papyrus.infra.gmfdiag.css.modelstylesheets.util;
+package org.eclipse.papyrus.infra.gmfdiag.css.stylesheets.util;
import org.eclipse.emf.ecore.EModelElement;
import org.eclipse.emf.ecore.EObject;
@@ -12,7 +8,7 @@ import org.eclipse.emf.ecore.EPackage;
import org.eclipse.emf.ecore.util.Switch;
-import org.eclipse.papyrus.infra.gmfdiag.css.modelstylesheets.*;
+import org.eclipse.papyrus.infra.gmfdiag.css.stylesheets.*;
/**
* <!-- begin-user-doc -->
@@ -24,17 +20,17 @@ import org.eclipse.papyrus.infra.gmfdiag.css.modelstylesheets.*;
* until a non-null result is returned,
* which is the result of the switch.
* <!-- end-user-doc -->
- * @see org.eclipse.papyrus.infra.gmfdiag.css.modelstylesheets.ModelStyleSheetsPackage
+ * @see org.eclipse.papyrus.infra.gmfdiag.css.stylesheets.StylesheetsPackage
* @generated
*/
-public class ModelStyleSheetsSwitch<T> extends Switch<T> {
+public class StylesheetsSwitch<T> extends Switch<T> {
/**
* The cached model package
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
- protected static ModelStyleSheetsPackage modelPackage;
+ protected static StylesheetsPackage modelPackage;
/**
* Creates an instance of the switch.
@@ -42,9 +38,9 @@ public class ModelStyleSheetsSwitch<T> extends Switch<T> {
* <!-- end-user-doc -->
* @generated
*/
- public ModelStyleSheetsSwitch() {
+ public StylesheetsSwitch() {
if (modelPackage == null) {
- modelPackage = ModelStyleSheetsPackage.eINSTANCE;
+ modelPackage = StylesheetsPackage.eINSTANCE;
}
}
@@ -71,27 +67,27 @@ public class ModelStyleSheetsSwitch<T> extends Switch<T> {
@Override
protected T doSwitch(int classifierID, EObject theEObject) {
switch (classifierID) {
- case ModelStyleSheetsPackage.MODEL_STYLE_SHEETS: {
+ case StylesheetsPackage.MODEL_STYLE_SHEETS: {
ModelStyleSheets modelStyleSheets = (ModelStyleSheets)theEObject;
T result = caseModelStyleSheets(modelStyleSheets);
if (result == null) result = caseEModelElement(modelStyleSheets);
if (result == null) result = defaultCase(theEObject);
return result;
}
- case ModelStyleSheetsPackage.STYLE_SHEET: {
+ case StylesheetsPackage.STYLE_SHEET: {
StyleSheet styleSheet = (StyleSheet)theEObject;
T result = caseStyleSheet(styleSheet);
if (result == null) result = defaultCase(theEObject);
return result;
}
- case ModelStyleSheetsPackage.STYLE_SHEET_REFERENCE: {
+ case StylesheetsPackage.STYLE_SHEET_REFERENCE: {
StyleSheetReference styleSheetReference = (StyleSheetReference)theEObject;
T result = caseStyleSheetReference(styleSheetReference);
if (result == null) result = caseStyleSheet(styleSheetReference);
if (result == null) result = defaultCase(theEObject);
return result;
}
- case ModelStyleSheetsPackage.EMBEDDED_STYLE_SHEET: {
+ case StylesheetsPackage.EMBEDDED_STYLE_SHEET: {
EmbeddedStyleSheet embeddedStyleSheet = (EmbeddedStyleSheet)theEObject;
T result = caseEmbeddedStyleSheet(embeddedStyleSheet);
if (result == null) result = caseStyleSheet(embeddedStyleSheet);
@@ -193,4 +189,4 @@ public class ModelStyleSheetsSwitch<T> extends Switch<T> {
return null;
}
-} //ModelStyleSheetsSwitch
+} //StylesheetsSwitch
diff --git a/incoming/org.eclipse.papyrus.infra.gmfdiag.css.model/src/org/eclipse/papyrus/infra/gmfdiag/css/model/Activator.java b/incoming/org.eclipse.papyrus.infra.gmfdiag.css.model/src/org/eclipse/papyrus/infra/gmfdiag/css/model/Activator.java
new file mode 100644
index 00000000000..9f9ffda23ca
--- /dev/null
+++ b/incoming/org.eclipse.papyrus.infra.gmfdiag.css.model/src/org/eclipse/papyrus/infra/gmfdiag/css/model/Activator.java
@@ -0,0 +1,58 @@
+package org.eclipse.papyrus.infra.gmfdiag.css.model;
+
+import org.eclipse.papyrus.infra.core.log.LogHelper;
+import org.eclipse.ui.plugin.AbstractUIPlugin;
+import org.osgi.framework.BundleContext;
+
+/**
+ * The activator class controls the plug-in life cycle
+ */
+public class Activator extends AbstractUIPlugin {
+
+ // The plug-in ID
+ public static final String PLUGIN_ID = "org.eclipse.papyrus.infra.gmfdiag.css.model"; //$NON-NLS-1$
+
+ // The shared instance
+ private static Activator plugin;
+
+ public static LogHelper log;
+
+ /**
+ * The constructor
+ */
+ public Activator() {
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
+ */
+ @Override
+ public void start(BundleContext context) throws Exception {
+ super.start(context);
+ plugin = this;
+ log = new LogHelper(this);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
+ */
+ @Override
+ public void stop(BundleContext context) throws Exception {
+ plugin = null;
+ super.stop(context);
+ }
+
+ /**
+ * Returns the shared instance
+ *
+ * @return the shared instance
+ */
+ public static Activator getDefault() {
+ return plugin;
+ }
+
+}
diff --git a/incoming/org.eclipse.papyrus.infra.gmfdiag.css.properties/META-INF/MANIFEST.MF b/incoming/org.eclipse.papyrus.infra.gmfdiag.css.properties/META-INF/MANIFEST.MF
index 4443574fcbb..8f223fdf033 100644
--- a/incoming/org.eclipse.papyrus.infra.gmfdiag.css.properties/META-INF/MANIFEST.MF
+++ b/incoming/org.eclipse.papyrus.infra.gmfdiag.css.properties/META-INF/MANIFEST.MF
@@ -21,6 +21,7 @@ Require-Bundle: org.eclipse.ui,
org.eclipse.emf.databinding;bundle-version="1.2.0",
org.eclipse.gmf.runtime.notation;bundle-version="1.5.0",
org.eclipse.papyrus.infra.gmfdiag.common;bundle-version="0.9.0",
- org.eclipse.papyrus.infra.gmfdiag.properties;bundle-version="0.9.0"
+ org.eclipse.papyrus.infra.gmfdiag.properties;bundle-version="0.9.0",
+ org.eclipse.papyrus.infra.gmfdiag.css.model;bundle-version="0.9.0"
Bundle-RequiredExecutionEnvironment: J2SE-1.5
Bundle-ActivationPolicy: lazy
diff --git a/incoming/org.eclipse.papyrus.infra.gmfdiag.css.properties/model/Environment.xmi b/incoming/org.eclipse.papyrus.infra.gmfdiag.css.properties/model/Environment.xmi
index f704718e972..c3508ded046 100644
--- a/incoming/org.eclipse.papyrus.infra.gmfdiag.css.properties/model/Environment.xmi
+++ b/incoming/org.eclipse.papyrus.infra.gmfdiag.css.properties/model/Environment.xmi
@@ -6,4 +6,7 @@
<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"/>
</environment:Environment>
diff --git a/incoming/org.eclipse.papyrus.infra.gmfdiag.css.properties/model/properties/css.ctx b/incoming/org.eclipse.papyrus.infra.gmfdiag.css.properties/model/properties/css.ctx
index 643014523fc..817eac6ff98 100644
--- a/incoming/org.eclipse.papyrus.infra.gmfdiag.css.properties/model/properties/css.ctx
+++ b/incoming/org.eclipse.papyrus.infra.gmfdiag.css.properties/model/properties/css.ctx
@@ -55,8 +55,8 @@
<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"/>
- <properties name="cssStyle" label="CSS Style"/>
+ <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"/>
@@ -65,9 +65,10 @@
</dataContexts>
<dataContexts name="modelstylesheets" label="StyleSheets">
<elements name="StyleSheetReference">
- <properties name="path" label="Path" description="The path to the external style sheet"/>
+ <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">
@@ -79,6 +80,6 @@
<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.views.properties/model/Environment.xmi#//@modelElementFactories.2"/>
+ <modelElementFactory href="ppe:/environment/org.eclipse.papyrus.infra.gmfdiag.css.properties/model/Environment.xmi#//@modelElementFactories.1"/>
</dataContexts>
</contexts:Context>
diff --git a/incoming/org.eclipse.papyrus.infra.gmfdiag.css.properties/model/properties/ui/SingleEmbeddedStyleSheet.xwt b/incoming/org.eclipse.papyrus.infra.gmfdiag.css.properties/model/properties/ui/SingleEmbeddedStyleSheet.xwt
index 76d6487605a..6e65d7d870a 100644
--- a/incoming/org.eclipse.papyrus.infra.gmfdiag.css.properties/model/properties/ui/SingleEmbeddedStyleSheet.xwt
+++ b/incoming/org.eclipse.papyrus.infra.gmfdiag.css.properties/model/properties/ui/SingleEmbeddedStyleSheet.xwt
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
-<Composite xmlns:ppe="clr-namespace:org.eclipse.papyrus.views.properties.widgets"
- xmlns="http://www.eclipse.org/xwt/presentation"
+<Composite
xmlns:ppel="clr-namespace:org.eclipse.papyrus.views.properties.widgets.layout"
- xmlns:x="http://www.eclipse.org/xwt">
+ xmlns:x="http://www.eclipse.org/xwt" xmlns:ppe="clr-namespace:org.eclipse.papyrus.views.properties.widgets"
+ xmlns="http://www.eclipse.org/xwt/presentation">
<Composite.layout>
<ppel:PropertiesLayout numColumns="1"></ppel:PropertiesLayout>
</Composite.layout>
@@ -10,6 +10,8 @@
<Composite.layout>
<ppel:PropertiesLayout numColumns="1"></ppel:PropertiesLayout>
</Composite.layout>
+ <ppe:StringEditor property="modelstylesheets:EmbeddedStyleSheet:label"
+ input="{Binding}"></ppe:StringEditor>
<ppe:StringMultiline input="{Binding}"
property="modelstylesheets:EmbeddedStyleSheet:content"></ppe:StringMultiline>
</Composite>
diff --git a/incoming/org.eclipse.papyrus.infra.gmfdiag.css.properties/src/org/eclipse/papyrus/infra/gmfdiag/css/properties/creation/StyleSheetFactory.java b/incoming/org.eclipse.papyrus.infra.gmfdiag.css.properties/src/org/eclipse/papyrus/infra/gmfdiag/css/properties/creation/StyleSheetFactory.java
index 9c7373c4486..7e6b5d802e1 100644
--- a/incoming/org.eclipse.papyrus.infra.gmfdiag.css.properties/src/org/eclipse/papyrus/infra/gmfdiag/css/properties/creation/StyleSheetFactory.java
+++ b/incoming/org.eclipse.papyrus.infra.gmfdiag.css.properties/src/org/eclipse/papyrus/infra/gmfdiag/css/properties/creation/StyleSheetFactory.java
@@ -16,7 +16,7 @@ import java.util.Collection;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.gmf.runtime.notation.NotationPackage;
import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.infra.gmfdiag.css.modelstylesheets.ModelStyleSheetsPackage;
+import org.eclipse.papyrus.infra.gmfdiag.css.stylesheets.StylesheetsPackage;
import org.eclipse.papyrus.views.properties.creation.EcorePropertyEditorFactory;
import org.eclipse.swt.widgets.Control;
@@ -32,7 +32,7 @@ public class StyleSheetFactory extends EcorePropertyEditorFactory {
public StyleSheetFactory(View context) {
super(NotationPackage.eINSTANCE.getEObjectListValueStyle_EObjectListValue());
- this.type = ModelStyleSheetsPackage.eINSTANCE.getStyleSheet();
+ this.type = StylesheetsPackage.eINSTANCE.getStyleSheet();
this.context = context;
}
diff --git a/incoming/org.eclipse.papyrus.infra.gmfdiag.css.properties/src/org/eclipse/papyrus/infra/gmfdiag/css/properties/modelelement/CSSPreferencesModelElement.java b/incoming/org.eclipse.papyrus.infra.gmfdiag.css.properties/src/org/eclipse/papyrus/infra/gmfdiag/css/properties/modelelement/CSSPreferencesModelElement.java
new file mode 100644
index 00000000000..29685f4baaa
--- /dev/null
+++ b/incoming/org.eclipse.papyrus.infra.gmfdiag.css.properties/src/org/eclipse/papyrus/infra/gmfdiag/css/properties/modelelement/CSSPreferencesModelElement.java
@@ -0,0 +1,35 @@
+/*****************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Initial API and implementation
+ *****************************************************************************/
+package org.eclipse.papyrus.infra.gmfdiag.css.properties.modelelement;
+
+import org.eclipse.jface.viewers.ILabelProvider;
+import org.eclipse.papyrus.infra.gmfdiag.css.preferences.ThemePreferences;
+import org.eclipse.papyrus.infra.gmfdiag.css.properties.provider.CSSThemeLabelProvider;
+import org.eclipse.papyrus.views.properties.contexts.DataContextElement;
+import org.eclipse.papyrus.views.properties.modelelement.PreferencesModelElement;
+
+
+public class CSSPreferencesModelElement extends PreferencesModelElement {
+
+ public CSSPreferencesModelElement(DataContextElement context) {
+ super(context);
+ }
+
+ @Override
+ public ILabelProvider getLabelProvider(String propertyPath) {
+ if(ThemePreferences.CURRENT_THEME.equals(propertyPath)) {
+ return new CSSThemeLabelProvider();
+ }
+ return super.getLabelProvider(propertyPath);
+ }
+
+}
diff --git a/incoming/org.eclipse.papyrus.infra.gmfdiag.css.properties/src/org/eclipse/papyrus/infra/gmfdiag/css/properties/modelelement/CSSPreferencesModelElementFactory.java b/incoming/org.eclipse.papyrus.infra.gmfdiag.css.properties/src/org/eclipse/papyrus/infra/gmfdiag/css/properties/modelelement/CSSPreferencesModelElementFactory.java
new file mode 100644
index 00000000000..d335bb1eb20
--- /dev/null
+++ b/incoming/org.eclipse.papyrus.infra.gmfdiag.css.properties/src/org/eclipse/papyrus/infra/gmfdiag/css/properties/modelelement/CSSPreferencesModelElementFactory.java
@@ -0,0 +1,25 @@
+/*****************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Initial API and implementation
+ *****************************************************************************/
+package org.eclipse.papyrus.infra.gmfdiag.css.properties.modelelement;
+
+import org.eclipse.papyrus.views.properties.contexts.DataContextElement;
+import org.eclipse.papyrus.views.properties.modelelement.ModelElement;
+import org.eclipse.papyrus.views.properties.modelelement.PreferencesModelElementFactory;
+
+
+public class CSSPreferencesModelElementFactory extends PreferencesModelElementFactory {
+
+ @Override
+ public ModelElement createFromSource(Object sourceElement, DataContextElement context) {
+ return new CSSPreferencesModelElement(context);
+ }
+}
diff --git a/incoming/org.eclipse.papyrus.infra.gmfdiag.css.properties/src/org/eclipse/papyrus/infra/gmfdiag/css/properties/provider/CSSStyleSheetContentProvider.java b/incoming/org.eclipse.papyrus.infra.gmfdiag.css.properties/src/org/eclipse/papyrus/infra/gmfdiag/css/properties/provider/CSSStyleSheetContentProvider.java
index a5f51a81a99..9fa6f8c6e82 100644
--- a/incoming/org.eclipse.papyrus.infra.gmfdiag.css.properties/src/org/eclipse/papyrus/infra/gmfdiag/css/properties/provider/CSSStyleSheetContentProvider.java
+++ b/incoming/org.eclipse.papyrus.infra.gmfdiag.css.properties/src/org/eclipse/papyrus/infra/gmfdiag/css/properties/provider/CSSStyleSheetContentProvider.java
@@ -19,8 +19,8 @@ import org.eclipse.emf.ecore.EStructuralFeature;
import org.eclipse.emf.ecore.resource.Resource;
import org.eclipse.jface.viewers.IStructuredContentProvider;
import org.eclipse.papyrus.infra.emf.providers.EMFContentProvider;
-import org.eclipse.papyrus.infra.gmfdiag.css.modelstylesheets.ModelStyleSheetsPackage;
-import org.eclipse.papyrus.infra.gmfdiag.css.modelstylesheets.StyleSheet;
+import org.eclipse.papyrus.infra.gmfdiag.css.stylesheets.StyleSheet;
+import org.eclipse.papyrus.infra.gmfdiag.css.stylesheets.StylesheetsPackage;
import org.eclipse.papyrus.infra.widgets.providers.AbstractStaticContentProvider;
@@ -29,7 +29,7 @@ public class CSSStyleSheetContentProvider extends EMFContentProvider {
private EObject context;
public CSSStyleSheetContentProvider(EObject sourceEObject) {
- super(sourceEObject, ModelStyleSheetsPackage.eINSTANCE.getModelStyleSheets_Stylesheets());
+ super(sourceEObject, StylesheetsPackage.eINSTANCE.getModelStyleSheets_Stylesheets());
this.context = sourceEObject;
}
diff --git a/incoming/org.eclipse.papyrus.infra.gmfdiag.css.properties/src/org/eclipse/papyrus/infra/gmfdiag/css/properties/provider/CSSStyleSheetLabelProvider.java b/incoming/org.eclipse.papyrus.infra.gmfdiag.css.properties/src/org/eclipse/papyrus/infra/gmfdiag/css/properties/provider/CSSStyleSheetLabelProvider.java
index 1ddeeb3277f..366dc87e280 100644
--- a/incoming/org.eclipse.papyrus.infra.gmfdiag.css.properties/src/org/eclipse/papyrus/infra/gmfdiag/css/properties/provider/CSSStyleSheetLabelProvider.java
+++ b/incoming/org.eclipse.papyrus.infra.gmfdiag.css.properties/src/org/eclipse/papyrus/infra/gmfdiag/css/properties/provider/CSSStyleSheetLabelProvider.java
@@ -12,8 +12,8 @@
package org.eclipse.papyrus.infra.gmfdiag.css.properties.provider;
import org.eclipse.papyrus.infra.emf.providers.EMFLabelProvider;
-import org.eclipse.papyrus.infra.gmfdiag.css.modelstylesheets.EmbeddedStyleSheet;
-import org.eclipse.papyrus.infra.gmfdiag.css.modelstylesheets.StyleSheetReference;
+import org.eclipse.papyrus.infra.gmfdiag.css.stylesheets.EmbeddedStyleSheet;
+import org.eclipse.papyrus.infra.gmfdiag.css.stylesheets.StyleSheetReference;
public class CSSStyleSheetLabelProvider extends EMFLabelProvider {
@@ -23,7 +23,11 @@ public class CSSStyleSheetLabelProvider extends EMFLabelProvider {
if(element instanceof StyleSheetReference) {
return ((StyleSheetReference)element).getPath();
} else if(element instanceof EmbeddedStyleSheet) {
- return "EmbeddedStyleSheet";
+ EmbeddedStyleSheet styleSheet = (EmbeddedStyleSheet)element;
+ if(styleSheet.getLabel() == null || "".equals(styleSheet)) {
+ return "EmbeddedStyleSheet";
+ }
+ return styleSheet.getLabel();
}
return super.getText(element);
}
diff --git a/incoming/org.eclipse.papyrus.infra.gmfdiag.css.properties/src/org/eclipse/papyrus/infra/gmfdiag/css/properties/provider/CSSThemeLabelProvider.java b/incoming/org.eclipse.papyrus.infra.gmfdiag.css.properties/src/org/eclipse/papyrus/infra/gmfdiag/css/properties/provider/CSSThemeLabelProvider.java
new file mode 100644
index 00000000000..288dba9c4be
--- /dev/null
+++ b/incoming/org.eclipse.papyrus.infra.gmfdiag.css.properties/src/org/eclipse/papyrus/infra/gmfdiag/css/properties/provider/CSSThemeLabelProvider.java
@@ -0,0 +1,48 @@
+/*****************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Initial API and implementation
+ *****************************************************************************/
+package org.eclipse.papyrus.infra.gmfdiag.css.properties.provider;
+
+import org.eclipse.jface.viewers.LabelProvider;
+import org.eclipse.papyrus.infra.gmfdiag.css.theme.Theme;
+import org.eclipse.papyrus.infra.gmfdiag.css.theme.ThemeManager;
+import org.eclipse.swt.graphics.Image;
+
+
+public class CSSThemeLabelProvider extends LabelProvider {
+
+ @Override
+ public String getText(Object value) {
+ Theme theme = getTheme(value);
+ if(theme != null) {
+ return theme.getLabel();
+ }
+ return super.getText(value);
+ }
+
+ @Override
+ public Image getImage(Object value) {
+ Theme theme = getTheme(value);
+ if(theme != null) {
+ return theme.getIcon();
+ }
+ return super.getImage(value);
+ }
+
+ protected Theme getTheme(Object value) {
+ if(value instanceof String) {
+ String themeId = (String)value;
+ Theme theme = ThemeManager.instance.getTheme(themeId);
+ return theme;
+ }
+ return null;
+ }
+}
diff --git a/incoming/org.eclipse.papyrus.infra.gmfdiag.css/META-INF/MANIFEST.MF b/incoming/org.eclipse.papyrus.infra.gmfdiag.css/META-INF/MANIFEST.MF
index d9f08cb2b83..5a893be50dc 100644
--- a/incoming/org.eclipse.papyrus.infra.gmfdiag.css/META-INF/MANIFEST.MF
+++ b/incoming/org.eclipse.papyrus.infra.gmfdiag.css/META-INF/MANIFEST.MF
@@ -18,7 +18,9 @@ Require-Bundle: org.eclipse.ui,
org.eclipse.papyrus.infra.core;bundle-version="0.9.0",
org.eclipse.papyrus.infra.emf.appearance;bundle-version="0.9.0",
org.eclipse.papyrus.infra.tools;bundle-version="0.9.0",
- org.eclipse.core.databinding;bundle-version="1.4.1"
+ org.eclipse.core.databinding;bundle-version="1.4.1",
+ org.eclipse.papyrus.infra.widgets;bundle-version="0.9.0",
+ org.eclipse.papyrus.infra.gmfdiag.css.model;bundle-version="0.9.0"
Bundle-RequiredExecutionEnvironment: J2SE-1.5
Bundle-ActivationPolicy: lazy
Export-Package: org.eclipse.papyrus.infra.gmfdiag.css,
@@ -29,9 +31,8 @@ Export-Package: org.eclipse.papyrus.infra.gmfdiag.css,
org.eclipse.papyrus.infra.gmfdiag.css.helper,
org.eclipse.papyrus.infra.gmfdiag.css.listener,
org.eclipse.papyrus.infra.gmfdiag.css.lists,
- org.eclipse.papyrus.infra.gmfdiag.css.modelstylesheets,
- org.eclipse.papyrus.infra.gmfdiag.css.modelstylesheets.impl,
- org.eclipse.papyrus.infra.gmfdiag.css.modelstylesheets.util,
org.eclipse.papyrus.infra.gmfdiag.css.notation,
- org.eclipse.papyrus.infra.gmfdiag.css.style.impl
+ org.eclipse.papyrus.infra.gmfdiag.css.preferences,
+ org.eclipse.papyrus.infra.gmfdiag.css.style.impl,
+ org.eclipse.papyrus.infra.gmfdiag.css.theme
Bundle-Localization: plugin
diff --git a/incoming/org.eclipse.papyrus.infra.gmfdiag.css/icons/papyrus.png b/incoming/org.eclipse.papyrus.infra.gmfdiag.css/icons/papyrus.png
new file mode 100644
index 00000000000..0f74e27b483
--- /dev/null
+++ b/incoming/org.eclipse.papyrus.infra.gmfdiag.css/icons/papyrus.png
Binary files differ
diff --git a/incoming/org.eclipse.papyrus.infra.gmfdiag.css/model/ModelStyleSheets.genmodel b/incoming/org.eclipse.papyrus.infra.gmfdiag.css/model/ModelStyleSheets.genmodel
deleted file mode 100644
index a89cfd7a9d9..00000000000
--- a/incoming/org.eclipse.papyrus.infra.gmfdiag.css/model/ModelStyleSheets.genmodel
+++ /dev/null
@@ -1,22 +0,0 @@
-<?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.infra.gmfdiag.css/src-gen"
- editorDirectory="/org.eclipse.papyrus.infra.gmfdiag.css.editor/src-gen" modelPluginID="org.eclipse.papyrus.infra.gmfdiag.css"
- modelName="ModelStyleSheets" testsDirectory="/org.eclipse.papyrus.infra.gmfdiag.css.tests/src-gen"
- importerID="org.eclipse.emf.importer.ecore" complianceLevel="5.0" copyrightFields="false"
- usedGenPackages="platform:/plugin/org.eclipse.emf.ecore/model/Ecore.genmodel#//ecore">
- <foreignModel>ModelStyleSheets.ecore</foreignModel>
- <genPackages prefix="ModelStyleSheets" basePackage="org.eclipse.papyrus.infra.gmfdiag.css"
- disposableProviderFactory="true" ecorePackage="ModelStyleSheets.ecore#/">
- <genClasses ecoreClass="ModelStyleSheets.ecore#//ModelStyleSheets">
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference ModelStyleSheets.ecore#//ModelStyleSheets/stylesheets"/>
- </genClasses>
- <genClasses image="false" ecoreClass="ModelStyleSheets.ecore#//StyleSheet"/>
- <genClasses ecoreClass="ModelStyleSheets.ecore#//StyleSheetReference">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute ModelStyleSheets.ecore#//StyleSheetReference/path"/>
- </genClasses>
- <genClasses ecoreClass="ModelStyleSheets.ecore#//EmbeddedStyleSheet">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute ModelStyleSheets.ecore#//EmbeddedStyleSheet/content"/>
- </genClasses>
- </genPackages>
-</genmodel:GenModel>
diff --git a/incoming/org.eclipse.papyrus.infra.gmfdiag.css/plugin.xml b/incoming/org.eclipse.papyrus.infra.gmfdiag.css/plugin.xml
index dcefe3f24f6..3a65d8fbce5 100644
--- a/incoming/org.eclipse.papyrus.infra.gmfdiag.css/plugin.xml
+++ b/incoming/org.eclipse.papyrus.infra.gmfdiag.css/plugin.xml
@@ -74,11 +74,16 @@
</extension>
<extension
point="org.eclipse.papyrus.infra.gmfdiag.css.theme">
- <theme
- id="papyrus_theme">
+ <themeDefinition
+ icon="icons/papyrus.png"
+ id="org.eclipse.papyrus.css.papyrus_theme"
+ label="Papyrus Theme">
+ </themeDefinition>
+ <themeContribution
+ id="org.eclipse.papyrus.css.papyrus_theme">
<stylesheet
stylesheetPath="resources/papyrus_theme.css">
</stylesheet>
- </theme>
+ </themeContribution>
</extension>
</plugin>
diff --git a/incoming/org.eclipse.papyrus.infra.gmfdiag.css/resources/papyrus_theme.css b/incoming/org.eclipse.papyrus.infra.gmfdiag.css/resources/papyrus_theme.css
index a8ebaa358c6..16136647718 100644
--- a/incoming/org.eclipse.papyrus.infra.gmfdiag.css/resources/papyrus_theme.css
+++ b/incoming/org.eclipse.papyrus.infra.gmfdiag.css/resources/papyrus_theme.css
@@ -100,3 +100,10 @@ gradient and should have the same color as the diagram */
SequenceDiagram > Interaction {
fillColor:white;
}
+
+SequenceDiagram CombinedFragment,
+SequenceDiagram ConsiderIgnoreFragment,
+SequenceDiagram CombinedFragment *,
+SequenceDiagram ConsiderIgnoreFragment *{
+ fillColor:white;
+}
diff --git a/incoming/org.eclipse.papyrus.infra.gmfdiag.css/schema/theme.exsd b/incoming/org.eclipse.papyrus.infra.gmfdiag.css/schema/theme.exsd
index 569b9a9ebb8..107b8280d21 100644
--- a/incoming/org.eclipse.papyrus.infra.gmfdiag.css/schema/theme.exsd
+++ b/incoming/org.eclipse.papyrus.infra.gmfdiag.css/schema/theme.exsd
@@ -17,9 +17,12 @@
</appinfo>
</annotation>
<complexType>
- <sequence>
- <element ref="theme" minOccurs="1" maxOccurs="unbounded"/>
- </sequence>
+ <choice>
+ <sequence>
+ <element ref="themeContribution" minOccurs="1" maxOccurs="unbounded"/>
+ </sequence>
+ <element ref="themeDefinition" minOccurs="0" maxOccurs="unbounded"/>
+ </choice>
<attribute name="point" type="string" use="required">
<annotation>
<documentation>
@@ -47,7 +50,7 @@
</complexType>
</element>
- <element name="theme">
+ <element name="themeContribution">
<complexType>
<sequence minOccurs="1" maxOccurs="unbounded">
<element ref="stylesheet"/>
@@ -57,6 +60,9 @@
<documentation>
</documentation>
+ <appinfo>
+ <meta.attribute kind="identifier" basedOn="org.eclipse.papyrus.infra.gmfdiag.css.theme/themeDefinition/@id"/>
+ </appinfo>
</annotation>
</attribute>
</complexType>
@@ -77,6 +83,35 @@
</complexType>
</element>
+ <element name="themeDefinition">
+ <complexType>
+ <attribute name="id" type="string" use="required">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="icon" type="string">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ <appinfo>
+ <meta.attribute kind="resource"/>
+ </appinfo>
+ </annotation>
+ </attribute>
+ <attribute name="label" type="string">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
<annotation>
<appinfo>
<meta.section type="since"/>
diff --git a/incoming/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/modelstylesheets/EmbeddedStyleSheet.java b/incoming/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/modelstylesheets/EmbeddedStyleSheet.java
deleted file mode 100644
index 09e267160c5..00000000000
--- a/incoming/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/modelstylesheets/EmbeddedStyleSheet.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/**
- * <copyright>
- * </copyright>
- *
- * $Id$
- */
-package org.eclipse.papyrus.infra.gmfdiag.css.modelstylesheets;
-
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Embedded Style Sheet</b></em>'.
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.papyrus.infra.gmfdiag.css.modelstylesheets.EmbeddedStyleSheet#getContent <em>Content</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.papyrus.infra.gmfdiag.css.modelstylesheets.ModelStyleSheetsPackage#getEmbeddedStyleSheet()
- * @model
- * @generated
- */
-public interface EmbeddedStyleSheet extends StyleSheet {
- /**
- * Returns the value of the '<em><b>Content</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Content</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Content</em>' attribute.
- * @see #setContent(String)
- * @see org.eclipse.papyrus.infra.gmfdiag.css.modelstylesheets.ModelStyleSheetsPackage#getEmbeddedStyleSheet_Content()
- * @model required="true"
- * @generated
- */
- String getContent();
-
- /**
- * Sets the value of the '{@link org.eclipse.papyrus.infra.gmfdiag.css.modelstylesheets.EmbeddedStyleSheet#getContent <em>Content</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Content</em>' attribute.
- * @see #getContent()
- * @generated
- */
- void setContent(String value);
-
-} // EmbeddedStyleSheet
diff --git a/incoming/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/modelstylesheets/impl/StyleSheetImpl.java b/incoming/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/modelstylesheets/impl/StyleSheetImpl.java
deleted file mode 100644
index a133fe7afda..00000000000
--- a/incoming/org.eclipse.papyrus.infra.gmfdiag.css/src-gen/org/eclipse/papyrus/infra/gmfdiag/css/modelstylesheets/impl/StyleSheetImpl.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/**
- * <copyright>
- * </copyright>
- *
- * $Id$
- */
-package org.eclipse.papyrus.infra.gmfdiag.css.modelstylesheets.impl;
-
-import org.eclipse.emf.ecore.EClass;
-
-import org.eclipse.emf.ecore.impl.EObjectImpl;
-
-import org.eclipse.papyrus.infra.gmfdiag.css.modelstylesheets.ModelStyleSheetsPackage;
-import org.eclipse.papyrus.infra.gmfdiag.css.modelstylesheets.StyleSheet;
-
-/**
- * <!-- begin-user-doc -->
- * An implementation of the model object '<em><b>Style Sheet</b></em>'.
- * <!-- end-user-doc -->
- * <p>
- * </p>
- *
- * @generated
- */
-public abstract class StyleSheetImpl extends EObjectImpl implements StyleSheet {
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected StyleSheetImpl() {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass() {
- return ModelStyleSheetsPackage.Literals.STYLE_SHEET;
- }
-
-} //StyleSheetImpl
diff --git a/incoming/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/dom/GMFElementAdapter.java b/incoming/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/dom/GMFElementAdapter.java
index fd65212f671..fef6467705b 100644
--- a/incoming/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/dom/GMFElementAdapter.java
+++ b/incoming/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/dom/GMFElementAdapter.java
@@ -12,6 +12,7 @@
package org.eclipse.papyrus.infra.gmfdiag.css.dom;
import static org.eclipse.papyrus.infra.gmfdiag.css.notation.CSSAnnotations.CSS_ANNOTATION;
+import static org.eclipse.papyrus.infra.gmfdiag.css.notation.CSSAnnotations.CSS_DIAGRAM_STYLESHEETS_KEY;
import static org.eclipse.papyrus.infra.gmfdiag.css.notation.CSSAnnotations.CSS_GMF_CLASS_KEY;
import static org.eclipse.papyrus.infra.gmfdiag.css.notation.CSSAnnotations.CSS_GMF_ID_KEY;
import static org.eclipse.papyrus.infra.gmfdiag.css.notation.CSSAnnotations.CSS_GMF_STYLE_KEY;
@@ -44,6 +45,7 @@ import org.eclipse.papyrus.infra.emf.utils.EMFHelper;
import org.eclipse.papyrus.infra.gmfdiag.common.listener.CustomStyleListener;
import org.eclipse.papyrus.infra.gmfdiag.css.engine.ExtendedCSSEngine;
import org.eclipse.papyrus.infra.gmfdiag.css.helper.SemanticElementHelper;
+import org.eclipse.papyrus.infra.gmfdiag.css.notation.CSSDiagram;
import org.eclipse.papyrus.infra.tools.util.ListHelper;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
@@ -194,7 +196,7 @@ public class GMFElementAdapter extends ElementAdapter implements NodeList, IChan
private void listenNotationElement() {
notationElement.eAdapters().add(getStyleListener());
- Collection<String> cssStyles = Arrays.asList(new String[]{ CSS_GMF_CLASS_KEY, CSS_GMF_ID_KEY, CSS_GMF_STYLE_KEY });
+ Collection<String> cssStyles = Arrays.asList(new String[]{ CSS_GMF_CLASS_KEY, CSS_GMF_ID_KEY, CSS_GMF_STYLE_KEY, CSS_DIAGRAM_STYLESHEETS_KEY });
notationElement.eAdapters().add(cssStyleListener = new CustomStyleListener(notationElement, this, cssStyles));
}
@@ -374,8 +376,14 @@ public class GMFElementAdapter extends ElementAdapter implements NodeList, IChan
getEngine().notifyChange(this);
}
- //Change incoming from one of the cssCustomStyles (class, id or local style)
+ //Change incoming from one of the cssCustomStyles (class, id, local style or diagram stylesheets)
public void handleChange(ChangeEvent event) {
+ if(notationElement instanceof CSSDiagram) {
+ //TODO: Use a finer grained event (We should reset only when the
+ //change occurs on a DiagramStyleSheet)
+ getEngine().reset();
+ }
+
//Notify the CSS Engine
getEngine().notifyChange(this);
}
diff --git a/incoming/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/engine/DiagramCSSEngine.java b/incoming/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/engine/DiagramCSSEngine.java
index 9c25265803d..cdfe9355bce 100644
--- a/incoming/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/engine/DiagramCSSEngine.java
+++ b/incoming/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/engine/DiagramCSSEngine.java
@@ -23,9 +23,9 @@ import org.eclipse.gmf.runtime.notation.View;
import org.eclipse.papyrus.infra.gmfdiag.common.handler.RefreshHandler;
import org.eclipse.papyrus.infra.gmfdiag.css.Activator;
import org.eclipse.papyrus.infra.gmfdiag.css.helper.SemanticElementHelper;
-import org.eclipse.papyrus.infra.gmfdiag.css.modelstylesheets.StyleSheet;
-import org.eclipse.papyrus.infra.gmfdiag.css.modelstylesheets.StyleSheetReference;
import org.eclipse.papyrus.infra.gmfdiag.css.notation.CSSDiagram;
+import org.eclipse.papyrus.infra.gmfdiag.css.stylesheets.StyleSheet;
+import org.eclipse.papyrus.infra.gmfdiag.css.stylesheets.StyleSheetReference;
import org.w3c.dom.Element;
@SuppressWarnings("restriction")
diff --git a/incoming/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/engine/ExtendedCSSEngineImpl.java b/incoming/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/engine/ExtendedCSSEngineImpl.java
index a4f5a3ac929..75946452a09 100644
--- a/incoming/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/engine/ExtendedCSSEngineImpl.java
+++ b/incoming/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/engine/ExtendedCSSEngineImpl.java
@@ -40,9 +40,9 @@ import org.eclipse.papyrus.infra.gmfdiag.css.converters.StringConverter;
import org.eclipse.papyrus.infra.gmfdiag.css.engine.enginecopy.ExtendedViewCSSImpl;
import org.eclipse.papyrus.infra.gmfdiag.css.listener.StyleSheetChangeListener;
import org.eclipse.papyrus.infra.gmfdiag.css.lists.ExtendedStyleSheetList;
-import org.eclipse.papyrus.infra.gmfdiag.css.modelstylesheets.EmbeddedStyleSheet;
-import org.eclipse.papyrus.infra.gmfdiag.css.modelstylesheets.StyleSheet;
-import org.eclipse.papyrus.infra.gmfdiag.css.modelstylesheets.StyleSheetReference;
+import org.eclipse.papyrus.infra.gmfdiag.css.stylesheets.EmbeddedStyleSheet;
+import org.eclipse.papyrus.infra.gmfdiag.css.stylesheets.StyleSheet;
+import org.eclipse.papyrus.infra.gmfdiag.css.stylesheets.StyleSheetReference;
import org.w3c.css.sac.ConditionFactory;
import org.w3c.dom.Element;
import org.w3c.dom.css.CSSStyleDeclaration;
diff --git a/incoming/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/engine/ModelCSSEngine.java b/incoming/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/engine/ModelCSSEngine.java
index e7f73e7b3f3..b7af7ab1cce 100644
--- a/incoming/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/engine/ModelCSSEngine.java
+++ b/incoming/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/engine/ModelCSSEngine.java
@@ -19,9 +19,9 @@ import org.eclipse.e4.ui.css.core.engine.CSSElementContext;
import org.eclipse.emf.common.util.URI;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.resource.Resource;
-import org.eclipse.papyrus.infra.gmfdiag.css.modelstylesheets.ModelStyleSheets;
-import org.eclipse.papyrus.infra.gmfdiag.css.modelstylesheets.StyleSheet;
-import org.eclipse.papyrus.infra.gmfdiag.css.modelstylesheets.StyleSheetReference;
+import org.eclipse.papyrus.infra.gmfdiag.css.stylesheets.ModelStyleSheets;
+import org.eclipse.papyrus.infra.gmfdiag.css.stylesheets.StyleSheet;
+import org.eclipse.papyrus.infra.gmfdiag.css.stylesheets.StyleSheetReference;
import org.w3c.dom.Element;
@SuppressWarnings("restriction")
diff --git a/incoming/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/engine/WorkspaceCSSEngine.java b/incoming/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/engine/WorkspaceCSSEngine.java
index 139f64673be..f30219a8a9d 100644
--- a/incoming/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/engine/WorkspaceCSSEngine.java
+++ b/incoming/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/engine/WorkspaceCSSEngine.java
@@ -15,7 +15,7 @@ import java.net.URL;
import org.eclipse.e4.ui.css.core.dom.IElementProvider;
import org.eclipse.e4.ui.css.core.engine.CSSElementContext;
-import org.eclipse.papyrus.infra.gmfdiag.css.preferences.ThemePreferencesPage;
+import org.eclipse.papyrus.infra.gmfdiag.css.theme.ThemeManager;
import org.w3c.dom.Element;
/**
@@ -37,7 +37,7 @@ public class WorkspaceCSSEngine extends ExtendedCSSEngineImpl {
@Override
protected void reloadStyleSheets() {
styleSheetURLs.clear();
- for(URL styleSheetURL : ThemePreferencesPage.getWorkspaceStyleSheets()) {
+ for(URL styleSheetURL : ThemeManager.instance.getWorkspaceStyleSheets()) {
styleSheetURLs.add(styleSheetURL);
}
}
diff --git a/incoming/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/notation/CSSDiagram.java b/incoming/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/notation/CSSDiagram.java
index fb4973c0021..c879f074240 100644
--- a/incoming/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/notation/CSSDiagram.java
+++ b/incoming/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/notation/CSSDiagram.java
@@ -15,7 +15,7 @@ import java.util.List;
import org.eclipse.gmf.runtime.notation.Diagram;
import org.eclipse.papyrus.infra.gmfdiag.css.engine.ExtendedCSSEngine;
-import org.eclipse.papyrus.infra.gmfdiag.css.modelstylesheets.StyleSheet;
+import org.eclipse.papyrus.infra.gmfdiag.css.stylesheets.StyleSheet;
public interface CSSDiagram extends Diagram {
diff --git a/incoming/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/notation/CSSDiagramImpl.java b/incoming/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/notation/CSSDiagramImpl.java
index 9fe72416f22..50975bfe4ee 100644
--- a/incoming/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/notation/CSSDiagramImpl.java
+++ b/incoming/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/notation/CSSDiagramImpl.java
@@ -24,8 +24,8 @@ import org.eclipse.gmf.runtime.notation.NamedStyle;
import org.eclipse.gmf.runtime.notation.impl.DiagramImpl;
import org.eclipse.papyrus.infra.gmfdiag.css.engine.DiagramCSSEngine;
import org.eclipse.papyrus.infra.gmfdiag.css.engine.ExtendedCSSEngine;
-import org.eclipse.papyrus.infra.gmfdiag.css.modelstylesheets.StyleSheet;
import org.eclipse.papyrus.infra.gmfdiag.css.resource.CSSNotationResource;
+import org.eclipse.papyrus.infra.gmfdiag.css.stylesheets.StyleSheet;
@SuppressWarnings("restriction")
public class CSSDiagramImpl extends DiagramImpl implements CSSDiagram {
diff --git a/incoming/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/preferences/ThemePreferences.java b/incoming/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/preferences/ThemePreferences.java
new file mode 100644
index 00000000000..c1877eb8bf9
--- /dev/null
+++ b/incoming/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/preferences/ThemePreferences.java
@@ -0,0 +1,21 @@
+/*****************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Initial API and implementation
+ *****************************************************************************/
+package org.eclipse.papyrus.infra.gmfdiag.css.preferences;
+
+
+public interface ThemePreferences {
+
+ /**
+ * The "Current Theme" preference
+ */
+ public static String CURRENT_THEME = "currentTheme"; //$NON-NLS-1$
+}
diff --git a/incoming/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/preferences/ThemePreferencesPage.java b/incoming/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/preferences/ThemePreferencesPage.java
index 8c5f30e38c2..2d970dbbc47 100644
--- a/incoming/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/preferences/ThemePreferencesPage.java
+++ b/incoming/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/preferences/ThemePreferencesPage.java
@@ -11,44 +11,25 @@
*****************************************************************************/
package org.eclipse.papyrus.infra.gmfdiag.css.preferences;
-import java.io.IOException;
-import java.net.URL;
-import java.text.Collator;
-import java.util.Collections;
-import java.util.Comparator;
-import java.util.HashMap;
-import java.util.LinkedList;
import java.util.List;
-import java.util.Map;
import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.core.runtime.Platform;
import org.eclipse.jface.preference.ComboFieldEditor;
import org.eclipse.jface.preference.FieldEditor;
import org.eclipse.jface.preference.FieldEditorPreferencePage;
-import org.eclipse.jface.preference.IPersistentPreferenceStore;
-import org.eclipse.jface.preference.IPreferenceStore;
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.jface.util.PropertyChangeEvent;
import org.eclipse.papyrus.infra.gmfdiag.common.handler.RefreshHandler;
import org.eclipse.papyrus.infra.gmfdiag.css.Activator;
import org.eclipse.papyrus.infra.gmfdiag.css.engine.WorkspaceCSSEngine;
+import org.eclipse.papyrus.infra.gmfdiag.css.theme.Theme;
+import org.eclipse.papyrus.infra.gmfdiag.css.theme.ThemeManager;
import org.eclipse.ui.IWorkbench;
import org.eclipse.ui.IWorkbenchPreferencePage;
public class ThemePreferencesPage extends FieldEditorPreferencePage implements IWorkbenchPreferencePage {
- /**
- * The "Current Theme" preference
- */
- public static String CURRENT_THEME = "currentTheme"; //$NON-NLS-1$
-
- public static String EXTENSION_ID = Activator.PLUGIN_ID + ".theme";
-
- private static Map<String, Theme> allThemes;
-
public boolean needsRefresh = false;
/**
@@ -100,18 +81,18 @@ public class ThemePreferencesPage extends FieldEditorPreferencePage implements I
@Override
protected void createFieldEditors() {
String[][] themes = getFieldThemes();
- ComboFieldEditor editor = new ComboFieldEditor(CURRENT_THEME, "Current theme:", themes, getFieldEditorParent());
+ ComboFieldEditor editor = new ComboFieldEditor(ThemePreferences.CURRENT_THEME, "Current theme:", themes, getFieldEditorParent());
addField(editor);
}
@Override
public void propertyChange(PropertyChangeEvent event) {
super.propertyChange(event);
- if(CURRENT_THEME.equals(event.getProperty())) {
+ if(ThemePreferences.CURRENT_THEME.equals(event.getProperty())) {
needsRefresh = true;
}
if(FieldEditor.VALUE.equals(event.getProperty())) {
- if(CURRENT_THEME.equals(((FieldEditor)event.getSource()).getPreferenceName())) {
+ if(ThemePreferences.CURRENT_THEME.equals(((FieldEditor)event.getSource()).getPreferenceName())) {
needsRefresh = true;
}
}
@@ -132,134 +113,16 @@ public class ThemePreferencesPage extends FieldEditorPreferencePage implements I
}
protected String[][] getFieldThemes() {
- List<Theme> themes = sortThemes();
+ List<Theme> themes = ThemeManager.instance.getThemes();
String[][] result = new String[themes.size()][2];
int i = 0;
for(Theme theme : themes) {
- result[i][0] = theme.label;
- result[i][1] = theme.id;
+ result[i][0] = theme.getLabel();
+ result[i][1] = theme.getId();
i++;
}
return result;
}
- protected static Map<String, Theme> getThemes() {
- if(allThemes == null) {
- allThemes = new HashMap<String, Theme>();
- allThemes.put(EmptyTheme.instance.id, EmptyTheme.instance);
- IConfigurationElement[] config = Platform.getExtensionRegistry().getConfigurationElementsFor(EXTENSION_ID);
-
- for(IConfigurationElement themeConfig : config) {
- final String themeId = themeConfig.getAttribute("id");
- Theme theme = getTheme(themeId);
- IConfigurationElement[] stylesheets = themeConfig.getChildren("stylesheet");
- for(IConfigurationElement stylesheetConfig : stylesheets) {
- String path = stylesheetConfig.getAttribute("stylesheetPath");
- try {
- URL url = new URL("platform:/plugin/" + themeConfig.getContributor().getName() + "/" + path);
- theme.styleSheets.add(url);
- } catch (IOException ex) {
- Activator.log.error(ex);
- }
- }
- }
- }
-
- return allThemes;
- }
-
- public static List<URL> getWorkspaceStyleSheets() {
- Theme current = findCurrentTheme();
- if(current == null) {
- return Collections.emptyList();
- }
- return current.styleSheets;
- }
-
- protected static Theme findCurrentTheme() {
- IPreferenceStore store = Activator.getDefault().getPreferenceStore();
-
- if(store.contains(CURRENT_THEME)) {
- String themeId = store.getString(CURRENT_THEME);
- Theme theme = getThemes().containsKey(themeId) ? getThemes().get(themeId) : EmptyTheme.instance;
- return theme;
- }
-
- //The theme has not been defined: return the first one, and store it
-
- List<Theme> sortedThemes = sortThemes();
- if(sortedThemes.size() < 2) {
- return EmptyTheme.instance;
- }
-
- //Index 0 is EmptyTheme ; we return the first non-empty theme
- Theme theme = sortedThemes.get(1);
- store.setValue(CURRENT_THEME, theme.id);
- try {
- ((IPersistentPreferenceStore)store).save();
- } catch (IOException e) {
- Activator.log.error(e);
- }
- return theme;
- }
-
- protected static List<Theme> sortThemes() {
- List<Theme> sortedThemes = new LinkedList<Theme>(getThemes().values());
- Collections.sort(sortedThemes, ThemeComparator.instance);
- return sortedThemes;
- }
-
- protected static Theme getTheme(String id) {
- if(!allThemes.containsKey(id)) {
- Theme theme = new Theme(id, id, new LinkedList<URL>());
- allThemes.put(id, theme);
- }
- return allThemes.get(id);
- }
-
- private static class Theme {
-
- public Theme(String id, String label, List<URL> styleSheets) {
- this.id = id;
- this.label = label;
- this.styleSheets = styleSheets;
- }
-
- public final List<URL> styleSheets;
-
- public final String id;
-
- public final String label;
- }
-
- private static class EmptyTheme extends Theme {
-
- public static Theme instance = new EmptyTheme();
-
- private EmptyTheme() {
- super("none", "No theme", Collections.<URL> emptyList());
- }
- }
-
- private static class ThemeComparator implements Comparator<Theme> {
-
- private ThemeComparator() {
- }
-
- public int compare(Theme o1, Theme o2) {
- if(o1 == EmptyTheme.instance) {
- return -1;
- }
- if(o2 == EmptyTheme.instance) {
- return 1;
- }
-
- return Collator.getInstance().compare(o1.label, o2.label);
- }
-
- public static Comparator<Theme> instance = new ThemeComparator();
-
- }
-
}
diff --git a/incoming/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/theme/Theme.java b/incoming/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/theme/Theme.java
new file mode 100644
index 00000000000..39c19f2aee2
--- /dev/null
+++ b/incoming/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/theme/Theme.java
@@ -0,0 +1,63 @@
+/*****************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Initial API and implementation
+ *****************************************************************************/
+package org.eclipse.papyrus.infra.gmfdiag.css.theme;
+
+import java.net.URL;
+import java.util.LinkedList;
+import java.util.List;
+
+import org.eclipse.swt.graphics.Image;
+
+
+public class Theme {
+
+ private String label;
+
+ private Image icon;
+
+ private final String id;
+
+ private final List<URL> styleSheets;
+
+ public Theme(String id) {
+ this.id = id;
+ this.styleSheets = new LinkedList<URL>();
+ }
+
+ public String getLabel() {
+ return label == null || "".equals(label) ? id : label;
+ }
+
+ public void setLabel(String label) {
+ this.label = label;
+ }
+
+ public Image getIcon() {
+ return icon;
+ }
+
+ public void setIcon(Image icon) {
+ this.icon = icon;
+ }
+
+ public String getId() {
+ return id;
+ }
+
+ public void addStyleSheet(URL url) {
+ styleSheets.add(url);
+ }
+
+ public List<URL> getStyleSheets() {
+ return styleSheets;
+ }
+}
diff --git a/incoming/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/theme/ThemeManager.java b/incoming/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/theme/ThemeManager.java
new file mode 100644
index 00000000000..bbda16c9b82
--- /dev/null
+++ b/incoming/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/theme/ThemeManager.java
@@ -0,0 +1,189 @@
+/*****************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Initial API and implementation
+ *****************************************************************************/
+package org.eclipse.papyrus.infra.gmfdiag.css.theme;
+
+import java.io.IOException;
+import java.net.URL;
+import java.text.Collator;
+import java.util.Collections;
+import java.util.Comparator;
+import java.util.HashMap;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Map;
+
+import org.eclipse.core.runtime.IConfigurationElement;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.jface.preference.IPersistentPreferenceStore;
+import org.eclipse.jface.preference.IPreferenceStore;
+import org.eclipse.papyrus.infra.gmfdiag.css.Activator;
+import org.eclipse.papyrus.infra.gmfdiag.css.preferences.ThemePreferences;
+import org.eclipse.swt.graphics.Image;
+
+
+public class ThemeManager {
+
+ public static String EXTENSION_ID = Activator.PLUGIN_ID + ".theme";
+
+ public static ThemeManager instance = new ThemeManager();
+
+ private Map<String, Theme> allThemes;
+
+ public List<Theme> getThemes() {
+ List<Theme> sortedThemes = new LinkedList<Theme>(getAllThemes().values());
+ Collections.sort(sortedThemes, ThemeComparator.instance);
+ return sortedThemes;
+ }
+
+ public List<URL> getWorkspaceStyleSheets() {
+ Theme current = findCurrentTheme();
+ if(current == null) {
+ return Collections.emptyList();
+ }
+ return current.getStyleSheets();
+ }
+
+ public Theme getTheme(String themeId) {
+ return getAllThemes().get(themeId);
+ }
+
+ private Map<String, Theme> getAllThemes() {
+ if(allThemes == null) {
+ allThemes = new HashMap<String, Theme>();
+ allThemes.put(EmptyTheme.instance.getId(), EmptyTheme.instance);
+ IConfigurationElement[] config = Platform.getExtensionRegistry().getConfigurationElementsFor(EXTENSION_ID);
+
+ loadThemeDefinitions(config);
+ loadThemeContributions(config);
+ }
+
+ return allThemes;
+ }
+
+ private void loadThemeDefinitions(IConfigurationElement[] config) {
+ for(IConfigurationElement themeConfig : config) {
+ if(!themeConfig.getName().equals("themeDefinition")) {
+ continue;
+ }
+
+ final String themeId = themeConfig.getAttribute("id");
+ if(themeId == null) {
+ Activator.log.warn("Cannot define a CSS Theme with an empty id (Contributed by " + themeConfig.getContributor() + ")");
+ continue;
+ }
+ Theme theme = new Theme(themeId);
+
+ String themeLabel = themeConfig.getAttribute("label");
+ theme.setLabel(themeLabel);
+
+ String themeIcon = themeConfig.getAttribute("icon");
+ if(themeIcon != null) {
+ //FIXME: Use the Papyrus Image service when it is available
+ Image icon = org.eclipse.papyrus.infra.widgets.Activator.getDefault().getImage(themeConfig.getContributor().getName(), themeIcon);
+ if(icon != null) {
+ theme.setIcon(icon);
+ }
+ }
+
+ allThemes.put(themeId, theme);
+ }
+ }
+
+ private void loadThemeContributions(IConfigurationElement[] config) {
+ for(IConfigurationElement themeConfig : config) {
+ if(!themeConfig.getName().equals("themeContribution")) {
+ continue;
+ }
+
+ final String themeId = themeConfig.getAttribute("id");
+ if(themeId == null || !allThemes.containsKey(themeId)) {
+ Activator.log.warn("Cannot contribute to an undefined theme: " + themeId);
+ continue;
+ }
+
+ Theme theme = allThemes.get(themeId);
+
+ IConfigurationElement[] stylesheets = themeConfig.getChildren("stylesheet");
+ for(IConfigurationElement stylesheetConfig : stylesheets) {
+ String path = stylesheetConfig.getAttribute("stylesheetPath");
+ try {
+ URL url = new URL("platform:/plugin/" + themeConfig.getContributor().getName() + "/" + path);
+ theme.addStyleSheet(url);
+ } catch (IOException ex) {
+ Activator.log.error(ex);
+ }
+ }
+ }
+ }
+
+ private Theme findCurrentTheme() {
+ IPreferenceStore store = Activator.getDefault().getPreferenceStore();
+
+ if(store.contains(ThemePreferences.CURRENT_THEME)) {
+ String themeId = store.getString(ThemePreferences.CURRENT_THEME);
+ Theme theme = getAllThemes().containsKey(themeId) ? getAllThemes().get(themeId) : EmptyTheme.instance;
+ return theme;
+ }
+
+ //The theme has not been defined: return the first one, and store it
+ List<Theme> sortedThemes = getThemes();
+ if(sortedThemes.size() < 2) {
+ return EmptyTheme.instance;
+ }
+
+ //Index 0 is EmptyTheme ; we return the first non-empty theme
+ Theme theme = sortedThemes.get(1);
+ store.setValue(ThemePreferences.CURRENT_THEME, theme.getId());
+ try {
+ ((IPersistentPreferenceStore)store).save();
+ } catch (IOException e) {
+ Activator.log.error(e);
+ }
+ return theme;
+ }
+
+ private static class EmptyTheme extends Theme {
+
+ public static Theme instance = new EmptyTheme();
+
+ private EmptyTheme() {
+ super("none"); //$NON-NLS-1$
+ setLabel("No theme");
+ Image icon = org.eclipse.papyrus.infra.widgets.Activator.getDefault().getImage("icons/Delete_12x12.gif");
+ setIcon(icon);
+ }
+ }
+
+ private static class ThemeComparator implements Comparator<Theme> {
+
+ private ThemeComparator() {
+ }
+
+ public int compare(Theme o1, Theme o2) {
+ if(o1 == EmptyTheme.instance) {
+ return -1;
+ }
+ if(o2 == EmptyTheme.instance) {
+ return 1;
+ }
+
+ return Collator.getInstance().compare(o1.getLabel(), o2.getLabel());
+ }
+
+ public static Comparator<Theme> instance = new ThemeComparator();
+
+ }
+
+ private ThemeManager() {
+
+ }
+}

Back to the top