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.
-
editingExpanded
- Is the current item being edited expanded?
-
editingIcon
- Icon for the current item in the current editing session.
-
editingLeaf
- Is the current item being edited a leaf?
-
editingOffset
- Offset, in the x direction, where to start editing from.
-
editor
- Component used in editing.
-
realEditor
- The real TreeCellEditor that this Container is wrapping.
-
renderer
- Renderer used to draw the corresponding component.
-
BasicTreeCellEditorContainer(TreeCellEditor, BasicTreeCellRenderer)
-
-
addCellEditorListener(CellEditorListener)
- Adds the CellEditorListener.
-
cancelCellEditing()
- Messages cancelCellEditing to the realEditor and removes it from this
instance.
-
doLayout()
- Lays out this Container.
-
getCellEditorValue()
- Returns the value currently being edited.
-
getPreferredSize()
- Returns the preferred size for the Container.
-
getTreeCellEditorComponent(JTree, Object, boolean, boolean, boolean, int)
- Configures the editor.
-
isCellEditable(EventObject)
- If the realEditor returns true to this message, prepareForEditing
is messaged and true is returned.
-
paint(Graphics)
- If editing, the icon is painted.
-
prepareForEditing()
- Sets the editor, adds it to this Container and updates the editingIcon
and editingOffset.
-
removeCellEditorListener(CellEditorListener)
- Removes the previously added CellEditorListener l.
-
requestFocus()
-
-
shouldSelectCell(EventObject)
- Messages the realEditor for the return value.
-
stopCellEditing()
- If the realEditor will allow editing to stop, the realEditor is
removed and true is returned, otherwise false is returned.
renderer
protected BasicTreeCellRenderer renderer
- Renderer used to draw the corresponding component.
editor
protected transient Component editor
- Component used in editing. Will be valid for the life of the editing
session.
realEditor
protected transient TreeCellEditor realEditor
- The real TreeCellEditor that this Container is wrapping.
editingIcon
protected transient Icon editingIcon
- Icon for the current item in the current editing session.
editingOffset
protected int editingOffset
- Offset, in the x direction, where to start editing from.
editingLeaf
protected boolean editingLeaf
- Is the current item being edited a leaf?
editingExpanded
protected boolean editingExpanded
- Is the current item being edited expanded?
BasicTreeCellEditorContainer
public BasicTreeCellEditorContainer(TreeCellEditor realEditor,
BasicTreeCellRenderer renderer)
getCellEditorValue
public Object getCellEditorValue()
- Returns the value currently being edited.
isCellEditable
public boolean isCellEditable(EventObject event)
- If the realEditor returns true to this message, prepareForEditing
is messaged and true is returned.
shouldSelectCell
public boolean shouldSelectCell(EventObject event)
- Messages the realEditor for the return value.
prepareForEditing
protected void prepareForEditing()
- Sets the editor, adds it to this Container and updates the editingIcon
and editingOffset.
stopCellEditing
public boolean stopCellEditing()
- If the realEditor will allow editing to stop, the realEditor is
removed and true is returned, otherwise false is returned.
cancelCellEditing
public void cancelCellEditing()
- Messages cancelCellEditing to the realEditor and removes it from this
instance.
addCellEditorListener
public void addCellEditorListener(CellEditorListener l)
- Adds the CellEditorListener.
removeCellEditorListener
public void removeCellEditorListener(CellEditorListener l)
- Removes the previously added CellEditorListener l.
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
getTreeCellEditorComponent
public Component getTreeCellEditorComponent(JTree tree,
Object value,
boolean isSelected,
boolean expanded,
boolean leaf,
int row)
- Configures the editor. Passed onto the realEditor.
paint
public void paint(Graphics g)
- If editing, the icon is painted.
- Overrides:
- paint in class Container
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
requestFocus
public void requestFocus()
- Overrides:
- requestFocus in class Component
All Packages Class Hierarchy This Package Previous Next Index