Example usage for javafx.scene.control.cell CheckBoxListCell forListView

List of usage examples for javafx.scene.control.cell CheckBoxListCell forListView

Introduction

In this page you can find the example usage for javafx.scene.control.cell CheckBoxListCell forListView.

Prototype

public static <T> Callback<ListView<T>, ListCell<T>> forListView(
        final Callback<T, ObservableValue<Boolean>> getSelectedProperty, final StringConverter<T> converter) 

Source Link

Document

Creates a cell factory for use in ListView controls.

Usage

From source file:gov.va.isaac.gui.preferences.plugins.ViewCoordinatePreferencesPluginViewController.java

private void initializeSelectableModuleListView() {
    allModulesMarker.selectedProperty().set(true); // default only.  may be changed in getContent()
    selectableModuleListView.setCellFactory(CheckBoxListCell.forListView(SelectableModule::selectedProperty,
            new StringConverter<SelectableModule>() {
                @Override// ww  w .  j a  va 2  s  .c  o  m
                public String toString(SelectableModule object) {
                    return object.getDescription();
                }

                @Override
                public SelectableModule fromString(String string) {
                    return null;
                }
            }));
    selectableModuleListView.setTooltip(new Tooltip(
            "Select one or more modules to enable filtering for selected modules\nor deselect all to disable filtering by module.\nDefault module list is "
                    + Arrays.toString(getDefaultModules().toArray(new UUID[getDefaultModules().size()]))));
}