Added new figures to the diagram. [message #158529] |
Thu, 18 November 2004 14:21  |
Eclipse User |
|
|
|
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  |
Eclipse User |
|
|
|
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
>
>
|
|
|
Powered by
FUDForum. Page generated in 0.93658 seconds