|
|
|
Re: Getting a path to a file when right clicked [message #648134 is a reply to message #647252] |
Tue, 11 January 2011 11:48 |
Haffi Messages: 39 Registered: November 2010 |
Member |
|
|
I've found the solution to the problem so if it can benefit anyone else, here is the code for getting the URI of the file:
IWorkbenchPage activePage = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
CoreMultiDiagramEditor activeEditor = (CoreMultiDiagramEditor)activePage.getActiveEditor();
EObject model = (EObject)activeEditor.getDiagramEditPart().getModel();
URI uri = model.eResource().getURI();
Path pathToDiagram = new Path(uri.toPlatformString(false));
[Updated on: Tue, 11 January 2011 11:49] Report message to a moderator
|
|
|
Powered by
FUDForum. Page generated in 0.02592 seconds