Package docking.widgets.table
Class GTableColumnModel
- java.lang.Object
-
- docking.widgets.table.GTableColumnModel
-
- All Implemented Interfaces:
java.beans.PropertyChangeListener
,java.util.EventListener
,javax.swing.event.ListSelectionListener
,javax.swing.table.TableColumnModel
public class GTableColumnModel extends java.lang.Object implements javax.swing.table.TableColumnModel, java.beans.PropertyChangeListener, javax.swing.event.ListSelectionListener
-
-
Field Summary
Fields Modifier and Type Field Description protected javax.swing.ListSelectionModel
selectionModel
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addColumn(javax.swing.table.TableColumn aColumn)
void
addColumnModelListener(javax.swing.event.TableColumnModelListener listener)
protected TableColumnModelState
createTableColumnModelState()
java.util.List<javax.swing.table.TableColumn>
getAllColumns()
This returns all columns known by this model, both visible and not seen.javax.swing.table.TableColumn
getColumn(int columnIndex)
int
getColumnCount()
int
getColumnIndex(java.lang.Object columnIdentifier)
int
getColumnIndexAtX(int x)
int
getColumnMargin()
java.util.Enumeration<javax.swing.table.TableColumn>
getColumns()
boolean
getColumnSelectionAllowed()
protected GTable
getGTable()
int
getSelectedColumnCount()
int[]
getSelectedColumns()
javax.swing.ListSelectionModel
getSelectionModel()
int
getTotalColumnWidth()
boolean
isVisible(int modelIndex)
Returns true if the column at the given index is visible.boolean
isVisible(javax.swing.table.TableColumn column)
Returns true if the given column is visible.void
moveColumn(int columnIndex, int newIndex)
void
propertyChange(java.beans.PropertyChangeEvent evt)
void
removeColumn(javax.swing.table.TableColumn column)
void
removeColumnModelListener(javax.swing.event.TableColumnModelListener listener)
void
restoreFromXML(org.jdom.Element element)
org.jdom.Element
saveToXML()
void
setColumnMargin(int newMargin)
void
setColumnSelectionAllowed(boolean flag)
void
setSelectionModel(javax.swing.ListSelectionModel newModel)
void
setVisible(javax.swing.table.TableColumn column, boolean visible)
void
valueChanged(javax.swing.event.ListSelectionEvent e)
-
-
-
Method Detail
-
createTableColumnModelState
protected TableColumnModelState createTableColumnModelState()
-
getGTable
protected GTable getGTable()
-
isVisible
public boolean isVisible(javax.swing.table.TableColumn column)
Returns true if the given column is visible.- Parameters:
column
- The column for which to check visibility.- Returns:
- true if the given column is visible.
-
isVisible
public boolean isVisible(int modelIndex)
Returns true if the column at the given index is visible. This call is handy when checking for visibility when dealing with model data that knows nothing about the hidden columns.- Parameters:
modelIndex
- The column index for which to check visibility. This is the model's index and not the table's index.- Returns:
- true if the given column is visible.
-
setVisible
public void setVisible(javax.swing.table.TableColumn column, boolean visible)
-
addColumn
public void addColumn(javax.swing.table.TableColumn aColumn)
- Specified by:
addColumn
in interfacejavax.swing.table.TableColumnModel
-
addColumnModelListener
public void addColumnModelListener(javax.swing.event.TableColumnModelListener listener)
- Specified by:
addColumnModelListener
in interfacejavax.swing.table.TableColumnModel
-
getColumn
public javax.swing.table.TableColumn getColumn(int columnIndex)
- Specified by:
getColumn
in interfacejavax.swing.table.TableColumnModel
-
getColumnCount
public int getColumnCount()
- Specified by:
getColumnCount
in interfacejavax.swing.table.TableColumnModel
-
getColumnIndex
public int getColumnIndex(java.lang.Object columnIdentifier)
- Specified by:
getColumnIndex
in interfacejavax.swing.table.TableColumnModel
-
getColumnIndexAtX
public int getColumnIndexAtX(int x)
- Specified by:
getColumnIndexAtX
in interfacejavax.swing.table.TableColumnModel
-
getColumnMargin
public int getColumnMargin()
- Specified by:
getColumnMargin
in interfacejavax.swing.table.TableColumnModel
-
getColumnSelectionAllowed
public boolean getColumnSelectionAllowed()
- Specified by:
getColumnSelectionAllowed
in interfacejavax.swing.table.TableColumnModel
-
getColumns
public java.util.Enumeration<javax.swing.table.TableColumn> getColumns()
- Specified by:
getColumns
in interfacejavax.swing.table.TableColumnModel
-
getAllColumns
public java.util.List<javax.swing.table.TableColumn> getAllColumns()
This returns all columns known by this model, both visible and not seen.- Returns:
- all columns known by this model, both visible and not seen.
-
getSelectedColumnCount
public int getSelectedColumnCount()
- Specified by:
getSelectedColumnCount
in interfacejavax.swing.table.TableColumnModel
-
getSelectedColumns
public int[] getSelectedColumns()
- Specified by:
getSelectedColumns
in interfacejavax.swing.table.TableColumnModel
-
getSelectionModel
public javax.swing.ListSelectionModel getSelectionModel()
- Specified by:
getSelectionModel
in interfacejavax.swing.table.TableColumnModel
-
getTotalColumnWidth
public int getTotalColumnWidth()
- Specified by:
getTotalColumnWidth
in interfacejavax.swing.table.TableColumnModel
-
moveColumn
public void moveColumn(int columnIndex, int newIndex)
- Specified by:
moveColumn
in interfacejavax.swing.table.TableColumnModel
-
removeColumn
public void removeColumn(javax.swing.table.TableColumn column)
- Specified by:
removeColumn
in interfacejavax.swing.table.TableColumnModel
-
removeColumnModelListener
public void removeColumnModelListener(javax.swing.event.TableColumnModelListener listener)
- Specified by:
removeColumnModelListener
in interfacejavax.swing.table.TableColumnModel
-
setColumnMargin
public void setColumnMargin(int newMargin)
- Specified by:
setColumnMargin
in interfacejavax.swing.table.TableColumnModel
-
setColumnSelectionAllowed
public void setColumnSelectionAllowed(boolean flag)
- Specified by:
setColumnSelectionAllowed
in interfacejavax.swing.table.TableColumnModel
-
setSelectionModel
public void setSelectionModel(javax.swing.ListSelectionModel newModel)
- Specified by:
setSelectionModel
in interfacejavax.swing.table.TableColumnModel
-
propertyChange
public void propertyChange(java.beans.PropertyChangeEvent evt)
- Specified by:
propertyChange
in interfacejava.beans.PropertyChangeListener
-
valueChanged
public void valueChanged(javax.swing.event.ListSelectionEvent e)
- Specified by:
valueChanged
in interfacejavax.swing.event.ListSelectionListener
-
saveToXML
public org.jdom.Element saveToXML()
-
restoreFromXML
public void restoreFromXML(org.jdom.Element element)
-
-