All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class com.sun.java.swing.basic.BasicTreeCellEditorContainer

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

public class BasicTreeCellEditorContainer
extends Container
implements TreeCellEditor
Use this object when you have a TreeCellEditor that you wish to use in a tree that uses a BasicTreeCellRenderer. The editor you pass in will get all the TreeCellEditor messages and will be added as a child. This will then draw the appropriate image and position the editor at the appropriate place.


Variable Index

 o editingExpanded
Is the current item being edited expanded?
 o editingIcon
Icon for the current item in the current editing session.
 o editingLeaf
Is the current item being edited a leaf?
 o editingOffset
Offset, in the x direction, where to start editing from.
 o editor
Component used in editing.
 o realEditor
The real TreeCellEditor that this Container is wrapping.
 o renderer
Renderer used to draw the corresponding component.

Constructor Index

 o BasicTreeCellEditorContainer(TreeCellEditor, BasicTreeCellRenderer)

Method Index

 o addCellEditorListener(CellEditorListener)
Adds the CellEditorListener.
 o cancelCellEditing()
Messages cancelCellEditing to the realEditor and removes it from this instance.
 o doLayout()
Lays out this Container.
 o getCellEditorValue()
Returns the value currently being edited.
 o getPreferredSize()
Returns the preferred size for the Container.
 o getTreeCellEditorComponent(JTree, Object, boolean, boolean, boolean, int)
Configures the editor.
 o isCellEditable(EventObject)
If the realEditor returns true to this message, prepareForEditing is messaged and true is returned.
 o paint(Graphics)
If editing, the icon is painted.
 o prepareForEditing()
Sets the editor, adds it to this Container and updates the editingIcon and editingOffset.
 o removeCellEditorListener(CellEditorListener)
Removes the previously added CellEditorListener l.
 o requestFocus()
 o shouldSelectCell(EventObject)
Messages the realEditor for the return value.
 o stopCellEditing()
If the realEditor will allow editing to stop, the realEditor is removed and true is returned, otherwise false is returned.

Variables

 o renderer
 protected BasicTreeCellRenderer renderer
Renderer used to draw the corresponding component.

 o editor
 protected transient Component editor
Component used in editing. Will be valid for the life of the editing session.

 o realEditor
 protected transient TreeCellEditor realEditor
The real TreeCellEditor that this Container is wrapping.

 o editingIcon
 protected transient Icon editingIcon
Icon for the current item in the current editing session.

 o editingOffset
 protected int editingOffset
Offset, in the x direction, where to start editing from.

 o editingLeaf
 protected boolean editingLeaf
Is the current item being edited a leaf?

 o editingExpanded
 protected boolean editingExpanded
Is the current item being edited expanded?

Constructors

 o BasicTreeCellEditorContainer
 public BasicTreeCellEditorContainer(TreeCellEditor realEditor,
                                     BasicTreeCellRenderer renderer)

Methods

 o getCellEditorValue
 public Object getCellEditorValue()
Returns the value currently being edited.

 o isCellEditable
 public boolean isCellEditable(EventObject event)
If the realEditor returns true to this message, prepareForEditing is messaged and true is returned.

 o shouldSelectCell
 public boolean shouldSelectCell(EventObject event)
Messages the realEditor for the return value.

 o prepareForEditing
 protected void prepareForEditing()
Sets the editor, adds it to this Container and updates the editingIcon and editingOffset.

 o stopCellEditing
 public boolean stopCellEditing()
If the realEditor will allow editing to stop, the realEditor is removed and true is returned, otherwise false is returned.

 o cancelCellEditing
 public void cancelCellEditing()
Messages cancelCellEditing to the realEditor and removes it from this instance.

 o addCellEditorListener
 public void addCellEditorListener(CellEditorListener l)
Adds the CellEditorListener.

 o removeCellEditorListener
 public void removeCellEditorListener(CellEditorListener l)
Removes the previously added CellEditorListener l.

 o doLayout
 public void doLayout()
Lays out this Container. If editing, the editor will be placed at editingOffset in the x direction and 0 for y.

Overrides:
doLayout in class Container
 o getTreeCellEditorComponent
 public Component getTreeCellEditorComponent(JTree tree,
                                             Object value,
                                             boolean isSelected,
                                             boolean expanded,
                                             boolean leaf,
                                             int row)
Configures the editor. Passed onto the realEditor.

 o paint
 public void paint(Graphics g)
If editing, the icon is painted.

Overrides:
paint in class Container
 o getPreferredSize
 public Dimension getPreferredSize()
Returns the preferred size for the Container. This will be the preferred size of the editor offset by editingOffset.

Overrides:
getPreferredSize in class Container
 o requestFocus
 public void requestFocus()
Overrides:
requestFocus in class Component

All Packages  Class Hierarchy  This Package  Previous  Next  Index