Example usage for javafx.scene.control TreeView TreeView

List of usage examples for javafx.scene.control TreeView TreeView

Introduction

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

Prototype

public TreeView() 

Source Link

Document

Creates an empty TreeView.

Usage

From source file:net.sourceforge.pmd.util.fxdesigner.util.controls.TreeViewWrapper.java

private void initialiseTreeViewReflection() {

    // we can't use wrapped.getSkin() because it may be null.
    // we don't care about the specific instance, we just want the class
    @SuppressWarnings("PMD.UselessOverridingMethod")
    Skin<?> dftSkin = new TreeView<Object>() {
        @Override//from   w  w w  .j av  a  2  s. c  om
        protected Skin<?> createDefaultSkin() {
            return super.createDefaultSkin();
        }
    }.createDefaultSkin();

    Object flow = getVirtualFlow(dftSkin);

    if (flow == null) {
        return;
    }

    treeViewFirstVisibleMethod = MethodUtils.getMatchingMethod(flow.getClass(), "getFirstVisibleCell");
    treeViewLastVisibleMethod = MethodUtils.getMatchingMethod(flow.getClass(), "getLastVisibleCell");
}

From source file:acmi.l2.clientmod.xdat.Controller.java

private TreeView<Object> createTreeView(Field listField, ObservableValue<String> filter) {
    TreeView<Object> elements = new TreeView<>();
    elements.setShowRoot(false);//from  w ww. j av a2  s  .c o  m
    elements.setContextMenu(createContextMenu(elements));

    InvalidationListener treeInvalidation = (observable) -> buildTree(editor.xdatObjectProperty().get(),
            listField, elements, filter.getValue());
    editor.xdatObjectProperty().addListener(treeInvalidation);
    xdatListeners.add(treeInvalidation);

    filter.addListener(treeInvalidation);

    return elements;
}