[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[news.eclipse.tools.gef] Re: Added new figures to the diagram.

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@xxxxxxxxxxx> wrote in message
news:cnisov$r5m$1@xxxxxxxxxxxxxxxxxx
> 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
>
>