All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class com.sun.java.swing.basic.BasicTreeCellEditor

java.lang.Object
   |
   +----java.awt.Component
           |
           +----java.awt.Container
                   |
                   +----com.sun.java.swing.basic.BasicTreeCellEditorContainer
                           |
                           +----com.sun.java.swing.basic.BasicTreeCellEditor

public class BasicTreeCellEditor
extends BasicTreeCellEditorContainer
implements ActionListener, TreeSelectionListener
BasicTreeCellEditor starts editing on triple clicks, or on click-pause-click-pause (two single clicks, followed by a delay of 1200 milliseconds). This determines the JTree instance by seeing if one of the editorListeners that is added is the BasicTreeUI, and if it is the JTree is obtained from that. Meaning there isn't really a good reason for this to be an inner class.


Variable Index

 o canEdit
Should isCellEditable return true? This is set in configure...
 o changeTree
JTree instance listening too.
 o lastPath
last path that was selected.
 o timer
Used before starting the editing session.

Constructor Index

 o BasicTreeCellEditor(BasicTreeCellRenderer)

Method Index

 o actionPerformed(ActionEvent)
Messaged when the timer fires, this will start the editing session.
 o addCellEditorListener(CellEditorListener)
Messages super and setChangeTree.
 o getTreeCellEditorComponent(JTree, Object, boolean, boolean, boolean, int)
Messages super and sets isCellEditable based on value nast lastPath.
 o isCellEditable(EventObject)
Returns true for triple clicks, or if isCellEditable is true, or the event is null.
 o removeCellEditorListener(CellEditorListener)
Messages super and setChangeTree.
 o setChangeTree(JTree)
Sets the JTree to listen to to newTree.
 o valueChanged(TreeSelectionEvent)
Resets lastPath.

Variables

 o canEdit
 protected boolean canEdit
Should isCellEditable return true? This is set in configure... based on the value and lastPath.

 o changeTree
 protected JTree changeTree
JTree instance listening too.

 o lastPath
 protected TreePath lastPath
last path that was selected.

 o timer
 protected Timer timer
Used before starting the editing session.

Constructors

 o BasicTreeCellEditor
 public BasicTreeCellEditor(BasicTreeCellRenderer renderer)

Methods

 o getTreeCellEditorComponent
 public Component getTreeCellEditorComponent(JTree tree,
                                             Object value,
                                             boolean isSelected,
                                             boolean expanded,
                                             boolean leaf,
                                             int row)
Messages super and sets isCellEditable based on value nast lastPath.

Overrides:
getTreeCellEditorComponent in class BasicTreeCellEditorContainer
 o isCellEditable
 public boolean isCellEditable(EventObject event)
Returns true for triple clicks, or if isCellEditable is true, or the event is null.

Overrides:
isCellEditable in class BasicTreeCellEditorContainer
 o addCellEditorListener
 public void addCellEditorListener(CellEditorListener l)
Messages super and setChangeTree.

Overrides:
addCellEditorListener in class BasicTreeCellEditorContainer
 o removeCellEditorListener
 public void removeCellEditorListener(CellEditorListener l)
Messages super and setChangeTree.

Overrides:
removeCellEditorListener in class BasicTreeCellEditorContainer
 o setChangeTree
 protected void setChangeTree(JTree newTree)
Sets the JTree to listen to to newTree.

 o valueChanged
 public void valueChanged(TreeSelectionEvent e)
Resets lastPath.

 o actionPerformed
 public void actionPerformed(ActionEvent e)
Messaged when the timer fires, this will start the editing session.


All Packages  Class Hierarchy  This Package  Previous  Next  Index