Example usage for javafx.beans.binding Bindings equal

List of usage examples for javafx.beans.binding Bindings equal

Introduction

In this page you can find the example usage for javafx.beans.binding Bindings equal.

Prototype

public static BooleanBinding equal(Object op1, final ObservableObjectValue<?> op2) 

Source Link

Document

Creates a new javafx.beans.binding.BooleanBinding that holds true if the value of an javafx.beans.value.ObservableObjectValue is equal to a constant value.

Usage

From source file:org.sleuthkit.autopsy.imagegallery.gui.navpanel.GroupTree.java

@FXML
@Override// ww w  .  ja  v  a 2  s. c om
@NbBundle.Messages({ "GroupTree.displayName.allGroups=All Groups" })
void initialize() {
    super.initialize();
    setText(Bundle.GroupTree_displayName_allGroups());
    setGraphic(new ImageView("org/sleuthkit/autopsy/imagegallery/images/Folder-icon.png")); //NON-NLS

    getBorderPane().setCenter(groupTree);

    //only show sorting controls if not grouping by path
    BooleanBinding groupedByPath = Bindings.equal(getGroupManager().getGroupByProperty(),
            DrawableAttribute.PATH);
    getToolBar().visibleProperty().bind(groupedByPath.not());
    getToolBar().managedProperty().bind(groupedByPath.not());

    GroupCellFactory groupCellFactory = new GroupCellFactory(getController(), comparatorProperty());
    groupTree.setCellFactory(groupCellFactory::getTreeCell);
    groupTree.setShowRoot(false);

    getGroupManager().getAnalyzedGroups()
            .addListener((ListChangeListener.Change<? extends DrawableGroup> change) -> {
                while (change.next()) {
                    change.getAddedSubList().stream().forEach(this::insertGroup);
                    change.getRemoved().stream().forEach(this::removeFromTree);
                }
                sortGroups();
            });

    for (DrawableGroup g : getGroupManager().getAnalyzedGroups()) {
        insertGroup(g);
    }
    sortGroups();
}