| 
FreeHEP API Version current  | 
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.freehep.swing.table.TableColumnSelector
Allows the user to select which columns are visible in a table.
Example of usage:
    TableModel model = ...
    TableColumnSelector selector = new TableColumnSelector(model);
    JTable table = new JTable(selector.getFilteredTableModel());
    table.addMouseListener(new PopupListener(selector.createPopupMenu()));
 
| Constructor Summary | |
TableColumnSelector(TableModel model)
Create a TableColumnSelector.  | 
|
| Method Summary | |
 JPopupMenu | 
createPopupMenu()
Creates a JPopupMenu filled with appropriate JCheckBoxMenuItems.  | 
protected  void | 
fireTableChanged(TableModelEvent event)
Notifies all listeners of a change to the filtered TableModel.  | 
 TableModel | 
getFilteredTableModel()
Get the resulting table model.  | 
 boolean | 
isHideColumn(int columnIndex)
Test if a column is hidden.  | 
 void | 
populateMenu(JComponent menu)
Can be used to fill a JMenu or JPopupMenu with appropriate JCheckBoxMenuItems.  | 
 void | 
setHideColumn(int columnIndex,
              boolean hide)
Show or Hide the specied column.  | 
| Methods inherited from class java.lang.Object | 
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait | 
| Constructor Detail | 
public TableColumnSelector(TableModel model)
model - The source table model.| Method Detail | 
public void populateMenu(JComponent menu)
menu - The JMenu or JPopupMenu to populate.public JPopupMenu createPopupMenu()
public void setHideColumn(int columnIndex,
                          boolean hide)
columnIndex - The columnIndex in the source TableModelhide - if true hides this columnprotected void fireTableChanged(TableModelEvent event)
event - The event to be sent to the listeners.public boolean isHideColumn(int columnIndex)
columnIndex - The columnIndex in the source TableModel.
true if this column is hiddenpublic TableModel getFilteredTableModel()
  | 
FreeHEP API Version current  | 
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||