FileDocCategorySizeDatePackage
CategoryAbstractCellEditor.javaAPI DocApache log4j 1.2.155450Sat Aug 25 00:09:38 BST 2007org.apache.log4j.lf5.viewer.categoryexplorer

CategoryAbstractCellEditor

public class CategoryAbstractCellEditor extends Object implements TreeCellEditor, TableCellEditor
CategoryAbstractCellEditor. Base class to handle the some common details of cell editing.
author
Michael J. Sikorsky
author
Robert Shaw

Fields Summary
protected EventListenerList
_listenerList
protected Object
_value
protected ChangeEvent
_changeEvent
protected int
_clickCountToStart
Constructors Summary
Methods Summary
public voidaddCellEditorListener(javax.swing.event.CellEditorListener l)

    _listenerList.add(CellEditorListener.class, l);
  
public voidcancelCellEditing()

    fireEditingCanceled();
  
protected voidfireEditingCanceled()

    Object[] listeners = _listenerList.getListenerList();

    for (int i = listeners.length - 2; i >= 0; i -= 2) {
      if (listeners[i] == CellEditorListener.class) {
        if (_changeEvent == null) {
          _changeEvent = new ChangeEvent(this);
        }

        ((CellEditorListener) listeners[i + 1]).editingCanceled(_changeEvent);
      }
    }
  
protected voidfireEditingStopped()

    Object[] listeners = _listenerList.getListenerList();

    for (int i = listeners.length - 2; i >= 0; i -= 2) {
      if (listeners[i] == CellEditorListener.class) {
        if (_changeEvent == null) {
          _changeEvent = new ChangeEvent(this);
        }

        ((CellEditorListener) listeners[i + 1]).editingStopped(_changeEvent);
      }
    }
  
public java.lang.ObjectgetCellEditorValue()


  //--------------------------------------------------------------------------
  //   Private Variables:
  //--------------------------------------------------------------------------

  //--------------------------------------------------------------------------
  //   Constructors:
  //--------------------------------------------------------------------------

  //--------------------------------------------------------------------------
  //   Public Methods:
  //--------------------------------------------------------------------------

     
    return _value;
  
public intgetClickCountToStart()

    return _clickCountToStart;
  
public java.awt.ComponentgetTableCellEditorComponent(javax.swing.JTable table, java.lang.Object value, boolean isSelected, int row, int column)

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

    return null;
  
public booleanisCellEditable(java.util.EventObject anEvent)

    if (anEvent instanceof MouseEvent) {
      if (((MouseEvent) anEvent).getClickCount() < _clickCountToStart) {
        return false;
      }
    }
    return true;
  
public voidremoveCellEditorListener(javax.swing.event.CellEditorListener l)

    _listenerList.remove(CellEditorListener.class, l);
  
public voidsetCellEditorValue(java.lang.Object value)

    _value = value;
  
public voidsetClickCountToStart(int count)

    _clickCountToStart = count;
  
public booleanshouldSelectCell(java.util.EventObject anEvent)

    if (this.isCellEditable(anEvent)) {
      if (anEvent == null ||
          ((MouseEvent) anEvent).getClickCount() >= _clickCountToStart) {
        return true;
      }
    }
    return false;
  
public booleanstopCellEditing()

    fireEditingStopped();
    return true;