public interface ItsNatTableHeader extends ItsNatElementComponent
A table header component depends on a table component and is created automatically by the table whether the table markup has a header (for instance a <thead>).
A header component is not very different to a list but column values (header data model)
are managed by the javax.swing.table.TableModel
data model of the parent table
(see DefaultTableModel.addColumn(Object)
).
Any change to the header data model is notified to the component and the markup is rendered again. The data model ever mandates over the markup, any initial markup content (initial header cell) is removed.
Almost a header cell must be present in the markup, this cell is used as pattern to create new cells, and is removed because by default the header model is empty.
If a header column is clicked the column is selected.
There is no default header cell decoration when a complete column is selected, use a column selection model listener to detect when a column is selected.
Header cell indexes start in 0.
Modifier and Type | Method and Description |
---|---|
ItsNatTable |
getItsNatTable()
Returns the table component this header belongs to.
|
ItsNatTableHeaderCellRenderer |
getItsNatTableHeaderCellRenderer()
Returns the current component renderer.
|
ItsNatTableHeaderUI |
getItsNatTableHeaderUI()
Returns the user interface manager of this component.
|
javax.swing.ListSelectionModel |
getListSelectionModel()
Returns the current header selection model.
|
int |
getSelectedIndex()
Returns the index of the first selected header column.
|
void |
setItsNatTableHeaderCellRenderer(ItsNatTableHeaderCellRenderer renderer)
Sets the component renderer.
|
void |
setListSelectionModel(javax.swing.ListSelectionModel selectionModel)
Sets the new selection model.
|
void |
setSelectedIndex(int index)
Selects the specified header column.
|
getElement, getItsNatElementComponentUI
addEventListener, addEventListener, addEventListener, addEventListener, addPropertyChangeListener, addPropertyChangeListener, addVetoableChangeListener, disableEventListener, disableEventListener, dispose, enableEventListener, enableEventListener, getArtifact, getArtifact, getItsNatComponentManager, getItsNatComponentUI, getItsNatDocument, getNode, getPropertyChangeListeners, getPropertyChangeListeners, getVetoableChangeListeners, isDisposed, isEnabled, registerArtifact, removeArtifact, removeEventListener, removeEventListener, removeEventListener, removeEventListener, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, setEnabled, setEventListenerParams, setEventListenerParams, setNode
containsUserValueName, getUserValue, getUserValueNames, removeUserValue, setUserValue
ItsNatTable getItsNatTable()
ItsNatTableHeaderUI getItsNatTableHeaderUI()
ItsNatTableHeaderCellRenderer getItsNatTableHeaderCellRenderer()
ItsNatComponentManager.createDefaultItsNatTableHeaderCellRenderer()
)setItsNatTableHeaderCellRenderer(ItsNatTableHeaderCellRenderer)
void setItsNatTableHeaderCellRenderer(ItsNatTableHeaderCellRenderer renderer)
renderer
- the new renderer.getItsNatTableHeaderCellRenderer()
javax.swing.ListSelectionModel getListSelectionModel()
By default if a header cell is clicked the selection model is used to remember this selection, may be used to do typical tasks like to sort the rows by the selected column.
javax.swing.DefaultListSelectionModel
instance
in ListSelectionModel.SINGLE_SELECTION
mode.setListSelectionModel(javax.swing.ListSelectionModel)
void setListSelectionModel(javax.swing.ListSelectionModel selectionModel)
If the new selection model is the current defined then is "reset", component listener is removed and added again. Use this technique if you want to add a listener to be executed before the default component listener.
selectionModel
- the new selection model.getListSelectionModel()
int getSelectedIndex()
void setSelectedIndex(int index)
index
- the index of the item to selectCopyright © 2007 Innowhere Software Services S.L. All Rights Reserved.