|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.sciapp.table.TableAssistant
public class TableAssistant
TableAssistant is a class that provides additional functions to a JTable. More specifically:
1) It automatically resizes the column of a table to the greatest preferred width of all cells under that column, when the column is double-clicked on its border.
2) Provides a popup through which the columns of the table can be dynamically added/removed. The popup is shown upon right-clicking on the table header.
Constructor Summary | |
---|---|
TableAssistant(JTable table)
Constructs a TableAssistant having table as the JTable on which this
object acts. |
Method Summary | |
---|---|
void |
deselect(int modelIndex)
Unchecks the column with model index modelIndex from the column popup. |
boolean |
getShowPopup()
Returns true if the column popup is to be shown. |
void |
register(TableColumnModel tcm)
The component registers itself to the listener list of tcm . |
void |
select(int modelIndex)
Checks the column with model index modelIndex from the column popup. |
void |
setHeader(JTableHeader newTableHeader)
Associates newTableHeader with this instance of TableAssistant. |
void |
setShowPopup(boolean showPopup)
Sets a flag that is true if the column popup is to be shown. |
void |
unregister(TableColumnModel tcm)
The component unregisters itself from the listener list of tcm . |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public TableAssistant(JTable table)
table
as the JTable on which this
object acts.
table
- the tableMethod Detail |
---|
public void deselect(int modelIndex)
modelIndex
from the column popup.
modelIndex
- the model index of the table's columnpublic boolean getShowPopup()
public void register(TableColumnModel tcm)
tcm
.
tcm
- the TableColumnModelpublic void select(int modelIndex)
modelIndex
from the column popup.
modelIndex
- the model index of the table's columnpublic void setHeader(JTableHeader newTableHeader)
newTableHeader
with this instance of TableAssistant.
newTableHeader
- the JTableHeader to associate with this TableAssistant.public void setShowPopup(boolean showPopup)
showPopup
- the show popup value to setpublic void unregister(TableColumnModel tcm)
tcm
.
tcm
- the TableColumnModel
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |