Class DefaultTableColumnModel<V>

java.lang.Object
com.globalmentor.beans.BoundPropertyObject
Type Parameters:
V - The type of values contained in the table column.
All Implemented Interfaces:
com.globalmentor.beans.PropertyBindable, com.globalmentor.beans.PropertyConstrainable, InfoModel, LabelModel, Model, TableColumnModel<V>
Direct Known Subclasses:
CalendarMonthTableModel.WeekDayTableColumnModel

public class DefaultTableColumnModel<V> extends DefaultInfoModel implements TableColumnModel<V>
The default implementation of a column in a table. The table column model by default is not editable.
Author:
Garret Wilson
  • Constructor Details

    • DefaultTableColumnModel

      public DefaultTableColumnModel(Class<V> valueClass)
      Value class constructor.
      Parameters:
      valueClass - The class indicating the type of values held in the model.
      Throws:
      NullPointerException - if the given value class is null.
    • DefaultTableColumnModel

      public DefaultTableColumnModel(Class<V> valueClass, String label)
      Value class and label constructor.
      Parameters:
      valueClass - The class indicating the type of values held in the model.
      label - The text of the label, or null if there should be no label.
    • DefaultTableColumnModel

      public DefaultTableColumnModel(Class<V> valueClass, String label, URI glyphURI)
      Value class, label, and glyph URI constructor.
      Parameters:
      valueClass - The class indicating the type of values held in the model.
      label - The text of the label, or null if there should be no label.
      glyphURI - The glyph URI, which may be a resource URI, or null if there is no glyph URI.
  • Method Details

    • getValueClass

      public Class<V> getValueClass()
      Specified by:
      getValueClass in interface TableColumnModel<V>
      Returns:
      The class representing the type of values this model can hold.
    • isEditable

      public boolean isEditable()
      Specified by:
      isEditable in interface TableColumnModel<V>
      Returns:
      Whether the cells in this table column model are editable and will allow the the user to change their values.
    • setEditable

      public void setEditable(boolean newEditable)
      Description copied from interface: TableColumnModel
      Sets whether the cells in this table column model are editable and will allow the the user to change their values. This is a bound property of type Boolean.
      Specified by:
      setEditable in interface TableColumnModel<V>
      Parameters:
      newEditable - true if the table column cells should allow the user to change their values.
      See Also:
    • getStyleID

      public String getStyleID()
      Specified by:
      getStyleID in interface TableColumnModel<V>
      Returns:
      The style identifier, or null if there is no style ID.
    • setStyleID

      public void setStyleID(String newStyleID)
      Description copied from interface: TableColumnModel
      Identifies the style for the column. This is a bound property.
      Specified by:
      setStyleID in interface TableColumnModel<V>
      Parameters:
      newStyleID - The style identifier, or null if there is no style ID.
      See Also:
    • getValidator

      public Validator<V> getValidator()
      Specified by:
      getValidator in interface TableColumnModel<V>
      Returns:
      The validator for cells in this column, or null if no validator is installed.
    • setValidator

      public void setValidator(Validator<V> newValidator)
      Description copied from interface: TableColumnModel
      Sets the validator. This is a bound property
      Specified by:
      setValidator in interface TableColumnModel<V>
      Parameters:
      newValidator - The validator for cells in this column, or null if no validator should be used.
      See Also:
    • isVisible

      public boolean isVisible()
      Specified by:
      isVisible in interface TableColumnModel<V>
      Returns:
      Whether the column is visible.
    • setVisible

      public void setVisible(boolean newVisible)
      Description copied from interface: TableColumnModel
      Sets whether the column is visible. This is a bound property of type Boolean.
      Specified by:
      setVisible in interface TableColumnModel<V>
      Parameters:
      newVisible - true if the column should be visible, else false.
      See Also: