List of usage examples for javafx.beans.value ObservableValue addListener
void addListener(ChangeListener<? super T> listener);
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);/*ww w .ja v a 2 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; }