Java 类javax.swing.event.CellEditorListener 实例源码

项目:incubator-netbeans    文件:WatchesColumnModels.java   
@Override
protected void processKeyEvent(KeyEvent e) {
    KeyStroke ks = KeyStroke.getKeyStrokeForEvent(e);
    if (enter.equals(ks)) {
        // Prevent JComponent.processKeyBindings() to be called (it is called from
        // JComponent.processKeyEvent() ), notify only registered key listeners
        int id = e.getID();
        for (KeyListener keyListener : getKeyListeners()) {
            switch(id) {
              case KeyEvent.KEY_TYPED:
                  keyListener.keyTyped(e);
                  break;
              case KeyEvent.KEY_PRESSED:
                  keyListener.keyPressed(e);
                  break;
              case KeyEvent.KEY_RELEASED:
                  keyListener.keyReleased(e);
                  break;
            }
        }
        if (!e.isConsumed() && id == KeyEvent.KEY_PRESSED) {
            synchronized(listeners) {
                List<CellEditorListener> list = new ArrayList<CellEditorListener>(listeners);
                for (CellEditorListener listener : list) {
                    listener.editingStopped(new ChangeEvent(this));
                }
            }
        }
        e.consume();
    } else {
        super.processKeyEvent(e);
    }
}
项目:incubator-netbeans    文件:ColumnModels.java   
@Override
protected void processKeyEvent(KeyEvent e) {
    KeyStroke ks = KeyStroke.getKeyStrokeForEvent(e);
    if (enter.equals(ks)) {
        // Prevent JComponent.processKeyBindings() to be called (it is called from
        // JComponent.processKeyEvent() ), notify only registered key listeners
        int id = e.getID();
        for (KeyListener keyListener : getKeyListeners()) {
            switch(id) {
              case KeyEvent.KEY_TYPED:
                  keyListener.keyTyped(e);
                  break;
              case KeyEvent.KEY_PRESSED:
                  keyListener.keyPressed(e);
                  break;
              case KeyEvent.KEY_RELEASED:
                  keyListener.keyReleased(e);
                  break;
            }
        }
        if (!e.isConsumed() && id == KeyEvent.KEY_PRESSED) {
            synchronized(listeners) {
                List<CellEditorListener> list = new ArrayList<CellEditorListener>(listeners);
                for (CellEditorListener listener : list) {
                    listener.editingStopped(new ChangeEvent(this));
                }
            }
        }
        e.consume();
    } else {
        super.processKeyEvent(e);
    }
}
项目:incubator-netbeans    文件:ComponentsSelectionPanel.java   
private void fireEditingStopped() {
    final CellEditorListener[] clone;
    synchronized (listeners) {
        clone = listeners.toArray(new CellEditorListener[0]);
    }

    final ChangeEvent event = new ChangeEvent(this);
    for (CellEditorListener listener: clone) {
        listener.editingStopped(event);
    }
}
项目:incubator-netbeans    文件:ComponentsSelectionPanel.java   
private void fireEditingCanceled() {
    final CellEditorListener[] clone;
    synchronized (listeners) {
        clone = listeners.toArray(new CellEditorListener[0]);
    }

    final ChangeEvent event = new ChangeEvent(this);
    for (CellEditorListener listener: clone) {
        listener.editingCanceled(event);
    }
}
项目:incubator-netbeans    文件:WatchesColumnModels.java   
private void fireEditingStopped() {
    synchronized(listeners) {
        List<CellEditorListener> list = new ArrayList<CellEditorListener>(listeners);
        for (CellEditorListener listener : list) {
            listener.editingStopped(new ChangeEvent(this));
        }
    }
}
项目:incubator-netbeans    文件:DelegatingCellEditor.java   
@Override
public void removeCellEditorListener(CellEditorListener l) {
    TableCellEditor editor = currentEditor;
    if (editor == null && canceledEditorRef != null) {
        editor = canceledEditorRef.get();
    }
    if (editor != null) {
        editor.removeCellEditorListener(l);
    }
}
项目:incubator-netbeans    文件:ColumnModels.java   
private void fireEditingStopped() {
    synchronized(listeners) {
        List<CellEditorListener> list = new ArrayList<CellEditorListener>(listeners);
        for (CellEditorListener listener : list) {
            listener.editingStopped(new ChangeEvent(this));
        }
    }
}
项目:audiveris    文件:AbstractCellEditor.java   
protected void fireEditingCanceled ()
{
    // Guaranteed to return a non-null array
    Object[] listeners = listenerList.getListenerList();

    // Process the listeners last to first, notifying those that are
    // interested in this event
    for (int i = listeners.length - 2; i >= 0; i -= 2) {
        if (listeners[i] == CellEditorListener.class) {
            ((CellEditorListener) listeners[i + 1]).editingCanceled(new ChangeEvent(this));
        }
    }
}
项目:audiveris    文件:AbstractCellEditor.java   
protected void fireEditingStopped ()
{
    // Guaranteed to return a non-null array
    Object[] listeners = listenerList.getListenerList();

    // Process the listeners last to first, notifying
    // those that are interested in this event
    for (int i = listeners.length - 2; i >= 0; i -= 2) {
        if (listeners[i] == CellEditorListener.class) {
            ((CellEditorListener) listeners[i + 1]).editingStopped(new ChangeEvent(this));
        }
    }
}
项目:VisualDCT    文件:InspectorCellEditor.java   
/**
 * Constructs a InspectorCellEditor that uses a text field.
 */
/* @param formattedTextField javax.swing.JFormattedTextField
 */
/*public InspectorCellEditor(final JFormattedTextField formattedTextField) {
    editorComponent = formattedTextField;
    delegate = new EditorDelegate() {

        public void setValue(Object value) {
            formattedTextField.setText((value != null) ? value.toString() : "");
        }

        public Object getCellEditorValue() {
            return formattedTextField.getText();
        }

    };
    formattedTextField.addActionListener(delegate);
    // coloring
    formattedTextField.addPropertyChangeListener(new PropertyChangeListener() {
        public void propertyChange(PropertyChangeEvent pce) {
            if ("editValid".equals(pce.getPropertyName()))
            {
                if (formattedTextField.isEditValid())
                    formattedTextField.setForeground(Color.blue);
                else
                    formattedTextField.setForeground(Color.red);
            }
        }
    });
    formatter = (RegexFormatter)formattedTextField.getFormatter();
}

 */ // implements javax.swing.CellEditor
public void addCellEditorListener(CellEditorListener l) {
    listenerList.add(CellEditorListener.class, l);
}
项目:VisualDCT    文件:InspectorCellEditor.java   
protected void fireEditingCanceled() {
    delegate.cancelCellEditing();
    // Guaranteed to return a non-null array
    Object[] listeners = listenerList.getListenerList();
    // Process the listeners last to first, notifying
    // those that are interested in this event
    for (int i = listeners.length-2; i>=0; i-=2) {
        if (listeners[i]==CellEditorListener.class) {
            // Lazily create the event:
            if (changeEvent == null)
                changeEvent = new ChangeEvent(this);
            ((CellEditorListener)listeners[i+1]).editingCanceled(changeEvent);
        }          
    }
}
项目:VisualDCT    文件:InspectorCellEditor.java   
protected void fireEditingStopped() {
    delegate.stopCellEditing();
    // Guaranteed to return a non-null array
    Object[] listeners = listenerList.getListenerList();
    // Process the listeners last to first, notifying
    // those that are interested in this event
    for (int i = listeners.length-2; i>=0; i-=2) {
        if (listeners[i]==CellEditorListener.class) {
            // Lazily create the event:
            if (changeEvent == null)
                changeEvent = new ChangeEvent(this);
            ((CellEditorListener)listeners[i+1]).editingStopped(changeEvent);
        }          
    }
}
项目:checkstyle-backport-jre6    文件:BaseCellEditor.java   
/**
 * Notifies all listeners that have registered interest for
 * 'editing stopped' event.
 * @see EventListenerList
 */
protected void fireEditingStopped() {
    // Guaranteed to return a non-null array
    final Object[] listeners = listenerList.getListenerList();
    // Process the listeners last to first, notifying
    // those that are interested in this event
    for (int i = listeners.length - 2; i >= 0; i -= 2) {
        if (listeners[i] == CellEditorListener.class) {
            ((CellEditorListener) listeners[i + 1]).editingStopped(new ChangeEvent(this));
        }
    }
}
项目:checkstyle-backport-jre6    文件:BaseCellEditor.java   
/**
 * Notifies all listeners that have registered interest for
 * 'editing canceled' event.
 * @see EventListenerList
 */
protected void fireEditingCanceled() {
    // Guaranteed to return a non-null array
    final Object[] listeners = listenerList.getListenerList();
    // Process the listeners last to first, notifying
    // those that are interested in this event
    for (int i = listeners.length - 2; i >= 0; i -= 2) {
        if (listeners[i] == CellEditorListener.class) {
            ((CellEditorListener) listeners[i + 1]).editingCanceled(new ChangeEvent(this));
        }
    }
}
项目:spring16project-Modula-2    文件:AbstractCellEditor.java   
protected void fireEditingStopped() {
// Guaranteed to return a non-null array
Object[] listeners = listenerList.getListenerList();
// Process the listeners last to first, notifying
// those that are interested in this event
for (int i = listeners.length-2; i>=0; i-=2) {
    if (listeners[i]==CellEditorListener.class) {
    ((CellEditorListener)listeners[i+1]).editingStopped(new ChangeEvent(this));
    }          
}
   }
项目:spring16project-Modula-2    文件:AbstractCellEditor.java   
protected void fireEditingCanceled() {
// Guaranteed to return a non-null array
Object[] listeners = listenerList.getListenerList();
// Process the listeners last to first, notifying
// those that are interested in this event
for (int i = listeners.length-2; i>=0; i-=2) {
    if (listeners[i]==CellEditorListener.class) {
    ((CellEditorListener)listeners[i+1]).editingCanceled(new ChangeEvent(this));
    }          
}
   }
项目:Prism-gsoc16    文件:GUIMultiModelTree.java   
public void addCellEditorListener(CellEditorListener l)
{

    modelTypeEditor.addCellEditorListener(l);
    expressionEditor.addCellEditorListener(l);

    moduleEditor.addCellEditorListener(l);

    declarationEditor.addCellEditorListener(l);
    super.addCellEditorListener(l);
}
项目:Prism-gsoc16    文件:GUIMultiModelTree.java   
public void removeCellEditorListener(CellEditorListener l)
{
    modelTypeEditor.removeCellEditorListener(l);
    expressionEditor.removeCellEditorListener(l);

    moduleEditor.removeCellEditorListener(l);

    declarationEditor.removeCellEditorListener(l);
    super.removeCellEditorListener(l);
}
项目:javify    文件:DefaultCellEditor.java   
/**
 * Notify the registered listeners (including the table) that the editing
 * has been completed.
 */
void fireEditingStopped()
{
  CellEditorListener[] listeners = getCellEditorListeners();
  for (int index = 0; index < listeners.length; index++)
    listeners[index].editingStopped(changeEvent);

}
项目:javify    文件:DefaultCellEditor.java   
/**
 * Notify the registered listeners (including the table) that the editing
 * has been canceled.
 */
void fireEditingCanceled()
{
  CellEditorListener[] listeners = getCellEditorListeners();
  for (int index = 0; index < listeners.length; index++)
    listeners[index].editingCanceled(changeEvent);
}
项目:javify    文件:AbstractCellEditor.java   
/**
 * Notifies all registered listeners that the editing of the cell has has been
 * stopped.
 */
protected void fireEditingStopped()
{
  CellEditorListener[] listeners = getCellEditorListeners();

  for (int index = 0; index < listeners.length; index++)
    {
      listeners[index].editingStopped(changeEvent);
    }
}
项目:javify    文件:AbstractCellEditor.java   
/**
 * Notifies all registered listeners that the editing of the cell has
 * has been canceled.
 */
protected void fireEditingCanceled()
{
  CellEditorListener[] listeners = getCellEditorListeners();

  for (int index = 0; index < listeners.length; index++)
    {
      listeners[index].editingCanceled(changeEvent);
    }
}
项目:pizzascript    文件:AbstractCellEditor.java   
protected void fireEditingStopped() {
    Object[] listeners = listenerList.getListenerList();
    for (int i = listeners.length-2; i>=0; i-=2) {
        if (listeners[i]==CellEditorListener.class) {
            ((CellEditorListener)listeners[i+1]).editingStopped(new ChangeEvent(this));
        }
    }
}
项目:pizzascript    文件:AbstractCellEditor.java   
protected void fireEditingCanceled() {
    Object[] listeners = listenerList.getListenerList();
    for (int i = listeners.length-2; i>=0; i-=2) {
        if (listeners[i]==CellEditorListener.class) {
            ((CellEditorListener)listeners[i+1]).editingCanceled(new ChangeEvent(this));
        }
    }
}
项目:intellij-ce-playground    文件:ComboBoxTableRenderer.java   
protected void fireEditingStopped() {
  // Guaranteed to return a non-null array
  Object[] listeners = myListenerList.getListenerList();
  // Process the listeners last to first, notifying
  // those that are interested in this event
  for (int i = listeners.length - 2; i >= 0; i -= 2) {
    if (listeners[i] == CellEditorListener.class) {
      // Lazily create the event:
      if (myChangeEvent == null) {
        myChangeEvent = new ChangeEvent(this);
      }
      ((CellEditorListener)listeners[i + 1]).editingStopped(myChangeEvent);
    }
  }
}
项目:intellij-ce-playground    文件:ComboBoxTableRenderer.java   
protected void fireEditingCanceled() {
  // Guaranteed to return a non-null array
  Object[] listeners = myListenerList.getListenerList();
  // Process the listeners last to first, notifying
  // those that are interested in this event
  for (int i = listeners.length - 2; i >= 0; i -= 2) {
    if (listeners[i] == CellEditorListener.class) {
      // Lazily create the event:
      if (myChangeEvent == null) {
        myChangeEvent = new ChangeEvent(this);
      }
      ((CellEditorListener)listeners[i + 1]).editingCanceled(myChangeEvent);
    }
  }
}
项目:intellij-ce-playground    文件:ThreeStateCheckBoxRenderer.java   
@Override
public boolean stopCellEditing() {
  final ChangeEvent e = new ChangeEvent(this);
  for (final CellEditorListener listener : new ArrayList<CellEditorListener>(myListeners)) {
    listener.editingStopped(e);
  }
  return true;
}
项目:intellij-ce-playground    文件:ThreeStateCheckBoxRenderer.java   
@Override
public void cancelCellEditing() {
  final ChangeEvent e = new ChangeEvent(this);
  for (final CellEditorListener listener : new ArrayList<CellEditorListener>(myListeners)) {
    listener.editingCanceled(e);
  }
}
项目:rapidminer-studio    文件:MetaDataTableHeaderCellEditor.java   
private void fireEditingStopped() {
    CellEditorListener[] listeners = listenerList.getListeners(CellEditorListener.class);
    ChangeEvent changeEvent = null;
    for (CellEditorListener l : listeners) {
        if (changeEvent == null) {
            changeEvent = new ChangeEvent(this);
        }
        l.editingStopped(changeEvent);
    }
}
项目:rapidminer-studio    文件:MetaDataTableHeaderCellEditor.java   
private void fireEditingCancelled() {
    CellEditorListener[] listeners = listenerList.getListeners(CellEditorListener.class);
    ChangeEvent changeEvent = null;
    for (CellEditorListener l : listeners) {
        if (changeEvent == null) {
            changeEvent = new ChangeEvent(this);
        }
        l.editingCanceled(changeEvent);
    }
}
项目:cacheonix-core    文件:CategoryAbstractCellEditor.java   
protected void fireEditingStopped() {
  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);
    }
  }
}
项目:cacheonix-core    文件:CategoryAbstractCellEditor.java   
protected void fireEditingCanceled() {
  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);
    }
  }
}
项目:cacheonix-core    文件:CategoryAbstractCellEditor.java   
protected final void fireEditingStopped() {

      final Object[] listeners = _listenerList.getListenerList();

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

            ((CellEditorListener) listeners[i + 1]).editingStopped(_changeEvent);
         }
      }
   }
项目:cacheonix-core    文件:CategoryAbstractCellEditor.java   
protected final void fireEditingCanceled() {

      final Object[] listeners = _listenerList.getListenerList();

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

            ((CellEditorListener) listeners[i + 1]).editingCanceled(_changeEvent);
         }
      }
   }
项目:PasswordSafe    文件:CTreeTableRendererEditor.java   
public void addCellEditorListener(CellEditorListener li)
{
    // FIX too late
    if(node != null)
    {
        CTreeNode nd = node.getItem();
        nd.editingStarted();
    }

    baseEditor.addCellEditorListener(li);
}
项目:PasswordSafe    文件:CTreeTableRendererEditor.java   
public void removeCellEditorListener(CellEditorListener li)
{
    baseEditor.removeCellEditorListener(li);

    // end of editing
    if(node != null)
    {
        CTreeNode nd = node.getItem();
        nd.editingStopped();
    }
}
项目:jvm-stm    文件:DefaultCellEditor.java   
/**
 * Notify the registered listeners (including the table) that the editing
 * has been completed.
 */
void fireEditingStopped()
{
  CellEditorListener[] listeners = getCellEditorListeners();
  for (int index = 0; index < listeners.length; index++)
    listeners[index].editingStopped(changeEvent);

}
项目:jvm-stm    文件:DefaultCellEditor.java   
/**
 * Notify the registered listeners (including the table) that the editing
 * has been canceled.
 */
void fireEditingCanceled()
{
  CellEditorListener[] listeners = getCellEditorListeners();
  for (int index = 0; index < listeners.length; index++)
    listeners[index].editingCanceled(changeEvent);
}
项目:jvm-stm    文件:AbstractCellEditor.java   
/**
 * Notifies all registered listeners that the editing of the cell has has been
 * stopped.
 */
protected void fireEditingStopped()
{
  CellEditorListener[] listeners = getCellEditorListeners();

  for (int index = 0; index < listeners.length; index++)
    {
      listeners[index].editingStopped(changeEvent);
    }
}
项目:jvm-stm    文件:AbstractCellEditor.java   
/**
 * Notifies all registered listeners that the editing of the cell has
 * has been canceled.
 */
protected void fireEditingCanceled()
{
  CellEditorListener[] listeners = getCellEditorListeners();

  for (int index = 0; index < listeners.length; index++)
    {
      listeners[index].editingCanceled(changeEvent);
    }
}