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 06:26 Go to next message
cloud wang is currently offline cloud wang
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] Thu, 04 June 2009 22:19 Go to previous message
Alex Boyko is currently offline Alex Boyko
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: Fri Jul 25 05:01:54 EDT 2014

Powered by FUDForum. Page generated in 0.02310 seconds