Skip navigation links
oracle.jdevimpl.audit.swing
Class CheckBoxTreeCellEditor
java.lang.Object
javax.swing.AbstractCellEditor
oracle.jdevimpl.audit.swing.CheckBoxTreeCellEditor
- All Implemented Interfaces:
- java.awt.event.ActionListener, java.io.Serializable, java.util.EventListener, javax.swing.CellEditor, javax.swing.tree.TreeCellEditor
-
public class CheckBoxTreeCellEditor
- extends javax.swing.AbstractCellEditor
- implements java.awt.event.ActionListener, javax.swing.tree.TreeCellEditor
Adapts a CheckBoxTreeCellRenderer to be a TreeCellEditor. The implementation of isCellEditable distinguishes between mouse clicks on the checkbox icon and mouse clicks on the checkbox label. Although JCheckBox typically responds to clicks on the label, allowing it to do so in a tree makes it impossible to select a row without changing its state, so this renderer ignores them.
- See Also:
CheckBoxTreeCellRenderer
, Serialized Form
Fields inherited from class javax.swing.AbstractCellEditor |
changeEvent, listenerList |
Methods inherited from class javax.swing.AbstractCellEditor |
addCellEditorListener, fireEditingCanceled, fireEditingStopped, getCellEditorListeners, removeCellEditorListener, shouldSelectCell |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface javax.swing.CellEditor |
addCellEditorListener, removeCellEditorListener, shouldSelectCell |
CheckBoxTreeCellEditor
public CheckBoxTreeCellEditor(CheckBoxTreeCellRenderer renderer)
- Creates an editor from a
CheckBoxTreeCellRenderer
. Do not reuse the same renderer instance passed in here as the tree renderer.
- Parameters:
renderer
- The renderer to wrap.
forwardKeyEvent
public void forwardKeyEvent(java.awt.event.KeyEvent event)
getRenderer
public CheckBoxTreeCellRenderer getRenderer()
- Gets the renderer wrapped by this editor. Do not install the renderer instance returned here as the tree renderer.
getTreeCellEditorComponent
public java.awt.Component getTreeCellEditorComponent(javax.swing.JTree tree,
java.lang.Object value,
boolean selected,
boolean expanded,
boolean leaf,
int row)
-
- Specified by:
getTreeCellEditorComponent
in interface javax.swing.tree.TreeCellEditor
isCellEditable
public boolean isCellEditable(java.util.EventObject event)
- This implementation returns false for mouse clicks on the label part of the checkbox.
-
- Specified by:
isCellEditable
in interface javax.swing.CellEditor
- Overrides:
isCellEditable
in class javax.swing.AbstractCellEditor
getCellEditorValue
public java.lang.Object getCellEditorValue()
-
- Specified by:
getCellEditorValue
in interface javax.swing.CellEditor
actionPerformed
public void actionPerformed(java.awt.event.ActionEvent e)
-
- Specified by:
actionPerformed
in interface java.awt.event.ActionListener
stopCellEditing
public boolean stopCellEditing()
-
- Specified by:
stopCellEditing
in interface javax.swing.CellEditor
- Overrides:
stopCellEditing
in class javax.swing.AbstractCellEditor
cancelCellEditing
public void cancelCellEditing()
-
- Specified by:
cancelCellEditing
in interface javax.swing.CellEditor
- Overrides:
cancelCellEditing
in class javax.swing.AbstractCellEditor
toString
public java.lang.String toString()
-
- Overrides:
toString
in class java.lang.Object
Skip navigation links
Copyright © 1997, 2013, Oracle. All rights reserved.