aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRené Brandstetter2013-10-17 00:33:23 (EDT)
committerGerrit Code Review @ Eclipse.org2013-10-24 16:05:11 (EDT)
commitf368d17aa5f8ac1eac7c910c3ce34dd30b589f1f (patch)
tree3d4faa7a969b2da168d11cf1c9db5923953a8c67
parent5ea1ac97127f926f3e91e1dac1a4540900982db4 (diff)
downloadeclipse.platform.ui-f368d17aa5f8ac1eac7c910c3ce34dd30b589f1f.zip
eclipse.platform.ui-f368d17aa5f8ac1eac7c910c3ce34dd30b589f1f.tar.gz
eclipse.platform.ui-f368d17aa5f8ac1eac7c910c3ce34dd30b589f1f.tar.bz2
Bug 371027 – [Model] platform:/plugin/ not used for fragment uri in org.eclipse.e4.workbench.model extension pointrefs/changes/70/17470/2
Add the possibility to also allow platform-URIs in the uri-attribute of the fragment-extension point. Change-Id: I328526c3ce28cc9308cab74f95a07ff6b6ac30ae Signed-off-by: René Brandstetter <Rene.Brandstetter@gmx.net>
-rw-r--r--bundles/org.eclipse.e4.ui.workbench/src/org/eclipse/e4/ui/internal/workbench/ModelAssembler.java12
-rw-r--r--bundles/org.eclipse.e4.ui.workbench/src/org/eclipse/e4/ui/internal/workbench/URIHelper.java12
2 files changed, 21 insertions, 3 deletions
diff --git a/bundles/org.eclipse.e4.ui.workbench/src/org/eclipse/e4/ui/internal/workbench/ModelAssembler.java b/bundles/org.eclipse.e4.ui.workbench/src/org/eclipse/e4/ui/internal/workbench/ModelAssembler.java
index 0d9d8db..870e24a 100644
--- a/bundles/org.eclipse.e4.ui.workbench/src/org/eclipse/e4/ui/internal/workbench/ModelAssembler.java
+++ b/bundles/org.eclipse.e4.ui.workbench/src/org/eclipse/e4/ui/internal/workbench/ModelAssembler.java
@@ -104,10 +104,16 @@ public class ModelAssembler {
}
URI uri;
- String bundleName = contributor.getName();
- String path = bundleName + '/' + attrURI;
+
try {
- uri = URI.createPlatformPluginURI(path, false);
+ // check if the attrURI is already a platform URI
+ if (URIHelper.isPlatformURI(attrURI)) {
+ uri = URI.createURI(attrURI);
+ } else {
+ String bundleName = contributor.getName();
+ String path = bundleName + '/' + attrURI;
+ uri = URI.createPlatformPluginURI(path, false);
+ }
} catch (RuntimeException e) {
logger.warn(e, "Model extension has invalid location"); //$NON-NLS-1$
continue;
diff --git a/bundles/org.eclipse.e4.ui.workbench/src/org/eclipse/e4/ui/internal/workbench/URIHelper.java b/bundles/org.eclipse.e4.ui.workbench/src/org/eclipse/e4/ui/internal/workbench/URIHelper.java
index 0b31e00..f8a9d86 100644
--- a/bundles/org.eclipse.e4.ui.workbench/src/org/eclipse/e4/ui/internal/workbench/URIHelper.java
+++ b/bundles/org.eclipse.e4.ui.workbench/src/org/eclipse/e4/ui/internal/workbench/URIHelper.java
@@ -94,4 +94,16 @@ public class URIHelper {
return uri.toString();
}
+ /**
+ * Helper method which checks if given String represents a Platform URI.
+ *
+ * @param uri
+ * a possible Platform URI
+ * @return true if the given string is not {@code null} and starts with
+ * {@value #PLATFORM_SCHEMA}; false otherwise
+ */
+ public static boolean isPlatformURI(String uri) {
+ return uri != null && uri.startsWith(PLATFORM_SCHEMA);
+ }
+
}