Example usage for javafx.scene.control TreeTableView getRoot

List of usage examples for javafx.scene.control TreeTableView getRoot

Introduction

In this page you can find the example usage for javafx.scene.control TreeTableView getRoot.

Prototype

public final TreeItem<S> getRoot() 

Source Link

Document

Returns the current root node of this TreeTableView, or null if no root node is specified.

Usage

From source file:org.eclipse.jubula.rc.javafx.tester.adapter.TreeTableOperationContext.java

/**
 * Creates a new instance.//from w w w  .j a  va2 s .c o  m
 *
 * @param queuer
 *            The queuer
 * @param robot
 *            The Robot
 * @param treeTable
 *            The treeTable
 */
public TreeTableOperationContext(IEventThreadQueuer queuer, IRobot robot, TreeTableView<?> treeTable) {
    super(queuer, robot, treeTable);
    Validate.notNull(treeTable.getRoot());
}

From source file:org.eclipse.jubula.rc.javafx.tester.adapter.TreeTableOperationContext.java

@Override
public Object[] getRootNodes() {
    Object[] result = EventThreadQueuerJavaFXImpl.invokeAndWait("getRootNodes", new Callable<Object[]>() { //$NON-NLS-1$

        @Override//from   w  ww .  j a  va 2  s.com
        public Object[] call() throws Exception {
            TreeTableView<?> tree = getTree();

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

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