FileDocCategorySizeDatePackage
ExpressionTreeCellEditor.javaAPI DocExample2296Mon Nov 09 12:45:50 GMT 1998None

ExpressionTreeCellEditor

public class ExpressionTreeCellEditor extends Object implements TreeCellEditor

Fields Summary
EditorComboBox
nodeEditor
EditorTextField
leafEditor
CellEditor
currentEditor
static String[]
operators
Constructors Summary
public ExpressionTreeCellEditor()


      

        EditorTextField tf = new EditorTextField();
        tf.setFont(new Font("Monospaced", Font.PLAIN, 14));
        EditorComboBox cb = new EditorComboBox(operators);
        cb.setFont(new Font("Monospaced", Font.PLAIN, 14));

        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(((OpNode)value).getOperator());
        }
        return (Component)currentEditor;
    
public booleanisCellEditable(java.util.EventObject event)

      return currentEditor.isCellEditable(event);
    
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();