Example usage for javafx.beans.binding BooleanBinding not

List of usage examples for javafx.beans.binding BooleanBinding not

Introduction

In this page you can find the example usage for javafx.beans.binding BooleanBinding not.

Prototype

public BooleanBinding not() 

Source Link

Document

Creates a new BooleanExpression that calculates the negation of this BooleanExpression .

Usage

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

@FXML
@Override//from  ww  w.ja va  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();
}