|
QJCC homepage | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.awt.event.MouseAdapter biz.chitec.quarterback.swing.TableHeaderConfigurator
Controlling element for table header configuration. TableHeaderConfigurator is bound to a JTable with a MapListTableModel. It coordinates state changes of its TableHeaderConfigurationModel with the JTable and listens for action if the JTable to pass state changes to the model.
Currently it listens for two interactions:
Field Summary | |
protected TableCellSizeAdjustor |
cellsizeadjustor
|
protected java.awt.event.ActionListener |
columnnameitemal
|
protected javax.swing.JTable |
jt
|
protected java.awt.event.ActionListener |
lockedwidthitemal
|
protected java.util.List |
lockedwidthitems
|
protected java.util.List |
menuitems
|
protected MapListTableModel |
mltm
|
protected java.util.ResourceBundle |
myrb
|
protected javax.swing.JPopupMenu |
popupmenu
|
protected java.util.ResourceBundle |
rb
|
protected java.lang.String |
rbprefix
|
protected int |
sourcecolumn
|
protected int |
targetcolumn
|
protected TableHeaderConfigurationModel |
thcm
|
Constructor Summary | |
TableHeaderConfigurator()
Initializes the configurator with no model. |
|
TableHeaderConfigurator(TableHeaderConfigurationModel thcmx)
Initialize the configurator with a model. |
Method Summary | |
void |
addTo(javax.swing.JTable jtx)
Adds the configurator to a table. |
static void |
addTo(javax.swing.JTable jt,
TableHeaderConfigurationModel thcmx)
|
protected void |
addToTableModel(javax.swing.JTable jtx)
Add the configurator to the table's model. |
private void |
checkPopup(java.awt.event.MouseEvent e)
Opens the popup menu if needed |
protected void |
checkPopupMenu()
Checks whether the entries of the popup menu are correctly activated or deactivated |
void |
columnAdded(javax.swing.event.TableColumnModelEvent e)
TableColumnModelListener: unused but needed |
void |
columnMarginChanged(javax.swing.event.ChangeEvent e)
TableColumnModelListener: unused but needed |
void |
columnMoved(javax.swing.event.TableColumnModelEvent e)
TableColumnModelListener: tracking of column movement |
void |
columnRemoved(javax.swing.event.TableColumnModelEvent e)
TableColumnModelListener: unused but needed |
void |
columnSelectionChanged(javax.swing.event.ListSelectionEvent e)
TableColumnModelListener: unused but needed |
protected void |
generatePopupMenu()
Generates the popup menu, i.e. populates it with entries |
void |
mouseClicked(java.awt.event.MouseEvent e)
MouseListener on JTable's header: If clicked, show popup menu. |
void |
mousePressed(java.awt.event.MouseEvent e)
MouseListener on JTable: If pressed, reset column moving |
void |
mouseReleased(java.awt.event.MouseEvent e)
MouseListener on JTable: If released, check if column has been moved and report this to configuration model. |
void |
propertyChange(java.beans.PropertyChangeEvent evt)
PropertyEventListener on both configuration model and table. |
void |
reloadResourceBundle()
Reload the ResourceBundle from the table's model. |
void |
setModel(TableHeaderConfigurationModel thcmx)
Set the configuration model. |
protected void |
setModelHeader(java.lang.String[] newheader)
Set the header from the configuration model to the table, in fact to the MapListTableModel of the table. |
void |
setTableCellSizeAdjustor(TableCellSizeAdjustor tcsax)
Sets a link to a TableCellSizeAdjustor from the outside and regenerates the popup menu. |
protected void |
spreadLockedWidthColumns()
Gets model header from table and locked width columns from own model. |
Methods inherited from class java.awt.event.MouseAdapter |
mouseEntered, mouseExited |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected javax.swing.JTable jt
protected MapListTableModel mltm
protected java.util.ResourceBundle rb
protected java.util.ResourceBundle myrb
protected java.lang.String rbprefix
protected TableHeaderConfigurationModel thcm
protected int sourcecolumn
protected int targetcolumn
protected javax.swing.JPopupMenu popupmenu
protected java.util.List menuitems
protected java.util.List lockedwidthitems
protected java.awt.event.ActionListener columnnameitemal
protected java.awt.event.ActionListener lockedwidthitemal
protected TableCellSizeAdjustor cellsizeadjustor
Constructor Detail |
public TableHeaderConfigurator()
public TableHeaderConfigurator(TableHeaderConfigurationModel thcmx)
thcmx
- The modelMethod Detail |
public void setModel(TableHeaderConfigurationModel thcmx)
thcmx
- The new configuration modelprotected void setModelHeader(java.lang.String[] newheader)
newheader
- Array of strings containing the new headerprotected void spreadLockedWidthColumns()
protected void addToTableModel(javax.swing.JTable jtx)
jtx
- public void addTo(javax.swing.JTable jtx)
jtx
- Table to bind the configurator topublic void setTableCellSizeAdjustor(TableCellSizeAdjustor tcsax)
tcsax
- A table cell size adjustor or null if the TCSA is removed.public void reloadResourceBundle()
protected void generatePopupMenu()
protected void checkPopupMenu()
public void mousePressed(java.awt.event.MouseEvent e)
mousePressed
in interface java.awt.event.MouseListener
public void mouseReleased(java.awt.event.MouseEvent e)
mouseReleased
in interface java.awt.event.MouseListener
public void mouseClicked(java.awt.event.MouseEvent e)
mouseClicked
in interface java.awt.event.MouseListener
private void checkPopup(java.awt.event.MouseEvent e)
public void propertyChange(java.beans.PropertyChangeEvent evt)
propertyChange
in interface java.beans.PropertyChangeListener
public void columnMarginChanged(javax.swing.event.ChangeEvent e)
columnMarginChanged
in interface javax.swing.event.TableColumnModelListener
public void columnSelectionChanged(javax.swing.event.ListSelectionEvent e)
columnSelectionChanged
in interface javax.swing.event.TableColumnModelListener
public void columnAdded(javax.swing.event.TableColumnModelEvent e)
columnAdded
in interface javax.swing.event.TableColumnModelListener
public void columnMoved(javax.swing.event.TableColumnModelEvent e)
columnMoved
in interface javax.swing.event.TableColumnModelListener
public void columnRemoved(javax.swing.event.TableColumnModelEvent e)
columnRemoved
in interface javax.swing.event.TableColumnModelListener
public static void addTo(javax.swing.JTable jt, TableHeaderConfigurationModel thcmx)
|
QJCC homepage | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |