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 addEditorListener(CellEditorListener)
Adds the CellEditorListener.
 o cancelEditing()
Messages cancelEditing to the realEditor and removes it from this instance.
 o canEdit(EventObject)
If the realEditor returns true to this message, prepareForEditing is messaged and true is returned.
 o configureTreeCellEditor(Object, boolean, boolean, boolean)
Configures the editor.
 o doLayout()
Lays out this Container.
 o getCellEditorComponent()
Returns the editorComponent, which is this object.
 o getPreferredSize()
Returns the preferred size for the Container.
 o getValue()
Returns the value currently being edited.
 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 removeEditorListener(CellEditorListener)
Removes the previously added CellEditorListener l.
 o requestFocus()
 o startEditing(EventObject)
Messages the realEditor for the return value.
 o stopEditing()
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 Component editor
Component used in editing. Will be valid for the life of the editing session.

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

 o editingIcon
 protected 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 getCellEditorComponent
 public Component getCellEditorComponent()
Returns the editorComponent, which is this object.

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

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

 o startEditing
 public boolean startEditing(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 stopEditing
 public boolean stopEditing()
If the realEditor will allow editing to stop, the realEditor is removed and true is returned, otherwise false is returned.

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

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

 o removeEditorListener
 public void removeEditorListener(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 configureTreeCellEditor
 public void configureTreeCellEditor(Object value,
                                     boolean isSelected,
                                     boolean expanded,
                                     boolean leaf)
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