Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMickael ADAM2016-08-25 05:58:59 -0400
committerGerrit Code Review @ Eclipse.org2016-09-27 04:02:02 -0400
commitad65ff8c3f11fd8651c42be6eff13abbb1d3b279 (patch)
tree96920ac8874dce44d109342dda08af4e1e09814f /plugins/facet
parent21f7c5441e48e341c79ccd90cc78227b39c6e6d7 (diff)
downloadorg.eclipse.papyrus-ad65ff8c3f11fd8651c42be6eff13abbb1d3b279.tar.gz
org.eclipse.papyrus-ad65ff8c3f11fd8651c42be6eff13abbb1d3b279.tar.xz
org.eclipse.papyrus-ad65ff8c3f11fd8651c42be6eff13abbb1d3b279.zip
Bug 500219 - [Model Explorer] Papyrus Should provide an other way to
customize uml label Change-Id: Ic3213ed9aefb636f4e581df7996378dfd96d8937 Signed-off-by: Mickael ADAM <mickael.adam@ALL4TEC.net>
Diffstat (limited to 'plugins/facet')
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.custom.core/META-INF/MANIFEST.MF2
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.custom.core/src/org/eclipse/papyrus/emf/facet/custom/core/internal/exported/CustomizationUtils.java8
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.custom.metamodel.edit/META-INF/MANIFEST.MF2
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.custom.metamodel/.settings/org.eclipse.core.resources.prefs1
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.custom.metamodel/META-INF/MANIFEST.MF7
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.custom.metamodel/model/custom_primitive_types-0.2.0.ecore7
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.custom.metamodel/model/custom_primitive_types-0.2.0.genmodel1
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.custom.metamodel/pom.xml2
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.custom.metamodel/src/org/eclipse/papyrus/emf/facet/custom/metamodel/v0_2_0/custompt/Alignment.java49
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.custom.metamodel/src/org/eclipse/papyrus/emf/facet/custom/metamodel/v0_2_0/custompt/CustomptFactory.java5
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.custom.metamodel/src/org/eclipse/papyrus/emf/facet/custom/metamodel/v0_2_0/custompt/CustomptPackage.java50
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.custom.metamodel/src/org/eclipse/papyrus/emf/facet/custom/metamodel/v0_2_0/custompt/Shadow.java49
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.custom.metamodel/src/org/eclipse/papyrus/emf/facet/custom/metamodel/v0_2_0/custompt/impl/CustomptFactoryImpl.java103
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.custom.metamodel/src/org/eclipse/papyrus/emf/facet/custom/metamodel/v0_2_0/custompt/impl/CustomptPackageImpl.java75
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.custom.ui/src/org/eclipse/papyrus/emf/facet/custom/ui/ICustomizedLabelProvider.java26
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.custom.ui/src/org/eclipse/papyrus/emf/facet/custom/ui/internal/CustomizedLabelProvider.java94
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.custom.ui/src/org/eclipse/papyrus/emf/facet/custom/ui/internal/DecoratingCustomizedLabelProvider.java22
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.custom.ui/src/org/eclipse/papyrus/emf/facet/custom/ui/internal/ResolvingCustomizedLabelProvider.java30
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.query.java.sdk.ui/META-INF/MANIFEST.MF2
19 files changed, 316 insertions, 219 deletions
diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.custom.core/META-INF/MANIFEST.MF b/plugins/facet/org.eclipse.papyrus.emf.facet.custom.core/META-INF/MANIFEST.MF
index 00a1c80b084..8faa15d3def 100644
--- a/plugins/facet/org.eclipse.papyrus.emf.facet.custom.core/META-INF/MANIFEST.MF
+++ b/plugins/facet/org.eclipse.papyrus.emf.facet.custom.core/META-INF/MANIFEST.MF
@@ -7,7 +7,7 @@ Export-Package: org.eclipse.papyrus.emf.facet.custom.core,
org.eclipse.papyrus.emf.facet.custom.core.internal.query
Require-Bundle: org.eclipse.ui;bundle-version="[3.107.0,4.0.0)",
org.eclipse.core.runtime;bundle-version="[3.12.0,4.0.0)",
- org.eclipse.papyrus.emf.facet.custom.metamodel;bundle-version="[1.2.0,2.0.0)";visibility:=reexport,
+ org.eclipse.papyrus.emf.facet.custom.metamodel;bundle-version="[1.3.0,2.0.0)";visibility:=reexport,
org.eclipse.papyrus.emf.facet.efacet.core;bundle-version="[2.0.0,3.0.0)";visibility:=reexport,
org.eclipse.papyrus.emf.facet.util.core;bundle-version="[1.2.0,2.0.0)",
org.eclipse.emf.validation;bundle-version="[1.8.0,2.0.0)"
diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.custom.core/src/org/eclipse/papyrus/emf/facet/custom/core/internal/exported/CustomizationUtils.java b/plugins/facet/org.eclipse.papyrus.emf.facet.custom.core/src/org/eclipse/papyrus/emf/facet/custom/core/internal/exported/CustomizationUtils.java
index 36a961abc48..d17f8fcc391 100644
--- a/plugins/facet/org.eclipse.papyrus.emf.facet.custom.core/src/org/eclipse/papyrus/emf/facet/custom/core/internal/exported/CustomizationUtils.java
+++ b/plugins/facet/org.eclipse.papyrus.emf.facet.custom.core/src/org/eclipse/papyrus/emf/facet/custom/core/internal/exported/CustomizationUtils.java
@@ -10,6 +10,7 @@
* Gregoire Dupe (Mia-Software) - Bug 373078 - API Cleaning
* Gregoire Dupe (Mia-Software) - Bug 376576 - [EFacet] Change the multiplicity of Facet::extendedFacet
* David Couvrand (Soft-Maint) - Bug 418418 - [Customization] Overlay icons not implemented
+ * Mickael ADAM (ALL4TEC) - mickael.adam@all4tec.net - Bug 500219 - implementation of IStyledLabelProvider
*/
package org.eclipse.papyrus.emf.facet.custom.core.internal.exported;
@@ -22,6 +23,7 @@ import org.eclipse.emf.ecore.EClassifier;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.EPackage;
import org.eclipse.emf.ecore.ETypedElement;
+import org.eclipse.jface.viewers.StyledString;
import org.eclipse.papyrus.emf.facet.custom.core.ICustomizationManager;
import org.eclipse.papyrus.emf.facet.custom.core.exception.CustomizationException;
import org.eclipse.papyrus.emf.facet.custom.core.internal.Activator;
@@ -127,6 +129,12 @@ public final class CustomizationUtils {
Activator.getDefault());
}
}
+
+ // Patch to convert StyledString to String in case of customManager provide StyleString and String is expected.
+ if (result instanceof StyledString && !classs.isInstance(result)) {
+ result = (T) result.toString();
+ }
+
return result;
}
}
diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.custom.metamodel.edit/META-INF/MANIFEST.MF b/plugins/facet/org.eclipse.papyrus.emf.facet.custom.metamodel.edit/META-INF/MANIFEST.MF
index b267c1b7ae4..3d20d83dedc 100644
--- a/plugins/facet/org.eclipse.papyrus.emf.facet.custom.metamodel.edit/META-INF/MANIFEST.MF
+++ b/plugins/facet/org.eclipse.papyrus.emf.facet.custom.metamodel.edit/META-INF/MANIFEST.MF
@@ -1,7 +1,7 @@
Manifest-Version: 1.0
Export-Package: org.eclipse.papyrus.emf.facet.custom.metamodel.v0_2_0.custom.provider;x-internal:=true
Require-Bundle: org.eclipse.core.runtime;bundle-version="[3.12.0,4.0.0)",
- org.eclipse.papyrus.emf.facet.custom.metamodel;bundle-version="[1.2.0,2.0.0)";visibility:=reexport,
+ org.eclipse.papyrus.emf.facet.custom.metamodel;bundle-version="[1.3.0,2.0.0)";visibility:=reexport,
org.eclipse.papyrus.emf.facet.efacet.metamodel;bundle-version="[1.2.0,2.0.0)";visibility:=reexport,
org.eclipse.papyrus.emf.facet.efacet.metamodel.edit;bundle-version="[1.2.0,2.0.0)";visibility:=reexport
Bundle-Vendor: %providerName
diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.custom.metamodel/.settings/org.eclipse.core.resources.prefs b/plugins/facet/org.eclipse.papyrus.emf.facet.custom.metamodel/.settings/org.eclipse.core.resources.prefs
index e1105b315f5..6b2762e2f36 100644
--- a/plugins/facet/org.eclipse.papyrus.emf.facet.custom.metamodel/.settings/org.eclipse.core.resources.prefs
+++ b/plugins/facet/org.eclipse.papyrus.emf.facet.custom.metamodel/.settings/org.eclipse.core.resources.prefs
@@ -1,4 +1,3 @@
-#Thu Oct 20 20:43:55 CEST 2011
eclipse.preferences.version=1
encoding//model/custom_main.ecorediag=UTF-8
encoding//model/custom_property_declaration.ecorediag=UTF-8
diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.custom.metamodel/META-INF/MANIFEST.MF b/plugins/facet/org.eclipse.papyrus.emf.facet.custom.metamodel/META-INF/MANIFEST.MF
index 1e7b5b27d6f..0849e5a3dbc 100644
--- a/plugins/facet/org.eclipse.papyrus.emf.facet.custom.metamodel/META-INF/MANIFEST.MF
+++ b/plugins/facet/org.eclipse.papyrus.emf.facet.custom.metamodel/META-INF/MANIFEST.MF
@@ -1,6 +1,9 @@
Manifest-Version: 1.0
Require-Bundle: org.eclipse.core.runtime;bundle-version="[3.12.0,4.0.0)",
- org.eclipse.papyrus.emf.facet.efacet.metamodel;bundle-version="[1.2.0,2.0.0)";visibility:=reexport
+ org.eclipse.emf.ecore;bundle-version="[2.12.0,3.0.0)";visibility:=reexport,
+ org.eclipse.papyrus.emf.facet.efacet.metamodel;bundle-version="[1.2.0,2.0.0)";visibility:=reexport,
+ org.eclipse.emf.edit;bundle-version="[2.12.0,3.0.0)",
+ org.eclipse.jface;bundle-version="[3.12.0,4.0.0)"
Export-Package: org.eclipse.papyrus.emf.facet.custom.metamodel.custompt,
org.eclipse.papyrus.emf.facet.custom.metamodel.v0_2_0.custom,
org.eclipse.papyrus.emf.facet.custom.metamodel.v0_2_0.custom.impl,
@@ -14,7 +17,7 @@ Export-Package: org.eclipse.papyrus.emf.facet.custom.metamodel.custompt,
Bundle-Vendor: %providerName
Bundle-ActivationPolicy: lazy
Bundle-ClassPath: .
-Bundle-Version: 1.2.0.qualifier
+Bundle-Version: 1.3.0.qualifier
Bundle-Localization: plugin
Bundle-Name: %pluginName
Bundle-ManifestVersion: 2
diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.custom.metamodel/model/custom_primitive_types-0.2.0.ecore b/plugins/facet/org.eclipse.papyrus.emf.facet.custom.metamodel/model/custom_primitive_types-0.2.0.ecore
index 16c772e2b38..bc6d75d7e35 100644
--- a/plugins/facet/org.eclipse.papyrus.emf.facet.custom.metamodel/model/custom_primitive_types-0.2.0.ecore
+++ b/plugins/facet/org.eclipse.papyrus.emf.facet.custom.metamodel/model/custom_primitive_types-0.2.0.ecore
@@ -1,8 +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="custompt"
- nsURI="http://www.eclipse.org/papyrus/emf/facet/custom/0.2.incubation/custom_primitive_types"
+<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="custompt" nsURI="http://www.eclipse.org/papyrus/emf/facet/custom/0.2.incubation/custom_primitive_types"
nsPrefix="custompt">
<eClassifiers xsi:type="ecore:EDataType" name="Image" instanceClassName="org.eclipse.papyrus.emf.facet.custom.metamodel.custompt.IImage"/>
<eClassifiers xsi:type="ecore:EDataType" name="Color" instanceClassName="org.eclipse.papyrus.emf.facet.custom.metamodel.custompt.IColor"/>
@@ -16,4 +14,5 @@
<eLiterals name="CENTER" value="1"/>
<eLiterals name="RIGHT" value="2"/>
</eClassifiers>
+ <eClassifiers xsi:type="ecore:EDataType" name="StyledLabel" instanceClassName="org.eclipse.jface.viewers.StyledString"/>
</ecore:EPackage>
diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.custom.metamodel/model/custom_primitive_types-0.2.0.genmodel b/plugins/facet/org.eclipse.papyrus.emf.facet.custom.metamodel/model/custom_primitive_types-0.2.0.genmodel
index 66acb7a10b0..b64920b7d48 100644
--- a/plugins/facet/org.eclipse.papyrus.emf.facet.custom.metamodel/model/custom_primitive_types-0.2.0.genmodel
+++ b/plugins/facet/org.eclipse.papyrus.emf.facet.custom.metamodel/model/custom_primitive_types-0.2.0.genmodel
@@ -19,5 +19,6 @@
</genEnums>
<genDataTypes ecoreDataType="custom_primitive_types-0.2.0.ecore#//Image"/>
<genDataTypes ecoreDataType="custom_primitive_types-0.2.0.ecore#//Color"/>
+ <genDataTypes ecoreDataType="custom_primitive_types-0.2.0.ecore#//StyledLabel"/>
</genPackages>
</genmodel:GenModel>
diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.custom.metamodel/pom.xml b/plugins/facet/org.eclipse.papyrus.emf.facet.custom.metamodel/pom.xml
index b54d39edc35..8170cd8c3c6 100644
--- a/plugins/facet/org.eclipse.papyrus.emf.facet.custom.metamodel/pom.xml
+++ b/plugins/facet/org.eclipse.papyrus.emf.facet.custom.metamodel/pom.xml
@@ -7,6 +7,6 @@
<version>0.0.1-SNAPSHOT</version>
</parent>
<artifactId>org.eclipse.papyrus.emf.facet.custom.metamodel</artifactId>
- <version>1.2.0-SNAPSHOT</version>
+ <version>1.3.0-SNAPSHOT</version>
<packaging>eclipse-plugin</packaging>
</project>
diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.custom.metamodel/src/org/eclipse/papyrus/emf/facet/custom/metamodel/v0_2_0/custompt/Alignment.java b/plugins/facet/org.eclipse.papyrus.emf.facet.custom.metamodel/src/org/eclipse/papyrus/emf/facet/custom/metamodel/v0_2_0/custompt/Alignment.java
index b462da95e88..23a87022531 100644
--- a/plugins/facet/org.eclipse.papyrus.emf.facet.custom.metamodel/src/org/eclipse/papyrus/emf/facet/custom/metamodel/v0_2_0/custompt/Alignment.java
+++ b/plugins/facet/org.eclipse.papyrus.emf.facet.custom.metamodel/src/org/eclipse/papyrus/emf/facet/custom/metamodel/v0_2_0/custompt/Alignment.java
@@ -24,7 +24,6 @@ import org.eclipse.emf.common.util.Enumerator;
* A representation of the literals of the enumeration '<em><b>Alignment</b></em>',
* and utility methods for working with them.
* <!-- end-user-doc -->
- *
* @see org.eclipse.papyrus.emf.facet.custom.metamodel.v0_2_0.custompt.CustomptPackage#getAlignment()
* @model
* @generated
@@ -34,7 +33,6 @@ public enum Alignment implements Enumerator {
* The '<em><b>LEFT</b></em>' literal object.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
- *
* @see #LEFT_VALUE
* @generated
* @ordered
@@ -45,7 +43,6 @@ public enum Alignment implements Enumerator {
* The '<em><b>CENTER</b></em>' literal object.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
- *
* @see #CENTER_VALUE
* @generated
* @ordered
@@ -56,7 +53,6 @@ public enum Alignment implements Enumerator {
* The '<em><b>RIGHT</b></em>' literal object.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
- *
* @see #RIGHT_VALUE
* @generated
* @ordered
@@ -70,7 +66,6 @@ public enum Alignment implements Enumerator {
* If the meaning of '<em><b>LEFT</b></em>' literal object isn't clear, there really should be more of a description here...
* </p>
* <!-- end-user-doc -->
- *
* @see #LEFT
* @model
* @generated
@@ -85,7 +80,6 @@ public enum Alignment implements Enumerator {
* If the meaning of '<em><b>CENTER</b></em>' literal object isn't clear, there really should be more of a description here...
* </p>
* <!-- end-user-doc -->
- *
* @see #CENTER
* @model
* @generated
@@ -100,7 +94,6 @@ public enum Alignment implements Enumerator {
* If the meaning of '<em><b>RIGHT</b></em>' literal object isn't clear, there really should be more of a description here...
* </p>
* <!-- end-user-doc -->
- *
* @see #RIGHT
* @model
* @generated
@@ -112,21 +105,19 @@ public enum Alignment implements Enumerator {
* An array of all the '<em><b>Alignment</b></em>' enumerators.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
- *
* @generated
*/
private static final Alignment[] VALUES_ARRAY =
new Alignment[] {
- LEFT,
- CENTER,
- RIGHT,
- };
+ LEFT,
+ CENTER,
+ RIGHT,
+ };
/**
* A public read-only list of all the '<em><b>Alignment</b></em>' enumerators.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
- *
* @generated
*/
public static final List<Alignment> VALUES = Collections.unmodifiableList(Arrays.asList(VALUES_ARRAY));
@@ -135,7 +126,8 @@ public enum Alignment implements Enumerator {
* Returns the '<em><b>Alignment</b></em>' literal with the specified literal value.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
- *
+ * @param literal the literal.
+ * @return the matching enumerator or <code>null</code>.
* @generated
*/
public static Alignment get(String literal) {
@@ -152,7 +144,8 @@ public enum Alignment implements Enumerator {
* Returns the '<em><b>Alignment</b></em>' literal with the specified name.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
- *
+ * @param name the name.
+ * @return the matching enumerator or <code>null</code>.
* @generated
*/
public static Alignment getByName(String name) {
@@ -169,17 +162,15 @@ public enum Alignment implements Enumerator {
* Returns the '<em><b>Alignment</b></em>' literal with the specified integer value.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
- *
+ * @param value the integer value.
+ * @return the matching enumerator or <code>null</code>.
* @generated
*/
public static Alignment get(int value) {
switch (value) {
- case LEFT_VALUE:
- return LEFT;
- case CENTER_VALUE:
- return CENTER;
- case RIGHT_VALUE:
- return RIGHT;
+ case LEFT_VALUE: return LEFT;
+ case CENTER_VALUE: return CENTER;
+ case RIGHT_VALUE: return RIGHT;
}
return null;
}
@@ -187,7 +178,6 @@ public enum Alignment implements Enumerator {
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
- *
* @generated
*/
private final int value;
@@ -195,7 +185,6 @@ public enum Alignment implements Enumerator {
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
- *
* @generated
*/
private final String name;
@@ -203,7 +192,6 @@ public enum Alignment implements Enumerator {
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
- *
* @generated
*/
private final String literal;
@@ -212,7 +200,6 @@ public enum Alignment implements Enumerator {
* Only this class can construct instances.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
- *
* @generated
*/
private Alignment(int value, String name, String literal) {
@@ -224,38 +211,34 @@ public enum Alignment implements Enumerator {
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
- *
* @generated
*/
public int getValue() {
- return value;
+ return value;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
- *
* @generated
*/
public String getName() {
- return name;
+ return name;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
- *
* @generated
*/
public String getLiteral() {
- return literal;
+ return literal;
}
/**
* Returns the literal value of the enumerator, which is its string representation.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
- *
* @generated
*/
@Override
diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.custom.metamodel/src/org/eclipse/papyrus/emf/facet/custom/metamodel/v0_2_0/custompt/CustomptFactory.java b/plugins/facet/org.eclipse.papyrus.emf.facet.custom.metamodel/src/org/eclipse/papyrus/emf/facet/custom/metamodel/v0_2_0/custompt/CustomptFactory.java
index 372fbee5c3a..8578c782939 100644
--- a/plugins/facet/org.eclipse.papyrus.emf.facet.custom.metamodel/src/org/eclipse/papyrus/emf/facet/custom/metamodel/v0_2_0/custompt/CustomptFactory.java
+++ b/plugins/facet/org.eclipse.papyrus.emf.facet.custom.metamodel/src/org/eclipse/papyrus/emf/facet/custom/metamodel/v0_2_0/custompt/CustomptFactory.java
@@ -18,18 +18,14 @@ import org.eclipse.emf.ecore.EFactory;
/**
* <!-- begin-user-doc --> The <b>Factory</b> for the model. It provides a
* create method for each non-abstract class of the model. <!-- end-user-doc -->
- *
* @see org.eclipse.papyrus.emf.facet.custom.metamodel.v0_2_0.custompt.CustomptPackage
* @generated
- * @noextend This interface is not intended to be extended by clients.
- * @noimplement This interface is not intended to be implemented by clients.
*/
public interface CustomptFactory extends EFactory {
/**
* The singleton instance of the factory.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
- *
* @generated
*/
CustomptFactory eINSTANCE = org.eclipse.papyrus.emf.facet.custom.metamodel.v0_2_0.custompt.impl.CustomptFactoryImpl.init();
@@ -38,7 +34,6 @@ public interface CustomptFactory extends EFactory {
* Returns the package supported by this factory.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
- *
* @return the package supported by this factory.
* @generated
*/
diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.custom.metamodel/src/org/eclipse/papyrus/emf/facet/custom/metamodel/v0_2_0/custompt/CustomptPackage.java b/plugins/facet/org.eclipse.papyrus.emf.facet.custom.metamodel/src/org/eclipse/papyrus/emf/facet/custom/metamodel/v0_2_0/custompt/CustomptPackage.java
index efb373a956d..eec647d5eba 100644
--- a/plugins/facet/org.eclipse.papyrus.emf.facet.custom.metamodel/src/org/eclipse/papyrus/emf/facet/custom/metamodel/v0_2_0/custompt/CustomptPackage.java
+++ b/plugins/facet/org.eclipse.papyrus.emf.facet.custom.metamodel/src/org/eclipse/papyrus/emf/facet/custom/metamodel/v0_2_0/custompt/CustomptPackage.java
@@ -28,7 +28,6 @@ import org.eclipse.emf.ecore.EPackage;
* <li>and each data type</li>
* </ul>
* <!-- end-user-doc -->
- *
* @see org.eclipse.papyrus.emf.facet.custom.metamodel.v0_2_0.custompt.CustomptFactory
* @model kind="package"
* @generated
@@ -38,7 +37,6 @@ public interface CustomptPackage extends EPackage {
* The package name.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
- *
* @generated
*/
String eNAME = "custompt";
@@ -47,7 +45,6 @@ public interface CustomptPackage extends EPackage {
* The package namespace URI.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
- *
* @generated
*/
String eNS_URI = "http://www.eclipse.org/papyrus/emf/facet/custom/0.2.incubation/custom_primitive_types";
@@ -56,7 +53,6 @@ public interface CustomptPackage extends EPackage {
* The package namespace name.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
- *
* @generated
*/
String eNS_PREFIX = "custompt";
@@ -65,7 +61,6 @@ public interface CustomptPackage extends EPackage {
* The singleton instance of the package.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
- *
* @generated
*/
CustomptPackage eINSTANCE = org.eclipse.papyrus.emf.facet.custom.metamodel.v0_2_0.custompt.impl.CustomptPackageImpl.init();
@@ -74,7 +69,6 @@ public interface CustomptPackage extends EPackage {
* The meta object id for the '{@link org.eclipse.papyrus.emf.facet.custom.metamodel.v0_2_0.custompt.Shadow <em>Shadow</em>}' enum.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
- *
* @see org.eclipse.papyrus.emf.facet.custom.metamodel.v0_2_0.custompt.Shadow
* @see org.eclipse.papyrus.emf.facet.custom.metamodel.v0_2_0.custompt.impl.CustomptPackageImpl#getShadow()
* @generated
@@ -85,7 +79,6 @@ public interface CustomptPackage extends EPackage {
* The meta object id for the '{@link org.eclipse.papyrus.emf.facet.custom.metamodel.v0_2_0.custompt.Alignment <em>Alignment</em>}' enum.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
- *
* @see org.eclipse.papyrus.emf.facet.custom.metamodel.v0_2_0.custompt.Alignment
* @see org.eclipse.papyrus.emf.facet.custom.metamodel.v0_2_0.custompt.impl.CustomptPackageImpl#getAlignment()
* @generated
@@ -96,7 +89,6 @@ public interface CustomptPackage extends EPackage {
* The meta object id for the '<em>Image</em>' data type.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
- *
* @see org.eclipse.papyrus.emf.facet.custom.metamodel.custompt.IImage
* @see org.eclipse.papyrus.emf.facet.custom.metamodel.v0_2_0.custompt.impl.CustomptPackageImpl#getImage()
* @generated
@@ -107,7 +99,6 @@ public interface CustomptPackage extends EPackage {
* The meta object id for the '<em>Color</em>' data type.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
- *
* @see org.eclipse.papyrus.emf.facet.custom.metamodel.custompt.IColor
* @see org.eclipse.papyrus.emf.facet.custom.metamodel.v0_2_0.custompt.impl.CustomptPackageImpl#getColor()
* @generated
@@ -115,10 +106,19 @@ public interface CustomptPackage extends EPackage {
int COLOR = 3;
/**
+ * The meta object id for the '<em>Styled Label</em>' data type.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see org.eclipse.jface.viewers.StyledString
+ * @see org.eclipse.papyrus.emf.facet.custom.metamodel.v0_2_0.custompt.impl.CustomptPackageImpl#getStyledLabel()
+ * @generated
+ */
+ int STYLED_LABEL = 4;
+
+ /**
* Returns the meta object for enum '{@link org.eclipse.papyrus.emf.facet.custom.metamodel.v0_2_0.custompt.Shadow <em>Shadow</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
- *
* @return the meta object for enum '<em>Shadow</em>'.
* @see org.eclipse.papyrus.emf.facet.custom.metamodel.v0_2_0.custompt.Shadow
* @generated
@@ -129,7 +129,6 @@ public interface CustomptPackage extends EPackage {
* Returns the meta object for enum '{@link org.eclipse.papyrus.emf.facet.custom.metamodel.v0_2_0.custompt.Alignment <em>Alignment</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
- *
* @return the meta object for enum '<em>Alignment</em>'.
* @see org.eclipse.papyrus.emf.facet.custom.metamodel.v0_2_0.custompt.Alignment
* @generated
@@ -140,7 +139,6 @@ public interface CustomptPackage extends EPackage {
* Returns the meta object for data type '{@link org.eclipse.papyrus.emf.facet.custom.metamodel.custompt.IImage <em>Image</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
- *
* @return the meta object for data type '<em>Image</em>'.
* @see org.eclipse.papyrus.emf.facet.custom.metamodel.custompt.IImage
* @model instanceClass="org.eclipse.papyrus.emf.facet.custom.metamodel.custompt.IImage"
@@ -152,7 +150,6 @@ public interface CustomptPackage extends EPackage {
* Returns the meta object for data type '{@link org.eclipse.papyrus.emf.facet.custom.metamodel.custompt.IColor <em>Color</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
- *
* @return the meta object for data type '<em>Color</em>'.
* @see org.eclipse.papyrus.emf.facet.custom.metamodel.custompt.IColor
* @model instanceClass="org.eclipse.papyrus.emf.facet.custom.metamodel.custompt.IColor"
@@ -161,10 +158,20 @@ public interface CustomptPackage extends EPackage {
EDataType getColor();
/**
+ * Returns the meta object for data type '{@link org.eclipse.jface.viewers.StyledString <em>Styled Label</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for data type '<em>Styled Label</em>'.
+ * @see org.eclipse.jface.viewers.StyledString
+ * @model instanceClass="org.eclipse.jface.viewers.StyledString"
+ * @generated
+ */
+ EDataType getStyledLabel();
+
+ /**
* Returns the factory that creates the instances of the model.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
- *
* @return the factory that creates the instances of the model.
* @generated
*/
@@ -180,7 +187,6 @@ public interface CustomptPackage extends EPackage {
* <li>and each data type</li>
* </ul>
* <!-- end-user-doc -->
- *
* @generated
*/
interface Literals {
@@ -188,7 +194,6 @@ public interface CustomptPackage extends EPackage {
* The meta object literal for the '{@link org.eclipse.papyrus.emf.facet.custom.metamodel.v0_2_0.custompt.Shadow <em>Shadow</em>}' enum.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
- *
* @see org.eclipse.papyrus.emf.facet.custom.metamodel.v0_2_0.custompt.Shadow
* @see org.eclipse.papyrus.emf.facet.custom.metamodel.v0_2_0.custompt.impl.CustomptPackageImpl#getShadow()
* @generated
@@ -199,7 +204,6 @@ public interface CustomptPackage extends EPackage {
* The meta object literal for the '{@link org.eclipse.papyrus.emf.facet.custom.metamodel.v0_2_0.custompt.Alignment <em>Alignment</em>}' enum.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
- *
* @see org.eclipse.papyrus.emf.facet.custom.metamodel.v0_2_0.custompt.Alignment
* @see org.eclipse.papyrus.emf.facet.custom.metamodel.v0_2_0.custompt.impl.CustomptPackageImpl#getAlignment()
* @generated
@@ -210,7 +214,6 @@ public interface CustomptPackage extends EPackage {
* The meta object literal for the '<em>Image</em>' data type.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
- *
* @see org.eclipse.papyrus.emf.facet.custom.metamodel.custompt.IImage
* @see org.eclipse.papyrus.emf.facet.custom.metamodel.v0_2_0.custompt.impl.CustomptPackageImpl#getImage()
* @generated
@@ -221,13 +224,22 @@ public interface CustomptPackage extends EPackage {
* The meta object literal for the '<em>Color</em>' data type.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
- *
* @see org.eclipse.papyrus.emf.facet.custom.metamodel.custompt.IColor
* @see org.eclipse.papyrus.emf.facet.custom.metamodel.v0_2_0.custompt.impl.CustomptPackageImpl#getColor()
* @generated
*/
EDataType COLOR = eINSTANCE.getColor();
+ /**
+ * The meta object literal for the '<em>Styled Label</em>' data type.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see org.eclipse.jface.viewers.StyledString
+ * @see org.eclipse.papyrus.emf.facet.custom.metamodel.v0_2_0.custompt.impl.CustomptPackageImpl#getStyledLabel()
+ * @generated
+ */
+ EDataType STYLED_LABEL = eINSTANCE.getStyledLabel();
+
}
} // CustomptPackage
diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.custom.metamodel/src/org/eclipse/papyrus/emf/facet/custom/metamodel/v0_2_0/custompt/Shadow.java b/plugins/facet/org.eclipse.papyrus.emf.facet.custom.metamodel/src/org/eclipse/papyrus/emf/facet/custom/metamodel/v0_2_0/custompt/Shadow.java
index 7aec54783e6..35b1d6ae4ba 100644
--- a/plugins/facet/org.eclipse.papyrus.emf.facet.custom.metamodel/src/org/eclipse/papyrus/emf/facet/custom/metamodel/v0_2_0/custompt/Shadow.java
+++ b/plugins/facet/org.eclipse.papyrus.emf.facet.custom.metamodel/src/org/eclipse/papyrus/emf/facet/custom/metamodel/v0_2_0/custompt/Shadow.java
@@ -24,7 +24,6 @@ import org.eclipse.emf.common.util.Enumerator;
* A representation of the literals of the enumeration '<em><b>Shadow</b></em>',
* and utility methods for working with them.
* <!-- end-user-doc -->
- *
* @see org.eclipse.papyrus.emf.facet.custom.metamodel.v0_2_0.custompt.CustomptPackage#getShadow()
* @model
* @generated
@@ -34,7 +33,6 @@ public enum Shadow implements Enumerator {
* The '<em><b>NONE</b></em>' literal object.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
- *
* @see #NONE_VALUE
* @generated
* @ordered
@@ -45,7 +43,6 @@ public enum Shadow implements Enumerator {
* The '<em><b>IN</b></em>' literal object.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
- *
* @see #IN_VALUE
* @generated
* @ordered
@@ -56,7 +53,6 @@ public enum Shadow implements Enumerator {
* The '<em><b>OUT</b></em>' literal object.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
- *
* @see #OUT_VALUE
* @generated
* @ordered
@@ -70,7 +66,6 @@ public enum Shadow implements Enumerator {
* If the meaning of '<em><b>NONE</b></em>' literal object isn't clear, there really should be more of a description here...
* </p>
* <!-- end-user-doc -->
- *
* @see #NONE
* @model
* @generated
@@ -85,7 +80,6 @@ public enum Shadow implements Enumerator {
* If the meaning of '<em><b>IN</b></em>' literal object isn't clear, there really should be more of a description here...
* </p>
* <!-- end-user-doc -->
- *
* @see #IN
* @model
* @generated
@@ -100,7 +94,6 @@ public enum Shadow implements Enumerator {
* If the meaning of '<em><b>OUT</b></em>' literal object isn't clear, there really should be more of a description here...
* </p>
* <!-- end-user-doc -->
- *
* @see #OUT
* @model
* @generated
@@ -112,21 +105,19 @@ public enum Shadow implements Enumerator {
* An array of all the '<em><b>Shadow</b></em>' enumerators.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
- *
* @generated
*/
private static final Shadow[] VALUES_ARRAY =
new Shadow[] {
- NONE,
- IN,
- OUT,
- };
+ NONE,
+ IN,
+ OUT,
+ };
/**
* A public read-only list of all the '<em><b>Shadow</b></em>' enumerators.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
- *
* @generated
*/
public static final List<Shadow> VALUES = Collections.unmodifiableList(Arrays.asList(VALUES_ARRAY));
@@ -135,7 +126,8 @@ public enum Shadow implements Enumerator {
* Returns the '<em><b>Shadow</b></em>' literal with the specified literal value.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
- *
+ * @param literal the literal.
+ * @return the matching enumerator or <code>null</code>.
* @generated
*/
public static Shadow get(String literal) {
@@ -152,7 +144,8 @@ public enum Shadow implements Enumerator {
* Returns the '<em><b>Shadow</b></em>' literal with the specified name.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
- *
+ * @param name the name.
+ * @return the matching enumerator or <code>null</code>.
* @generated
*/
public static Shadow getByName(String name) {
@@ -169,17 +162,15 @@ public enum Shadow implements Enumerator {
* Returns the '<em><b>Shadow</b></em>' literal with the specified integer value.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
- *
+ * @param value the integer value.
+ * @return the matching enumerator or <code>null</code>.
* @generated
*/
public static Shadow get(int value) {
switch (value) {
- case NONE_VALUE:
- return NONE;
- case IN_VALUE:
- return IN;
- case OUT_VALUE:
- return OUT;
+ case NONE_VALUE: return NONE;
+ case IN_VALUE: return IN;
+ case OUT_VALUE: return OUT;
}
return null;
}
@@ -187,7 +178,6 @@ public enum Shadow implements Enumerator {
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
- *
* @generated
*/
private final int value;
@@ -195,7 +185,6 @@ public enum Shadow implements Enumerator {
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
- *
* @generated
*/
private final String name;
@@ -203,7 +192,6 @@ public enum Shadow implements Enumerator {
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
- *
* @generated
*/
private final String literal;
@@ -212,7 +200,6 @@ public enum Shadow implements Enumerator {
* Only this class can construct instances.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
- *
* @generated
*/
private Shadow(int value, String name, String literal) {
@@ -224,38 +211,34 @@ public enum Shadow implements Enumerator {
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
- *
* @generated
*/
public int getValue() {
- return value;
+ return value;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
- *
* @generated
*/
public String getName() {
- return name;
+ return name;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
- *
* @generated
*/
public String getLiteral() {
- return literal;
+ return literal;
}
/**
* Returns the literal value of the enumerator, which is its string representation.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
- *
* @generated
*/
@Override
diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.custom.metamodel/src/org/eclipse/papyrus/emf/facet/custom/metamodel/v0_2_0/custompt/impl/CustomptFactoryImpl.java b/plugins/facet/org.eclipse.papyrus.emf.facet.custom.metamodel/src/org/eclipse/papyrus/emf/facet/custom/metamodel/v0_2_0/custompt/impl/CustomptFactoryImpl.java
index 550a0a25e0e..15693273348 100644
--- a/plugins/facet/org.eclipse.papyrus.emf.facet.custom.metamodel/src/org/eclipse/papyrus/emf/facet/custom/metamodel/v0_2_0/custompt/impl/CustomptFactoryImpl.java
+++ b/plugins/facet/org.eclipse.papyrus.emf.facet.custom.metamodel/src/org/eclipse/papyrus/emf/facet/custom/metamodel/v0_2_0/custompt/impl/CustomptFactoryImpl.java
@@ -19,8 +19,10 @@ import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.EPackage;
import org.eclipse.emf.ecore.impl.EFactoryImpl;
import org.eclipse.emf.ecore.plugin.EcorePlugin;
+import org.eclipse.emf.edit.provider.StyledString;
import org.eclipse.papyrus.emf.facet.custom.metamodel.custompt.IColor;
import org.eclipse.papyrus.emf.facet.custom.metamodel.custompt.IImage;
+import org.eclipse.papyrus.emf.facet.custom.metamodel.v0_2_0.custompt.*;
import org.eclipse.papyrus.emf.facet.custom.metamodel.v0_2_0.custompt.Alignment;
import org.eclipse.papyrus.emf.facet.custom.metamodel.v0_2_0.custompt.CustomptFactory;
import org.eclipse.papyrus.emf.facet.custom.metamodel.v0_2_0.custompt.CustomptPackage;
@@ -30,7 +32,6 @@ import org.eclipse.papyrus.emf.facet.custom.metamodel.v0_2_0.custompt.Shadow;
* <!-- begin-user-doc -->
* An implementation of the model <b>Factory</b>.
* <!-- end-user-doc -->
- *
* @generated
*/
public class CustomptFactoryImpl extends EFactoryImpl implements CustomptFactory {
@@ -38,16 +39,16 @@ public class CustomptFactoryImpl extends EFactoryImpl implements CustomptFactory
* Creates the default factory implementation.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
- *
* @generated
*/
public static CustomptFactory init() {
try {
- CustomptFactory theCustomptFactory = (CustomptFactory) EPackage.Registry.INSTANCE.getEFactory("http://www.eclipse.org/papyrus/emf/facet/custom/0.2.incubation/custom_primitive_types");
+ CustomptFactory theCustomptFactory = (CustomptFactory)EPackage.Registry.INSTANCE.getEFactory(CustomptPackage.eNS_URI);
if (theCustomptFactory != null) {
return theCustomptFactory;
}
- } catch (Exception exception) {
+ }
+ catch (Exception exception) {
EcorePlugin.INSTANCE.log(exception);
}
return new CustomptFactoryImpl();
@@ -57,7 +58,6 @@ public class CustomptFactoryImpl extends EFactoryImpl implements CustomptFactory
* Creates an instance of the factory.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
- *
* @generated
*/
public CustomptFactoryImpl() {
@@ -67,79 +67,76 @@ public class CustomptFactoryImpl extends EFactoryImpl implements CustomptFactory
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
- *
* @generated
*/
@Override
public EObject create(EClass eClass) {
switch (eClass.getClassifierID()) {
- default:
- throw new IllegalArgumentException("The class '" + eClass.getName() + "' is not a valid classifier");
+ default:
+ throw new IllegalArgumentException("The class '" + eClass.getName() + "' is not a valid classifier");
}
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
- *
* @generated
*/
@Override
public Object createFromString(EDataType eDataType, String initialValue) {
switch (eDataType.getClassifierID()) {
- case CustomptPackage.SHADOW:
- return createShadowFromString(eDataType, initialValue);
- case CustomptPackage.ALIGNMENT:
- return createAlignmentFromString(eDataType, initialValue);
- case CustomptPackage.IMAGE:
- return createImageFromString(eDataType, initialValue);
- case CustomptPackage.COLOR:
- return createColorFromString(eDataType, initialValue);
- default:
- throw new IllegalArgumentException("The datatype '" + eDataType.getName() + "' is not a valid classifier");
+ case CustomptPackage.SHADOW:
+ return createShadowFromString(eDataType, initialValue);
+ case CustomptPackage.ALIGNMENT:
+ return createAlignmentFromString(eDataType, initialValue);
+ case CustomptPackage.IMAGE:
+ return createImageFromString(eDataType, initialValue);
+ case CustomptPackage.COLOR:
+ return createColorFromString(eDataType, initialValue);
+ case CustomptPackage.STYLED_LABEL:
+ return createStyledLabelFromString(eDataType, initialValue);
+ default:
+ throw new IllegalArgumentException("The datatype '" + eDataType.getName() + "' is not a valid classifier");
}
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
- *
* @generated
*/
@Override
public String convertToString(EDataType eDataType, Object instanceValue) {
switch (eDataType.getClassifierID()) {
- case CustomptPackage.SHADOW:
- return convertShadowToString(eDataType, instanceValue);
- case CustomptPackage.ALIGNMENT:
- return convertAlignmentToString(eDataType, instanceValue);
- case CustomptPackage.IMAGE:
- return convertImageToString(eDataType, instanceValue);
- case CustomptPackage.COLOR:
- return convertColorToString(eDataType, instanceValue);
- default:
- throw new IllegalArgumentException("The datatype '" + eDataType.getName() + "' is not a valid classifier");
+ case CustomptPackage.SHADOW:
+ return convertShadowToString(eDataType, instanceValue);
+ case CustomptPackage.ALIGNMENT:
+ return convertAlignmentToString(eDataType, instanceValue);
+ case CustomptPackage.IMAGE:
+ return convertImageToString(eDataType, instanceValue);
+ case CustomptPackage.COLOR:
+ return convertColorToString(eDataType, instanceValue);
+ case CustomptPackage.STYLED_LABEL:
+ return convertStyledLabelToString(eDataType, instanceValue);
+ default:
+ throw new IllegalArgumentException("The datatype '" + eDataType.getName() + "' is not a valid classifier");
}
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
- *
* @generated
*/
public Shadow createShadowFromString(EDataType eDataType, String initialValue) {
Shadow result = Shadow.get(initialValue);
- if (result == null) {
- throw new IllegalArgumentException("The value '" + initialValue + "' is not a valid enumerator of '" + eDataType.getName() + "'");
- }
+ if (result == null) throw new IllegalArgumentException("The value '" + initialValue + "' is not a valid enumerator of '" + eDataType.getName() + "'");
return result;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
- *
* @generated
*/
public String convertShadowToString(EDataType eDataType, Object instanceValue) {
@@ -149,21 +146,17 @@ public class CustomptFactoryImpl extends EFactoryImpl implements CustomptFactory
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
- *
* @generated
*/
public Alignment createAlignmentFromString(EDataType eDataType, String initialValue) {
Alignment result = Alignment.get(initialValue);
- if (result == null) {
- throw new IllegalArgumentException("The value '" + initialValue + "' is not a valid enumerator of '" + eDataType.getName() + "'");
- }
+ if (result == null) throw new IllegalArgumentException("The value '" + initialValue + "' is not a valid enumerator of '" + eDataType.getName() + "'");
return result;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
- *
* @generated
*/
public String convertAlignmentToString(EDataType eDataType, Object instanceValue) {
@@ -173,17 +166,15 @@ public class CustomptFactoryImpl extends EFactoryImpl implements CustomptFactory
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
- *
* @generated
*/
public IImage createImageFromString(EDataType eDataType, String initialValue) {
- return (IImage) super.createFromString(eDataType, initialValue);
+ return (IImage)super.createFromString(eDataType, initialValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
- *
* @generated
*/
public String convertImageToString(EDataType eDataType, Object instanceValue) {
@@ -193,17 +184,15 @@ public class CustomptFactoryImpl extends EFactoryImpl implements CustomptFactory
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
- *
* @generated
*/
public IColor createColorFromString(EDataType eDataType, String initialValue) {
- return (IColor) super.createFromString(eDataType, initialValue);
+ return (IColor)super.createFromString(eDataType, initialValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
- *
* @generated
*/
public String convertColorToString(EDataType eDataType, Object instanceValue) {
@@ -213,17 +202,33 @@ public class CustomptFactoryImpl extends EFactoryImpl implements CustomptFactory
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
- *
+ * @generated
+ */
+ public org.eclipse.jface.viewers.StyledString createStyledLabelFromString(EDataType eDataType, String initialValue) {
+ return (org.eclipse.jface.viewers.StyledString)super.createFromString(eDataType, initialValue);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public String convertStyledLabelToString(EDataType eDataType, Object instanceValue) {
+ return super.convertToString(eDataType, instanceValue);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
* @generated
*/
public CustomptPackage getCustomptPackage() {
- return (CustomptPackage) getEPackage();
+ return (CustomptPackage)getEPackage();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
- *
* @deprecated
* @generated
*/
diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.custom.metamodel/src/org/eclipse/papyrus/emf/facet/custom/metamodel/v0_2_0/custompt/impl/CustomptPackageImpl.java b/plugins/facet/org.eclipse.papyrus.emf.facet.custom.metamodel/src/org/eclipse/papyrus/emf/facet/custom/metamodel/v0_2_0/custompt/impl/CustomptPackageImpl.java
index 907647fd4dc..00e2865743a 100644
--- a/plugins/facet/org.eclipse.papyrus.emf.facet.custom.metamodel/src/org/eclipse/papyrus/emf/facet/custom/metamodel/v0_2_0/custompt/impl/CustomptPackageImpl.java
+++ b/plugins/facet/org.eclipse.papyrus.emf.facet.custom.metamodel/src/org/eclipse/papyrus/emf/facet/custom/metamodel/v0_2_0/custompt/impl/CustomptPackageImpl.java
@@ -17,6 +17,7 @@ import org.eclipse.emf.ecore.EDataType;
import org.eclipse.emf.ecore.EEnum;
import org.eclipse.emf.ecore.EPackage;
import org.eclipse.emf.ecore.impl.EPackageImpl;
+import org.eclipse.emf.edit.provider.StyledString;
import org.eclipse.papyrus.emf.facet.custom.metamodel.custompt.IColor;
import org.eclipse.papyrus.emf.facet.custom.metamodel.custompt.IImage;
import org.eclipse.papyrus.emf.facet.custom.metamodel.v0_2_0.custompt.Alignment;
@@ -28,14 +29,12 @@ import org.eclipse.papyrus.emf.facet.custom.metamodel.v0_2_0.custompt.Shadow;
* <!-- begin-user-doc -->
* An implementation of the model <b>Package</b>.
* <!-- end-user-doc -->
- *
* @generated
*/
public class CustomptPackageImpl extends EPackageImpl implements CustomptPackage {
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
- *
* @generated
*/
private EEnum shadowEEnum = null;
@@ -43,7 +42,6 @@ public class CustomptPackageImpl extends EPackageImpl implements CustomptPackage
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
- *
* @generated
*/
private EEnum alignmentEEnum = null;
@@ -51,7 +49,6 @@ public class CustomptPackageImpl extends EPackageImpl implements CustomptPackage
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
- *
* @generated
*/
private EDataType imageEDataType = null;
@@ -59,17 +56,26 @@ public class CustomptPackageImpl extends EPackageImpl implements CustomptPackage
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
- *
* @generated
*/
private EDataType colorEDataType = null;
/**
- * Creates an instance of the model <b>Package</b>, registered with {@link org.eclipse.emf.ecore.EPackage.Registry EPackage.Registry} by the package
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ private EDataType styledLabelEDataType = null;
+
+ /**
+ * Creates an instance of the model <b>Package</b>, registered with
+ * {@link org.eclipse.emf.ecore.EPackage.Registry EPackage.Registry} by the package
* package URI value.
- * <p>
- * Note: the correct way to create the package is via the static factory method {@link #init init()}, which also performs initialization of the package, or returns the registered package, if one already exists. <!-- begin-user-doc --> <!-- end-user-doc -->
- *
+ * <p>Note: the correct way to create the package is via the static
+ * factory method {@link #init init()}, which also performs
+ * initialization of the package, or returns the registered package,
+ * if one already exists.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
* @see org.eclipse.emf.ecore.EPackage.Registry
* @see org.eclipse.papyrus.emf.facet.custom.metamodel.v0_2_0.custompt.CustomptPackage#eNS_URI
* @see #init()
@@ -82,29 +88,26 @@ public class CustomptPackageImpl extends EPackageImpl implements CustomptPackage
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
- *
* @generated
*/
private static boolean isInited = false;
/**
* Creates, registers, and initializes the <b>Package</b> for this model, and for any others upon which it depends.
- *
- * <p>
- * This method is used to initialize {@link CustomptPackage#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 -->
- *
+ *
+ * <p>This method is used to initialize {@link CustomptPackage#eINSTANCE} when that field is accessed.
+ * Clients should not invoke it directly. Instead, they should simply access that field to obtain the package.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
* @see #eNS_URI
* @see #createPackageContents()
* @see #initializePackageContents()
* @generated
*/
public static CustomptPackage init() {
- if (isInited) {
- return (CustomptPackage) EPackage.Registry.INSTANCE.getEPackage(CustomptPackage.eNS_URI);
- }
+ if (isInited) return (CustomptPackage)EPackage.Registry.INSTANCE.getEPackage(CustomptPackage.eNS_URI);
// Obtain or create and register package
- CustomptPackageImpl theCustomptPackage = (CustomptPackageImpl) (EPackage.Registry.INSTANCE.get(eNS_URI) instanceof CustomptPackageImpl ? EPackage.Registry.INSTANCE.get(eNS_URI) : new CustomptPackageImpl());
+ CustomptPackageImpl theCustomptPackage = (CustomptPackageImpl)(EPackage.Registry.INSTANCE.get(eNS_URI) instanceof CustomptPackageImpl ? EPackage.Registry.INSTANCE.get(eNS_URI) : new CustomptPackageImpl());
isInited = true;
@@ -117,7 +120,7 @@ public class CustomptPackageImpl extends EPackageImpl implements CustomptPackage
// Mark meta-data to indicate it can't be changed
theCustomptPackage.freeze();
-
+
// Update the registry and return the package
EPackage.Registry.INSTANCE.put(CustomptPackage.eNS_URI, theCustomptPackage);
return theCustomptPackage;
@@ -126,7 +129,6 @@ public class CustomptPackageImpl extends EPackageImpl implements CustomptPackage
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
- *
* @generated
*/
public EEnum getShadow() {
@@ -136,7 +138,6 @@ public class CustomptPackageImpl extends EPackageImpl implements CustomptPackage
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
- *
* @generated
*/
public EEnum getAlignment() {
@@ -146,7 +147,6 @@ public class CustomptPackageImpl extends EPackageImpl implements CustomptPackage
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
- *
* @generated
*/
public EDataType getImage() {
@@ -156,7 +156,6 @@ public class CustomptPackageImpl extends EPackageImpl implements CustomptPackage
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
- *
* @generated
*/
public EDataType getColor() {
@@ -166,33 +165,37 @@ public class CustomptPackageImpl extends EPackageImpl implements CustomptPackage
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
- *
+ * @generated
+ */
+ public EDataType getStyledLabel() {
+ return styledLabelEDataType;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
* @generated
*/
public CustomptFactory getCustomptFactory() {
- return (CustomptFactory) getEFactoryInstance();
+ return (CustomptFactory)getEFactoryInstance();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
- *
* @generated
*/
private boolean isCreated = false;
/**
- * Creates the meta-model objects for the package. This method is
+ * Creates the meta-model objects for the package. This method is
* guarded to have no affect on any invocation but its first.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
- *
* @generated
*/
public void createPackageContents() {
- if (isCreated) {
- return;
- }
+ if (isCreated) return;
isCreated = true;
// Create enums
@@ -202,28 +205,25 @@ public class CustomptPackageImpl extends EPackageImpl implements CustomptPackage
// Create data types
imageEDataType = createEDataType(IMAGE);
colorEDataType = createEDataType(COLOR);
+ styledLabelEDataType = createEDataType(STYLED_LABEL);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
- *
* @generated
*/
private boolean isInitialized = false;
/**
- * Complete the initialization of the package and its meta-model. This
+ * Complete the initialization of the package and its meta-model. This
* method is guarded to have no affect on any invocation but its first.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
- *
* @generated
*/
public void initializePackageContents() {
- if (isInitialized) {
- return;
- }
+ if (isInitialized) return;
isInitialized = true;
// Initialize package
@@ -245,6 +245,7 @@ public class CustomptPackageImpl extends EPackageImpl implements CustomptPackage
// Initialize data types
initEDataType(imageEDataType, IImage.class, "Image", IS_SERIALIZABLE, !IS_GENERATED_INSTANCE_CLASS);
initEDataType(colorEDataType, IColor.class, "Color", IS_SERIALIZABLE, !IS_GENERATED_INSTANCE_CLASS);
+ initEDataType(styledLabelEDataType, org.eclipse.jface.viewers.StyledString.class, "StyledLabel", IS_SERIALIZABLE, !IS_GENERATED_INSTANCE_CLASS);
// Create resource
createResource(eNS_URI);
diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.custom.ui/src/org/eclipse/papyrus/emf/facet/custom/ui/ICustomizedLabelProvider.java b/plugins/facet/org.eclipse.papyrus.emf.facet.custom.ui/src/org/eclipse/papyrus/emf/facet/custom/ui/ICustomizedLabelProvider.java
index dc309d9c2f8..e2ce6216ce7 100644
--- a/plugins/facet/org.eclipse.papyrus.emf.facet.custom.ui/src/org/eclipse/papyrus/emf/facet/custom/ui/ICustomizedLabelProvider.java
+++ b/plugins/facet/org.eclipse.papyrus.emf.facet.custom.ui/src/org/eclipse/papyrus/emf/facet/custom/ui/ICustomizedLabelProvider.java
@@ -11,13 +11,16 @@
* Gregoire Dupe (Mia-Software) - Bug 369987 - [Restructuring][Table] Switch to the new customization and facet framework
* Vincent Lorenzo (CEA-LIST) - Bug 372644 - Create Customizable tooltips for the TreeViewer using a CustomizableLabelProvider
* Gregoire Dupe (Mia-Software) - Bug 373078 - API Cleaning
+ * Mickael ADAM (ALL4TEC) - mickael.adam@all4tec.net - Bug 500219 - implementation of IStyledLabelProvider
*/
package org.eclipse.papyrus.emf.facet.custom.ui;
import org.eclipse.emf.ecore.ETypedElement;
+import org.eclipse.jface.viewers.DelegatingStyledCellLabelProvider.IStyledLabelProvider;
import org.eclipse.jface.viewers.IColorProvider;
import org.eclipse.jface.viewers.IFontProvider;
import org.eclipse.jface.viewers.ILabelProvider;
+import org.eclipse.jface.viewers.StyledString;
import org.eclipse.papyrus.emf.facet.custom.core.ICustomizationManager;
import org.eclipse.swt.graphics.Image;
@@ -30,7 +33,7 @@ import org.eclipse.swt.graphics.Image;
* @noimplement This interface is not intended to be implemented by clients.
*/
public interface ICustomizedLabelProvider extends ILabelProvider,
- IColorProvider, IFontProvider, ICustomizedToolTipLabelProvider {
+ IColorProvider, IFontProvider, ICustomizedToolTipLabelProvider, IStyledLabelProvider {
/**
* This method returns the customization manager used by the label provider. The
* customization stack updates have to be done using this {@link ICustomizationManager}.
@@ -64,4 +67,25 @@ public interface ICustomizedLabelProvider extends ILabelProvider,
*/
ICustomizedLabelProvider cloneLabelProvider();
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.jface.viewers.DelegatingStyledCellLabelProvider.IStyledLabelProvider#getStyledText(java.lang.Object)
+ *
+ * @since 1.3
+ */
+ @Override
+ default StyledString getStyledText(final Object element) {
+ return new StyledString(getText(element));
+ }
+
+ /**
+ * Returns the styled text label for the given element.
+ *
+ * @since 1.3
+ */
+ default StyledString getStyledText(final Object element, final ETypedElement eTypedElement) {
+ return new StyledString(getText(element, eTypedElement));
+ }
+
}
diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.custom.ui/src/org/eclipse/papyrus/emf/facet/custom/ui/internal/CustomizedLabelProvider.java b/plugins/facet/org.eclipse.papyrus.emf.facet.custom.ui/src/org/eclipse/papyrus/emf/facet/custom/ui/internal/CustomizedLabelProvider.java
index dbd3499764f..aa319689a6c 100644
--- a/plugins/facet/org.eclipse.papyrus.emf.facet.custom.ui/src/org/eclipse/papyrus/emf/facet/custom/ui/internal/CustomizedLabelProvider.java
+++ b/plugins/facet/org.eclipse.papyrus.emf.facet.custom.ui/src/org/eclipse/papyrus/emf/facet/custom/ui/internal/CustomizedLabelProvider.java
@@ -16,13 +16,14 @@
* Gregoire Dupe (Mia-Software) - Bug 374941 - To be able to customize overlay icons on EClass
* Gregoire Dupe (Mia-Software) - Bug 364325 - [Restructuring] The user must be able to navigate into a model using the Facet.
* Vincent Lorenzo (CEA-LIST) - Bug 352603 - [Table] A tooltip which displays the full label of a String cell editor
- * Grégoire Dupé(Mia-Software) - Bug 352603 - [Table] A tooltip which displays the full label of a String cell editor
+ * Gr�goire Dup�(Mia-Software) - Bug 352603 - [Table] A tooltip which displays the full label of a String cell editor
* David Couvrand (Soft-Maint) - Bug 402725 - Need a query to get an image from an URI
* Nicolas Rault (Soft-Maint) - Bug 402725 - Need a query to get an image from an URI
* David Couvrand (Soft-Maint) - Bug 418418 - [Customization] Overlay icons not implemented
* David Couvrand (Soft-Maint) - Bug 422058 - Implementation of strikethrough and underline in the CustomizedLabelProvider
- * Grégoire Dupé (Mia-Software) - Bug 424122 - [Table] Images, fonts and colors are not shared between the instances of table
+ * Gr�goire Dup� (Mia-Software) - Bug 424122 - [Table] Images, fonts and colors are not shared between the instances of table
* Thomas Cicognani (Soft-Maint) - Bug 424414 - ImageManager doesn't cache images
+ * Mickael ADAM (ALL4TEC) - mickael.adam@all4tec.net - Bug 500219 - implementation of IStyledLabelProvider
*/
package org.eclipse.papyrus.emf.facet.custom.ui.internal;
@@ -105,8 +106,8 @@ public class CustomizedLabelProvider extends CellLabelProvider implements
public String getText(final Object element) {
String result;
if (element instanceof EObject) {
- result = getPropertyValue(element,
- this.propertiesHandler.getLabelProperty(), null, String.class);
+ result = getPropertyValue(element, this.propertiesHandler.getLabelProperty(), null, String.class);
+
} else if (element == null) {
result = Messages.CustomizedLabelProvider_null;
} else if (element instanceof List<?>) {
@@ -139,6 +140,27 @@ public class CustomizedLabelProvider extends CellLabelProvider implements
return result;
}
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.papyrus.emf.facet.custom.ui.ICustomizedLabelProvider#getStyledText(java.lang.Object)
+ */
+ @Override
+ public StyledString getStyledText(final Object element) {
+ Object result = null;
+ if (element instanceof EObject) {
+ result = getPropertyValue(element,
+ this.propertiesHandler.getLabelProperty(), null, StyledString.class);
+ if (result instanceof String) {
+ result = new StyledString((String) result);
+ }
+ } else {
+ result = new StyledString(getText(element));
+ }
+
+ return (StyledString) result;
+ }
+
private static ICustomOverride getICustomOverride() {
final Bundle bundle = Activator.getDefault().getBundle();
final BundleContext bundleContext = bundle.getBundleContext();
@@ -150,17 +172,22 @@ public class CustomizedLabelProvider extends CellLabelProvider implements
}
public String getText(final Object object, final ETypedElement eTypedElement) {
- String result;
+ String result = null;
if (object == null) {
result = Messages.CustomizedLabelProvider_null;
} else {
if (object instanceof EObject) {
final EObject eObject = (EObject) object;
try {
- result = this.customManager.getCustomValueOf(eObject,
+ Object objectResult = this.customManager.getCustomValueOf(eObject,
eTypedElement,
this.propertiesHandler.getLabelProperty(),
- String.class);
+ Object.class);
+ if (objectResult instanceof StyledString) {
+ result = objectResult.toString();
+ } else if (objectResult instanceof String) {
+ result = (String) objectResult;
+ }
} catch (CustomizationException e) {
Logger.logError(e, Activator.getDefault());
result = "!!! Error, cf log !!!";
@@ -171,27 +198,36 @@ public class CustomizedLabelProvider extends CellLabelProvider implements
}
return result;
+ }
- // TODO Remove before to commit
- // if (structuralFeature.getUpperBound() == 1) {
- // final Object object = this.customManager.getFacetManager().get(eObject,
- // structuralFeature, Object.class);
- // result = getText(object);
- // } else {
- // final StringBuffer stringBuffer = new StringBuffer();
- // final List<Object> objects = this.customManager.getFacetManager()
- // .getMultiValued(eObject, structuralFeature, Object.class);
- // final Iterator<Object> objectsIter = objects.iterator();
- // while (objectsIter.hasNext()) {
- // final Object object = objectsIter.next();
- // stringBuffer.append(this.getText(object));
- // if (objectsIter.hasNext()) {
- // stringBuffer.append(", ");
- // }
- // }
- // result = stringBuffer.toString();
- // }
- // TODO (end)
+ @Override
+ public StyledString getStyledText(final Object object, final ETypedElement eTypedElement) {
+ StyledString result = null;
+ if (object == null) {
+ result = new StyledString(Messages.CustomizedLabelProvider_null);
+ } else {
+ if (object instanceof EObject) {
+ final EObject eObject = (EObject) object;
+ try {
+ Object objectResult = this.customManager.getCustomValueOf(eObject,
+ eTypedElement,
+ this.propertiesHandler.getLabelProperty(),
+ Object.class);
+ if (objectResult instanceof StyledString) {
+ result = (StyledString) objectResult;
+ } else if (objectResult instanceof String) {
+ result = new StyledString((String) objectResult);
+ }
+ } catch (CustomizationException e) {
+ Logger.logError(e, Activator.getDefault());
+ result = new StyledString("!!! Error, cf log !!!");
+ }
+ } else {
+ result = new StyledString(object.toString());
+ }
+
+ }
+ return result;
}
@Override
@@ -587,8 +623,4 @@ public class CustomizedLabelProvider extends CellLabelProvider implements
return new CustomizedLabelProvider(this.customManager);
}
- public StyledString getStyledText(final Object element) {
- return new StyledString(getText(element));
- }
-
}
diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.custom.ui/src/org/eclipse/papyrus/emf/facet/custom/ui/internal/DecoratingCustomizedLabelProvider.java b/plugins/facet/org.eclipse.papyrus.emf.facet.custom.ui/src/org/eclipse/papyrus/emf/facet/custom/ui/internal/DecoratingCustomizedLabelProvider.java
index c339a77c462..b16b59b9798 100644
--- a/plugins/facet/org.eclipse.papyrus.emf.facet.custom.ui/src/org/eclipse/papyrus/emf/facet/custom/ui/internal/DecoratingCustomizedLabelProvider.java
+++ b/plugins/facet/org.eclipse.papyrus.emf.facet.custom.ui/src/org/eclipse/papyrus/emf/facet/custom/ui/internal/DecoratingCustomizedLabelProvider.java
@@ -7,6 +7,7 @@
*
* Contributors:
* David Couvrand (Soft-Maint) - Bug 418418 - [Customization] Overlay icons not implemented
+ * Mickael ADAM (ALL4TEC) - mickael.adam@all4tec.net - Bug 500219 - implementation of getStyledText
*******************************************************************************/
package org.eclipse.papyrus.emf.facet.custom.ui.internal;
@@ -14,6 +15,7 @@ import org.eclipse.emf.ecore.ETypedElement;
import org.eclipse.jface.viewers.DecoratingStyledCellLabelProvider;
import org.eclipse.jface.viewers.IDecorationContext;
import org.eclipse.jface.viewers.ILabelDecorator;
+import org.eclipse.jface.viewers.StyledString;
import org.eclipse.papyrus.emf.facet.custom.core.ICustomizationManager;
import org.eclipse.papyrus.emf.facet.custom.ui.ICustomizedLabelProvider;
import org.eclipse.swt.graphics.Color;
@@ -32,6 +34,26 @@ public class DecoratingCustomizedLabelProvider extends
super(labelProvider, decorator, decorationContext);
}
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.jface.viewers.DecoratingStyledCellLabelProvider#getStyledText(java.lang.Object)
+ */
+ @Override
+ public StyledString getStyledText(final Object element) {
+ return this.lblProvider.getStyledText(element);
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.papyrus.emf.facet.custom.ui.ICustomizedLabelProvider#getStyledText(java.lang.Object, org.eclipse.emf.ecore.ETypedElement)
+ */
+ @Override
+ public StyledString getStyledText(final Object element, final ETypedElement eTypedElement) {
+ return this.lblProvider.getStyledText(element, eTypedElement);
+ }
+
public DecoratingCustomizedLabelProvider(
final ICustomizationManager customizationMgr) {
this(new CustomizedLabelProvider(customizationMgr),
diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.custom.ui/src/org/eclipse/papyrus/emf/facet/custom/ui/internal/ResolvingCustomizedLabelProvider.java b/plugins/facet/org.eclipse.papyrus.emf.facet.custom.ui/src/org/eclipse/papyrus/emf/facet/custom/ui/internal/ResolvingCustomizedLabelProvider.java
index a4ad09bdbd9..759b7670c68 100644
--- a/plugins/facet/org.eclipse.papyrus.emf.facet.custom.ui/src/org/eclipse/papyrus/emf/facet/custom/ui/internal/ResolvingCustomizedLabelProvider.java
+++ b/plugins/facet/org.eclipse.papyrus.emf.facet.custom.ui/src/org/eclipse/papyrus/emf/facet/custom/ui/internal/ResolvingCustomizedLabelProvider.java
@@ -7,11 +7,14 @@
*
* Contributors:
* Nicolas Bros (Mia-Software) - Bug 379683 - customizable Tree content provider
+ * Mickael ADAM (ALL4TEC) - mickael.adam@all4tec.net - Bug 500219 - implementation of getStyledText
+ *
*******************************************************************************/
package org.eclipse.papyrus.emf.facet.custom.ui.internal;
import org.eclipse.emf.ecore.ETypedElement;
import org.eclipse.jface.viewers.ILabelProviderListener;
+import org.eclipse.jface.viewers.StyledString;
import org.eclipse.jface.viewers.ViewerCell;
import org.eclipse.papyrus.emf.facet.custom.core.ICustomizationManager;
import org.eclipse.papyrus.emf.facet.custom.metamodel.v0_2_0.internal.treeproxy.EAttributeTreeElement;
@@ -66,6 +69,32 @@ public class ResolvingCustomizedLabelProvider implements ICustomizedLabelProvide
return result;
}
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.papyrus.emf.facet.custom.ui.ICustomizedLabelProvider#getStyledText(java.lang.Object)
+ */
+ @Override
+ public StyledString getStyledText(final Object element) {
+ StyledString result;
+ if (delegate instanceof ICustomizedLabelProvider) {
+ if (element instanceof EReferenceTreeElement) {
+ final EReferenceTreeElement treeElement = (EReferenceTreeElement) element;
+ final EObjectTreeElement parent = treeElement.getParent();
+ result = this.delegate.getStyledText(parent.getEObject(), treeElement.getEReference());
+ } else if (element instanceof EAttributeTreeElement) {
+ final EAttributeTreeElement treeElement = (EAttributeTreeElement) element;
+ final EObjectTreeElement parent = (EObjectTreeElement) treeElement.getParent();
+ result = this.delegate.getStyledText(parent.getEObject(), treeElement.getEAttribute());
+ } else {
+ result = this.delegate.getStyledText(CustomizedContentProviderUtils.resolve(element));
+ }
+ } else {
+ result = new StyledString(getText(element));
+ }
+ return result;
+ }
+
public void addListener(final ILabelProviderListener listener) {
this.delegate.addListener(listener);
}
@@ -489,4 +518,5 @@ public class ResolvingCustomizedLabelProvider implements ICustomizedLabelProvide
public ICustomizedLabelProvider cloneLabelProvider() {
return new ResolvingCustomizedLabelProvider(this.delegate.cloneLabelProvider());
}
+
}
diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.query.java.sdk.ui/META-INF/MANIFEST.MF b/plugins/facet/org.eclipse.papyrus.emf.facet.query.java.sdk.ui/META-INF/MANIFEST.MF
index feac1c9e029..71f84730317 100644
--- a/plugins/facet/org.eclipse.papyrus.emf.facet.query.java.sdk.ui/META-INF/MANIFEST.MF
+++ b/plugins/facet/org.eclipse.papyrus.emf.facet.query.java.sdk.ui/META-INF/MANIFEST.MF
@@ -7,7 +7,7 @@ Require-Bundle: org.eclipse.papyrus.emf.facet.efacet.sdk.ui;bundle-version="[1.2
org.eclipse.jdt.core;bundle-version="[3.12.0,4.0.0)",
org.eclipse.emf.codegen.ecore;bundle-version="[2.12.0,3.0.0)",
org.eclipse.jdt.ui;bundle-version="[3.12.0,4.0.0)",
- org.eclipse.papyrus.emf.facet.custom.metamodel;bundle-version="[1.2.0,2.0.0)",
+ org.eclipse.papyrus.emf.facet.custom.metamodel;bundle-version="[1.3.0,2.0.0)",
org.eclipse.papyrus.emf.facet.util.pde.core;bundle-version="[1.2.0,2.0.0)"
Bundle-Vendor: %Bundle-Vendor
Bundle-ActivationPolicy: lazy

Back to the top