Example usage for javax.swing JTree isRootVisible

List of usage examples for javax.swing JTree isRootVisible

Introduction

In this page you can find the example usage for javax.swing JTree isRootVisible.

Prototype

public boolean isRootVisible() 

Source Link

Document

Returns true if the root node of the tree is displayed.

Usage

From source file:org.eclipse.jubula.rc.swing.tester.util.TreeOperationContext.java

/**
 * {@inheritDoc}/*from   w w w .  ja v  a2 s .c o m*/
 */
public Object[] getRootNodes() {
    JTree tree = (JTree) getTree();

    // If the root is visible, just return that.
    if (tree.isRootVisible()) {
        return new Object[] { tree.getModel().getRoot() };
    }

    // If the root is not visible, return all direct children of the 
    // non-visible root.
    return getChildren(tree.getModel().getRoot());
}