How to add ScrollingGraphicalViewer to Formpage [message #249192] |
Thu, 04 June 2009 06:26  |
Eclipse User |
|
|
|
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  |
Eclipse User |
|
|
|
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
|
|
|
Powered by
FUDForum. Page generated in 0.03097 seconds