Example usage for javafx.collections.transformation FilteredList getPredicate

List of usage examples for javafx.collections.transformation FilteredList getPredicate

Introduction

In this page you can find the example usage for javafx.collections.transformation FilteredList getPredicate.

Prototype

public final Predicate<? super E> getPredicate() 

Source Link

Usage

From source file:caillou.company.clonemanager.gui.customComponent.results.ResultController.java

private void filterList(FilteredList<GUIApplicationFile> fileListFiltered) {
    this.mainPredicate.clear();
    if (mainModel.getTaskModel().getCurrentTask().equals(TaskModel.TASK.DETECT_DOUBLONS)) {
        if (hideSingleFileId.selectedProperty().get()) {
            AlonePredicate alonePredicate = new AlonePredicate();
            this.mainPredicate.add(alonePredicate);
        }//  w w w.  j  a  v a 2  s .co m
    }
    if (filterTextFieldId.textProperty().get() != null && !filterTextFieldId.textProperty().get().equals("")) {
        PathPredicate pathPredicate = new PathPredicate();
        pathPredicate.setPath(filterTextFieldId.textProperty().get());
        if (pathFilterTypeId.valueProperty().get().equals(startWithValueId)) {
            pathPredicate.setCurrentType(PathPredicate.TYPE.STARTWITH);
        }
        if (pathFilterTypeId.valueProperty().get().equals(containsValueId)) {
            pathPredicate.setCurrentType(PathPredicate.TYPE.CONTAINS);
        }
        if (pathFilterTypeId.valueProperty().get().equals(endWithValueId)) {
            pathPredicate.setCurrentType(PathPredicate.TYPE.ENDWITH);
        }
        this.mainPredicate.add(pathPredicate);
    }
    fileListFiltered.setPredicate(fileListFiltered.getPredicate().and(mainPredicate));
}