Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » To fetch the absolute path of .mdzip file(Magicdraw project) opened in Eclipse editor
To fetch the absolute path of .mdzip file(Magicdraw project) opened in Eclipse editor [message #495492] Thu, 05 November 2009 05:34
Abhinav Mishra is currently offline Abhinav Mishra
Messages: 10
Registered: November 2009
Junior Member
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 succeed.

1. 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.

2. 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 class.


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

[Updated on: Sat, 07 November 2009 18:03]

Report message to a moderator

Previous Topic:Problem Working with shared directory files [Windows]
Next Topic:how to achieve eclipse "Properties" view similar with Web search
Goto Forum:
  


Current Time: Wed Sep 17 07:37:12 GMT 2014

Powered by FUDForum. Page generated in 0.12635 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software