Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorcdumoulin2010-01-13 16:58:49 +0000
committercdumoulin2010-01-13 16:58:49 +0000
commitb95f2cd22b77a8abed2210ab4fc4a4ac117ce8eb (patch)
tree07edf84778b781e449019bbaad1962c5f6229dbe /plugins/others
parent7b182d30d6ba12d9c022e9a912840bc156c15848 (diff)
downloadorg.eclipse.papyrus-b95f2cd22b77a8abed2210ab4fc4a4ac117ce8eb.tar.gz
org.eclipse.papyrus-b95f2cd22b77a8abed2210ab4fc4a4ac117ce8eb.tar.xz
org.eclipse.papyrus-b95f2cd22b77a8abed2210ab4fc4a4ac117ce8eb.zip
ASSIGNED - bug 290904: [backbone] Remove old and unused stuff
https://bugs.eclipse.org/bugs/show_bug.cgi?id=290904 Improve and simplify the EditorFactory and associated interfaces. Add an EditorIconsFactory. Remove some unused classes and code.
Diffstat (limited to 'plugins/others')
-rw-r--r--plugins/others/org.eclipse.papyrus.outline/src/org/eclipse/papyrus/outline/DiagramOrientedLabelProvider.java22
1 files changed, 16 insertions, 6 deletions
diff --git a/plugins/others/org.eclipse.papyrus.outline/src/org/eclipse/papyrus/outline/DiagramOrientedLabelProvider.java b/plugins/others/org.eclipse.papyrus.outline/src/org/eclipse/papyrus/outline/DiagramOrientedLabelProvider.java
index e5a68c68a18..3c8e15b5519 100644
--- a/plugins/others/org.eclipse.papyrus.outline/src/org/eclipse/papyrus/outline/DiagramOrientedLabelProvider.java
+++ b/plugins/others/org.eclipse.papyrus.outline/src/org/eclipse/papyrus/outline/DiagramOrientedLabelProvider.java
@@ -16,8 +16,10 @@ import org.eclipse.emf.edit.ui.provider.AdapterFactoryLabelProvider;
import org.eclipse.gmf.runtime.notation.Diagram;
import org.eclipse.jface.viewers.ILabelProvider;
import org.eclipse.jface.viewers.ILabelProviderListener;
-import org.eclipse.papyrus.core.extension.diagrameditor.EditorFactoryRegistry;
-import org.eclipse.papyrus.core.extension.diagrameditor.IEditorFactoryRegistry;
+import org.eclipse.papyrus.core.editorsfactory.IPageIconsRegistry;
+import org.eclipse.papyrus.core.editorsfactory.PageIconsRegistry;
+import org.eclipse.papyrus.core.services.ServiceException;
+import org.eclipse.papyrus.core.utils.EditorUtils;
import org.eclipse.swt.graphics.Image;
/**
@@ -32,7 +34,7 @@ public class DiagramOrientedLabelProvider implements ILabelProvider {
private AdapterFactoryLabelProvider myAdapterFactoryLabelProvider;
/** Registry to store editor factories */
- private IEditorFactoryRegistry editorRegistry;
+ private IPageIconsRegistry editorRegistry;
public DiagramOrientedLabelProvider(AdapterFactoryLabelProvider adapterFactoryLabelProvider) {
this.myAdapterFactoryLabelProvider = adapterFactoryLabelProvider;
@@ -45,6 +47,7 @@ public class DiagramOrientedLabelProvider implements ILabelProvider {
if(element instanceof Diagram) {
return getEditorRegistry().getEditorIcon(element);
}
+
return myAdapterFactoryLabelProvider.getImage(element);
}
@@ -93,8 +96,9 @@ public class DiagramOrientedLabelProvider implements ILabelProvider {
* the singleton eINSTANCE. This method can be subclassed to return another registry.
*
* @return the singleton eINSTANCE of editor registry
+ * @throws ServiceException
*/
- protected IEditorFactoryRegistry getEditorRegistry() {
+ protected IPageIconsRegistry getEditorRegistry() {
if(editorRegistry == null) {
editorRegistry = createEditorRegistry();
}
@@ -106,9 +110,15 @@ public class DiagramOrientedLabelProvider implements ILabelProvider {
* method in order to return the registry associated to the extension point namespace.
*
* @return the EditorRegistry for nested editor descriptors
+ * @throws ServiceException
*/
- protected IEditorFactoryRegistry createEditorRegistry() {
- return new EditorFactoryRegistry(org.eclipse.papyrus.core.Activator.PLUGIN_ID);
+ protected IPageIconsRegistry createEditorRegistry() {
+ try {
+ return EditorUtils.getServiceRegistry().getService(IPageIconsRegistry.class);
+ } catch (ServiceException e) {
+ // Not found, return an empty one which return null for each request.
+ return new PageIconsRegistry();
+ }
}
}

Back to the top