Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » Showing GEF editor on a SWT composite
Showing GEF editor on a SWT composite [message #243307] Sat, 31 May 2008 12:05 Go to next message
Eclipse UserFriend
Originally posted by: clandestinesnehal.gmail.com

Hi All,
I want to show a GEF editor on a SWT composite. Is it feasible?

I was able to show GraphicalViewer on a SWT composite. But i dont know
if showing GEF editor on a SWT composite is possible.

This is how i was able to show the GraphicalViewer on a SWT composite.

ScrollingGraphicalViewer leftViewer = new ScrollingGraphicalViewer();
leftViewer.createControl(acmeCompareSection); //acmeCompareSection is a
SWT composite
leftViewer.setRootEditPart(new ScalableFreeformRootEditPart());
leftViewer.getControl().setBackground(ColorConstants.white);
leftViewer.setEditPartFactory(getEditPartFactory());
leftViewer.setContents(getContent());


Any help will be appreciated!

Thanks,
Snehal
Re: Showing GEF editor on a SWT composite [message #243544 is a reply to message #243307] Wed, 11 June 2008 15:37 Go to previous message
Eclipse UserFriend
Originally posted by: javier.roca.planningforce.com

Hello Snehal,

I'd like to know if you have found a workaround for this? In my case,
I'm working with GMF and also I was able to show a
DiagramGraphicalViewer inside a SWT composite (by using the same
technique you indicate). However, I've also found a "dirty" way of
"moving" a GMF editor (in your case GEF) to a composite by changing the
parent or the existent editor created in a WorkbenchPage to a new parent
(your composite), simply use getControl.setParent(acmeCompareSection) in
your case). This "dirty" way works but indeed is not a good practice
given the fact the WorkBenchPage is still there and of course has
"weird" effects as expected.

It seems everybody uses the GEF/GMF editors withing WorkbenchPages.,
maybe some RCP guru can explain us how to put an EditorPart inside a
composite instead of a Workbenchpage....

Regards,

Snehal wrote:
> Hi All, I want to show a GEF editor on a SWT composite. Is it
> feasible?
>
> I was able to show GraphicalViewer on a SWT composite. But i dont
> know if showing GEF editor on a SWT composite is possible.
>
> This is how i was able to show the GraphicalViewer on a SWT
> composite.
>
> ScrollingGraphicalViewer leftViewer = new ScrollingGraphicalViewer();
> leftViewer.createControl(acmeCompareSection); //acmeCompareSection
> is a SWT composite leftViewer.setRootEditPart(new
> ScalableFreeformRootEditPart());
> leftViewer.getControl().setBackground(ColorConstants.white);
> leftViewer.setEditPartFactory(getEditPartFactory());
> leftViewer.setContents(getContent());
>
>
> Any help will be appreciated!
>
> Thanks, Snehal
Previous Topic:Add a GEF figures to the Multi page editor
Next Topic:fillPath() in ScaledGraphics
Goto Forum:
  


Current Time: Wed Oct 17 20:18:47 GMT 2018

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

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

Back to the top