javafx.scene.control.cell.CheckBoxListCell Java Examples

The following examples show how to use javafx.scene.control.cell.CheckBoxListCell. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: RFXCheckBoxListCell.java    From marathonv5 with Apache License 2.0 6 votes vote down vote up
@SuppressWarnings("unchecked")
@Override
public String _getValue() {
    @SuppressWarnings("rawtypes")
    CheckBoxListCell cell = (CheckBoxListCell) node;
    ObservableValue<Boolean> call = (ObservableValue<Boolean>) cell.getSelectedStateCallback().call(cell.getItem());
    String cbText;
    if (call != null) {
        int selection = call.getValue() ? 2 : 0;
        cbText = JavaFXCheckBoxElement.states[selection];
    } else {
        Node cb = cell.getGraphic();
        RFXComponent comp = getFinder().findRawRComponent(cb, null, null);
        cbText = comp._getValue();
    }
    return cbText;
}
 
Example #2
Source File: JavaFXElementFactory.java    From marathonv5 with Apache License 2.0 5 votes vote down vote up
public static void reset() {
    add(Node.class, JavaFXElement.class);
    add(TextInputControl.class, JavaFXTextInputControlElement.class);
    add(HTMLEditor.class, JavaFXHTMLEditor.class);
    add(CheckBox.class, JavaFXCheckBoxElement.class);
    add(ToggleButton.class, JavaFXToggleButtonElement.class);
    add(Slider.class, JavaFXSliderElement.class);
    add(Spinner.class, JavaFXSpinnerElement.class);
    add(SplitPane.class, JavaFXSplitPaneElement.class);
    add(ProgressBar.class, JavaFXProgressBarElement.class);
    add(ChoiceBox.class, JavaFXChoiceBoxElement.class);
    add(ColorPicker.class, JavaFXColorPickerElement.class);
    add(ComboBox.class, JavaFXComboBoxElement.class);
    add(DatePicker.class, JavaFXDatePickerElement.class);
    add(TabPane.class, JavaFXTabPaneElement.class);
    add(ListView.class, JavaFXListViewElement.class);
    add(TreeView.class, JavaFXTreeViewElement.class);
    add(TableView.class, JavaFXTableViewElement.class);
    add(TreeTableView.class, JavaFXTreeTableViewElement.class);
    add(CheckBoxListCell.class, JavaFXCheckBoxListCellElement.class);
    add(ChoiceBoxListCell.class, JavaFXChoiceBoxCellElement.class);
    add(ComboBoxListCell.class, JavaFXComboBoxCellElement.class);
    add(CheckBoxTreeCell.class, JavaFXCheckBoxTreeCellElement.class);
    add(ChoiceBoxTreeCell.class, JavaFXChoiceBoxCellElement.class);
    add(ComboBoxTreeCell.class, JavaFXComboBoxCellElement.class);
    add(TableCell.class, JavaFXTableViewCellElement.class);
    add(CheckBoxTableCell.class, JavaFXCheckBoxTableCellElement.class);
    add(ChoiceBoxTableCell.class, JavaFXChoiceBoxCellElement.class);
    add(ComboBoxTableCell.class, JavaFXComboBoxCellElement.class);
    add(TreeTableCell.class, JavaFXTreeTableCellElement.class);
    add(CheckBoxTreeTableCell.class, JavaFXCheckBoxTreeTableCell.class);
    add(ChoiceBoxTreeTableCell.class, JavaFXChoiceBoxCellElement.class);
    add(ComboBoxTreeTableCell.class, JavaFXComboBoxCellElement.class);
    add(WebView.class, JavaFXWebViewElement.class);
    add(GenericStyledArea.GENERIC_STYLED_AREA_CLASS, RichTextFXGenericStyledAreaElement.class);
}
 
Example #3
Source File: JavaFXCheckBoxListCellElement.java    From marathonv5 with Apache License 2.0 5 votes vote down vote up
@SuppressWarnings("unchecked")
@Override
public String _getValue() {
    @SuppressWarnings("rawtypes")
    CheckBoxListCell cell = (CheckBoxListCell) getComponent();
    ObservableValue<Boolean> call = (ObservableValue<Boolean>) cell.getSelectedStateCallback().call(cell.getItem());
    int selection = call.getValue() ? 2 : 0;
    String text = cell.getText() + ":" + JavaFXCheckBoxElement.states[selection];
    return text;
}
 
Example #4
Source File: StatisticalQueryGroupAndSortController.java    From arcgis-runtime-samples-java with Apache License 2.0 5 votes vote down vote up
/**
 * Add a CheckBox to each Group By field which sets whether that field should be grouped by.
 */
private void initializeGroupByListView() {
  groupFieldsListView.setCellFactory(CheckBoxListCell.forListView(groupField -> {
    // if the user deselects a field to be grouped by, remove it from order-by table too
    groupField.groupingProperty().addListener((observable, wasGrouping, isNowGrouping) -> {
      List<OrderByField> orderByFieldsMatchingGroupByField = orderByTableView.getItems().stream().filter(row -> row
          .getFieldName().equals(groupField.getFieldName())).collect(Collectors.toList());
      if (!isNowGrouping && !orderByFieldsMatchingGroupByField.isEmpty()) {
        orderByTableView.getItems().removeAll(orderByFieldsMatchingGroupByField);
      }
    });
    // bind the checkbox selection to the grouping property
    return groupField.groupingProperty();
  }));
}
 
Example #5
Source File: ColumnVisibleController.java    From logbook-kai with MIT License 4 votes vote down vote up
@FXML
void initialize() {
    this.listView.setCellFactory(
            CheckBoxListCell.forListView(t -> t.visibleProperty(),
                    ToStringConverter.of(Tools.Tables::getColumnName)));
}