JavaScript is disabled on your browser.
JavaFX 2.2
javafx.scene.control.cell

Class CheckBoxTableCell<S,T>

  • Type Parameters:
    T - The type of the elements contained within the TableColumn.
    All Implemented Interfaces:
    EventTarget, Skinnable


    public class CheckBoxTableCell<S,T>
    extends TableCell<S,T>
    A class containing a TableCell implementation that draws a CheckBox node inside the cell, optionally with a label to indicate what the checkbox represents.

    By default, the CheckBoxTableCell is rendered with a CheckBox centred in the TableColumn. If a label is required, it is necessary to provide a non-null StringConverter instance to the CheckBoxTableCell(Callback, StringConverter) constructor.

    To construct an instance of this class, it is necessary to provide a Callback that, given an object of type T, will return an ObservableProperty<Boolean> that represents whether the given item is selected or not. This ObservableValue will be bound bidirectionally (meaning that the CheckBox in the cell will set/unset this property based on user interactions, and the CheckBox will reflect the state of the ObservableValue, if it changes externally).

    Since:
    2.2
    • Constructor Detail

      • CheckBoxTableCell

        public CheckBoxTableCell()
        Creates a default CheckBoxTableCell.
      • CheckBoxTableCell

        public CheckBoxTableCell(Callback<java.lang.Integer,ObservableValue<java.lang.Boolean>> getSelectedProperty)
        Creates a default CheckBoxTableCell with a custom Callback to retrieve an ObservableValue for a given cell index.
        Parameters:
        getSelectedProperty - A Callback that will return an ObservableValue given an index from the TableColumn.
      • CheckBoxTableCell

        public CheckBoxTableCell(Callback<java.lang.Integer,ObservableValue<java.lang.Boolean>> getSelectedProperty,
         StringConverter<T> converter)
        Creates a CheckBoxTableCell with a custom string converter.
        Parameters:
        getSelectedProperty - A Callback that will return a ObservableValue given an index from the TableColumn.
        converter - A StringConverter that, given an object of type T, will return a String that can be used to represent the object visually.
    • Method Detail

      • forTableColumn

        public static <S> Callback<TableColumn<S,java.lang.Boolean>,TableCell<S,java.lang.Boolean>> forTableColumn(TableColumn<S,java.lang.Boolean> column)
        Creates a cell factory for use in a TableColumn cell factory. This method requires that the TableColumn be of type Boolean.

        When used in a TableColumn, the CheckBoxCell is rendered with a CheckBox centered in the column.

        The ObservableValue<Boolean> contained within each cell in the column will be bound bidirectionally. This means that the CheckBox in the cell will set/unset this property based on user interactions, and the CheckBox will reflect the state of the ObservableValue<Boolean>, if it changes externally).

Returns:
A Callback that will return a TableCell that is able to work on the type of element contained within the TableColumn.
JavaFX 2.2

Copyright (c) 2008, 2014, Oracle and/or its affiliates. All rights reserved.

AltStyle によって変換されたページ (->オリジナル) /