Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEd Willink2015-06-02 04:50:09 +0000
committerEd Willink2015-06-07 09:23:48 +0000
commit832217dcbd5dd69b8d39f8a43dc7191355eb3553 (patch)
treeee28ee217f9706a81ef88f32273e682d5f92d8b4
parentd173e011a1682a134f34b91b328d0f208fbdce6c (diff)
downloadorg.eclipse.qvtd-832217dcbd5dd69b8d39f8a43dc7191355eb3553.tar.gz
org.eclipse.qvtd-832217dcbd5dd69b8d39f8a43dc7191355eb3553.tar.xz
org.eclipse.qvtd-832217dcbd5dd69b8d39f8a43dc7191355eb3553.zip
[469560] Avoid ImageRegistry extension conflict
-rw-r--r--plugins/org.eclipse.qvtd.debug.ui/icons/attribute_obj.gifbin123 -> 0 bytes
-rw-r--r--plugins/org.eclipse.qvtd.debug.ui/icons/brkp_obj.gifbin197 -> 0 bytes
-rw-r--r--plugins/org.eclipse.qvtd.debug.ui/icons/localvar_obj.gifbin133 -> 0 bytes
-rw-r--r--plugins/org.eclipse.qvtd.debug.ui/icons/modelpar_obj.gifbin504 -> 0 bytes
-rw-r--r--plugins/org.eclipse.qvtd.debug.ui/icons/reference_obj.gifbin183 -> 0 bytes
-rw-r--r--plugins/org.eclipse.qvtd.debug.ui/src/org/eclipse/qvtd/debug/ui/QVTdDebugUIPlugin.java10
-rw-r--r--plugins/org.eclipse.qvtd.debug.ui/src/org/eclipse/qvtd/debug/ui/actions/QVTiDebugImages.java23
-rw-r--r--plugins/org.eclipse.qvtd.debug.ui/src/org/eclipse/qvtd/debug/ui/pages/QVTiDebugModelPresentation.java21
8 files changed, 38 insertions, 16 deletions
diff --git a/plugins/org.eclipse.qvtd.debug.ui/icons/attribute_obj.gif b/plugins/org.eclipse.qvtd.debug.ui/icons/attribute_obj.gif
deleted file mode 100644
index bc9944a7d..000000000
--- a/plugins/org.eclipse.qvtd.debug.ui/icons/attribute_obj.gif
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.qvtd.debug.ui/icons/brkp_obj.gif b/plugins/org.eclipse.qvtd.debug.ui/icons/brkp_obj.gif
deleted file mode 100644
index a831fe727..000000000
--- a/plugins/org.eclipse.qvtd.debug.ui/icons/brkp_obj.gif
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.qvtd.debug.ui/icons/localvar_obj.gif b/plugins/org.eclipse.qvtd.debug.ui/icons/localvar_obj.gif
deleted file mode 100644
index ef930ac8f..000000000
--- a/plugins/org.eclipse.qvtd.debug.ui/icons/localvar_obj.gif
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.qvtd.debug.ui/icons/modelpar_obj.gif b/plugins/org.eclipse.qvtd.debug.ui/icons/modelpar_obj.gif
deleted file mode 100644
index d4d07363f..000000000
--- a/plugins/org.eclipse.qvtd.debug.ui/icons/modelpar_obj.gif
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.qvtd.debug.ui/icons/reference_obj.gif b/plugins/org.eclipse.qvtd.debug.ui/icons/reference_obj.gif
deleted file mode 100644
index 88cdf2ad8..000000000
--- a/plugins/org.eclipse.qvtd.debug.ui/icons/reference_obj.gif
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.qvtd.debug.ui/src/org/eclipse/qvtd/debug/ui/QVTdDebugUIPlugin.java b/plugins/org.eclipse.qvtd.debug.ui/src/org/eclipse/qvtd/debug/ui/QVTdDebugUIPlugin.java
index 2b88488a9..d26abaf0f 100644
--- a/plugins/org.eclipse.qvtd.debug.ui/src/org/eclipse/qvtd/debug/ui/QVTdDebugUIPlugin.java
+++ b/plugins/org.eclipse.qvtd.debug.ui/src/org/eclipse/qvtd/debug/ui/QVTdDebugUIPlugin.java
@@ -22,6 +22,8 @@ import org.eclipse.emf.common.util.BasicDiagnostic;
import org.eclipse.emf.common.util.Diagnostic;
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.jface.resource.ImageRegistry;
+import org.eclipse.ocl.examples.debug.vm.ui.DebugVMUIPlugin;
+import org.eclipse.ocl.examples.debug.vm.ui.actions.DebugVMImages;
import org.eclipse.qvtd.debug.ui.actions.QVTiDebugImages;
import org.eclipse.qvtd.xtext.qvtimperative.ui.QVTimperativeEditor;
import org.eclipse.swt.graphics.Image;
@@ -245,12 +247,12 @@ public class QVTdDebugUIPlugin extends AbstractUIPlugin {
@Override
protected ImageRegistry createImageRegistry() {
ImageRegistry imageRegistry = super.createImageRegistry();
- imageRegistry.put(QVTiDebugImages.LOCAL_VARIABLE, imageDescriptor("localvar_obj.gif")); //$NON-NLS-1$
+ imageRegistry.put(DebugVMImages.LOCAL_VARIABLE, imageDescriptorFromPlugin(DebugVMUIPlugin.PLUGIN_ID, "localvar_obj.gif")); //$NON-NLS-1$
// imageRegistry.put(QVTiDebugImages.THIS_VARIABLE, imageDescriptor("thisvar_obj.gif")); //$NON-NLS-1$
// imageRegistry.put(QVTiDebugImages.PREDEFINED_VARIABLE, imageDescriptor("predefvar_obj.gif")); //$NON-NLS-1$
- imageRegistry.put(QVTiDebugImages.MODEL_PARAMETER, imageDescriptor("modelpar_obj.gif")); //$NON-NLS-1$
- imageRegistry.put(QVTiDebugImages.ATTRIBUTE, imageDescriptor("attribute_obj.gif")); //$NON-NLS-1$
- imageRegistry.put(QVTiDebugImages.REFERENCE, imageDescriptor("reference_obj.gif")); //$NON-NLS-1$
+ imageRegistry.put(DebugVMImages.MODEL_PARAMETER, imageDescriptorFromPlugin(DebugVMUIPlugin.PLUGIN_ID, "modelpar_obj.gif")); //$NON-NLS-1$
+ imageRegistry.put(DebugVMImages.ATTRIBUTE, imageDescriptorFromPlugin(DebugVMUIPlugin.PLUGIN_ID, "attribute_obj.gif")); //$NON-NLS-1$
+ imageRegistry.put(DebugVMImages.REFERENCE, imageDescriptorFromPlugin(DebugVMUIPlugin.PLUGIN_ID, "reference_obj.gif")); //$NON-NLS-1$
// imageRegistry.put(QVTiDebugImages.COLLECTION_ELEMENT, imageDescriptor("index_element_obj.gif")); //$NON-NLS-1$
imageRegistry.put(QVTiDebugImages.MAPPING, imageDescriptor("Mapping.gif")); //$NON-NLS-1$
imageRegistry.put(QVTiDebugImages.TRANSFORMATION, imageDescriptor("Transformation.gif")); //$NON-NLS-1$
diff --git a/plugins/org.eclipse.qvtd.debug.ui/src/org/eclipse/qvtd/debug/ui/actions/QVTiDebugImages.java b/plugins/org.eclipse.qvtd.debug.ui/src/org/eclipse/qvtd/debug/ui/actions/QVTiDebugImages.java
index 977f12fb5..9b511df6a 100644
--- a/plugins/org.eclipse.qvtd.debug.ui/src/org/eclipse/qvtd/debug/ui/actions/QVTiDebugImages.java
+++ b/plugins/org.eclipse.qvtd.debug.ui/src/org/eclipse/qvtd/debug/ui/actions/QVTiDebugImages.java
@@ -11,10 +11,29 @@
*******************************************************************************/
package org.eclipse.qvtd.debug.ui.actions;
-import org.eclipse.ocl.examples.debug.vm.ui.actions.DebugVMImages;
+import org.apache.log4j.Logger;
+import org.eclipse.jface.resource.ImageRegistry;
+import org.eclipse.qvtd.debug.ui.QVTdDebugUIPlugin;
+import org.eclipse.swt.graphics.Image;
-public class QVTiDebugImages extends DebugVMImages
+public class QVTiDebugImages
{
+ private static final Logger logger = Logger.getLogger(QVTiDebugImages.class);
+
public static final String TRANSFORMATION = "Transformation"; //$NON-NLS-1$
public static final String MAPPING = "Mapping"; //$NON-NLS-1$
+
+ private static ImageRegistry fgImageRegistry = QVTdDebugUIPlugin.getDefault().getImageRegistry();
+
+ protected QVTiDebugImages() {
+ super();
+ }
+
+ public static Image getImage(String key) {
+ Image image = fgImageRegistry.get(key);
+ if (image == null) {
+ logger.error("No image for '" + key + "'");
+ }
+ return image;
+ }
}
diff --git a/plugins/org.eclipse.qvtd.debug.ui/src/org/eclipse/qvtd/debug/ui/pages/QVTiDebugModelPresentation.java b/plugins/org.eclipse.qvtd.debug.ui/src/org/eclipse/qvtd/debug/ui/pages/QVTiDebugModelPresentation.java
index dc5021b52..c5b8898b7 100644
--- a/plugins/org.eclipse.qvtd.debug.ui/src/org/eclipse/qvtd/debug/ui/pages/QVTiDebugModelPresentation.java
+++ b/plugins/org.eclipse.qvtd.debug.ui/src/org/eclipse/qvtd/debug/ui/pages/QVTiDebugModelPresentation.java
@@ -20,6 +20,7 @@ import org.eclipse.ocl.examples.debug.vm.core.VMLineBreakpoint;
import org.eclipse.ocl.examples.debug.vm.core.VMStackFrame;
import org.eclipse.ocl.examples.debug.vm.core.VMThread;
import org.eclipse.ocl.examples.debug.vm.core.VMVariable;
+import org.eclipse.ocl.examples.debug.vm.ui.actions.DebugVMImages;
import org.eclipse.ocl.examples.debug.vm.ui.pages.VMDebugModelPresentation;
import org.eclipse.qvtd.debug.ui.QVTdDebugUIPlugin;
import org.eclipse.qvtd.debug.ui.actions.QVTiDebugImages;
@@ -51,27 +52,27 @@ public class QVTiDebugModelPresentation extends VMDebugModelPresentation
else if(element instanceof VMVariable) {
VMVariable var = (VMVariable) element;
if (var.isModelParameter()) {
- return QVTiDebugImages.getImage(QVTiDebugImages.MODEL_PARAMETER);
+ return DebugVMImages.getImage(DebugVMImages.MODEL_PARAMETER);
} else if (var.isReference()) {
- return QVTiDebugImages.getImage(QVTiDebugImages.REFERENCE);
+ return DebugVMImages.getImage(DebugVMImages.REFERENCE);
} else if (var.isAttribute()) {
- return QVTiDebugImages.getImage(QVTiDebugImages.ATTRIBUTE);
+ return DebugVMImages.getImage(DebugVMImages.ATTRIBUTE);
} else if (var.isIntermProperty()) {
- return QVTiDebugImages.getImage(QVTiDebugImages.INTERM_PROPERTY);
+ return DebugVMImages.getImage(DebugVMImages.INTERM_PROPERTY);
} else if (var.isLocalVariable()) {
- return QVTiDebugImages.getImage(QVTiDebugImages.LOCAL_VARIABLE);
+ return DebugVMImages.getImage(DebugVMImages.LOCAL_VARIABLE);
} else if (var.isPredefinedVariable()) {
// TODO - add special case for this
try {
if("this".equals(var.getName())) { //$NON-NLS-1$
- return QVTiDebugImages.getImage(QVTiDebugImages.THIS_VARIABLE);
+ return DebugVMImages.getImage(DebugVMImages.THIS_VARIABLE);
}
} catch (DebugException e) {
// do nothing use the std image
}
- return QVTiDebugImages.getImage(QVTiDebugImages.PREDEFINED_VARIABLE);
+ return DebugVMImages.getImage(DebugVMImages.PREDEFINED_VARIABLE);
} else if(var.isCollectionElement()) {
- return QVTiDebugImages.getImage(QVTiDebugImages.COLLECTION_ELEMENT);
+ return DebugVMImages.getImage(DebugVMImages.COLLECTION_ELEMENT);
}
} else if (element instanceof VMLineBreakpoint) {
@@ -79,8 +80,8 @@ public class QVTiDebugModelPresentation extends VMDebugModelPresentation
try {
if (breakpoint.isConditionEnabled()) {
return breakpoint.isEnabled() ?
- QVTiDebugImages.getImage(QVTiDebugImages.CONDITIONAL_BPNT_ENABLED) :
- QVTiDebugImages.getImage(QVTiDebugImages.CONDITIONAL_BPNT_DISABLED);
+ DebugVMImages.getImage(DebugVMImages.CONDITIONAL_BPNT_ENABLED) :
+ DebugVMImages.getImage(DebugVMImages.CONDITIONAL_BPNT_DISABLED);
}
} catch (CoreException ex) {
QVTdDebugUIPlugin.log(ex);

Back to the top