Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'bundles/org.eclipse.team.ui')
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/TeamUIPlugin.java17
1 files changed, 15 insertions, 2 deletions
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/TeamUIPlugin.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/TeamUIPlugin.java
index c5f61691e..86990a54b 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/TeamUIPlugin.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/TeamUIPlugin.java
@@ -14,6 +14,7 @@
package org.eclipse.team.internal.ui;
import java.lang.reflect.InvocationTargetException;
+import java.net.MalformedURLException;
import java.net.URL;
import java.util.ArrayList;
import java.util.HashMap;
@@ -335,8 +336,20 @@ public class TeamUIPlugin extends AbstractUIPlugin {
* @return the image
*/
public static ImageDescriptor getImageDescriptorFromExtension(IExtension extension, String subdirectoryAndFilename) {
- URL fullPathString = FileLocator.find(Platform.getBundle(extension.getContributor().getName()), new Path(subdirectoryAndFilename), null);
- return ImageDescriptor.createFromURL(fullPathString);
+ URL iconURL = FileLocator.find(Platform.getBundle(extension.getContributor().getName()), new Path(subdirectoryAndFilename), null);
+ if (iconURL != null) {
+ return ImageDescriptor.createFromURL(iconURL);
+ }
+ // try to search as a URL in case it is absolute path
+ try {
+ iconURL = FileLocator.find(new URL(subdirectoryAndFilename));
+ if (iconURL != null) {
+ return ImageDescriptor.createFromURL(iconURL);
+ }
+ } catch (MalformedURLException e) {
+ //ignore
+ }
+ return null;
}
public static final String FILE_DIRTY_OVR = "ovr/dirty_ov.png"; //$NON-NLS-1$

Back to the top