| Graphiti as RCP [message #1059920] |
Wed, 22 May 2013 04:00  |
Andrej K Messages: 16 Registered: March 2013 Location: germany |
Junior Member |
|
|
Hello!
I've build kind of prototype Editor with Graphiti, where I tried out how this and that works and what is possible.
Now i want to build my prototype in existing or leastwise as new RCP application. I'm new at RCP.
I have an RCP application with a menu where i should load my editor in my running rcp. (This menu works, i can write into console if I press this menu).
I made an extension in graphiti editor and extension in my RCP application + few dependencies to graphiti editor and graphiti self like: org.eclipse.graphiti
My question is how can I open my graphiti editor in rcp application? I had red this post:
http://satreth.blogspot.ch/2011/08/using-graphiti-in-eclipse-rcp.html
(but it don't really works or I'm using it wrong)
closely to say „opening a diagram", but "DiagramEditorFactory" doesn't work anymore (has been renamed to DiagramEditorInputFactory)
Can somebody give me an idea or code snippet how i can open my editor in/as RCP application? Unfortunately i find through internet investigation just this code snippet
Thanks in advance,
Andrej K
|
|
|
| Re: Graphiti as RCP [message #1059963 is a reply to message #1059920] |
Wed, 22 May 2013 07:26   |
Andrej K Messages: 16 Registered: March 2013 Location: germany |
Junior Member |
|
|
for now my code is looking like this:
public Object execute(ExecutionEvent event) throws ExecutionException {
System.out.println("trying to open Graphiti Editor");
File f = new File("C:\\...\\myDiagram.diagram");
IPath ipath = new Path(f.getAbsolutePath());
IFileStore fileLocation = EFS.getLocalFileSystem().getStore(ipath);
FileStoreEditorInput input = new FileStoreEditorInput(
fileLocation);
IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
try {
page.openEditor(input, "org.eclipse.graphiti.ui.editor.DiagramEditor");
} catch (PartInitException e) {
e.printStackTrace();
}
return null;
}
myDiagram.diagram was created with graphiti editor
I get NullPointerException in my try-catch block
what I'm doing wrong to open the editor?
Thanks in advance,
Andrej K
[Updated on: Wed, 22 May 2013 07:27] Report message to a moderator
|
|
|
|
|
|
|
| Re: Graphiti as RCP [message #1060576 is a reply to message #1060354] |
Mon, 27 May 2013 03:03   |
Andrej K Messages: 16 Registered: March 2013 Location: germany |
Junior Member |
|
|
Hello!
Have one more question, how can I "say" to my RCP application that I saved my graphiti editor?
I've extended DiagramEditor and overwritten doSave method and would to say to my rcp-application that i saved my/this diagram.
I've tried to Export an package which a class which i want to call at graphiti and imported this class in my graphiti project, but i get a cycle
How i should procedure?
Thanks in advance,
Andrej K
[Updated on: Mon, 27 May 2013 04:02] Report message to a moderator
|
|
|
| Re: Graphiti as RCP [message #1060766 is a reply to message #1060576] |
Tue, 28 May 2013 07:45  |
Michael Wenz Messages: 1275 Registered: July 2009 Location: Walldorf, Germany |
Senior Member |
|
|
Andrej,
not sure if that is what you mean: if you want the '*' on the editor tab to
disappear after saving, that is controlled in the editor's isDirty method.
Returning false there will hide the *. A call to that method should be
triggered after saving by firing a prop-dirty-event (simply call
firePropertyChange(IEditorPart.PROP_DIRTY) on your editor). The default save
implementation does exactly that.
Michael
|
|
|
Powered by
FUDForum. Page generated in 0.01806 seconds