API Overview API Index Package Overview Direct link to this page
JDK 1.6
  javax.swing.tree. DefaultTreeCellEditor View Source
Author(s)
Scott Violet
Since
Version
1.32 04/07/06
Serial
Hierarchy
 Object
      DefaultTreeCellEditor
Implements
 ActionListener
 TreeCellEditor
 TreeSelectionListener
Subclasses
Description
public class DefaultTreeCellEditor
  A TreeCellEditor.
See also:    JTree
Constructors
public DefaultTreeCellEditor (JTree tree, DefaultTreeCellRenderer renderer)
  Constructs a DefaultTreeCellEditor object for a JTree using the specified renderer and a default editor.
public DefaultTreeCellEditor (JTree tree, DefaultTreeCellRenderer renderer, TreeCellEditor editor)
  Constructs a DefaultTreeCellEditor object for a JTree using the specified renderer and the specified editor.
Methods
Hide/Show inherited methods
public void actionPerformed (ActionEvent e) [Specified in ActionListener]
Messaged when the timer fires, this will start the editing session.
public void addCellEditorListener (CellEditorListener l)
  Adds the CellEditorListener.
public void cancelCellEditing ()
Messages cancelCellEditing to the realEditor and removes it from this instance.
protected boolean canEditImmediately (EventObject event)
  Returns true if event is null, or it is a MouseEvent with a click count > 2 and inHitRegion returns true.
protected Container createContainer ()
Creates the container to manage placement of editingComponent.
protected TreeCellEditor createTreeCellEditor ()
  This is invoked if a TreeCellEditor is not supplied in the constructor.
protected void determineOffset (JTree tree, Object value, boolean isSelected, boolean expanded, boolean leaf, int row)
public Color getBorderSelectionColor ()
  Returns the color the border is drawn.
public CellEditorListener getCellEditorListeners ()
  Returns an array of all the CellEditorListeners added to this DefaultTreeCellEditor with addCellEditorListener().
public Object getCellEditorValue ()
  Returns the value currently being edited.
public Font getFont ()
  Gets the font used for editing.
public Component getTreeCellEditorComponent (JTree tree, Object value, boolean isSelected, boolean expanded, boolean leaf, int row) [Specified in TreeCellEditor]
  Configures the editor.
protected boolean inHitRegion (int x, int y)
  Returns true if the passed in location is a valid mouse location to start editing from.
public boolean isCellEditable (EventObject event)
If the realEditor returns true to this message, prepareForEditing is messaged and true is returned.
protected void prepareForEditing ()
  Invoked just before editing is to start.
public void removeCellEditorListener (CellEditorListener l)
  Removes the previously added CellEditorListener.
public void setBorderSelectionColor (Color newColor)
  Sets the color to use for the border.
public void setFont (Font font)
  Sets the font to edit with.
protected void setTree (JTree newTree)
  Sets the tree currently editing for.
public boolean shouldSelectCell (EventObject event)
Messages the realEditor for the return value.
protected boolean shouldStartEditingTimer (EventObject event)
  Returns true if event is a MouseEvent and the click count is 1.
protected void startEditingTimer ()
Starts the editing timer.
public boolean stopCellEditing ()
If the realEditor will allow editing to stop, the realEditor is removed and true is returned, otherwise false is returned.
public void valueChanged (TreeSelectionEvent e) [Specified in TreeSelectionListener]
Resets lastPath.
Fields
Hide/Show inherited fields
protected Color borderSelectionColor
True if the border selection color should be drawn.
protected boolean canEdit
  As of Java 2 platform v1.4 this field should no longer be used.
protectedtransient Component editingComponent
Component used in editing, obtained from the editingContainer.
protected Container editingContainer
Editing container, will contain the editorComponent.
protectedtransient Icon editingIcon
Icon to use when editing.
protected Font font
Font to paint with, null indicates font of renderer is to be used.
protectedtransient TreePath lastPath
Last path that was selected.
protectedtransient int lastRow
Row that was last passed into getTreeCellEditorComponent.
protectedtransient int offset
  Used in editing.
protected TreeCellEditor realEditor
Editor handling the editing.
protected DefaultTreeCellRenderer renderer
Renderer, used to get border and offsets from.
protectedtransient Timer timer
Used before starting the editing session.
protectedtransient JTree tree
JTree instance listening too.
Nested Classes
  DefaultTreeCellEditor.DefaultTextField
TextField used when no editor is supplied.
  DefaultTreeCellEditor.EditorContainer
Container responsible for placing the editingComponent.
Generated By: JavaOnTracks Doclet 0.1.4     ©Thibaut Colar