|
|
|
|
|
|
|
Re: Resolving Crossreferences in Eclipse context [message #986271 is a reply to message #985460] |
Mon, 19 November 2012 11:48  |
Eclipse User |
|
|
|
I got it...
Here's something for others that have this problem:
To get the resourceSet from a URI:
IResourceSet resourceSet = null;
if (resourceSetProvider != null) {
IWorkspace workspace = ResourcesPlugin.getWorkspace();
String s = uri.isPlatformResource() ? uri.toPlatformString(true) : uri.toString();
IPath path = new Path(s);
IResource resource = workspace.getRoot().getFile(path);
IProject project = null == resource ? null : resource.getProject();
resourceSet = resourceSetProvider.get(project==null?);
}else{
resourceSet = new ResourceSetImpl();
}
The ResourceSetProvider can be initialized by Guice. By supplying (optional = true) it will be null when running standalone, thus explaining the if-clause above.
(optional = true)
IResourceSetProvider resourceSetProvider;
If this solution is stupid, please tell me...
|
|
|
Powered by
FUDForum. Page generated in 0.08627 seconds