Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » How to add ScrollingGraphicalViewer to Formpage
How to add ScrollingGraphicalViewer to Formpage [message #249192] Thu, 04 June 2009 10:26 Go to next message
cloud wang is currently offline cloud wangFriend
Messages: 3
Registered: July 2009
Junior Member
Hi all:
I want to embed a ScrollingGraphicalViewer viewer into a FormPage so
that the viewer occupies the available space. To this end, I do the
following:

protected void createFormContent(IManagedForm managedForm) {
Composite container = toolkit.createComposite(scrolledForm.getBody());
container.setLayout(new GridLayout(1,true));
// viewer
ScrollingGraphicalViewer viewer = new ScrollingGraphicalViewer();
Control viewerControl = viewer.createControl(container);
Diagram diagram = new Diagram();
Ellipse ellipse = new Ellipse();
ellipse.setLocation(new Point(150, 50));
diagram.addChild(ellipse);
viewer.setContents(diagram);
viewerControl.setLayoutData(new GridData(GridData.FILL_BOTH));
}

But when I run the application, nothing in the formpage. Anybody can
help me to solve this problem?

Thanks for any pointers.

Cloud
Re: How to add ScrollingGraphicalViewer to Formpage [message #249205 is a reply to message #249192] Fri, 05 June 2009 02:19 Go to previous message
Alex Boyko is currently offline Alex BoykoFriend
Messages: 200
Registered: July 2009
Senior Member
Hi,

Did you set the editpart factory for the viewer? Did you create the root
editpart? I don't see that in your snippet.
If that doesn't help debug the #setContents(), check that editparts and
figures are created. IF yes, put a breakpoint in the ellipse figure paint
method or diagram figure paint method... check if they are being painted
and where...
Hope this helps.

Cheers,
Alex
Previous Topic:[Draw2D] Mouse Down in StackLayout - reaching "lower" pane
Next Topic:Problem running the Editor for Directed Graphs as RCP application
Goto Forum:
  


Current Time: Wed Apr 24 23:23:17 GMT 2024

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

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

Back to the top