Java Code Examples for org.eclipse.emf.common.CommonPlugin#resolve()

The following examples show how to use org.eclipse.emf.common.CommonPlugin#resolve() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: URIUtils.java    From n4js with Eclipse Public License 1.0 5 votes vote down vote up
/** Converts any emf URI to a file URI */
public static URI toFileUri(URI rUri) {
	URI fileUri = rUri;
	if (!rUri.isFile()) {
		fileUri = CommonPlugin.resolve(rUri);
	}
	return addEmptyAuthority(fileUri);
}
 
Example 2
Source File: PapyrusModelCreator.java    From txtUML with Eclipse Public License 1.0 5 votes vote down vote up
/**
 * Gets an IFile from the given String path
 * @param path - The path of the File
 * @return - The File
 */
private IFile fileFromPath(String path){
	URI FileURI =  URI.createFileURI(path);
	URI resolvedFile = CommonPlugin.resolve(FileURI);
	IFile file = ResourcesPlugin.getWorkspace().getRoot().getFile(new Path(resolvedFile.toFileString()));
	return file;
}
 
Example 3
Source File: TxtUMLExporter.java    From txtUML with Eclipse Public License 1.0 5 votes vote down vote up
/**
 * Creates a Visualizer with the correct settings
 * 
 * @param layoutDescriptor
 * @return The Visualizer
 */
public PapyrusVisualizer createVisualizer(TxtUMLLayoutDescriptor layoutDescriptor) {
	URI umlFileURI = URI.createFileURI(projectName + "/" + this.outputFolder + "/" + this.txtUMLModelName + ".uml");
	URI UmlFileResURI = CommonPlugin.resolve(umlFileURI);
	IFile UmlFile = ResourcesPlugin.getWorkspace().getRoot()
			.getFile(new org.eclipse.core.runtime.Path(UmlFileResURI.toFileString()));

	PapyrusVisualizer pv = new PapyrusVisualizer(projectName, this.outputFolder + "/" + this.txtUMLModelName,
			UmlFile.getRawLocationURI().toString(), layoutDescriptor);
	return pv;
}