|
Re: How to interact with CNF (Common Navigator Framework) and Editor [message #671417 is a reply to message #671212] |
Tue, 17 May 2011 19:33 |
|
Hi Chaitanya,
Look at my suggestions below
1. Loading Model: Override the setInput method and as you have access input to the editor input you can use the same for getting file from the editor input(by casting it to IFileEditorinput). Once you have the file you can implement your own logic to load the model from file.
2. Handling Save: Editor can be saved only when it is modified i.e in dirty state. You need to use command stack for modifying the model. Finally implement the dosave method.
Have a look at the shapes example plugin (File->New-> Gef Plugins ->Shapes) you will get a better idea.
Look for the following methods in ShapesEditor
1. Loading Model:
org.eclipse.gef.examples.shapes.ShapesEditor.setInput(IEdito rInput)
org.eclipse.gef.examples.shapes.ShapesEditor.initializeGraph icalViewer()
2. Save action :
org.eclipse.gef.examples.shapes.ShapesEditor.commandStackCha nged(EventObject)
org.eclipse.gef.examples.shapes.ShapesEditor.doSave(IProgres sMonitor)
Hope this helps you.
Regards,
Prasad
Regards,
Prasad
http://marketplace.eclipse.org/user/9964/listings
|
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.02129 seconds