"I need to fetch the absolute file path of any .mdzip file opened in Eclipse editor. The MDZIP file corresponds to a Magicdraw project which can be opened in Eclipse after integrating the Magicdraw plugin into Eclipse.
Normally, the path of opened file in Editor can be fetched by using: FileStoreEditorInput fipp = (FileStoreEditorInput) page.getActiveEditor().getEditorInput(); path = (new File(fipp.getURI())).getAbsolutePath();
But in case of an MDZIP file, several diagram files are opened in the editor. I have tried to get path from such a diagram file by using following work-arounds not didn't succeeded.
Simply using the above code gives typecasting error because these diagram files ar not of type 'FileStoreEditorInput' but are of type 'DiagramEditorInput'. So, getEditorInput() function gives error on typecasting. Actually the Magicdraw plugin uses another Editor (DiagramEditorInput) for these diagrams.
So I tried to use the jar file 'md_eclipse_api.jar' which is used by Magicdraw by making a separate plugin project and use it in my project as dependency. My intension was to make use of its class 'DiagramEditorInput' to typecast the page.getActiveEditor().getEditorInput(); into 'DiagramEditorInput'. But in this way I always get an error 'No class Def found error' for DiagramEditorInput.
I am not able to find out what I am missing in method (2).
Also, is it possible to get such MDZIP file path by using some other method.
Thanks in advance, Abhinav"