Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » Get domain model file in RPC Editor
Get domain model file in RPC Editor [message #234277] Fri, 19 June 2009 14:54 Go to next message
Patrick Schmitt is currently offline Patrick SchmittFriend
Messages: 87
Registered: July 2009
Member
Hello,
i need the domain model file of my diagram.

Getting the diagram file is no problem, also tried several ways as
described for example in
http://dev.eclipse.org/newslists/news.eclipse.modeling.gmf/m sg06592.html
or
http://dev.eclipse.org/newslists/news.eclipse.modeling.gmf/m sg18664.html
to get the domain model file.

But the Problem is that e.g.
WorkspaceSynchronizer.getFile(diagram.getElement().eResource ()) always
returns null.

I think the problem could be that in a RCP Editor i have no real workspace
with projects and files unedr control.

Does anybody know a way to get the domain model file in a stand alone
editor ?

Kind Regards
Patrick
Re: Get domain model file in RPC Editor [message #234297 is a reply to message #234277] Fri, 19 June 2009 15:27 Go to previous message
Patrick Schmitt is currently offline Patrick SchmittFriend
Messages: 87
Registered: July 2009
Member
Sorry, looks like I was the whole afternoon running in a cycle.

The solution is quite simple, just didnt find it :(

Here is the way now to get the domain model file:
IWorkbenchPage page =
PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActi vePage();
IEditorPart part = page.getActiveEditor();

if(part instanceof YourDiagrammEditor)
{
YourDiagrammEditor dslPart = (YourDiagrammEditor)part;
Diagram d = dslPart.getDiagram();
Resource res = d.getElement().eResource();
String pathToFile= res.getURI().devicePath();
}
Previous Topic:Getting editpart in DiagramEditor file
Next Topic:"Invalid view - remove from diagram" on diagrams created with older GMF opened in latest G
Goto Forum:
  


Current Time: Thu Apr 25 01:40:47 GMT 2024

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

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

Back to the top