eclipse-gmf

GMF display diagram example

二次信任 提交于 2019-12-11 11:35:49
问题 How can I display a GMF diagram, with the file format "*.ecorediag" in Eclipse in a View? The diagram should not be editable. Is there a simple sample view that loads a diagram from say "/home/diagrams/test.ecorediag" 回答1: The GMF diagrams (including ecorediag) are rendered on the editor with the help of "org.eclipse.gmf.runtime.diagram.ui.parts.DiagramGraphicalViewer". So the bare minimum code to make this work DiagramGraphicalViewer viewer = new DiagramGraphicalViewer(); viewer

Create GMF diagram programmatically

旧时模样 提交于 2019-12-10 00:03:32
问题 I trying to create one simple diagram using EMF & GMF in Eclipse plug-ins. I have created one Ecore with two node & connection. I am able to generate GMF out of that. When I run my application I am getting the palate and with the help of that I am able to draw the GMF diagram. But I want that programmatically. I have created one XML out of that Ecore and successfully able to load that XML into the EMF object. So my EObject is having that XML values. Now I want a GMF diagram out of that

Create GMF diagram programmatically

只愿长相守 提交于 2019-12-04 23:17:11
I trying to create one simple diagram using EMF & GMF in Eclipse plug-ins. I have created one Ecore with two node & connection. I am able to generate GMF out of that. When I run my application I am getting the palate and with the help of that I am able to draw the GMF diagram. But I want that programmatically. I have created one XML out of that Ecore and successfully able to load that XML into the EMF object. So my EObject is having that XML values. Now I want a GMF diagram out of that automatically. like with the opening of one sample RCP view it should load the GMF content. The problem is

How to get the project name in eclipse?

寵の児 提交于 2019-11-28 11:59:16
How do I get the name of the current eclipse project? I'm in a GMF view and need the projectname when some submenu of the popup menu ist used. This GMF class has a straightforward answer, if you have access to the ResourcesPlugin name: IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject(myBundleName); The generic answer (from a potentially outdated code ) could be like (if you have an editor opened): IEditorPart editorPart = getSite().getWorkbenchWindow().getActivePage().getActiveEditor(); if(editorPart != null) { IFileEditorInput input = (IFileEditorInput)editorPart

How to get the project name in eclipse?

ぃ、小莉子 提交于 2019-11-27 06:40:09
问题 How do I get the name of the current eclipse project? I'm in a GMF view and need the projectname when some submenu of the popup menu ist used. 回答1: This GMF class has a straightforward answer, if you have access to the ResourcesPlugin name: IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject(myBundleName); The generic answer (from a potentially outdated code) could be like (if you have an editor opened): IEditorPart editorPart = getSite().getWorkbenchWindow().getActivePage(