Package io.guise.framework.component
Class Table
java.lang.Object
- All Implemented Interfaces:
com.globalmentor.beans.PropertyBindable
,com.globalmentor.beans.PropertyConstrainable
,io.clogr.Clogged
,Component
,CompositeComponent
,Control
,EditComponent
,InputFocusableComponent
,EditListenable
,Displayable
,Enableable
,InfoModel
,LabelModel
,Model
,TableModel
,PresentationModel
,DepictedObject
public class Table
extends AbstractCompositeStateControl<TableModel.Cell<?>,Table.CellComponentState>
implements EditComponent, TableModel
A table component.
Property changes to a column's UI model are repeated with the component as the source and the column UI model as the target.
- Author:
- Garret Wilson
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static class
An encapsulation of a component for a cell along with other metadata, such as whether the component was editable when created.static interface
A strategy for generating components to represent table cell model values.protected static class
An encapsulation of the user interface-related model used for a column.static class
A message model that returns a default representation of the cell in a message.static class
A default table cell representation strategy.static class
A value model that returns and updates a the value of the cell.Nested classes/interfaces inherited from class io.guise.framework.component.AbstractCompositeStateComponent
AbstractCompositeStateComponent.ComponentState
Nested classes/interfaces inherited from class io.guise.framework.component.AbstractComponent
AbstractComponent.AbstractFlyoverFrameStrategy<S extends Component>, AbstractComponent.AbstractFlyoverStrategy<S extends Component>, AbstractComponent.DefaultFlyoverStrategy<S extends Component>
Nested classes/interfaces inherited from interface io.guise.framework.component.Component
Component.FlyoverStrategy<S extends Component>
Nested classes/interfaces inherited from interface io.guise.framework.component.Control
Control.Status
Nested classes/interfaces inherited from interface io.guise.framework.model.TableModel
TableModel.Cell<C>
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String
The display row count bound property.static final String
The display row start index bound property.protected final PropertyChangeListener
The property change listener that updates prototype properties.Fields inherited from class com.globalmentor.beans.BoundPropertyObject
NO_PROPERTY_CHANGE_LISTENERS, NO_VETOABLE_CHANGE_LISTENERS
Fields inherited from interface io.guise.framework.component.Component
BOOKMARK_ENABLED_PROPERTY, CONSTRAINTS_PROPERTY, DRAG_ENABLED_PROPERTY, DROP_ENABLED_PROPERTY, FLYOVER_ENABLED_PROPERTY, FLYOVER_STRATEGY_PROPERTY, INPUT_STRATEGY_PROPERTY, NAME_PROPERTY, NOTIFICATION_PROPERTY, ORIENTATION_PROPERTY, THEME_APPLIED_PROPERTY, VALID_PROPERTY
Fields inherited from interface io.guise.framework.component.Control
STATUS_PROPERTY
Fields inherited from interface io.guise.framework.model.Displayable
DISPLAYED_PROPERTY
Fields inherited from interface io.guise.framework.component.EditComponent
EDITABLE_PROPERTY
Fields inherited from interface io.guise.framework.model.Enableable
ENABLED_PROPERTY
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.ui.PresentationModel
BACKGROUND_COLOR_PROPERTY, BORDER_LINE_FAR_COLOR_PROPERTY, BORDER_LINE_FAR_EXTENT_PROPERTY, BORDER_LINE_FAR_STYLE_PROPERTY, BORDER_LINE_NEAR_COLOR_PROPERTY, BORDER_LINE_NEAR_EXTENT_PROPERTY, BORDER_LINE_NEAR_STYLE_PROPERTY, BORDER_PAGE_FAR_COLOR_PROPERTY, BORDER_PAGE_FAR_EXTENT_PROPERTY, BORDER_PAGE_FAR_STYLE_PROPERTY, BORDER_PAGE_NEAR_COLOR_PROPERTY, BORDER_PAGE_NEAR_EXTENT_PROPERTY, BORDER_PAGE_NEAR_STYLE_PROPERTY, CORNER_LINE_FAR_PAGE_FAR_ARC_SIZE_PROPERTY, CORNER_LINE_FAR_PAGE_NEAR_ARC_SIZE_PROPERTY, CORNER_LINE_NEAR_PAGE_FAR_ARC_SIZE_PROPERTY, CORNER_LINE_NEAR_PAGE_NEAR_ARC_SIZE_PROPERTY, CURSOR_PROPERTY, FONT_FAMILIES_PROPERTY, FONT_SIZE_PROPERTY, FONT_STYLE_PROPERTY, FONT_WEIGHT_BOLD, FONT_WEIGHT_NORMAL, FONT_WEIGHT_PROPERTY, LABEL_FONT_FAMILIES_PROPERTY, LABEL_FONT_SIZE_PROPERTY, LABEL_FONT_STYLE_PROPERTY, LABEL_FONT_WEIGHT_PROPERTY, LABEL_TEXT_COLOR_PROPERTY, LINE_EXTENT_PROPERTY, MARGIN_LINE_FAR_EXTENT_PROPERTY, MARGIN_LINE_NEAR_EXTENT_PROPERTY, MARGIN_PAGE_FAR_EXTENT_PROPERTY, MARGIN_PAGE_NEAR_EXTENT_PROPERTY, OPACITY_PROPERTY, PADDING_LINE_FAR_EXTENT_PROPERTY, PADDING_LINE_NEAR_EXTENT_PROPERTY, PADDING_PAGE_FAR_EXTENT_PROPERTY, PADDING_PAGE_NEAR_EXTENT_PROPERTY, PAGE_EXTENT_PROPERTY, ROUNDED_CORNER_ARC_SIZE, STYLE_ID_PROPERTY, TEXT_COLOR_PROPERTY, TOOLTIP_ENABLED_PROPERTY, VISIBLE_PROPERTY
-
Constructor Summary
ConstructorsConstructorDescriptionTable
(TableColumnModel<?>... columns) Columns constructor with a default data model.Table
(TableModel tableModel) Table model constructor.Value class, table data, and column names constructor with a default data model.Value class and column names constructor with a default data model.Table
(Object[][] rowValues, TableColumnModel<?>... columns) Table data and columns constructor with a default data model. -
Method Summary
Modifier and TypeMethodDescriptionvoid
addEditListener
(EditListener editListener) Adds an edit listener.protected Table.CellComponentState
createComponentState
(TableModel.Cell<?> cell) Creates a component state to represent the given object.protected <T> Table.CellComponentState
createTypedComponentState
(TableModel.Cell<T> cell) Creates a component state to represent the given object.protected void
Fires an edit event to all registered edit listeners.protected void
fireEdited
(EditEvent editEvent) Fires a given edit event to all registered edit listeners.<V> Table.CellRepresentationStrategy<? super V>
getCellRepresentationStrategy
(TableColumnModel<V> column) Returns the given cell representation strategy assigned to produce representation components for the given column.<V> Table.CellRepresentationStrategy<? super V>
getCellRepresentationStrategy
(Class<V> valueClass) Returns the given cell representation strategy assigned to produce representation components for the given value class.<C> C
getCellValue
(int rowIndex, TableColumnModel<C> column) Returns the cell value at the given row and column.<C> C
getCellValue
(TableModel.Cell<C> cell) Returns the cell value for the given cell.int
int
getColumnIndex
(TableColumnModel<?> column) Determines the logical index of the given table column.getColumnLabelFontFamilies
(TableColumnModel<?> column) Returns the label font families for a given column.getColumnLabelFontSize
(TableColumnModel<?> column) Returns the label font size for a given column.getColumnLabelFontStyle
(TableColumnModel<?> column) Returns the label font style for a given column.double
getColumnLabelFontWeight
(TableColumnModel<?> column) Returns the label font weight for a given column.getColumnPaddingExtent
(TableColumnModel<?> column, Border border) Returns the padding extent of the indicated column border.getColumnPaddingLineFarExtent
(TableColumnModel<?> column) Returns the padding extent of the column line far page near border.getColumnPaddingLineNearExtent
(TableColumnModel<?> column) Returns the padding extent of the column line near page near border.getColumnPaddingPageFarExtent
(TableColumnModel<?> column) Returns the padding extent of the column line far page far border.getColumnPaddingPageNearExtent
(TableColumnModel<?> column) Returns the padding extent of the column line near page far border.List<TableColumnModel<?>>
getColumnUIModel
(TableColumnModel<?> column) Retrieves the UI model for the given column.getComponent
(TableModel.Cell<?> cell) Retrieves the component for the given object.int
int
int
protected TableModel
void
goFirst()
Goes to the first set of table rows.void
goLast()
Goes to the last set of table rows if the display row count is restricted.void
goNext()
Goes to the next set of table rows if the display row count is restricted.void
Goes to the previous set of table rows if the display row count is restricted.boolean
void
removeEditListener
(EditListener editListener) Removes an edit listener.<V> Table.CellRepresentationStrategy<? super V>
setCellRepresentationStrategy
(TableColumnModel<V> column, Table.CellRepresentationStrategy<V> cellRepresentationStrategy) Installs the given cell representation strategy to produce representation components for the given column.<V> Table.CellRepresentationStrategy<? super V>
setCellRepresentationStrategy
(Class<V> valueClass, Table.CellRepresentationStrategy<V> cellRepresentationStrategy) Installs the given cell representation strategy to produce representation components for the given value class.<C> void
setCellValue
(int rowIndex, TableColumnModel<C> column, C newCellValue) Sets the cell value at the given row and column.<C> void
setCellValue
(TableModel.Cell<C> cell, C newCellValue) Sets the cell value for the given cell.void
setColumnLabelFontFamilies
(TableColumnModel<?> column, List<String> newLabelFontFamilies) Sets the font families of the label for a given column.void
setColumnLabelFontFamilies
(List<String> newLabelFontFamilies) Sets the font families of the labels of all columns.void
setColumnLabelFontSize
(Extent newLabelFontSize) Sets the label font size of all columns.void
setColumnLabelFontSize
(TableColumnModel<?> column, Extent newLabelFontSize) Sets the label font size of a given column.void
setColumnLabelFontStyle
(TableColumnModel<?> column, FontStyle newLabelFontStyle) Sets the style of the label font for a given column.void
setColumnLabelFontStyle
(FontStyle newLabelFontStyle) Sets the style of the label font for all columns.void
setColumnLabelFontWeight
(double newLabelFontWeight) Sets the weight of the label font of all columns.void
setColumnLabelFontWeight
(TableColumnModel<?> column, double newLabelFontWeight) Sets the weight of the label font of a given column.void
setColumnPaddingExtent
(Border border, Extent newPaddingExtent) Sets the padding extent of a all column borders of all columns.void
setColumnPaddingExtent
(Extent newPaddingExtent) Sets the padding extent of all borders of all columns.void
setColumnPaddingExtent
(TableColumnModel<?> column, Border border, Extent newPaddingExtent) Sets the padding extent of a given column border.void
setColumnPaddingExtent
(TableColumnModel<?> column, Extent newPaddingExtent) Sets the padding extent of all borders of a column.void
setColumnPaddingLineFarExtent
(Extent newPaddingExtent) Sets the padding extent of the line far border of all columns.void
setColumnPaddingLineFarExtent
(TableColumnModel<?> column, Extent newPaddingExtent) Sets the padding extent of the column line far border.void
setColumnPaddingLineNearExtent
(Extent newPaddingExtent) Sets the padding extent of the line near border of all columns.void
setColumnPaddingLineNearExtent
(TableColumnModel<?> column, Extent newPaddingExtent) Sets the padding extent of the column line near border.void
setColumnPaddingPageFarExtent
(Extent newPaddingExtent) Sets the padding extent of the page far border of all columns.void
setColumnPaddingPageFarExtent
(TableColumnModel<?> column, Extent newPaddingExtent) Sets the padding extent of the column page far border.void
setColumnPaddingPageNearExtent
(Extent newPaddingExtent) Sets the padding extent of the page near border of all columns.void
setColumnPaddingPageNearExtent
(TableColumnModel<?> column, Extent newPaddingExtent) Sets the padding extent of the column page near border.void
setDisplayRowCount
(int newDisplayRowCount) Sets the number of rows to display at one time.void
setDisplayRowStartIndex
(int newDisplayRowStartIndex) Sets the index of the first row to display.void
setEditable
(boolean newEditable) Sets whether the value is editable and the component will allow the the user to change the value.protected void
Updates the state of the prototypes, such as previous and next.Methods inherited from class io.guise.framework.component.AbstractCompositeStateControl
determineStatus, getEnableable, getStatus, isEnabled, reset, setEnabled, setNotification, setStatus, updateStatus, updateValid
Methods inherited from class io.guise.framework.component.AbstractCompositeStateComponent
clearComponentStates, determineComponentState, getComponentState, getComponentStates, getObject, putComponentState, removeComponentState
Methods inherited from class io.guise.framework.component.AbstractMultipleCompositeComponent
addComponent, getChildComponents, hasChildComponents, removeComponent
Methods inherited from class io.guise.framework.component.AbstractCompositeComponent
addCompositeComponentListener, childComponentValidPropertyChanged, determineChildrenValid, determineValid, dispatchInputEvent, dispatchInputEvent, fireChildComponentAdded, fireChildComponentAdded, fireChildComponentRemoved, fireChildComponentRemoved, initializeChildComponent, loadPreferences, removeCompositeComponentListener, resetTheme, savePreferences, uninitializeChildComponent, updateTheme, validate, validateChildren
Methods inherited from class io.guise.framework.component.AbstractComponent
addCommandListener, addExportStrategy, addImportStrategy, addKeyListener, addMouseListener, addNotificationListener, addPreferenceProperty, applyTheme, applyTheme, depict, equals, exportTransfer, fireInputEvent, fireNotified, fireNotified, getAncestor, getCommandListeners, getComponentByID, getComponentByName, getComponentOrientation, getConstraints, getDepictID, getDepictor, getDescription, getDescriptionContentType, getDirtyComponents, getDirtyComponents, getEventListenerManager, getFlyoverStrategy, getGlyphURI, getInfo, getInfoContentType, getInfoModel, getInputStrategy, getKeyListeners, getLabel, getLabelContentType, getMouseListeners, getName, getNotification, getNotifications, getNotifications, getOrientation, getParent, getPreferenceProperties, getRootComponent, getTheme, hasAncestor, hasCommandListeners, hashCode, hasKeyListeners, hasMouseListeners, importTransfer, initialize, isDragEnabled, isDropEnabled, isFlyoverEnabled, isPreferenceProperty, isThemeApplied, isValid, notify, processEvent, removeCommandListener, removeExportStrategy, removeImportStrategy, removeKeyListener, removeMouseListener, removeNotificationListener, removePreferenceProperty, setConstraints, setDepicted, setDescription, setDescriptionContentType, setDragEnabled, setDropEnabled, setFlyoverEnabled, setFlyoverStrategy, setGlyphURI, setInfo, setInfoContentType, setInputStrategy, setLabel, setLabelContentType, setName, setOrientation, setParent, setThemeApplied, setValid, toString, update
Methods inherited from class io.guise.framework.model.ui.AbstractPresentationModel
BorderLineFarColor, BorderLineFarExtent, BorderLineFarStyle, BorderLineNearColor, BorderLineNearExtent, BorderLineNearStyle, BorderPageFarColor, BorderPageFarExtent, BorderPageFarStyle, BorderPageNearColor, BorderPageNearExtent, BorderPageNearStyle, getBackgroundColor, getBorderColor, getBorderExtent, getBorderStyle, getCornerArcSize, getCornerLineFarPageFarArcSize, getCornerLineFarPageNearArcSize, getCornerLineNearPageFarArcSize, getCornerLineNearPageNearArcSize, getCursor, getExtent, getFontFamilies, getFontSize, getFontStyle, getFontWeight, getLabelFontFamilies, getLabelFontSize, getLabelFontStyle, getLabelFontWeight, getLabelTextColor, getLineExtent, getMarginExtent, getMarginLineFarExtent, getMarginLineNearExtent, getMarginPageFarExtent, getMarginPageNearExtent, getOpacity, getPaddingExtent, getPaddingLineFarExtent, getPaddingLineNearExtent, getPaddingPageFarExtent, getPaddingPageNearExtent, getPageExtent, getStyleID, getTextColor, isDisplayed, isTooltipEnabled, isVisible, setBackgroundColor, setBorderColor, setBorderColor, setBorderExtent, setBorderExtent, setBorderLineFarColor, setBorderLineFarExtent, setBorderLineFarStyle, setBorderLineNearColor, setBorderLineNearExtent, setBorderLineNearStyle, setBorderPageFarColor, setBorderPageFarExtent, setBorderPageFarStyle, setBorderPageNearColor, setBorderPageNearExtent, setBorderPageNearStyle, setBorderStyle, setBorderStyle, setCornerArcSize, setCornerArcSize, setCornerLineFarPageFarArcSize, setCornerLineFarPageNearArcSize, setCornerLineNearPageFarArcSize, setCornerLineNearPageNearArcSize, setCursor, setDisplayed, setExtent, setFontFamilies, setFontSize, setFontStyle, setFontWeight, setLabelFontFamilies, setLabelFontSize, setLabelFontStyle, setLabelFontWeight, setLabelTextColor, setLineExtent, setMarginExtent, setMarginExtent, setMarginLineFarExtent, setMarginLineNearExtent, setMarginPageFarExtent, setMarginPageNearExtent, setOpacity, setPaddingExtent, setPaddingExtent, setPaddingLineFarExtent, setPaddingLineNearExtent, setPaddingPageFarExtent, setPaddingPageNearExtent, setPageExtent, setStyleID, setTextColor, setTooltipEnabled, setVisible
Methods inherited from class io.guise.framework.event.GuiseBoundPropertyObject
getSession
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, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface io.clogr.Clogged
getLogger
Methods inherited from interface io.guise.framework.component.Component
addCommandListener, addExportStrategy, addImportStrategy, addKeyListener, addMouseListener, addNotificationListener, addPreferenceProperty, applyTheme, applyTheme, dispatchInputEvent, exportTransfer, fireInputEvent, getAncestor, getComponentOrientation, getConstraints, getDepictor, getFlyoverStrategy, getInputStrategy, getName, getNotification, getOrientation, getParent, getPreferenceProperties, getTheme, hasCommandListeners, hasKeyListeners, hasMouseListeners, importTransfer, initialize, isDragEnabled, isDropEnabled, isFlyoverEnabled, isPreferenceProperty, isThemeApplied, isValid, loadPreferences, notify, removeCommandListener, removeExportStrategy, removeImportStrategy, removeKeyListener, removeMouseListener, removeNotificationListener, removePreferenceProperty, resetTheme, savePreferences, setConstraints, setDragEnabled, setDropEnabled, setFlyoverEnabled, setFlyoverStrategy, setInputStrategy, setName, setNotification, setOrientation, setParent, setThemeApplied, updateTheme, validate
Methods inherited from interface io.guise.framework.platform.DepictedObject
depict, getDepictID, getSession, processEvent
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
Methods inherited from interface io.guise.framework.model.ui.PresentationModel
BorderLineFarColor, BorderLineFarExtent, BorderLineFarStyle, BorderLineNearColor, BorderLineNearExtent, BorderLineNearStyle, BorderPageFarColor, BorderPageFarExtent, BorderPageFarStyle, BorderPageNearColor, BorderPageNearExtent, BorderPageNearStyle, getBackgroundColor, getBorderColor, getBorderExtent, getBorderStyle, getCornerArcSize, getCornerLineFarPageFarArcSize, getCornerLineFarPageNearArcSize, getCornerLineNearPageFarArcSize, getCornerLineNearPageNearArcSize, getCursor, getExtent, getFontFamilies, getFontSize, getFontStyle, getFontWeight, getLabelFontFamilies, getLabelFontSize, getLabelFontStyle, getLabelFontWeight, getLabelTextColor, getLineExtent, getMarginExtent, getMarginLineFarExtent, getMarginLineNearExtent, getMarginPageFarExtent, getMarginPageNearExtent, getOpacity, getPaddingExtent, getPaddingLineFarExtent, getPaddingLineNearExtent, getPaddingPageFarExtent, getPaddingPageNearExtent, getPageExtent, getSession, getStyleID, getTextColor, isDisplayed, isTooltipEnabled, isVisible, setBackgroundColor, setBorderColor, setBorderColor, setBorderExtent, setBorderExtent, setBorderLineFarColor, setBorderLineFarExtent, setBorderLineFarStyle, setBorderLineNearColor, setBorderLineNearExtent, setBorderLineNearStyle, setBorderPageFarColor, setBorderPageFarExtent, setBorderPageFarStyle, setBorderPageNearColor, setBorderPageNearExtent, setBorderPageNearStyle, setBorderStyle, setBorderStyle, setCornerArcSize, setCornerArcSize, setCornerLineFarPageFarArcSize, setCornerLineFarPageNearArcSize, setCornerLineNearPageFarArcSize, setCornerLineNearPageNearArcSize, setCursor, setDisplayed, setExtent, setFontFamilies, setFontSize, setFontStyle, setFontWeight, setLabelFontFamilies, setLabelFontSize, setLabelFontStyle, setLabelFontWeight, setLabelTextColor, setLineExtent, setMarginExtent, setMarginExtent, setMarginLineFarExtent, setMarginLineNearExtent, setMarginPageFarExtent, setMarginPageNearExtent, setOpacity, setPaddingExtent, setPaddingExtent, setPaddingLineFarExtent, setPaddingLineNearExtent, setPaddingPageFarExtent, setPaddingPageNearExtent, setPageExtent, setStyleID, setTextColor, setTooltipEnabled, setVisible
Methods inherited from interface com.globalmentor.beans.PropertyBindable
addPropertyChangeListener, addPropertyChangeListener, getPropertyChangeListeners, getPropertyChangeListeners, hasPropertyChangeListeners, removePropertyChangeListener, removePropertyChangeListener
Methods inherited from interface com.globalmentor.beans.PropertyConstrainable
addVetoableChangeListener, addVetoableChangeListener, getVetoableChangeListeners, getVetoableChangeListeners, hasVetoableChangeListeners, removeVetoableChangeListener, removeVetoableChangeListener
-
Field Details
-
DISPLAY_ROW_COUNT_PROPERTY
The display row count bound property. -
DISPLAY_ROW_START_INDEX_PROPERTY
The display row start index bound property. -
updatePrototypesPropertyChangeListener
The property change listener that updates prototype properties.
-
-
Constructor Details
-
Table
Value class and column names constructor with a default data model. Default cell representation strategies will be installed for the value classes of the indicated columns.- Type Parameters:
C
- The type of values in all the cells in the table.- Parameters:
valueClass
- The class indicating the type of values held in the model.columnNames
- The names to serve as label headers for the columns.- Throws:
NullPointerException
- if the given value class isnull
.
-
Table
Columns constructor with a default data model. Default cell representation strategies will be installed for the value classes of the given columns.- Parameters:
columns
- The models representing the table columns.
-
Table
Value class, table data, and column names constructor with a default data model. Default cell representation strategies will be installed for the value classes of the indicated columns.- Type Parameters:
C
- The type of values in all the cells in the table.- Parameters:
valueClass
- The class indicating the type of values held in the model.rowValues
- The two-dimensional list of values, where the first index represents the row and the second represents the column, ornull
if no default values should be given.columnNames
- The names to serve as label headers for the columns.- Throws:
NullPointerException
- if the given value class isnull
.IllegalArgumentException
- if the given number of columns does not equal the number of columns in any given data row.ClassCastException
- if one of the values in a row is not compatible with the type of its column.
-
Table
Table data and columns constructor with a default data model. Default cell representation strategies will be installed for the value classes of the given columns.- Parameters:
rowValues
- The two-dimensional list of values, where the first index represents the row and the second represents the column, ornull
if no default values should be given.columns
- The models representing the table columns.- Throws:
IllegalArgumentException
- if the given number of columns does not equal the number of columns in any given data row.ClassCastException
- if one of the values in a row is not compatible with the type of its column.
-
Table
Table model constructor. Default cell representation strategies will be installed for the value classes of all the model's columns.- Parameters:
tableModel
- The component data model.- Throws:
NullPointerException
- if the given table model isnull
.
-
-
Method Details
-
getTableModel
- Returns:
- The table model used by this component.
-
getFirstActionPrototype
- Returns:
- The prototype for the first action.
-
getPreviousActionPrototype
- Returns:
- The prototype for the previous action.
-
getNextActionPrototype
- Returns:
- The prototype for the next action.
-
getLastActionPrototype
- Returns:
- The prototype for the last action.
-
getDisplayRowCount
public int getDisplayRowCount()- Returns:
- The number of rows to display at one time, or -1 the row count is not restricted.
-
setDisplayRowCount
public void setDisplayRowCount(int newDisplayRowCount) Sets the number of rows to display at one time. This is a bound property of typeInteger
.- Parameters:
newDisplayRowCount
- The number of rows to display at one time, or -1 the row count is not restricted.- See Also:
-
getDisplayRowStartIndex
public int getDisplayRowStartIndex()- Returns:
- The index of the first row to display.
-
setDisplayRowStartIndex
public void setDisplayRowStartIndex(int newDisplayRowStartIndex) Sets the index of the first row to display. This is a bound property of typeInteger
.- Parameters:
newDisplayRowStartIndex
- The index of the first row to display.- Throws:
IndexOutOfBoundsException
- if the given index is less than zero.- See Also:
-
isEditable
public boolean isEditable()- Specified by:
isEditable
in interfaceEditComponent
- Returns:
- Whether the value is editable and the component will allow the the user to change the value.
-
setEditable
public void setEditable(boolean newEditable) Description copied from interface:EditComponent
Sets whether the value is editable and the component will allow the the user to change the value. This is a bound property of typeBoolean
.- Specified by:
setEditable
in interfaceEditComponent
- Parameters:
newEditable
-true
if the component should allow the user to change the value.- See Also:
-
setCellRepresentationStrategy
public <V> Table.CellRepresentationStrategy<? super V> setCellRepresentationStrategy(Class<V> valueClass, Table.CellRepresentationStrategy<V> cellRepresentationStrategy) Installs the given cell representation strategy to produce representation components for the given value class. The specified representation strategy will only be used if there is no representation strategy for a given column.- Type Parameters:
V
- The type of value represented.- Parameters:
valueClass
- The value class with which the strategy should be associated.cellRepresentationStrategy
- The strategy for generating components to represent values of the given type.- Returns:
- The representation strategy previously associated with the given value class.
- See Also:
-
getCellRepresentationStrategy
public <V> Table.CellRepresentationStrategy<? super V> getCellRepresentationStrategy(Class<V> valueClass) Returns the given cell representation strategy assigned to produce representation components for the given value class. The returned representation strategy can be overridden by a representation strategy associated with a particular column.- Type Parameters:
V
- The type of value represented.- Parameters:
valueClass
- The value class with which the strategy should be associated.- Returns:
- The strategy for generating components to represent values of the given type, or
null
if there is no associated representation strategy. - See Also:
-
setCellRepresentationStrategy
public <V> Table.CellRepresentationStrategy<? super V> setCellRepresentationStrategy(TableColumnModel<V> column, Table.CellRepresentationStrategy<V> cellRepresentationStrategy) Installs the given cell representation strategy to produce representation components for the given column. A cell representation strategy for a particular column will override a cell representation strategy registered for a given type.- Type Parameters:
V
- The type of value the column represents.- Parameters:
column
- The column with which the strategy should be associated.cellRepresentationStrategy
- The strategy for generating components to represent values in the given column.- Returns:
- The representation strategy previously associated with the given column.
- See Also:
-
getCellRepresentationStrategy
public <V> Table.CellRepresentationStrategy<? super V> getCellRepresentationStrategy(TableColumnModel<V> column) Returns the given cell representation strategy assigned to produce representation components for the given column. A cell representation strategy for a particular column will override a cell representation strategy registered for a given type.- Type Parameters:
V
- The type of value the column represents.- Parameters:
column
- The column with which the strategy should be associated.- Returns:
- The strategy for generating components to represent values in the given column, or
null
if there is no associated representation strategy. - See Also:
-
getComponent
Retrieves the component for the given object. If no component yet exists for the given object, one will be created.This version is provided to allow public access.
- Overrides:
getComponent
in classAbstractCompositeStateComponent<TableModel.Cell<?>,
Table.CellComponentState> - Parameters:
cell
- The object for which a representation component should be returned.- Returns:
- The child component representing the given object.
-
createComponentState
Creates a component state to represent the given object.This implementation delegates to
createTypedComponentState(io.guise.framework.model.TableModel.Cell)
.- Specified by:
createComponentState
in classAbstractCompositeStateComponent<TableModel.Cell<?>,
Table.CellComponentState> - Parameters:
cell
- The object with which the component state is to be associated.- Returns:
- The component state to represent the given object.
-
createTypedComponentState
Creates a component state to represent the given object.- Type Parameters:
T
- The type of value contained in the cell.- Parameters:
cell
- The object with which the component state is to be associated.- Returns:
- The component state to represent the given object.
- Throws:
IllegalArgumentException
- if the given object is not an appropriate object for a component state to be created.IllegalStateException
- if there is no registered cell representation strategy appropriate for the cell.
-
getColumnUIModel
Retrieves the UI model for the given column. If no UI model yet exists for the given column, one will be created. There is normally no need for applications to call this method directly.- Parameters:
column
- The column for which a UI model should be returned.- Returns:
- The UI model for the given column.
- Throws:
NullPointerException
- if the given column isnull
.
-
getColumnLabelFontFamilies
Returns the label font families for a given column.- Parameters:
column
- The column for which the label font families should be returned.- Returns:
- The prioritized list of label font family names, or
null
if no label font family names have been specified. - Throws:
NullPointerException
- if the given column isnull
.
-
setColumnLabelFontFamilies
public void setColumnLabelFontFamilies(TableColumnModel<?> column, List<String> newLabelFontFamilies) Sets the font families of the label for a given column. This is a bound property.- Parameters:
column
- The column for which the label font families should be set.newLabelFontFamilies
- The new prioritized list of label font family names, ornull
if no label font family names are specified.- Throws:
NullPointerException
- if the given column isnull
.- See Also:
-
setColumnLabelFontFamilies
Sets the font families of the labels of all columns. This is a bound property for each column.- Parameters:
newLabelFontFamilies
- The new prioritized list of label font family names, ornull
if no label font family names are specified.- See Also:
-
getColumnLabelFontSize
Returns the label font size for a given column.- Parameters:
column
- The column for which the label font size should be returned.- Returns:
- The size of the label font from baseline to baseline, or
null
if no label font size has been specified. - Throws:
NullPointerException
- if the given column isnull
.
-
setColumnLabelFontSize
Sets the label font size of a given column. This is a bound property.- Parameters:
column
- The column for which the label font size should be set.newLabelFontSize
- The new size of the label font from baseline to baseline, ornull
there is no label font size specified.- Throws:
NullPointerException
- if the given column isnull
.- See Also:
-
setColumnLabelFontSize
Sets the label font size of all columns. This is a bound property for each column.- Parameters:
newLabelFontSize
- The new size of the label font from baseline to baseline, ornull
there is no label font size specified.- See Also:
-
getColumnLabelFontStyle
Returns the label font style for a given column.- Parameters:
column
- The column for which the label font style should be returned.- Returns:
- The style of the label font.
- Throws:
NullPointerException
- if the given column isnull
.
-
setColumnLabelFontStyle
Sets the style of the label font for a given column. This is a bound property.- Parameters:
column
- The column for which the label font size should be set.newLabelFontStyle
- The style of the label font.- Throws:
NullPointerException
- if the given column and/or label font style isnull
.- See Also:
-
setColumnLabelFontStyle
Sets the style of the label font for all columns. This is a bound property of each column.- Parameters:
newLabelFontStyle
- The style of the label font.- Throws:
NullPointerException
- if the given label font style isnull
.- See Also:
-
getColumnLabelFontWeight
Returns the label font weight for a given column.- Parameters:
column
- The column for which the label font weight should be returned.- Returns:
- The weight of the label font relative to a normal value of 0.5.
- Throws:
NullPointerException
- if the given column isnull
.
-
setColumnLabelFontWeight
Sets the weight of the label font of a given column. The weight of the label font relative to a normal value of 0.5. A font weight of 0.75 is equivalent to a bold font. It is recommended that the constant variablesPresentationModel.FONT_WEIGHT_NORMAL
andPresentationModel.FONT_WEIGHT_BOLD
be used for the most compatibility across platforms. This is a bound property of typeDouble
.- Parameters:
column
- The column for which the label font weight should be set.newLabelFontWeight
- The weight of the label font relative to a normal value of 0.5.- Throws:
NullPointerException
- if the given column isnull
.- See Also:
-
setColumnLabelFontWeight
public void setColumnLabelFontWeight(double newLabelFontWeight) Sets the weight of the label font of all columns. The weight of the label font relative to a normal value of 0.5. A font weight of 0.75 is equivalent to a bold font. It is recommended that the constant variablesPresentationModel.FONT_WEIGHT_NORMAL
andPresentationModel.FONT_WEIGHT_BOLD
be used for the most compatibility across platforms. This is a bound property of typeDouble
.- Parameters:
newLabelFontWeight
- The weight of the label font relative to a normal value of 0.5.- See Also:
-
getColumnPaddingExtent
Returns the padding extent of the indicated column border.- Parameters:
column
- The column for which a padding extent should be returned.border
- The border for which a padding extent should be returned.- Returns:
- The padding extent of the given column border.
- Throws:
NullPointerException
- if the given column isnull
.
-
getColumnPaddingLineNearExtent
Returns the padding extent of the column line near page near border.- Parameters:
column
- The column for which a padding extent should be returned.- Returns:
- The padding extent of the given column border.
- Throws:
NullPointerException
- if the given column isnull
.
-
getColumnPaddingLineFarExtent
Returns the padding extent of the column line far page near border.- Parameters:
column
- The column for which a padding extent should be returned.- Returns:
- The padding extent of the given column border.
- Throws:
NullPointerException
- if the given column isnull
.
-
getColumnPaddingPageNearExtent
Returns the padding extent of the column line near page far border.- Parameters:
column
- The column for which a padding extent should be returned.- Returns:
- The padding extent of the given column border.
- Throws:
NullPointerException
- if the given column isnull
.
-
getColumnPaddingPageFarExtent
Returns the padding extent of the column line far page far border.- Parameters:
column
- The column for which a padding extent should be returned.- Returns:
- The padding extent of the given column border.
- Throws:
NullPointerException
- if the given column isnull
.
-
setColumnPaddingExtent
public void setColumnPaddingExtent(TableColumnModel<?> column, Border border, Extent newPaddingExtent) Sets the padding extent of a given column border. The padding extent of each column border represents a bound property.- Parameters:
column
- The column for which the padding extent should be set.border
- The border for which the padding extent should be set.newPaddingExtent
- The padding extent.- Throws:
NullPointerException
- if the given column, border and/or padding extent isnull
.- See Also:
-
setColumnPaddingLineNearExtent
Sets the padding extent of the column line near border. This is a bound property.- Parameters:
column
- The column for which the padding extent should be set.newPaddingExtent
- The padding extent.- Throws:
NullPointerException
- if the given column and/or padding extent isnull
.- See Also:
-
setColumnPaddingLineFarExtent
Sets the padding extent of the column line far border. This is a bound property.- Parameters:
column
- The column for which the padding extent should be set.newPaddingExtent
- The padding extent, ornull
if the default padding extent should be used.- Throws:
NullPointerException
- if the given column and/or padding extent isnull
.- See Also:
-
setColumnPaddingPageNearExtent
Sets the padding extent of the column page near border. This is a bound property.- Parameters:
column
- The column for which the padding extent should be set.newPaddingExtent
- The padding extent, ornull
if the default padding extent should be used.- Throws:
NullPointerException
- if the given columna and/or padding extent isnull
.- See Also:
-
setColumnPaddingPageFarExtent
Sets the padding extent of the column page far border. This is a bound property.- Parameters:
column
- The column for which the padding extent should be set.newPaddingExtent
- The padding extent, ornull
if the default padding extent should be used.- Throws:
NullPointerException
- if the given column and/or padding extent isnull
.- See Also:
-
setColumnPaddingExtent
Sets the padding extent of all borders of a column. The padding extent of each column border represents a bound property.- Parameters:
column
- The column for which the padding extent should be set.newPaddingExtent
- The padding extent.- Throws:
NullPointerException
- if the given column and/or padding extent isnull
.- See Also:
-
setColumnPaddingExtent
Sets the padding extent of a all column borders of all columns. The padding extent of each column border represents a bound property.- Parameters:
border
- The border for which the padding extent should be set.newPaddingExtent
- The padding extent.- Throws:
NullPointerException
- if the border and/or padding extent isnull
.- See Also:
-
setColumnPaddingLineNearExtent
Sets the padding extent of the line near border of all columns. This is a bound property.- Parameters:
newPaddingExtent
- The padding extent.- Throws:
NullPointerException
- if the given padding extent isnull
.- See Also:
-
setColumnPaddingLineFarExtent
Sets the padding extent of the line far border of all columns. This is a bound property.- Parameters:
newPaddingExtent
- The padding extent, ornull
if the default padding extent should be used.- Throws:
NullPointerException
- if the given padding extent isnull
.- See Also:
-
setColumnPaddingPageNearExtent
Sets the padding extent of the page near border of all columns. This is a bound property.- Parameters:
newPaddingExtent
- The padding extent, ornull
if the default padding extent should be used.- Throws:
NullPointerException
- if the given padding extent isnull
.- See Also:
-
setColumnPaddingPageFarExtent
Sets the padding extent of the page far border of all columns. This is a bound property.- Parameters:
newPaddingExtent
- The padding extent, ornull
if the default padding extent should be used.- Throws:
NullPointerException
- if the given padding extent isnull
.- See Also:
-
setColumnPaddingExtent
Sets the padding extent of all borders of all columns. The padding extent of each border represents a bound property. This is a convenience method that callssetColumnPaddingExtent(Border, Extent)
for each border.- Parameters:
newPaddingExtent
- The padding extent.- Throws:
NullPointerException
- if the given padding extent isnull
.- See Also:
-
updatePrototypes
protected void updatePrototypes()Updates the state of the prototypes, such as previous and next. -
goFirst
public void goFirst()Goes to the first set of table rows. -
goPrevious
public void goPrevious()Goes to the previous set of table rows if the display row count is restricted. If the display row count is not restricted and the row start index is greater than zero, it is reset to zero. -
goNext
public void goNext()Goes to the next set of table rows if the display row count is restricted. If the display row count is not restricted, or there are no rows, nothing occurs. -
goLast
public void goLast()Goes to the last set of table rows if the display row count is restricted. If the display row count is not restricted, nothing occurs. -
getColumnIndex
Description copied from interface:TableModel
Determines the logical index of the given table column.- Specified by:
getColumnIndex
in interfaceTableModel
- Parameters:
column
- One of the table columns.- Returns:
- The zero-based logical index of the column within the table, or -1 if the column is not one of the model's columns.
-
getColumns
- Specified by:
getColumns
in interfaceTableModel
- Returns:
- A read-only list of table columns in physical order.
-
getRowCount
public int getRowCount()- Specified by:
getRowCount
in interfaceTableModel
- Returns:
- The number of rows in this table.
-
getColumnCount
public int getColumnCount()- Specified by:
getColumnCount
in interfaceTableModel
- Returns:
- The number of columns in this table.
-
getCellValue
Description copied from interface:TableModel
Returns the cell value for the given cell. This method delegates toTableModel.getCellValue(int, TableColumnModel)
.- Specified by:
getCellValue
in interfaceTableModel
- Type Parameters:
C
- The type of cell value.- Parameters:
cell
- The cell containing the row index and column information.- Returns:
- The value in the cell at the given row and column, or
null
if there is no value in that cell.
-
getCellValue
Description copied from interface:TableModel
Returns the cell value at the given row and column.- Specified by:
getCellValue
in interfaceTableModel
- Type Parameters:
C
- The type of cell values in the given column.- Parameters:
rowIndex
- The zero-based row index.column
- The column for which a value should be returned.- Returns:
- The value in the cell at the given row and column, or
null
if there is no value in that cell.
-
setCellValue
Description copied from interface:TableModel
Sets the cell value for the given cell. This method delegates toTableModel.setCellValue(int, TableColumnModel, Object)
.- Specified by:
setCellValue
in interfaceTableModel
- Type Parameters:
C
- The type of cell value.- Parameters:
cell
- The cell containing the row index and column information.newCellValue
- The value to place in the cell at the given row and column, ornull
if there should be no value in that cell.
-
setCellValue
Description copied from interface:TableModel
Sets the cell value at the given row and column.- Specified by:
setCellValue
in interfaceTableModel
- Type Parameters:
C
- The type of cell values in the given column.- Parameters:
rowIndex
- The zero-based row index.column
- The column for which a value should be returned.newCellValue
- The value to place in the cell at the given row and column, ornull
if there should be no value in that cell.
-
addEditListener
Description copied from interface:EditListenable
Adds an edit listener.- Specified by:
addEditListener
in interfaceEditListenable
- Parameters:
editListener
- The edit listener to add.
-
removeEditListener
Description copied from interface:EditListenable
Removes an edit listener.- Specified by:
removeEditListener
in interfaceEditListenable
- Parameters:
editListener
- The edit listener to remove.
-
fireEdited
protected void fireEdited()Fires an edit event to all registered edit listeners. This method delegates tofireEdited(EditEvent)
.- See Also:
-
fireEdited
Fires a given edit event to all registered edit listeners.- Parameters:
editEvent
- The edit event to fire.
-