How to use GEF in RCP. [message #235237] |
Thu, 07 June 2007 10:17 |
Eclipse User |
|
|
|
Originally posted by: chaitannyam.yahoo.co.uk
Hello everyone....
I wanted to use GEF in my RCP application and there was this link which showed how to do this.. but i couldn't figure out what the auther wanted to say ...
<b>"The conversion of the shapes example into an RCP-based application is a lot simpler than most people think. The problem stems from the setInput method of ShapesEditor expecting an IEditorInput, but the most familiar editor input people work with is IFileEditorInput. The problem with IFileEditorInput is that it belongs to the pesky org.eclipse.ui.ide plugin which is not an acceptable dependency for an RCP-based application. The solution to this problem is to simply create our own editor input, ShapesEditorInput which implements the IEditorInput interface via IPathEditorInput interface. Once this change is completed and the setInput method is properly changed in ShapesEditor to use ShapesEditorInput, we can now properly open a shapes editor. Note, the sole purpose of this example is to demonstrate how to get a GEF editor inside of an RCP application, it doesn't include support for various actions such as saving or wizards (I leave this for the reader to explore).
"</b>
Here is the link www.eclipse.org/articles/Article-GEF-EMF/gef-emf.html
Anyways if anyone knows how to do it... please let me know the procedure.
|
|
|
|
|
|
Re: How to use GEF in RCP. [message #235386 is a reply to message #235380] |
Mon, 11 June 2007 14:12 |
Eclipse User |
|
|
|
Originally posted by: apexgroup07.gmail.com
Hello,
1. Enable the editor in your perspective class using: layout.setEditorAreaVisible(true);
2. The entry of editor should be there in the plugin.xml.
3. Now you can open the editor using
PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActi vePage().openEditor(editorInput, "ID");
Here you need to create editor input class for your self. you can do it by extending IStorageEditorInput class.
The same editor input you will get in the protected void setInput(IEditorInput input) method of your editor. Here you can extract your desired information from the input and set into the editor.
It is not a difficult task. once you will try it will take only 5-10 min to do it.
Regards
Rohit
|
|
|
|
Powered by
FUDForum. Page generated in 0.03758 seconds