Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Fedorov2019-04-13 12:09:36 -0400
committerAlexander Kurtakov2019-04-18 03:16:22 -0400
commit47b1fa3fbb58588f218c6138e4bcd9ecbcc5d036 (patch)
tree73daec54233e9a607f3a21b0a5a0c38d368dc375
parent2a44308b041da309149d120f95b8cf55879aa8e1 (diff)
downloadeclipse.platform.team-master.tar.gz
eclipse.platform.team-master.tar.xz
eclipse.platform.team-master.zip
Change-Id: I7bc428b6b55c62d0a096ebd5f968b0dda85ebac5 Signed-off-by: Alexander Fedorov <alexander.fedorov@arsysop.ru>
-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