Class TagTableColumnModelBuilder


  • public class TagTableColumnModelBuilder
    extends java.lang.Object
    Builder class allowing to construct customized tag table column models. All columns are resizable and share the same renderer.
    Since:
    9847
    • Field Detail

      • model

        private final javax.swing.table.DefaultTableColumnModel model
    • Constructor Detail

      • TagTableColumnModelBuilder

        public TagTableColumnModelBuilder​(javax.swing.table.TableCellRenderer renderer,
                                          java.lang.String... headerValues)
        Construct a new TagTableColumnModelBuilder.
        Parameters:
        renderer - rendered used for all columns
        headerValues - header values of each column, determining the number of columns
        See Also:
        TableColumn.setHeaderValue(java.lang.Object), TableColumn.setCellRenderer(javax.swing.table.TableCellRenderer)
    • Method Detail

      • setWidth

        public TagTableColumnModelBuilder setWidth​(int width,
                                                   int... indexes)
        Sets width of specified columns.
        Parameters:
        width - the new width
        indexes - indexes of columns to setup
        Returns:
        this
        See Also:
        TableColumn.setWidth(int)
      • setPreferredWidth

        public TagTableColumnModelBuilder setPreferredWidth​(int width,
                                                            int... indexes)
        Sets preferred width of specified columns.
        Parameters:
        width - the new width
        indexes - indexes of columns to setup
        Returns:
        this
        See Also:
        TableColumn.setPreferredWidth(int)
      • setMaxWidth

        public TagTableColumnModelBuilder setMaxWidth​(int width,
                                                      int... indexes)
        Sets max width of specified columns.
        Parameters:
        width - the new width
        indexes - indexes of columns to setup
        Returns:
        this
        See Also:
        TableColumn.setMaxWidth(int)
      • setCellEditor

        public TagTableColumnModelBuilder setCellEditor​(javax.swing.table.TableCellEditor editor,
                                                        int... indexes)
        Sets cell editor of specified columns.
        Parameters:
        editor - the new cell editor
        indexes - indexes of columns to setup
        Returns:
        this
        See Also:
        TableColumn.setCellEditor(javax.swing.table.TableCellEditor)
      • setSelectionModel

        public TagTableColumnModelBuilder setSelectionModel​(javax.swing.ListSelectionModel selectionModel)
        Sets selection model.
        Parameters:
        selectionModel - new selection model
        Returns:
        this
        See Also:
        DefaultTableColumnModel.setSelectionModel(javax.swing.ListSelectionModel)
      • build

        public javax.swing.table.DefaultTableColumnModel build()
        Returns the new tag table column model.
        Returns:
        the new tag table column model