com.ibm.xtools.bpmn2.util
Class Bpmn2URIHelper

java.lang.Object
  extended by com.ibm.xtools.bpmn2.util.Bpmn2URIHelper

public class Bpmn2URIHelper
extends java.lang.Object

Helper class to deal with EMF URIs.


Constructor Summary
Bpmn2URIHelper()
           
 
Method Summary
static org.eclipse.emf.common.util.URI covertToPlatformURI(org.eclipse.emf.common.util.URI fileURI)
          This method will convert the file URI to platform URI if the file is part of workspace resource
static org.eclipse.emf.common.util.URI getMostRelativeURI(org.eclipse.emf.common.util.URI uri, org.eclipse.emf.ecore.EObject referencer)
          Given a URI, return a URI that is the most relative to where the user is in the workspace.
static org.eclipse.emf.common.util.URI getMostRelativeURI(org.eclipse.emf.common.util.URI uri, org.eclipse.emf.ecore.resource.Resource resource)
          Given a URI, return a URI that is the most relative to where the user is in the workspace.
static boolean isSameProject(org.eclipse.emf.common.util.URI uriA, org.eclipse.emf.common.util.URI uriB)
          This method will check whether the given URIs are belongs to the same project or not
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Bpmn2URIHelper

public Bpmn2URIHelper()
Method Detail

getMostRelativeURI

public static org.eclipse.emf.common.util.URI getMostRelativeURI(org.eclipse.emf.common.util.URI uri,
                                                                 org.eclipse.emf.ecore.EObject referencer)
Given a URI, return a URI that is the most relative to where the user is in the workspace. For instance, if a file:/ URI refers to a resource in the workspace, convert the URI to a platform URI. If a platform:/ URI refers to a resource that is in the same project, convert the URI so it uses no scheme. This will enable users to use either the File System or the Workspace to browse to referenced resources and yet keep the model as portable as possible. If the incoming URI identifies a file that is outside of the current workspace, or is of some other scheme, e.g., pathmap, there will be no conversion.

Parameters:
uri - Incoming URI to be converted
referencer - EObject that references the resource the URI identifies
Returns:
most relative URI possible given current workspace and project

getMostRelativeURI

public static org.eclipse.emf.common.util.URI getMostRelativeURI(org.eclipse.emf.common.util.URI uri,
                                                                 org.eclipse.emf.ecore.resource.Resource resource)
Given a URI, return a URI that is the most relative to where the user is in the workspace. For instance, if a file:/ URI refers to a resource in the workspace, convert the URI to a platform URI. If a platform:/ URI refers to a resource that is in the same project, convert the URI so it uses no scheme. This will enable users to use either the File System or the Workspace to browse to referenced resources and yet keep the model as portable as possible. If the incoming URI identifies a file that is outside of the current workspace, or is of some other scheme, e.g., pathmap, there will be no conversion.

Parameters:
uri - Incoming URI to be converted
resource - The resource that URI identifies
Returns:
most relative URI possible given current workspace and project

isSameProject

public static boolean isSameProject(org.eclipse.emf.common.util.URI uriA,
                                    org.eclipse.emf.common.util.URI uriB)
This method will check whether the given URIs are belongs to the same project or not

Parameters:
uriA -
uriB -
Returns:
true when the projects of uriA and uriB are same, otherwise false.

covertToPlatformURI

public static org.eclipse.emf.common.util.URI covertToPlatformURI(org.eclipse.emf.common.util.URI fileURI)
This method will convert the file URI to platform URI if the file is part of workspace resource

Parameters:
fileURI -
Returns:
platform URI if the file is part of workspace resource, otherwise null.