Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/org.eclipse.gmf.common')
-rw-r--r--plugins/org.eclipse.gmf.common/META-INF/MANIFEST.MF2
-rw-r--r--plugins/org.eclipse.gmf.common/src/org/eclipse/gmf/internal/common/URIUtil.java38
2 files changed, 39 insertions, 1 deletions
diff --git a/plugins/org.eclipse.gmf.common/META-INF/MANIFEST.MF b/plugins/org.eclipse.gmf.common/META-INF/MANIFEST.MF
index d746ebcac..279e04a1d 100644
--- a/plugins/org.eclipse.gmf.common/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.gmf.common/META-INF/MANIFEST.MF
@@ -7,7 +7,7 @@ Bundle-Localization: plugin
Export-Package: org.eclipse.gmf.common,
org.eclipse.gmf.common.codegen,
org.eclipse.gmf.internal.codegen.dispatch;x-friends:="org.eclipse.gmf.codegen,org.eclipse.gmf.graphdef.codegen,org.eclipse.gmf.codegen.lite",
- org.eclipse.gmf.internal.common;x-friends:="org.eclipse.gmf.codegen.edit,org.eclipse.gmf.graphdef.edit,org.eclipse.gmf.map.edit,org.eclipse.gmf.tooldef.edit,org.eclipse.gmf.bridge.trace,org.eclipse.gmf.bridge.ui,org.eclipse.gmf.bridge,org.eclipse.gmf.tests",
+ org.eclipse.gmf.internal.common;x-friends:="org.eclipse.gmf.codegen.edit,org.eclipse.gmf.graphdef.edit,org.eclipse.gmf.map.edit,org.eclipse.gmf.tooldef.edit,org.eclipse.gmf.bridge.trace,org.eclipse.gmf.bridge.ui,org.eclipse.gmf.bridge,org.eclipse.gmf.tests,org.eclipse.gmf.bridge.ui.dashboard,org.eclipse.gmf.codegen.ui,org.eclipse.gmf.codegen.lite.ui",
org.eclipse.gmf.internal.common.codegen;x-friends:="org.eclipse.gmf.codegen,org.eclipse.gmf.graphdef.codegen,org.eclipse.gmf.bridge,org.eclipse.gmf.codegen.lite,org.eclipse.gmf.tests,org.eclipse.gmf.codegen.ui,org.eclipse.gmf.codegen.lite.ui,org.eclipse.gmf.tests.lite,org.eclipse.gmf.graphdef.codegen.ui",
org.eclipse.gmf.internal.common.migrate;x-friends:="org.eclipse.gmf.codegen.ui,org.eclipse.gmf.tests,org.eclipse.gmf.codegen,org.eclipse.gmf.map",
org.eclipse.gmf.internal.common.reconcile;x-friends:="org.eclipse.gmf.codegen.ui,org.eclipse.gmf.tests",
diff --git a/plugins/org.eclipse.gmf.common/src/org/eclipse/gmf/internal/common/URIUtil.java b/plugins/org.eclipse.gmf.common/src/org/eclipse/gmf/internal/common/URIUtil.java
new file mode 100644
index 000000000..88c06a1b6
--- /dev/null
+++ b/plugins/org.eclipse.gmf.common/src/org/eclipse/gmf/internal/common/URIUtil.java
@@ -0,0 +1,38 @@
+/*
+ * Copyright (c) 2006 Borland Software Corporation
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Dmitry Stadnik (Borland) - initial API and implementation
+ */
+package org.eclipse.gmf.internal.common;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.emf.common.util.URI;
+
+/**
+ * @author dstadnik
+ */
+public class URIUtil {
+
+ private URIUtil() {
+ }
+
+ public static IFile getFile(URI uri) {
+ if (uri.toString().startsWith("platform:/resource")) { //$NON-NLS-1$
+ String path = uri.toString().substring("platform:/resource".length()); //$NON-NLS-1$
+ IResource workspaceResource = ResourcesPlugin.getWorkspace().getRoot().findMember(new Path(path));
+ if (workspaceResource instanceof IFile) {
+ return (IFile) workspaceResource;
+ }
+ }
+ return null;
+ }
+}

Back to the top