FileDocCategorySizeDatePackage
EmailTreeCellEditor.javaAPI DocExample2197Thu Oct 24 20:14:26 BST 2002None

EmailTreeCellEditor

public class EmailTreeCellEditor extends Object implements TreeCellEditor

Fields Summary
EditorComboBox
nodeEditor
EmailEditor
leafEditor
CellEditor
currentEditor
static String[]
emailTypes
Constructors Summary
public EmailTreeCellEditor()


      

        EmailEditor tf = new EmailEditor();
        EditorComboBox cb = new EditorComboBox(emailTypes);

        nodeEditor = cb;
        leafEditor = tf;
    
Methods Summary
public voidaddCellEditorListener(javax.swing.event.CellEditorListener l)

      nodeEditor.addCellEditorListener(l);
      leafEditor.addCellEditorListener(l);
    
public voidcancelCellEditing()

      currentEditor.cancelCellEditing();
    
public java.lang.ObjectgetCellEditorValue()

      return currentEditor.getCellEditorValue();
    
public java.awt.ComponentgetTreeCellEditorComponent(javax.swing.JTree tree, java.lang.Object value, boolean isSelected, boolean expanded, boolean leaf, int row)

        if (leaf) { 
          currentEditor = leafEditor;
          leafEditor.setText(value.toString());
        }
        else {
          currentEditor = nodeEditor;
          nodeEditor.setSelectedItem(
              ((DefaultMutableTreeNode)value).getUserObject());
        }
        return (Component)currentEditor;
    
public booleanisCellEditable(java.util.EventObject event)

      return true;
    
public voidremoveCellEditorListener(javax.swing.event.CellEditorListener l)

      nodeEditor.removeCellEditorListener(l);
      leafEditor.removeCellEditorListener(l);
    
public booleanshouldSelectCell(java.util.EventObject event)

      return currentEditor.shouldSelectCell(event);
    
public booleanstopCellEditing()

      return currentEditor.stopCellEditing();