Class TableColumnBuilder<S,T>

java.lang.Object
io.github.sosuisen.jfxbuilder.controls.TableColumnBuilder<S,T>

public class TableColumnBuilder<S,T> extends Object
The TableColumnBuilder class constructs instances of the TableColumn class and offers a fluent interface for creating and configuring it.

This class includes a static create method that accepts the same arguments as the original TableColumn constructor and returns an instance of the TableColumnBuilder.

You can use method chaining to call the builder methods for configuring the TableColumn. Finally, invoke the build method to generate an instance of the TableColumn class.

Note that intermediate builder methods are not evaluated until the build method is called, meaning they are evaluated lazily.

Author:
Hidekazu Kubota <hidekazu.kubota@gmail.com>
  • Method Details

    • create

      public static <S,T> TableColumnBuilder<S,T> create()
      Returns an instance of the TableColumnBuilder<S, T>.
      Returns:
      an instance of the TableColumnBuilder<S, T>.
    • create

      public static <S,T> TableColumnBuilder<S,T> create(String text)
      Accepts the constructor arguments of TableColumn(String) and returns an instance of TableColumnBuilder<S, T>.
      Returns:
      an instance of the TableColumnBuilder<S, T>.
    • build

      public TableColumn<S,T> build()
      Builds and returns an instance of the TableColumn class.

      Intermediate builder methods are not evaluated until the build method is called; in other words, they are evaluated lazily.

      Returns:
      new instance of the TableColumn class
    • apply

      public TableColumnBuilder<S,T> apply(Consumer<TableColumn<S,T>> func)
      Applies a function to the TableColumn instance being constructed. Most operations on the instance can be performed using this method.
      Returns:
      builder instance
    • cellFactory

      public TableColumnBuilder<S,T> cellFactory(Callback<TableColumn<S,T>, TableCell<S,T>> value)
      A builder method that invokes the setCellFactory method on the instance being constructed.
      Returns:
      builder instance
    • cellValueFactory

      A builder method that invokes the setCellValueFactory method on the instance being constructed.
      Returns:
      builder instance
    • comparator

      public TableColumnBuilder<S,T> comparator(Comparator<T> value)
      A builder method that invokes the setComparator method on the instance being constructed.
      Returns:
      builder instance
    • contextMenu

      public TableColumnBuilder<S,T> contextMenu(ContextMenu value)
      A builder method that invokes the setContextMenu method on the instance being constructed.
      Returns:
      builder instance
    • editable

      public TableColumnBuilder<S,T> editable(boolean value)
      A builder method that invokes the setEditable method on the instance being constructed.
      Returns:
      builder instance
    • graphic

      public TableColumnBuilder<S,T> graphic(Node value)
      A builder method that invokes the setGraphic method on the instance being constructed.
      Returns:
      builder instance
    • id

      public TableColumnBuilder<S,T> id(String value)
      A builder method that invokes the setId method on the instance being constructed.
      Returns:
      builder instance
    • maxWidth

      public TableColumnBuilder<S,T> maxWidth(double value)
      A builder method that invokes the setMaxWidth method on the instance being constructed.
      Returns:
      builder instance
    • minWidth

      public TableColumnBuilder<S,T> minWidth(double value)
      A builder method that invokes the setMinWidth method on the instance being constructed.
      Returns:
      builder instance
    • onEditCancel

      A builder method that invokes the setOnEditCancel method on the instance being constructed.
      Returns:
      builder instance
    • onEditCommit

      A builder method that invokes the setOnEditCommit method on the instance being constructed.
      Returns:
      builder instance
    • onEditStart

      A builder method that invokes the setOnEditStart method on the instance being constructed.
      Returns:
      builder instance
    • prefWidth

      public TableColumnBuilder<S,T> prefWidth(double value)
      A builder method that invokes the setPrefWidth method on the instance being constructed.
      Returns:
      builder instance
    • reorderable

      public TableColumnBuilder<S,T> reorderable(boolean value)
      A builder method that invokes the setReorderable method on the instance being constructed.
      Returns:
      builder instance
    • resizable

      public TableColumnBuilder<S,T> resizable(boolean value)
      A builder method that invokes the setResizable method on the instance being constructed.
      Returns:
      builder instance
    • sortNode

      public TableColumnBuilder<S,T> sortNode(Node value)
      A builder method that invokes the setSortNode method on the instance being constructed.
      Returns:
      builder instance
    • sortType

      public TableColumnBuilder<S,T> sortType(TableColumn.SortType value)
      A builder method that invokes the setSortType method on the instance being constructed.
      Returns:
      builder instance
    • sortable

      public TableColumnBuilder<S,T> sortable(boolean value)
      A builder method that invokes the setSortable method on the instance being constructed.
      Returns:
      builder instance
    • style

      public TableColumnBuilder<S,T> style(String value)
      A builder method that invokes the setStyle method on the instance being constructed.
      Returns:
      builder instance
    • text

      public TableColumnBuilder<S,T> text(String value)
      A builder method that invokes the setText method on the instance being constructed.
      Returns:
      builder instance
    • userData

      public TableColumnBuilder<S,T> userData(Object value)
      A builder method that invokes the setUserData method on the instance being constructed.
      Returns:
      builder instance
    • visible

      public TableColumnBuilder<S,T> visible(boolean value)
      A builder method that invokes the setVisible method on the instance being constructed.
      Returns:
      builder instance
    • addColumns

      @SafeVarargs public final TableColumnBuilder<S,T> addColumns(TableColumn<S,?>... elements)
      Calls the addAll method on the ObservableList returned by the TableColumn#getColumns() method.
      Returns:
      builder instance
    • addColumns

      public final TableColumnBuilder<S,T> addColumns(Collection<? extends TableColumn<S,?>> col)
      Calls the addAll method on the ObservableList returned by the TableColumn#getColumns() method.
      Returns:
      builder instance
    • withColumns

      @SafeVarargs public static <S,T> TableColumnBuilder<S,T> withColumns(TableColumn<S,?>... elements)
      Creates an instance of the builder, then calls the addAll method on the ObservableList returned by the TableColumn#getColumns() method.
      Returns:
      builder instance
    • withColumns

      public static <S,T> TableColumnBuilder<S,T> withColumns(Collection<? extends TableColumn<S,?>> col)
      Creates an instance of the builder, then calls the addAll method on the ObservableList returned by the TableColumn#getColumns() method.
      Returns:
      builder instance
    • addStyleClass

      public final TableColumnBuilder<S,T> addStyleClass(String... elements)
      Calls the addAll method on the ObservableList returned by the TableColumn#getStyleClass() method.
      Returns:
      builder instance
    • addStyleClass

      public final TableColumnBuilder<S,T> addStyleClass(Collection<? extends String> col)
      Calls the addAll method on the ObservableList returned by the TableColumn#getStyleClass() method.
      Returns:
      builder instance
    • cellFactoryPropertyApply

      public TableColumnBuilder<S,T> cellFactoryPropertyApply(Consumer<ObjectProperty<Callback<TableColumn<S,T>, TableCell<S,T>>>> op)
      Applies a function to the cellFactoryProperty of the instance being constructed. This serves as a shorthand form of the apply method.

      Example:

      // Use apply
      .apply(obj -> obj.cellFactoryProperty().bind(anotherProperty))
      
      // Use shorthand form
      .cellFactoryPropertyApply(prop -> prop.bind(anotherProperty))
      
      Returns:
      builder instance
    • cellValueFactoryPropertyApply

      Applies a function to the cellValueFactoryProperty of the instance being constructed. This serves as a shorthand form of the apply method.

      Example:

      // Use apply
      .apply(obj -> obj.cellValueFactoryProperty().bind(anotherProperty))
      
      // Use shorthand form
      .cellValueFactoryPropertyApply(prop -> prop.bind(anotherProperty))
      
      Returns:
      builder instance
    • comparatorPropertyApply

      public TableColumnBuilder<S,T> comparatorPropertyApply(Consumer<ObjectProperty<Comparator<T>>> op)
      Applies a function to the comparatorProperty of the instance being constructed. This serves as a shorthand form of the apply method.

      Example:

      // Use apply
      .apply(obj -> obj.comparatorProperty().bind(anotherProperty))
      
      // Use shorthand form
      .comparatorPropertyApply(prop -> prop.bind(anotherProperty))
      
      Returns:
      builder instance
    • contextMenuPropertyApply

      public TableColumnBuilder<S,T> contextMenuPropertyApply(Consumer<ObjectProperty<ContextMenu>> op)
      Applies a function to the contextMenuProperty of the instance being constructed. This serves as a shorthand form of the apply method.

      Example:

      // Use apply
      .apply(obj -> obj.contextMenuProperty().bind(anotherProperty))
      
      // Use shorthand form
      .contextMenuPropertyApply(prop -> prop.bind(anotherProperty))
      
      Returns:
      builder instance
    • editablePropertyApply

      public TableColumnBuilder<S,T> editablePropertyApply(Consumer<BooleanProperty> op)
      Applies a function to the editableProperty of the instance being constructed. This serves as a shorthand form of the apply method.

      Example:

      // Use apply
      .apply(obj -> obj.editableProperty().bind(anotherProperty))
      
      // Use shorthand form
      .editablePropertyApply(prop -> prop.bind(anotherProperty))
      
      Returns:
      builder instance
    • graphicPropertyApply

      public TableColumnBuilder<S,T> graphicPropertyApply(Consumer<ObjectProperty<Node>> op)
      Applies a function to the graphicProperty of the instance being constructed. This serves as a shorthand form of the apply method.

      Example:

      // Use apply
      .apply(obj -> obj.graphicProperty().bind(anotherProperty))
      
      // Use shorthand form
      .graphicPropertyApply(prop -> prop.bind(anotherProperty))
      
      Returns:
      builder instance
    • idPropertyApply

      public TableColumnBuilder<S,T> idPropertyApply(Consumer<StringProperty> op)
      Applies a function to the idProperty of the instance being constructed. This serves as a shorthand form of the apply method.

      Example:

      // Use apply
      .apply(obj -> obj.idProperty().bind(anotherProperty))
      
      // Use shorthand form
      .idPropertyApply(prop -> prop.bind(anotherProperty))
      
      Returns:
      builder instance
    • maxWidthPropertyApply

      public TableColumnBuilder<S,T> maxWidthPropertyApply(Consumer<DoubleProperty> op)
      Applies a function to the maxWidthProperty of the instance being constructed. This serves as a shorthand form of the apply method.

      Example:

      // Use apply
      .apply(obj -> obj.maxWidthProperty().bind(anotherProperty))
      
      // Use shorthand form
      .maxWidthPropertyApply(prop -> prop.bind(anotherProperty))
      
      Returns:
      builder instance
    • minWidthPropertyApply

      public TableColumnBuilder<S,T> minWidthPropertyApply(Consumer<DoubleProperty> op)
      Applies a function to the minWidthProperty of the instance being constructed. This serves as a shorthand form of the apply method.

      Example:

      // Use apply
      .apply(obj -> obj.minWidthProperty().bind(anotherProperty))
      
      // Use shorthand form
      .minWidthPropertyApply(prop -> prop.bind(anotherProperty))
      
      Returns:
      builder instance
    • onEditCancelPropertyApply

      Applies a function to the onEditCancelProperty of the instance being constructed. This serves as a shorthand form of the apply method.

      Example:

      // Use apply
      .apply(obj -> obj.onEditCancelProperty().bind(anotherProperty))
      
      // Use shorthand form
      .onEditCancelPropertyApply(prop -> prop.bind(anotherProperty))
      
      Returns:
      builder instance
    • onEditCommitPropertyApply

      Applies a function to the onEditCommitProperty of the instance being constructed. This serves as a shorthand form of the apply method.

      Example:

      // Use apply
      .apply(obj -> obj.onEditCommitProperty().bind(anotherProperty))
      
      // Use shorthand form
      .onEditCommitPropertyApply(prop -> prop.bind(anotherProperty))
      
      Returns:
      builder instance
    • onEditStartPropertyApply

      Applies a function to the onEditStartProperty of the instance being constructed. This serves as a shorthand form of the apply method.

      Example:

      // Use apply
      .apply(obj -> obj.onEditStartProperty().bind(anotherProperty))
      
      // Use shorthand form
      .onEditStartPropertyApply(prop -> prop.bind(anotherProperty))
      
      Returns:
      builder instance
    • parentColumnPropertyApply

      public TableColumnBuilder<S,T> parentColumnPropertyApply(Consumer<ReadOnlyObjectProperty<TableColumnBase<S,?>>> op)
      Applies a function to the parentColumnProperty of the instance being constructed. This serves as a shorthand form of the apply method.

      Example:

      // Use apply
      .apply(obj -> obj.parentColumnProperty().bind(anotherProperty))
      
      // Use shorthand form
      .parentColumnPropertyApply(prop -> prop.bind(anotherProperty))
      
      Returns:
      builder instance
    • prefWidthPropertyApply

      public TableColumnBuilder<S,T> prefWidthPropertyApply(Consumer<DoubleProperty> op)
      Applies a function to the prefWidthProperty of the instance being constructed. This serves as a shorthand form of the apply method.

      Example:

      // Use apply
      .apply(obj -> obj.prefWidthProperty().bind(anotherProperty))
      
      // Use shorthand form
      .prefWidthPropertyApply(prop -> prop.bind(anotherProperty))
      
      Returns:
      builder instance
    • reorderablePropertyApply

      public TableColumnBuilder<S,T> reorderablePropertyApply(Consumer<BooleanProperty> op)
      Applies a function to the reorderableProperty of the instance being constructed. This serves as a shorthand form of the apply method.

      Example:

      // Use apply
      .apply(obj -> obj.reorderableProperty().bind(anotherProperty))
      
      // Use shorthand form
      .reorderablePropertyApply(prop -> prop.bind(anotherProperty))
      
      Returns:
      builder instance
    • resizablePropertyApply

      public TableColumnBuilder<S,T> resizablePropertyApply(Consumer<BooleanProperty> op)
      Applies a function to the resizableProperty of the instance being constructed. This serves as a shorthand form of the apply method.

      Example:

      // Use apply
      .apply(obj -> obj.resizableProperty().bind(anotherProperty))
      
      // Use shorthand form
      .resizablePropertyApply(prop -> prop.bind(anotherProperty))
      
      Returns:
      builder instance
    • sortNodePropertyApply

      public TableColumnBuilder<S,T> sortNodePropertyApply(Consumer<ObjectProperty<Node>> op)
      Applies a function to the sortNodeProperty of the instance being constructed. This serves as a shorthand form of the apply method.

      Example:

      // Use apply
      .apply(obj -> obj.sortNodeProperty().bind(anotherProperty))
      
      // Use shorthand form
      .sortNodePropertyApply(prop -> prop.bind(anotherProperty))
      
      Returns:
      builder instance
    • sortTypePropertyApply

      public TableColumnBuilder<S,T> sortTypePropertyApply(Consumer<ObjectProperty<TableColumn.SortType>> op)
      Applies a function to the sortTypeProperty of the instance being constructed. This serves as a shorthand form of the apply method.

      Example:

      // Use apply
      .apply(obj -> obj.sortTypeProperty().bind(anotherProperty))
      
      // Use shorthand form
      .sortTypePropertyApply(prop -> prop.bind(anotherProperty))
      
      Returns:
      builder instance
    • sortablePropertyApply

      public TableColumnBuilder<S,T> sortablePropertyApply(Consumer<BooleanProperty> op)
      Applies a function to the sortableProperty of the instance being constructed. This serves as a shorthand form of the apply method.

      Example:

      // Use apply
      .apply(obj -> obj.sortableProperty().bind(anotherProperty))
      
      // Use shorthand form
      .sortablePropertyApply(prop -> prop.bind(anotherProperty))
      
      Returns:
      builder instance
    • stylePropertyApply

      public TableColumnBuilder<S,T> stylePropertyApply(Consumer<StringProperty> op)
      Applies a function to the styleProperty of the instance being constructed. This serves as a shorthand form of the apply method.

      Example:

      // Use apply
      .apply(obj -> obj.styleProperty().bind(anotherProperty))
      
      // Use shorthand form
      .stylePropertyApply(prop -> prop.bind(anotherProperty))
      
      Returns:
      builder instance
    • tableViewPropertyApply

      public TableColumnBuilder<S,T> tableViewPropertyApply(Consumer<ReadOnlyObjectProperty<TableView<S>>> op)
      Applies a function to the tableViewProperty of the instance being constructed. This serves as a shorthand form of the apply method.

      Example:

      // Use apply
      .apply(obj -> obj.tableViewProperty().bind(anotherProperty))
      
      // Use shorthand form
      .tableViewPropertyApply(prop -> prop.bind(anotherProperty))
      
      Returns:
      builder instance
    • textPropertyApply

      public TableColumnBuilder<S,T> textPropertyApply(Consumer<StringProperty> op)
      Applies a function to the textProperty of the instance being constructed. This serves as a shorthand form of the apply method.

      Example:

      // Use apply
      .apply(obj -> obj.textProperty().bind(anotherProperty))
      
      // Use shorthand form
      .textPropertyApply(prop -> prop.bind(anotherProperty))
      
      Returns:
      builder instance
    • visiblePropertyApply

      public TableColumnBuilder<S,T> visiblePropertyApply(Consumer<BooleanProperty> op)
      Applies a function to the visibleProperty of the instance being constructed. This serves as a shorthand form of the apply method.

      Example:

      // Use apply
      .apply(obj -> obj.visibleProperty().bind(anotherProperty))
      
      // Use shorthand form
      .visiblePropertyApply(prop -> prop.bind(anotherProperty))
      
      Returns:
      builder instance
    • widthPropertyApply

      public TableColumnBuilder<S,T> widthPropertyApply(Consumer<ReadOnlyDoubleProperty> op)
      Applies a function to the widthProperty of the instance being constructed. This serves as a shorthand form of the apply method.

      Example:

      // Use apply
      .apply(obj -> obj.widthProperty().bind(anotherProperty))
      
      // Use shorthand form
      .widthPropertyApply(prop -> prop.bind(anotherProperty))
      
      Returns:
      builder instance