Example usage for javafx.collections.transformation SortedList SortedList

List of usage examples for javafx.collections.transformation SortedList SortedList

Introduction

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

Prototype

public SortedList(@NamedArg("source") ObservableList<? extends E> source) 

Source Link

Document

Constructs a new unordered SortedList wrapper around the source list.

Usage

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

@Override
public void initialize(URL location, ResourceBundle resources) {
    this.guiApplicationFileListFiltered = new FilteredList<>(guiApplicationFileList);
    this.initializePhaseAutomaticResizing();
    this.initializeContextDependant();

    SortedList<GUIApplicationFile> sortedList = new SortedList<>(guiApplicationFileListFiltered);
    // Bind the SortedList comparator to the TableView comparator.
    sortedList.comparatorProperty().bind(resultViewId.comparatorProperty());

    resultViewId.setItems(sortedList);/*from www . j  a  v  a  2 s  .  c  om*/
    resultViewId.getSelectionModel().setSelectionMode(SelectionMode.MULTIPLE);

    this.filterList(guiApplicationFileListFiltered);
    this.initializeFilter();
    this.initializeRowFactory();

    this.initializeStatistic();

    accordionPaneId.setExpandedPane(informationPaneId);

    groupId.getItems().add(Group.GROUPA);
    groupId.getItems().add(Group.GROUPB);
    groupId.setValue(Group.GROUPA);

    /**
     * Due to the bug
     * "https://bitbucket.org/controlsfx/controlsfx/issue/185/nullpointerexception-when-using-popover"
     */
    MainApp.getInstance().getStage().setOnCloseRequest(new EventHandler<WindowEvent>() {
        @Override
        public void handle(WindowEvent event) {
            if (popOver != null) {
                popOver.hide(Duration.millis(0));
            }
        }
    });
    /**
     * End *
     */
}

From source file:dtv.controller.FXMLMainController.java

@Override
public void initialize(URL url, ResourceBundle rb) {

    pi.setVisible(false);/*from  w w w.j  a v a  2 s  . c o m*/

    // test
    FilteredList<DVBChannel> filteredDataS2 = new FilteredList<>(serviceDataS2);
    FilteredList<DVBChannel> filteredDataT2 = new FilteredList<>(serviceDataT2);

    s_name.textProperty().addListener(obs -> filteredDataS2.setPredicate(getPredicate(obs)));
    s_name.textProperty().addListener(obs -> filteredDataT2.setPredicate(getPredicate(obs)));

    sortedDataS2 = new SortedList<>(filteredDataS2);
    sortedDataT2 = new SortedList<>(filteredDataT2);
    sortedDataS2.comparatorProperty().bind(serviceDVBS2Table.comparatorProperty());
    sortedDataT2.comparatorProperty().bind(serviceDVBT2Table.comparatorProperty());

    init(serviceDataS2, serviceDVBS2Table, s_idxColumnS2, s_nameColumnS2, s_typeColumnS2, s_pprColumnS2);
    init(serviceDataT2, serviceDVBT2Table, s_idxColumnT2, s_nameColumnT2, s_typeColumnT2, s_pprColumnT2);

    logs.setEditable(false);
    disableComponents(true);
}

From source file:eu.over9000.skadi.ui.MainWindow.java

private void setupTable() {
    this.table = new TableView<>();

    this.liveCol = new TableColumn<>("Live");
    this.liveCol.setCellValueFactory(p -> p.getValue().onlineProperty());
    this.liveCol.setSortType(SortType.DESCENDING);
    this.liveCol.setCellFactory(p -> new LiveCell());

    this.nameCol = new TableColumn<>("Channel");
    this.nameCol.setCellValueFactory(p -> p.getValue().nameProperty());

    this.titleCol = new TableColumn<>("Status");
    this.titleCol.setCellValueFactory(p -> p.getValue().titleProperty());

    this.gameCol = new TableColumn<>("Game");
    this.gameCol.setCellValueFactory(p -> p.getValue().gameProperty());

    this.viewerCol = new TableColumn<>("Viewer");
    this.viewerCol.setCellValueFactory(p -> p.getValue().viewerProperty().asObject());
    this.viewerCol.setSortType(SortType.DESCENDING);
    this.viewerCol.setCellFactory(p -> new RightAlignedCell<>());

    this.uptimeCol = new TableColumn<>("Uptime");
    this.uptimeCol.setCellValueFactory((p) -> p.getValue().uptimeProperty().asObject());
    this.uptimeCol.setCellFactory(p -> new UptimeCell());

    this.table.setPlaceholder(new Label("no channels added/matching the filters"));

    this.table.getColumns().add(this.liveCol);
    this.table.getColumns().add(this.nameCol);
    this.table.getColumns().add(this.titleCol);
    this.table.getColumns().add(this.gameCol);
    this.table.getColumns().add(this.viewerCol);
    this.table.getColumns().add(this.uptimeCol);

    this.table.getSortOrder().add(this.liveCol);
    this.table.getSortOrder().add(this.viewerCol);
    this.table.getSortOrder().add(this.nameCol);

    this.filteredChannelList = new FilteredList<>(this.channelHandler.getChannels());
    this.sortedChannelList = new SortedList<>(this.filteredChannelList);
    this.sortedChannelList.comparatorProperty().bind(this.table.comparatorProperty());

    this.table.setItems(this.sortedChannelList);

    this.table.setRowFactory(tv -> {
        final TableRow<Channel> row = new TableRow<>();
        row.setOnMouseClicked(event -> {
            if ((event.getButton() == MouseButton.PRIMARY) && (event.getClickCount() == 2) && !row.isEmpty()) {
                this.detailChannel.set(row.getItem());
                if (!this.sp.getItems().contains(this.detailPane)) {
                    this.sp.getItems().add(this.detailPane);
                    this.doDetailSlide(true);
                }//w  w w.ja  v  a 2 s  .co  m
            }
        });
        return row;
    });
    this.table.getSelectionModel().selectedItemProperty().addListener((obs, oldV, newV) -> {

        this.details.setDisable(newV == null);
        this.remove.setDisable(newV == null);
        this.chatAndStreamButton.setDisable(newV == null);
        this.chatAndStreamButton.resetQualities();
        if ((newV == null) && this.sp.getItems().contains(this.detailPane)) {
            this.doDetailSlide(false);
        }

    });
}

From source file:com.ggvaidya.scinames.dataset.DatasetSceneController.java

@SuppressWarnings("unchecked")
private void initAdditionalData() {
    // Resize to fit columns, as per https://stackoverflow.com/a/22488513/27310
    additionalDataTableView.setColumnResizePolicy((param) -> true);

    // Set up additional data objects.
    additionalDataTableView.setRowFactory(table -> {
        @SuppressWarnings("rawtypes")
        TableRow row = new TableRow<>();

        row.setOnMouseClicked(event -> {
            if (row.isEmpty())
                return;
            Object item = row.getItem();

            if (event.getClickCount() == 2) {
                // Try opening the detailed view on this item -- if we can.
                datasetView.getProjectView().openDetailedView(item);
            }//  www  .  j  a va 2s  .  c o  m
        });

        return row;
    });
    additionalDataTableView.setItems(new SortedList<>(tableItems));

    // Set up events.
    additionalDataCombobox.getSelectionModel().selectedItemProperty()
            .addListener((Observable o) -> additionalDataUpdateList());
    additionalListView.getSelectionModel().setSelectionMode(SelectionMode.SINGLE);
    additionalListView.getSelectionModel().selectedItemProperty()
            .addListener((Observable o) -> additionalDataUpdateTable());

    additionalDataCombobox.getSelectionModel().select(0);

    // When the change is changed, select an item.
    changesTableView.getSelectionModel().getSelectedItems()
            .addListener((ListChangeListener<Change>) c -> additionalDataUpdateList());
}

From source file:com.ggvaidya.scinames.dataset.BinomialChangesSceneController.java

@SuppressWarnings("unchecked")
private void initAdditionalData() {
    // Resize to fit columns, as per https://stackoverflow.com/a/22488513/27310
    additionalDataTableView.setColumnResizePolicy((param) -> true);

    // Set up additional data objects.
    additionalDataTableView.setRowFactory(table -> {
        @SuppressWarnings("rawtypes")
        TableRow row = new TableRow<>();

        row.setOnMouseClicked(event -> {
            if (row.isEmpty())
                return;
            Object item = row.getItem();

            if (event.getClickCount() == 2) {
                // Try opening the detailed view on this item -- if we can.
                binomialChangesView.getProjectView().openDetailedView(item);
            }/*from www.ja  v a  2s . c o  m*/
        });

        return row;
    });
    additionalDataTableView.setItems(new SortedList<>(tableItems));

    // Set up events.
    additionalDataCombobox.getSelectionModel().selectedItemProperty()
            .addListener((Observable o) -> additionalDataUpdateList());
    additionalListView.getSelectionModel().setSelectionMode(SelectionMode.SINGLE);
    additionalListView.getSelectionModel().selectedItemProperty()
            .addListener((Observable o) -> additionalDataUpdateTable());

    additionalDataCombobox.getSelectionModel().select(0);

    // When the change is changed, select an item.
    changesTableView.getSelectionModel().getSelectedItems()
            .addListener((ListChangeListener<Change>) c -> additionalDataUpdateList());
}

From source file:org.simmi.GeneSetHead.java

License:asdf

private void importStuff() throws IOException, UnavailableServiceException {
    boolean fail = true;
    /*try {/*from www. jav  a 2s .  c om*/
       FileOpenService fos = (FileOpenService)ServiceManager.lookup("javax.jnlp.FileOpenService");
       FileContents fc = fos.openFileDialog(null, null);
       is = fc.getInputStream();
    } catch( Exception e ) {
       fail = true;
    }*/

    Path zipp = null;
    if (fail && zipp == null) {
        FileChooser fc = new FileChooser();
        File f = fc.showOpenDialog(app.getOwner());
        if (f != null)
            zipp = f.toPath();
    }

    //if( is != null ) {
    /*ByteArrayOutputStream baos = new ByteArrayOutputStream();
    byte[] bab = new byte[1024];
    int rd = is.read( bab );
    while( rd > 0 ) {
       baos.write(bab, 0, rd);
       rd = is.read( bab );
    }
    baos.close();
    zipf = baos.toByteArray();*/

    /*ZipInputStream zipm = new ZipInputStream( new ByteArrayInputStream( zipf ) );
    ZipEntry ze = zipm.getNextEntry();
    while( ze != null ) {
       String zname = ze.getName();
       if( zname.equals("unresolved.blastout") ) {
    unresolvedmap = loadunresolvedmap( new InputStreamReader( zipm ) );
       } else if( zname.equals("namemap.txt") ) {
    namemap = loadnamemap( new InputStreamReader( zipm ) );
       } else if( ze.getName().equals("designations.txt") ) {
    designations = loadDesignations( new InputStreamReader(zipm), deset );
       } else if( ze.getName().equals("plasmids.txt") ) {
    plasmids = loadPlasmids( new InputStreamReader(zipm) );
       }
       ze = zipm.getNextEntry();
    }
    if( designations == null ) designations = new TreeMap<String,String>();
    //List<Set<String>> uclusterlist = null;*/

    if (zipp != null) {
        geneset.loadStuff(zipp);

        //syncolorcomb = new JComboBox();
        syncolorcomb.getItems().clear();
        syncolorcomb.getItems().add("");
        for (String spec : geneset.speccontigMap.keySet()) {
            syncolorcomb.getItems().add(spec);
        }
        syncolorcomb.getItems().add("All");

        /*
         * is = GeneSet.class.getResourceAsStream(""); Map<String,String> komap
         * = koMapping( new FileReader("/home/sigmar/asgard-bio/data/ko"),
         * funclist, genelist ); for( Function f : funclist ) { if(
         * komap.containsKey( f.ec ) ) { for( String gn : f.geneentries ) { Gene
         * g = refmap.get(gn); if( g.keggid == null ) g.keggid =
         * komap.get(f.ec); } } }
         */

        geneset.updateShareNum(geneset.specList);

        Set<String> allecs = new HashSet<>();
        for (Function f : geneset.funclist) {
            if (f.getEc() != null)
                allecs.add(f.getEc());
        }

        for (String val : geneset.pathwaymap.keySet()) {
            Set<String> set = geneset.pathwaymap.get(val);
            for (String s : set) {
                if (allecs.contains(s)) {
                    combo.getItems().add(val);
                    break;
                }
            }
        }

        Set<String> set = new TreeSet<>();
        for (Gene g : geneset.genelist) {
            Tegeval tv = g.tegeval;
            if (tv.eval <= 0.00001 && tv.teg != null && tv.teg.startsWith("[") && tv.teg.endsWith("]"))
                set.add(tv.teg);
        }

        for (String sp : set) {
            specombo.getItems().add(sp);
        }

        if (geneset.uclusterlist != null)
            geneset.clusterMap = Serifier.initClusterNew(geneset.uclusterlist, null, null);
        //table.tableChanged( new TableModelEvent( table.getModel() ) );
        //ftable.tableChanged( new TableModelEvent( ftable.getModel() ) );
        //table.setModel( nullmodel );
        //ftable.setModel( nullmodel );
        //table.setModel( groupModel );
        //ftable.setModel( ftablemodel );
        //ftable.setItems( geneset.f);

        for (String spec : geneset.specList) {
            TableColumn<GeneGroup, Teginfo> speccol = new TableColumn(spec);
            //speccol.getStyleClass().add("tabstyle");
            speccol.setCellFactory(cell -> {
                final TableCell<GeneGroup, Teginfo> tc = new TableCell<GeneGroup, Teginfo>() {
                    @Override
                    protected void updateItem(Teginfo item, boolean empty) {
                        super.updateItem(item, empty);

                        if (item == null || item.toString().length() == 0 || empty) {
                            setText(null);
                            setStyle("");
                            //getStyleClass().remove("tabcellstyle");
                        } else {
                            setText(item.toString());
                            cellRender(this, item, 0);
                            //getStyleClass().add("tabcellstyle");
                            /*if( (this.getTableRow() != null && getTableRow().isSelected()) || isSelected() ) {
                               //setTextFill( javafx.scene.paint.Color.WHITE );
                               setStyle("-fx-background-color: darkgreen");
                            } else {
                               //setTextFill( javafx.scene.paint.Color.BLACK );
                               setStyle("-fx-background-color: green");
                            }*/
                        }
                    }
                };
                return tc;
            });
            speccol.setCellValueFactory(cellValue -> {
                GeneGroup gg = cellValue.getValue();
                Teginfo tes = gg.getTes(spec);
                return new ReadOnlyObjectWrapper(tes);
                //return new SimpleStringProperty( tes != null ? tes.toString() : "" );
                //Teginfo ret = geneset.getGroupTes( cellValue.getValue(), spec );
                //return new ObservableValue<String>( ret.toString() );
                //return ret;
            });
            table.getColumns().add(speccol);

            TableColumn<Gene, Teg> gspeccol = new TableColumn(spec);
            gspeccol.setComparator((o1, o2) -> {
                if (o1 == null) {
                    if (o2 == null) {
                        return 0;
                    } else
                        return -1;
                } else if (o1 instanceof Tegeval) {
                    if (o2 == null || o2 instanceof Teginfo) {
                        return 1;
                    }
                } else {
                    if (o2 == null) {
                        return 1;
                    } else if (o2 instanceof Tegeval) {
                        return -1;
                    }
                }
                return o1.compareTo(o2);
            });
            gspeccol.setCellFactory(cell -> {
                final TableCell<Gene, Teg> tc = new TableCell<Gene, Teg>() {
                    @Override
                    protected void updateItem(Teg item, boolean empty) {
                        super.updateItem(item, empty);

                        if (item == null || item.toString().length() == 0 || empty) {
                            setText("");
                            setStyle("");
                        } else {
                            boolean render = cellRenderGene(this, item);
                            setText(item.toString());
                            if (!render)
                                setStyle("");
                            //getStyleClass().add("tabcellstyle");
                            /*if( (this.getTableRow() != null && getTableRow().isSelected()) || isSelected() ) {
                               //setTextFill( javafx.scene.paint.Color.WHITE );
                               setStyle("-fx-background-color: white");
                            } else {
                               //setTextFill( javafx.scene.paint.Color.BLACK );
                               setStyle("-fx-background-color: black");
                            }*/
                        }
                    }
                };
                return tc;
            });
            gspeccol.setCellValueFactory(cellValue -> {
                Gene g = cellValue.getValue();

                //Teginfo tes = g.tegeval;//getTes( spec );
                if (spec.equals(g.getSpecies())) {
                    return new ReadOnlyObjectWrapper(g.tegeval);
                } else {
                    GeneGroup gg = g.getGeneGroup();
                    Set<String> specset = gg.getSpecies();
                    if (specset.contains(spec)) {
                        Teginfo ti = gg.getGenes(spec);
                        return new ReadOnlyObjectWrapper(ti);
                    }
                }
                //return new SimpleStringProperty( tes != null ? tes.toString() : "" );
                //Teginfo ret = geneset.getGroupTes( cellValue.getValue(), spec );
                //return new ObservableValue<String>( ret.toString() );
                //return ret;
                return null;
            });

            /*gspeccol.setCellValueFactory( cellValue -> {
               return new SimpleStringProperty( cellValue.getValue().toString() );
               //Teginfo ret = geneset.getGroupTes( cellValue.getValue(), spec );
               //return new ObservableValue<String>( ret.toString() );
               //return ret;
            });*/
            gtable.getColumns().add(gspeccol);
        }

        ObservableList<Function> ofunc = FXCollections.observableList(geneset.funclist);
        ffilteredData = new FilteredList<>(ofunc, p -> true);
        fsortedData = new SortedList<>(ffilteredData);
        fsortedData.comparatorProperty().bind(ftable.comparatorProperty());
        ftable.setItems(fsortedData);

        ObservableList<GeneGroup> ogenegroup = FXCollections.observableList(geneset.allgenegroups);
        filteredData = new FilteredList<>(ogenegroup, p -> true);
        sortedData = new SortedList<>(filteredData);
        sortedData.comparatorProperty().bind(table.comparatorProperty());
        table.setItems(sortedData);

        ObservableList<Gene> ogene = FXCollections.observableList(geneset.genelist);
        gtable.setItems(ogene);

        int me = 0;
        int mu = 0;
        for (Gene g : geneset.genelist) {
            if (g.getGeneGroup() != null)
                me++;
            else
                mu++;
        }
        System.err.println(me + "  " + mu);
    }

    String userhome = System.getProperty("user.home");
    File f = new File(userhome);
    File idf = new File(f, "idspec.txt");
    BufferedWriter bw = new BufferedWriter(new FileWriter(idf)); //Files.newBufferedWriter(idf.toPath(), OpenOption.);
    for (String id : geneset.refmap.keySet()) {
        Gene g = geneset.refmap.get(id);
        bw.write(id + "\t" + g.getSpecies() + "\n");
    }
    bw.close();
}

From source file:qupath.lib.gui.tma.TMASummaryViewer.java

private Pane getCustomizeTablePane() {
    TableView<TreeTableColumn<TMAEntry, ?>> tableColumns = new TableView<>();
    tableColumns.setPlaceholder(new Text("No columns available"));
    tableColumns.getSelectionModel().setSelectionMode(SelectionMode.MULTIPLE);
    tableColumns.setColumnResizePolicy(TableView.CONSTRAINED_RESIZE_POLICY);

    SortedList<TreeTableColumn<TMAEntry, ?>> sortedColumns = new SortedList<>(
            table.getColumns().filtered(p -> !p.getText().trim().isEmpty()));
    sortedColumns.setComparator((c1, c2) -> c1.getText().compareTo(c2.getText()));
    tableColumns.setItems(sortedColumns);
    sortedColumns.comparatorProperty().bind(tableColumns.comparatorProperty());
    //      sortedColumns.comparatorProperty().bind(tableColumns.comparatorProperty());

    TableColumn<TreeTableColumn<TMAEntry, ?>, String> columnName = new TableColumn<>("Column");
    columnName.setCellValueFactory(v -> v.getValue().textProperty());
    TableColumn<TreeTableColumn<TMAEntry, ?>, Boolean> columnVisible = new TableColumn<>("Visible");
    columnVisible.setCellValueFactory(v -> v.getValue().visibleProperty());
    //      columnVisible.setCellValueFactory(col -> {
    //         SimpleBooleanProperty prop = new SimpleBooleanProperty(col.getValue().isVisible());
    //         prop.addListener((v, o, n) -> col.getValue().setVisible(n));
    //         return prop;
    //      });//from ww w.j a v  a2 s  .  c  o  m
    tableColumns.setEditable(true);
    columnVisible.setCellFactory(v -> new CheckBoxTableCell<>());
    tableColumns.getColumns().add(columnName);
    tableColumns.getColumns().add(columnVisible);
    ContextMenu contextMenu = new ContextMenu();

    Action actionShowSelected = new Action("Show selected", e -> {
        for (TreeTableColumn<?, ?> col : tableColumns.getSelectionModel().getSelectedItems()) {
            if (col != null)
                col.setVisible(true);
            else {
                // Not sure why this happens...?
                logger.trace("Selected column is null!");
            }
        }
    });

    Action actionHideSelected = new Action("Hide selected", e -> {
        for (TreeTableColumn<?, ?> col : tableColumns.getSelectionModel().getSelectedItems()) {
            if (col != null)
                col.setVisible(false);
            else {
                // Not sure why this happens...?
                logger.trace("Selected column is null!");
            }
        }
    });

    contextMenu.getItems().addAll(ActionUtils.createMenuItem(actionShowSelected),
            ActionUtils.createMenuItem(actionHideSelected));
    tableColumns.setContextMenu(contextMenu);
    tableColumns.setTooltip(
            new Tooltip("Show or hide table columns - right-click to change multiple columns at once"));

    BorderPane paneColumns = new BorderPane(tableColumns);
    paneColumns.setBottom(PanelToolsFX.createColumnGridControls(ActionUtils.createButton(actionShowSelected),
            ActionUtils.createButton(actionHideSelected)));

    VBox paneRows = new VBox();

    // Create a box to filter on some metadata text
    ComboBox<String> comboMetadata = new ComboBox<>();
    comboMetadata.setItems(metadataNames);
    comboMetadata.getSelectionModel().getSelectedItem();
    comboMetadata.setPromptText("Select column");
    TextField tfFilter = new TextField();
    CheckBox cbExact = new CheckBox("Exact");
    // Set listeners
    cbExact.selectedProperty().addListener(
            (v, o, n) -> setMetadataTextPredicate(comboMetadata.getSelectionModel().getSelectedItem(),
                    tfFilter.getText(), cbExact.isSelected(), !cbExact.isSelected()));
    tfFilter.textProperty().addListener(
            (v, o, n) -> setMetadataTextPredicate(comboMetadata.getSelectionModel().getSelectedItem(),
                    tfFilter.getText(), cbExact.isSelected(), !cbExact.isSelected()));
    comboMetadata.getSelectionModel().selectedItemProperty().addListener(
            (v, o, n) -> setMetadataTextPredicate(comboMetadata.getSelectionModel().getSelectedItem(),
                    tfFilter.getText(), cbExact.isSelected(), !cbExact.isSelected()));

    GridPane paneMetadata = new GridPane();
    paneMetadata.add(comboMetadata, 0, 0);
    paneMetadata.add(tfFilter, 1, 0);
    paneMetadata.add(cbExact, 2, 0);
    paneMetadata.setPadding(new Insets(10, 10, 10, 10));
    paneMetadata.setVgap(2);
    paneMetadata.setHgap(5);
    comboMetadata.setMaxWidth(Double.MAX_VALUE);
    GridPane.setHgrow(tfFilter, Priority.ALWAYS);
    GridPane.setFillWidth(comboMetadata, Boolean.TRUE);
    GridPane.setFillWidth(tfFilter, Boolean.TRUE);

    TitledPane tpMetadata = new TitledPane("Metadata filter", paneMetadata);
    tpMetadata.setExpanded(false);
    //      tpMetadata.setCollapsible(false);
    Tooltip tooltipMetadata = new Tooltip(
            "Enter text to filter entries according to a selected metadata column");
    Tooltip.install(paneMetadata, tooltipMetadata);
    tpMetadata.setTooltip(tooltipMetadata);
    paneRows.getChildren().add(tpMetadata);

    // Add measurement predicate
    TextField tfCommand = new TextField();
    tfCommand.setTooltip(new Tooltip("Predicate used to filter entries for inclusion"));

    TextFields.bindAutoCompletion(tfCommand, e -> {
        int ind = tfCommand.getText().lastIndexOf("\"");
        if (ind < 0)
            return Collections.emptyList();
        String part = tfCommand.getText().substring(ind + 1);
        return measurementNames.stream().filter(n -> n.startsWith(part)).map(n -> "\"" + n + "\" ")
                .collect(Collectors.toList());
    });

    String instructions = "Enter a predicate to filter entries.\n"
            + "Only entries passing the test will be included in any results.\n"
            + "Examples of predicates include:\n" + "    \"Num Tumor\" > 200\n"
            + "    \"Num Tumor\" > 100 && \"Num Stroma\" < 1000";
    //      labelInstructions.setTooltip(new Tooltip("Note: measurement names must be in \"inverted commands\" and\n" + 
    //            "&& indicates 'and', while || indicates 'or'."));

    BorderPane paneMeasurementFilter = new BorderPane(tfCommand);
    Label label = new Label("Predicate: ");
    label.setAlignment(Pos.CENTER);
    label.setMaxHeight(Double.MAX_VALUE);
    paneMeasurementFilter.setLeft(label);

    Button btnApply = new Button("Apply");
    btnApply.setOnAction(e -> {
        TablePredicate predicateNew = new TablePredicate(tfCommand.getText());
        if (predicateNew.isValid()) {
            predicateMeasurements.set(predicateNew);
        } else {
            DisplayHelpers.showErrorMessage("Invalid predicate",
                    "Current predicate '" + tfCommand.getText() + "' is invalid!");
        }
        e.consume();
    });
    TitledPane tpMeasurementFilter = new TitledPane("Measurement filter", paneMeasurementFilter);
    tpMeasurementFilter.setExpanded(false);
    Tooltip tooltipInstructions = new Tooltip(instructions);
    tpMeasurementFilter.setTooltip(tooltipInstructions);
    Tooltip.install(paneMeasurementFilter, tooltipInstructions);
    paneMeasurementFilter.setRight(btnApply);

    paneRows.getChildren().add(tpMeasurementFilter);

    logger.info("Predicate set to: {}", predicateMeasurements.get());

    VBox pane = new VBox();
    //      TitledPane tpColumns = new TitledPane("Select column", paneColumns);
    //      tpColumns.setMaxHeight(Double.MAX_VALUE);
    //      tpColumns.setCollapsible(false);
    pane.getChildren().addAll(paneColumns, new Separator(), paneRows);
    VBox.setVgrow(paneColumns, Priority.ALWAYS);

    return pane;
}