|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--javax.swing.AbstractCellEditor | +--org.gjt.btools.gui.component.CheckBoxRenderer
A checkbox that is used as a boolean table cell. This class can be used as both a cell renderer and a cell editor if desired. The corresponding value in the table must be of type Boolean.
Field Summary |
Fields inherited from class javax.swing.AbstractCellEditor |
changeEvent, listenerList |
Constructor Summary | |
CheckBoxRenderer()
Creates a new checkbox renderer/editor. |
Method Summary | |
void |
cancelCellEditing()
Cancels editing the table cell and disregards any changes. |
java.lang.Object |
getCellEditorValue()
Returns the value contained in the cell editor. |
java.awt.Component |
getTableCellEditorComponent(javax.swing.JTable table,
java.lang.Object value,
boolean isSelected,
int row,
int column)
Returns the component that does the editing. |
java.awt.Component |
getTableCellRendererComponent(javax.swing.JTable table,
java.lang.Object value,
boolean isSelected,
boolean hasFocus,
int row,
int column)
Returns the component that does the rendering. |
void |
itemStateChanged(java.awt.event.ItemEvent e)
Called when the checkbox has changed state. |
boolean |
shouldSelectCell(java.util.EventObject e)
Prepares the component for editing as requested by the given event. |
boolean |
stopCellEditing()
Stops editing the table cell and stores any changes. |
Methods inherited from class javax.swing.AbstractCellEditor |
addCellEditorListener, fireEditingCanceled, fireEditingStopped, getCellEditorListeners, isCellEditable, removeCellEditorListener |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface javax.swing.CellEditor |
addCellEditorListener, isCellEditable, removeCellEditorListener |
Constructor Detail |
public CheckBoxRenderer()
Method Detail |
public void itemStateChanged(java.awt.event.ItemEvent e)
itemStateChanged
in interface java.awt.event.ItemListener
e
- the state changing event.public java.awt.Component getTableCellRendererComponent(javax.swing.JTable table, java.lang.Object value, boolean isSelected, boolean hasFocus, int row, int column)
getTableCellRendererComponent
in interface javax.swing.table.TableCellRenderer
table
- the table in which a cell is being rendered.value
- the value of the table cell being rendered.isSelected
- whether or not the table cell is currently
selected.hasFocus
- whether or not the table cell currently has the
focus.row
- the row of the table cell being rendered.column
- the column of the table cell being rendered.
public java.awt.Component getTableCellEditorComponent(javax.swing.JTable table, java.lang.Object value, boolean isSelected, int row, int column)
getTableCellEditorComponent
in interface javax.swing.table.TableCellEditor
table
- the table in which a cell is being edited.value
- the value of the table cell being edited.isSelected
- whether or not the table cell is currently
selected.row
- the row of the table cell being edited.column
- the column of the table cell being edited.
public java.lang.Object getCellEditorValue()
getCellEditorValue
in interface javax.swing.CellEditor
public boolean shouldSelectCell(java.util.EventObject e)
shouldSelectCell
in interface javax.swing.CellEditor
shouldSelectCell
in class javax.swing.AbstractCellEditor
e
- the event that caused editing to begin.
public boolean stopCellEditing()
stopCellEditing
in interface javax.swing.CellEditor
stopCellEditing
in class javax.swing.AbstractCellEditor
public void cancelCellEditing()
cancelCellEditing
in interface javax.swing.CellEditor
cancelCellEditing
in class javax.swing.AbstractCellEditor
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |