Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorptessier2014-03-04 13:57:05 +0000
committerptessier2014-03-04 13:57:05 +0000
commit493d78d4af3fa77cc1b71e0b4ae4b25a1281fc82 (patch)
tree5ccb49145fb7679ce384ab8d78f96f13b0c83235 /plugins/facet/org.eclipse.papyrus.emf.facet.custom.ui
parent236cb1a4af4d3fdbb27e6d70ef7e0d99c98c4dcc (diff)
downloadorg.eclipse.papyrus-493d78d4af3fa77cc1b71e0b4ae4b25a1281fc82.tar.gz
org.eclipse.papyrus-493d78d4af3fa77cc1b71e0b4ae4b25a1281fc82.tar.xz
org.eclipse.papyrus-493d78d4af3fa77cc1b71e0b4ae4b25a1281fc82.zip
Bug 386118 - [EMF Facet] Papyrus should progressively support EMF Facet
0.2 adapt oep.view.papyrus
Diffstat (limited to 'plugins/facet/org.eclipse.papyrus.emf.facet.custom.ui')
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.custom.ui/META-INF/MANIFEST.MF1
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.custom.ui/src/org/eclipse/papyrus/emf/facet/custom/ui/internal/ResolvingCustomizedLabelProvider.java4
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.custom.ui/src/org/eclipse/papyrus/emf/facet/custom/ui/internal/query/ImageQuery.java20
3 files changed, 16 insertions, 9 deletions
diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.custom.ui/META-INF/MANIFEST.MF b/plugins/facet/org.eclipse.papyrus.emf.facet.custom.ui/META-INF/MANIFEST.MF
index b5dd7f2a8c8..285a95383cf 100644
--- a/plugins/facet/org.eclipse.papyrus.emf.facet.custom.ui/META-INF/MANIFEST.MF
+++ b/plugins/facet/org.eclipse.papyrus.emf.facet.custom.ui/META-INF/MANIFEST.MF
@@ -20,6 +20,7 @@ Bundle-RequiredExecutionEnvironment: J2SE-1.5
Bundle-ActivationPolicy: lazy
Export-Package: org.eclipse.papyrus.emf.facet.custom.ui,
org.eclipse.papyrus.emf.facet.custom.ui.internal,
+ org.eclipse.papyrus.emf.facet.custom.ui.internal.custompt,
org.eclipse.papyrus.emf.facet.custom.ui.internal.exported,
org.eclipse.papyrus.emf.facet.custom.ui.internal.exported.dialog,
org.eclipse.papyrus.emf.facet.custom.ui.internal.exported.exception
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 84950c7f7db..579ea41c864 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
@@ -42,7 +42,9 @@ public class ResolvingCustomizedLabelProvider implements ICustomizedLabelProvide
final EAttributeTreeElement treeElement = (EAttributeTreeElement) element;
final EObjectTreeElement parent = (EObjectTreeElement) treeElement.getParent();
image = this.delegate.getImage(parent.getEObject(), treeElement.getEAttribute());
- } else {
+ }
+
+ else {
image = this.delegate.getImage(CustomizedContentProviderUtils.resolve(element));
}
return image;
diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.custom.ui/src/org/eclipse/papyrus/emf/facet/custom/ui/internal/query/ImageQuery.java b/plugins/facet/org.eclipse.papyrus.emf.facet.custom.ui/src/org/eclipse/papyrus/emf/facet/custom/ui/internal/query/ImageQuery.java
index 1d80907c116..abe16d648b9 100644
--- a/plugins/facet/org.eclipse.papyrus.emf.facet.custom.ui/src/org/eclipse/papyrus/emf/facet/custom/ui/internal/query/ImageQuery.java
+++ b/plugins/facet/org.eclipse.papyrus.emf.facet.custom.ui/src/org/eclipse/papyrus/emf/facet/custom/ui/internal/query/ImageQuery.java
@@ -19,6 +19,7 @@ import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.EReference;
import org.eclipse.emf.ecore.ETypedElement;
import org.eclipse.emf.edit.provider.ComposedAdapterFactory;
+import org.eclipse.emf.edit.provider.ComposedImage;
import org.eclipse.emf.edit.provider.IItemLabelProvider;
import org.eclipse.emf.edit.ui.provider.ExtendedImageRegistry;
import org.eclipse.papyrus.emf.facet.custom.ui.internal.Activator;
@@ -63,14 +64,17 @@ public class ImageQuery implements IJavaQuery2<EObject, IImage> {
final IItemLabelProvider itemLabelProvider = (IItemLabelProvider) adapterFactory
.adapt(source, IItemLabelProvider.class);
if (itemLabelProvider != null) {
- final ImageDescriptor imgDescriptor = ExtendedImageRegistry
- .getInstance().getImageDescriptor(source);
- final IImageProvider imgProvider = IImageProviderFactory.DEFAULT
- .createIImageProvider(Activator.getDefault());
- if (imgDescriptor != null) {
- final Image image = imgProvider.getImage(imgDescriptor);
- result = new ImageWrapper(image);
- }
+ Object imageObject = itemLabelProvider.getImage(source);
+ Image image = ExtendedImageRegistry.getInstance().getImage(imageObject);
+ result = new ImageWrapper(image);
+//// final ImageDescriptor imgDescriptor = ExtendedImageRegistry
+//// .getInstance().getImageDescriptor(source);
+// final IImageProvider imgProvider = IImageProviderFactory.DEFAULT
+// .createIImageProvider(Activator.getDefault());
+// if (imgDescriptor != null) {
+// final Image image = imgProvider.getImage(imgDescriptor);
+// result = new ImageWrapper(image);
+// }
}
return result;
}

Back to the top