OutlineView Expanding nodes

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

OutlineView Expanding nodes

wAysen

Hi,

 

I want to expand all nodes in an OutlineView, but so far my attempts failed.

I tried it using the code below, which I called in the constructor, right after I set the root context of the ExplorerManager:

 

 private void expandAll() {

        Node node = explorerManager.getRootContext();

        ((OutlineView) outlineView).expandNode(node);

    }

 

    public void expandAll(Node node) {

        if (node == null) {

            return;

        }

        ((OutlineView) outlineView).expandNode(node);

        for (Node child : node.getChildren().getNodes(true)) {

            expandAll(child);

        }

    }

 

 

I uploaded a minimal example to github:

https://github.com/mthOne/examples

 

Maybe someone can take a look at this and tell me, what I´m doing wrong here?

 

Thanks in advance,

Marco

 

 


Rovema GmbH
Industriestr. 1, 35463 Fernwald, Germany
Geschäftsführung:
Thomas Becker, Sprecher der Geschäftsführung
Ralf Buch
Handelsreg.-Eintrag: Amtsger. Gießen, HRB 8551