Package io.guise.framework.model
Class DefaultTableColumnModel<V>
- java.lang.Object
-
- com.globalmentor.beans.BoundPropertyObject
-
- io.guise.framework.model.AbstractModel
-
- io.guise.framework.model.DefaultLabelModel
-
- io.guise.framework.model.DefaultInfoModel
-
- io.guise.framework.model.DefaultTableColumnModel<V>
-
- 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
-
-
Field Summary
-
Fields inherited from class com.globalmentor.beans.BoundPropertyObject
NO_PROPERTY_CHANGE_LISTENERS, NO_VETOABLE_CHANGE_LISTENERS
-
Fields inherited from interface io.guise.framework.model.InfoModel
DESCRIPTION_CONTENT_TYPE_PROPERTY, DESCRIPTION_PROPERTY, INFO_CONTENT_TYPE_PROPERTY, INFO_PROPERTY
-
Fields inherited from interface io.guise.framework.model.LabelModel
GLYPH_URI_PROPERTY, LABEL_CONTENT_TYPE_PROPERTY, LABEL_PROPERTY
-
Fields inherited from interface io.guise.framework.model.TableColumnModel
STYLE_ID_PROPERTY, VALIDATOR_PROPERTY, VISIBLE_PROPERTY
-
-
Constructor Summary
Constructors Constructor Description DefaultTableColumnModel(java.lang.Class<V> valueClass)
Value class constructor.DefaultTableColumnModel(java.lang.Class<V> valueClass, java.lang.String label)
Value class and label constructor.DefaultTableColumnModel(java.lang.Class<V> valueClass, java.lang.String label, java.net.URI glyphURI)
Value class, label, and glyph URI constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
getStyleID()
Validator<V>
getValidator()
java.lang.Class<V>
getValueClass()
boolean
isEditable()
boolean
isVisible()
void
setEditable(boolean newEditable)
Sets whether the cells in this table column model are editable and will allow the the user to change their values.void
setStyleID(java.lang.String newStyleID)
Identifies the style for the column.void
setValidator(Validator<V> newValidator)
Sets the validator.void
setVisible(boolean newVisible)
Sets whether the column is visible.-
Methods inherited from class io.guise.framework.model.DefaultInfoModel
getDescription, getDescriptionContentType, getInfo, getInfoContentType, setDescription, setDescriptionContentType, setInfo, setInfoContentType
-
Methods inherited from class io.guise.framework.model.DefaultLabelModel
getGlyphURI, getLabel, getLabelContentType, setGlyphURI, setLabel, setLabelContentType, toString
-
Methods inherited from class io.guise.framework.model.AbstractModel
getEventListenerManager, getPlainText
-
Methods inherited from class com.globalmentor.beans.BoundPropertyObject
addPropertyChangeListener, addPropertyChangeListener, addVetoableChangeListener, addVetoableChangeListener, createPostponedPropertyChangeEvent, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, fireVetoableChange, fireVetoableChange, fireVetoableChange, getForwardPropertyChangeListener, getPropertyChangeListeners, getPropertyChangeListeners, getPropertyChangeSupport, getRepeatPropertyChangeListener, getRepeatVetoableChangeListener, getVetoableChangeListeners, getVetoableChangeListeners, getVetoableChangeSupport, hasPropertyChangeListeners, hasVetoableChangeListeners, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, removeVetoableChangeListener
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface io.guise.framework.model.InfoModel
getDescription, getDescriptionContentType, getInfo, getInfoContentType, setDescription, setDescriptionContentType, setInfo, setInfoContentType
-
Methods inherited from interface io.guise.framework.model.LabelModel
getGlyphURI, getLabel, getLabelContentType, setGlyphURI, setLabel, setLabelContentType
-
-
-
-
Constructor Detail
-
DefaultTableColumnModel
public DefaultTableColumnModel(java.lang.Class<V> valueClass)
Value class constructor.- Parameters:
valueClass
- The class indicating the type of values held in the model.- Throws:
java.lang.NullPointerException
- if the given value class isnull
.
-
DefaultTableColumnModel
public DefaultTableColumnModel(java.lang.Class<V> valueClass, java.lang.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, ornull
if there should be no label.
-
DefaultTableColumnModel
public DefaultTableColumnModel(java.lang.Class<V> valueClass, java.lang.String label, java.net.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, ornull
if there should be no label.glyphURI
- The glyph URI, which may be a resource URI, ornull
if there is no glyph URI.
-
-
Method Detail
-
getValueClass
public java.lang.Class<V> getValueClass()
- Specified by:
getValueClass
in interfaceTableColumnModel<V>
- Returns:
- The class representing the type of values this model can hold.
-
isEditable
public boolean isEditable()
- Specified by:
isEditable
in interfaceTableColumnModel<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 typeBoolean
.- Specified by:
setEditable
in interfaceTableColumnModel<V>
- Parameters:
newEditable
-true
if the table column cells should allow the user to change their values.- See Also:
EditComponent.EDITABLE_PROPERTY
-
getStyleID
public java.lang.String getStyleID()
- Specified by:
getStyleID
in interfaceTableColumnModel<V>
- Returns:
- The style identifier, or
null
if there is no style ID.
-
setStyleID
public void setStyleID(java.lang.String newStyleID)
Description copied from interface:TableColumnModel
Identifies the style for the column. This is a bound property.- Specified by:
setStyleID
in interfaceTableColumnModel<V>
- Parameters:
newStyleID
- The style identifier, ornull
if there is no style ID.- See Also:
TableColumnModel.STYLE_ID_PROPERTY
-
getValidator
public Validator<V> getValidator()
- Specified by:
getValidator
in interfaceTableColumnModel<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 interfaceTableColumnModel<V>
- Parameters:
newValidator
- The validator for cells in this column, ornull
if no validator should be used.- See Also:
TableColumnModel.VALIDATOR_PROPERTY
-
isVisible
public boolean isVisible()
- Specified by:
isVisible
in interfaceTableColumnModel<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 typeBoolean
.- Specified by:
setVisible
in interfaceTableColumnModel<V>
- Parameters:
newVisible
-true
if the column should be visible, elsefalse
.- See Also:
TableColumnModel.VISIBLE_PROPERTY
-
-