Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAxel Richard2014-11-04 08:26:36 +0000
committerCamille Letavernier2014-11-04 15:47:58 +0000
commitaa9c9d9a1e32456faa7ef82cf985aac68d08863f (patch)
tree4cf1c18fa71a5243397fdd808555c456b9d19687 /plugins/infra
parent8051e9367499d9be403f9f07859320299d1f93e0 (diff)
downloadorg.eclipse.papyrus-aa9c9d9a1e32456faa7ef82cf985aac68d08863f.tar.gz
org.eclipse.papyrus-aa9c9d9a1e32456faa7ef82cf985aac68d08863f.tar.xz
org.eclipse.papyrus-aa9c9d9a1e32456faa7ef82cf985aac68d08863f.zip
449474: Do not load ImageRegistry in headless mode.
The test PlatformUI.isWorkbenchRunning() will allow to not invoke the eclipse ui plugin if eclipse is an headless mode. Bug: 449474 I, Axel Richard, wrote 100% of the code I've provided. This code contains no cryptography. I have the right to contribute the code to Eclipse. I contribute the content under the EPL. Change-Id: I0d3154f6d4a979a416fc39abee5fa472c37c5825 Signed-off-by: Axel Richard <axel.richard@obeo.fr>
Diffstat (limited to 'plugins/infra')
-rwxr-xr-xplugins/infra/core/org.eclipse.papyrus.infra.core.pluginexplorer/src/org/eclipse/papyrus/infra/core/pluginexplorer/Activator.java20
1 files changed, 12 insertions, 8 deletions
diff --git a/plugins/infra/core/org.eclipse.papyrus.infra.core.pluginexplorer/src/org/eclipse/papyrus/infra/core/pluginexplorer/Activator.java b/plugins/infra/core/org.eclipse.papyrus.infra.core.pluginexplorer/src/org/eclipse/papyrus/infra/core/pluginexplorer/Activator.java
index da8ea97f2bb..1c5b04707cf 100755
--- a/plugins/infra/core/org.eclipse.papyrus.infra.core.pluginexplorer/src/org/eclipse/papyrus/infra/core/pluginexplorer/Activator.java
+++ b/plugins/infra/core/org.eclipse.papyrus.infra.core.pluginexplorer/src/org/eclipse/papyrus/infra/core/pluginexplorer/Activator.java
@@ -1,5 +1,5 @@
/*****************************************************************************
- * Copyright (c) 2013 CEA LIST.
+ * Copyright (c) 2013, 2014 CEA LIST and others.
*
*
* All rights reserved. This program and the accompanying materials
@@ -9,7 +9,8 @@
*
* Contributors:
* Laurent Wouters laurent.wouters@cea.fr - Initial API and implementation
- *
+ * Axel Richard axel.richard@obeo.fr - Bug 449474
+ *
*****************************************************************************/
package org.eclipse.papyrus.infra.core.pluginexplorer;
@@ -19,6 +20,7 @@ import java.net.URL;
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.jface.resource.ImageRegistry;
import org.eclipse.papyrus.infra.core.log.LogHelper;
+import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.plugin.AbstractUIPlugin;
import org.osgi.framework.BundleContext;
@@ -73,12 +75,14 @@ public class Activator extends AbstractUIPlugin {
public void start(BundleContext context) throws Exception {
super.start(context);
this.context = context;
- ImageRegistry registry = getImageRegistry();
- registry.put("plugin", ImageDescriptor.createFromURL(new URL("platform:/plugin/" + PLUGIN_ID + "/icons/plugin_obj.gif")));
- registry.put("folder", ImageDescriptor.createFromURL(new URL("platform:/plugin/" + PLUGIN_ID + "/icons/packagefolder_obj.gif")));
- registry.put("class", ImageDescriptor.createFromURL(new URL("platform:/plugin/" + PLUGIN_ID + "/icons/classf_obj.gif")));
- registry.put("file", ImageDescriptor.createFromURL(new URL("platform:/plugin/" + PLUGIN_ID + "/icons/file_obj.gif")));
- registry.put("jar", ImageDescriptor.createFromURL(new URL("platform:/plugin/" + PLUGIN_ID + "/icons/jar_obj.gif")));
+ if (PlatformUI.isWorkbenchRunning()) {
+ ImageRegistry registry = getImageRegistry();
+ registry.put("plugin", ImageDescriptor.createFromURL(new URL("platform:/plugin/" + PLUGIN_ID + "/icons/plugin_obj.gif")));
+ registry.put("folder", ImageDescriptor.createFromURL(new URL("platform:/plugin/" + PLUGIN_ID + "/icons/packagefolder_obj.gif")));
+ registry.put("class", ImageDescriptor.createFromURL(new URL("platform:/plugin/" + PLUGIN_ID + "/icons/classf_obj.gif")));
+ registry.put("file", ImageDescriptor.createFromURL(new URL("platform:/plugin/" + PLUGIN_ID + "/icons/file_obj.gif")));
+ registry.put("jar", ImageDescriptor.createFromURL(new URL("platform:/plugin/" + PLUGIN_ID + "/icons/jar_obj.gif")));
+ }
plugin = this;
}

Back to the top