Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » Graphical Editor in Form Editor
Graphical Editor in Form Editor [message #555580] Fri, 27 August 2010 09:08 Go to next message
Hugo A. Garcia is currently offline Hugo A. GarciaFriend
Messages: 258
Registered: July 2009
Senior Member
Hi

I am building a Form Editor and would like one of the pages to be the
graphical editor.

Is there an example on how to do this?

-H
Re: Graphical Editor in Form Editor [message #556159 is a reply to message #555580] Tue, 31 August 2010 07:19 Go to previous message
Hugo A. Garcia is currently offline Hugo A. GarciaFriend
Messages: 258
Registered: July 2009
Senior Member
On 08/27/2010 11:08 AM, Hugo A. Garcia wrote:
> Hi
>
> I am building a Form Editor and would like one of the pages to be the
> graphical editor.
>
> Is there an example on how to do this?
>
> -H

Solution

Starting from the RCP of the generated GMF edtior:

Add the Coommon Navigator framework in order to test opening and
creating files.

Creeate a new form editor and add the contributer class, matching
strategy and the extension from the GMF edtior difinition.

Follow the following from the article "Integrating EMF and GMF Generated
Editors":

Wrapp the FileEditorInput as described in the section "Editor Input,
revised"

add the getWrappedInput() as explained in the section "Extending the
Editor Input" to your FormEdtior subclass and add the GMF page using:

edtior = new YourDiagramEditor();
IEditorInput input = getWrappedInput();
pageIndex = addPage(edtior, input);

and at least it will show in the page.

Still to implement the saving and dirty states but this will get you
started.

-H
Previous Topic:Context menu show with handle connection
Next Topic:Advanced topic: perform operations on diagram without opening the workbench
Goto Forum:
  


Current Time: Fri Apr 26 07:03:06 GMT 2024

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

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

Back to the top