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.
-
canEdit
- Should isCellEditable return true? This is set in configure...
-
changeTree
- JTree instance listening too.
-
lastPath
- last path that was selected.
-
timer
- Used before starting the editing session.
-
BasicTreeCellEditor(BasicTreeCellRenderer)
-
-
actionPerformed(ActionEvent)
- Messaged when the timer fires, this will start the editing
session.
-
addCellEditorListener(CellEditorListener)
- Messages super and setChangeTree.
-
getTreeCellEditorComponent(JTree, Object, boolean, boolean, boolean, int)
- Messages super and sets isCellEditable based on value nast lastPath.
-
isCellEditable(EventObject)
- Returns true for triple clicks, or if isCellEditable is true, or the
event is null.
-
removeCellEditorListener(CellEditorListener)
- Messages super and setChangeTree.
-
setChangeTree(JTree)
- Sets the JTree to listen to to newTree.
-
valueChanged(TreeSelectionEvent)
- Resets lastPath.
canEdit
protected boolean canEdit
- Should isCellEditable return true? This is set in configure...
based on the value and lastPath.
changeTree
protected JTree changeTree
- JTree instance listening too.
lastPath
protected TreePath lastPath
- last path that was selected.
timer
protected Timer timer
- Used before starting the editing session.
BasicTreeCellEditor
public BasicTreeCellEditor(BasicTreeCellRenderer renderer)
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
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
addCellEditorListener
public void addCellEditorListener(CellEditorListener l)
- Messages super and setChangeTree.
- Overrides:
- addCellEditorListener in class BasicTreeCellEditorContainer
removeCellEditorListener
public void removeCellEditorListener(CellEditorListener l)
- Messages super and setChangeTree.
- Overrides:
- removeCellEditorListener in class BasicTreeCellEditorContainer
setChangeTree
protected void setChangeTree(JTree newTree)
- Sets the JTree to listen to to newTree.
valueChanged
public void valueChanged(TreeSelectionEvent e)
- Resets lastPath.
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