Skip to main content



      Home
Home » Eclipse Projects » GEF » Added new figures to the diagram.
Added new figures to the diagram. [message #158529] Thu, 18 November 2004 14:21 Go to next message
Eclipse UserFriend
Originally posted by: jsk_lam.hotmail.com

Hi,

I have a model which contains a hierarchy structure of nodes. Everything
works fine if I create
all the node objects in the method
AbstractEditorPage#createGraphicalViewer() and the GEF
EditPartFactory#createEditorPart() will eventually be invoked to create the
edit part for all the
nodes.

But the diagram is so complex, I would like to only create the first level
of nodes and let the
user click on a specific node and expand it to show all the children nodes.
In this case, I do
not create all the nodes in the AbstractEditorPage#createGraphicalViewer(),
and only add
those children nodes to the diagram when the parent node is expanded.

I only call GraphicalViewer.setContents(diagram) in
AbstractEditorPage#createGraphicalViewer()
when the editor page is first loaded. How do I added those new children
nodes to my diagram
and invoke the EditPartFactory#createEditorPart() to create the
editparts/figures for those new
nodes? By the way, I am not using any palette at all.

Thanks
slam
Re: Added new figures to the diagram. [message #159134 is a reply to message #158529] Mon, 22 November 2004 16:44 Go to previous message
Eclipse UserFriend
getModelChildren() should return an empty list when the node is collapsed,
and the actual children when the node is expanded. You'll have to invoke
refreshChildren() when a node is collapsed/expanded.

"slam" <jsk_lam@hotmail.com> wrote in message
news:cnisov$r5m$1@www.eclipse.org...
> Hi,
>
> I have a model which contains a hierarchy structure of nodes. Everything
> works fine if I create
> all the node objects in the method
> AbstractEditorPage#createGraphicalViewer() and the GEF
> EditPartFactory#createEditorPart() will eventually be invoked to create
the
> edit part for all the
> nodes.
>
> But the diagram is so complex, I would like to only create the first level
> of nodes and let the
> user click on a specific node and expand it to show all the children
nodes.
> In this case, I do
> not create all the nodes in the
AbstractEditorPage#createGraphicalViewer(),
> and only add
> those children nodes to the diagram when the parent node is expanded.
>
> I only call GraphicalViewer.setContents(diagram) in
> AbstractEditorPage#createGraphicalViewer()
> when the editor page is first loaded. How do I added those new children
> nodes to my diagram
> and invoke the EditPartFactory#createEditorPart() to create the
> editparts/figures for those new
> nodes? By the way, I am not using any palette at all.
>
> Thanks
> slam
>
>
Previous Topic:can't get Rulers to correctly show centimeters and inches
Next Topic:how to create a line editpart?
Goto Forum:
  


Current Time: Tue Jul 08 02:15:38 EDT 2025

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

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

Back to the top