Showing GEF editor on a SWT composite [message #243307] |
Sat, 31 May 2008 12:05 ![Go to next message Go to next message](theme/Solstice/images/down.png) |
Eclipse User![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=) |
|
|
|
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 Go to previous message](theme/Solstice/images/up.png) |
Eclipse User![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=) |
|
|
|
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
|
|
|
Powered by
FUDForum. Page generated in 0.03655 seconds