Class TableView.Column

  • Enclosing class:
    TableView

    @DefaultProperty("cellRenderer")
    public static class TableView.Column
    extends java.lang.Object
    Contains information about a table column.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static int DEFAULT_WIDTH
      Default column width.
    • Constructor Summary

      Constructors 
      Constructor Description
      Column()
      Creates an empty column.
      Column​(java.lang.String name)
      Creates a new column with no header data and a fixed default width.
      Column​(java.lang.String name, java.lang.Object headerData)
      Creates a new column with a fixed default width.
      Column​(java.lang.String name, java.lang.Object headerData, int width)
      Creates a new column with a fixed width.
      Column​(java.lang.String name, java.lang.Object headerData, int width, boolean relative)
      Creates a new column.
      Column​(TableView tableView)  
      Column​(TableView tableView, java.lang.String name)  
      Column​(TableView tableView, java.lang.String name, java.lang.Object headerData)  
      Column​(TableView tableView, java.lang.String name, java.lang.Object headerData, int width)  
      Column​(TableView tableView, java.lang.String name, java.lang.Object headerData, int width, boolean relative)  
    • Field Detail

      • DEFAULT_WIDTH

        public static final int DEFAULT_WIDTH
        Default column width.
        See Also:
        Constant Field Values
    • Constructor Detail

      • Column

        public Column()
        Creates an empty column.
      • Column

        public Column​(java.lang.String name)
        Creates a new column with no header data and a fixed default width.
        Parameters:
        name - The column name.
      • Column

        public Column​(java.lang.String name,
                      java.lang.Object headerData)
        Creates a new column with a fixed default width.
        Parameters:
        name - The column name.
        headerData - The column header data.
      • Column

        public Column​(java.lang.String name,
                      java.lang.Object headerData,
                      int width)
        Creates a new column with a fixed width.
        Parameters:
        name - The column name.
        headerData - The column header data.
        width - The width of the column.
      • Column

        public Column​(java.lang.String name,
                      java.lang.Object headerData,
                      int width,
                      boolean relative)
        Creates a new column.
        Parameters:
        name - The column name.
        headerData - The column header data.
        width - The width of the column.
        relative - If true, specifies a relative column width; otherwise, specifies a fixed column width.
      • Column

        public Column​(TableView tableView)
      • Column

        public Column​(TableView tableView,
                      java.lang.String name)
      • Column

        public Column​(TableView tableView,
                      java.lang.String name,
                      java.lang.Object headerData)
      • Column

        public Column​(TableView tableView,
                      java.lang.String name,
                      java.lang.Object headerData,
                      int width)
      • Column

        public Column​(TableView tableView,
                      java.lang.String name,
                      java.lang.Object headerData,
                      int width,
                      boolean relative)
    • Method Detail

      • getTableView

        public TableView getTableView()
        Returns the table view with which this column is associated.
        Returns:
        The column's table view, or null if the column does not currently belong to a table.
      • getName

        public java.lang.String getName()
        Returns the column name.
        Returns:
        The column name.
      • setName

        public void setName​(java.lang.String name)
        Sets the column name.
        Parameters:
        name - The column name.
      • getHeaderData

        public java.lang.Object getHeaderData()
        Returns the column header data.
        Returns:
        The column header data, or null if the column has no header data.
      • setHeaderData

        public void setHeaderData​(java.lang.Object headerData)
        Sets the column header data.
        Parameters:
        headerData - The column header data, or null for no header data.
      • setHeaderDataRenderer

        public void setHeaderDataRenderer​(TableView.HeaderDataRenderer headerDataRenderer)
        Sets the column header data renderer.
        Parameters:
        headerDataRenderer - The new renderer for the header data.
      • getWidth

        public int getWidth()
        Returns the column width.
        Returns:
        The width of the column.
      • isRelative

        public boolean isRelative()
        Returns the relative flag.
        Returns:
        true if the column width is relative, false if it is fixed.
      • setWidth

        public void setWidth​(int width)
        Set the column width.
        Parameters:
        width - The absolute width of the column.
      • setWidth

        public void setWidth​(java.lang.String width)
        Set the column width.
        Parameters:
        width - The encoded width of the row. If the string ends with the '*' character, it is treated as a relative value. Otherwise, it is considered an absolute value.
      • setWidth

        public void setWidth​(int width,
                             boolean relative)
        Sets the column width.
        Parameters:
        width - The width of the column.
        relative - true if the column width is relative, false if it is fixed.
      • getWidthLimits

        public Limits getWidthLimits()
        Returns:
        The minimum and maximum widths to which the column can size.
      • setWidthLimits

        public void setWidthLimits​(int minimumWidth,
                                   int maximumWidth)
        Sets the minimum and maximum widths the column can size to.
        Parameters:
        minimumWidth - Column width cannot be smaller than this size.
        maximumWidth - Column width cannot be greater than this size.
      • setWidthLimits

        public void setWidthLimits​(Limits widthLimits)
        Sets the minimum and maximum widths to which the column can size.
        Parameters:
        widthLimits - The new width limits.
      • getMinimumWidth

        public int getMinimumWidth()
        Gets the minimum width the column is allowed to be.
        Returns:
        Minimum column width.
      • setMinimumWidth

        public void setMinimumWidth​(int minimumWidth)
        Sets the minimum width the column is allowed to be.
        Parameters:
        minimumWidth - Minimum column width.
      • getMaximumWidth

        public int getMaximumWidth()
        Get the maximum width the column is allowed to be.
        Returns:
        Maximum column width.
      • setMaximumWidth

        public void setMaximumWidth​(int maximumWidth)
        Set the maximum width the column is allowed to be.
        Parameters:
        maximumWidth - Maximum column width.
      • getFilter

        public java.lang.Object getFilter()
        Returns the column's filter.
        Returns:
        The column's filter, or null if the column does not have a filter.
      • setFilter

        public void setFilter​(java.lang.Object filter)
        Sets the column's filter.
        Parameters:
        filter - The column's filter, or null for no filter.
      • getCellRenderer

        public TableView.CellRenderer getCellRenderer()
        Returns the column's cell renderer.
        Returns:
        The cell renderer that is used to draw the contents of this column.
      • setCellRenderer

        public void setCellRenderer​(TableView.CellRenderer cellRenderer)
        Sets the column's cell renderer.
        Parameters:
        cellRenderer - The cell renderer that is used to draw the contents of this column.