summaryrefslogtreecommitdiffstatsabout
diff options
context:
space:
mode:
authorChristian Pontesegger2013-09-24 14:49:26 (EDT)
committer Paul Webster2013-09-24 14:52:55 (EDT)
commite5a2dd2e408aa29c7193e2a2df0f8444ce905379 (patch)
treef9ee3844dc7d6ca053d55123947f9cf3d224ecab
parentc1156eb060b87e108c78c67984d3b101f5bb14e6 (diff)
downloadeclipse.platform.ui-e5a2dd2e408aa29c7193e2a2df0f8444ce905379.zip
eclipse.platform.ui-e5a2dd2e408aa29c7193e2a2df0f8444ce905379.tar.gz
eclipse.platform.ui-e5a2dd2e408aa29c7193e2a2df0f8444ce905379.tar.bz2
Bug 232171 - [Decorators] DeclarativeDecorators don't seem to take a
plugin URL for an icon Change-Id: I8609d66809f977811cba42ccc84b98109da567b1 Signed-off-by: Christian Pontesegger <christian.pontesegger@web.de>
-rw-r--r--bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/decorators/DeclarativeDecorator.java23
1 files changed, 15 insertions, 8 deletions
diff --git a/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/decorators/DeclarativeDecorator.java b/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/decorators/DeclarativeDecorator.java
index 4c91a01..8288534 100644
--- a/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/decorators/DeclarativeDecorator.java
+++ b/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/decorators/DeclarativeDecorator.java
@@ -10,14 +10,14 @@
*******************************************************************************/
package org.eclipse.ui.internal.decorators;
+import java.net.MalformedURLException;
import java.net.URL;
-
import org.eclipse.core.runtime.IConfigurationElement;
+import org.eclipse.emf.common.util.URI;
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.jface.viewers.IDecoration;
import org.eclipse.jface.viewers.ILabelProviderListener;
import org.eclipse.jface.viewers.ILightweightLabelDecorator;
-import org.eclipse.ui.internal.util.BundleUtility;
/**
* The DeclarativeDecorator is a decorator that is made entirely from an XML
@@ -68,14 +68,21 @@ public class DeclarativeDecorator implements ILightweightLabelDecorator {
* org.eclipse.jface.viewers.IDecoration)
*/
public void decorate(Object element, IDecoration decoration) {
- if (descriptor == null) {
- URL url = BundleUtility.find(configElement.getDeclaringExtension()
- .getNamespace(), iconLocation);
- if (url == null) {
+ if (descriptor == null) {
+ URI iconURI = URI.createURI(iconLocation);
+ if (iconURI.isRelative()) {
+ URI pluginURI = URI.createPlatformPluginURI(configElement.getContributor()
+ .getName() + "/", true); //$NON-NLS-1$
+ iconURI = iconURI.resolve(pluginURI);
+ }
+
+ try {
+ descriptor = ImageDescriptor.createFromURL(new URL(iconURI.toString()));
+ } catch (MalformedURLException e) {
return;
}
- descriptor = ImageDescriptor.createFromURL(url);
- }
+
+ }
decoration.addOverlay(descriptor);
}
}