Best approach for viewer creation ? [message #166465] |
Tue, 01 February 2005 07:55 |
Eclipse User |
|
|
|
Originally posted by: no.mail.please
Hi !
I made my gef editor starting from the IBM GEF Redbook. It creates the
viewer in the createPartControl method (graphicalViewer =
createGraphicalViewer(parent)) and in the createGraphicalViewer method.
It also configures and initializes the viewer in this method.
Recently I found the latest example (ShapeDiagram) and was surprised the
way the author configures and initializes its viewer : he uses
configureGraphicalViewer and initializeGraphicalViewer to do the job
(and no createPartControl).
Both work fine but which is the recommended approach ? I guess this is
the ShapeDiagram Editor's one cause it is the most recent example, isn't
it ?
--
Arnaud
|
|
|
Re: Best approach for viewer creation ? [message #166473 is a reply to message #166465] |
Tue, 01 February 2005 08:00 |
Eclipse User |
|
|
|
Originally posted by: no.mail.please
OK, I found the answer myself ... stupid question ! I didn't notice the
ShapeDiagram Editor extended GraphicalEditorWithFlyoutPalette, so the
"original" methods are in this class.
protected void createGraphicalViewer(Composite parent) {
GraphicalViewer viewer = new ScrollingGraphicalViewer();
viewer.createControl(parent);
setGraphicalViewer(viewer);
configureGraphicalViewer();
hookGraphicalViewer();
initializeGraphicalViewer();
}
--
Arnaud
|
|
|
Powered by
FUDForum. Page generated in 0.03468 seconds