Java Code Examples for javax.swing.event.CellEditorListener

The following examples show how to use javax.swing.event.CellEditorListener. These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source Project: opensim-gui   Source File: AbstractCellEditor.java    License: Apache License 2.0 5 votes vote down vote up
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));
    }
}
   }
 
Example 2
protected void fireEditingCanceled() {
  final CellEditorListener[] listeners = this.listeners.getListeners( CellEditorListener.class );
  final ChangeEvent event = new ChangeEvent( this );
  for ( int i = 0; i < listeners.length; i++ ) {
    final CellEditorListener listener = listeners[ i ];
    listener.editingCanceled( event );
  }
}
 
Example 3
protected void fireEditingStopped() {
  final CellEditorListener[] listeners = eventListenerList.getListeners( CellEditorListener.class );
  final ChangeEvent event = new ChangeEvent( this );
  for ( int i = 0; i < listeners.length; i++ ) {
    final CellEditorListener listener = listeners[ i ];
    listener.editingStopped( event );
  }
}
 
Example 4
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));
        }
    }
}
 
Example 5
protected void fireEditingCanceled() {
  final CellEditorListener[] listeners = eventListenerList.getListeners( CellEditorListener.class );
  final ChangeEvent event = new ChangeEvent( this );
  for ( int i = 0; i < listeners.length; i++ ) {
    final CellEditorListener listener = listeners[ i ];
    listener.editingCanceled( event );
  }
}
 
Example 6
Source Project: netbeans   Source File: WatchesColumnModels.java    License: Apache License 2.0 5 votes vote down vote up
@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);
    }
}
 
Example 7
protected void fireEditingStopped() {
  final CellEditorListener[] listeners = eventListenerList.getListeners( CellEditorListener.class );
  final ChangeEvent event = new ChangeEvent( this );
  for ( int i = 0; i < listeners.length; i++ ) {
    final CellEditorListener listener = listeners[ i ];
    listener.editingStopped( event );
  }
}
 
Example 8
protected void fireEditingCanceled() {
  final CellEditorListener[] listeners = this.listeners.getListeners( CellEditorListener.class );
  final ChangeEvent event = new ChangeEvent( this );
  for ( int i = 0; i < listeners.length; i++ ) {
    final CellEditorListener listener = listeners[ i ];
    listener.editingCanceled( event );
  }
}
 
Example 9
Source Project: netbeans   Source File: ColumnModels.java    License: Apache License 2.0 5 votes vote down vote up
@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);
    }
}
 
Example 10
/**
 * Add the specified listener to <em>all</em> the delegate editors.
 * @param l the listener to add
 */
@Override
public void addCellEditorListener(CellEditorListener l) {
  for(TableCellEditor e : editors) {
    e.addCellEditorListener(l);
  }
}
 
Example 11
@Override
public boolean stopCellEditing() {
    for (CellEditorListener l : listeners) {
        l.editingStopped(new ChangeEvent(this));
    }
    return true;
}
 
Example 12
protected void fireEditingStopped() {
  final CellEditorListener[] listeners = eventListenerList.getListeners( CellEditorListener.class );
  final ChangeEvent event = new ChangeEvent( this );
  for ( int i = 0; i < listeners.length; i++ ) {
    final CellEditorListener listener = listeners[ i ];
    listener.editingStopped( event );
  }
}
 
Example 13
protected void fireStopCellEditing() {
    ChangeEvent changeEvent = new ChangeEvent(this);
    synchronized (cellEditorListenerSet) {
        Iterator<CellEditorListener> it = cellEditorListenerSet.iterator();
        while (it.hasNext()) {
            it.next().editingStopped(changeEvent);
        }
    }
}
 
Example 14
protected void fireCancelCellEditing() {
    ChangeEvent changeEvent = new ChangeEvent(this);
    synchronized (cellEditorListenerSet) {
        Iterator<CellEditorListener> it = cellEditorListenerSet.iterator();
        while (it.hasNext()) {
            it.next().editingCanceled(changeEvent);
        }
    }
}
 
Example 15
/**
 * Notify all listeners that have registered interest for notification on
 * this event type.
 *
 * @see EventListenerList
 */
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));
        }
    }
}
 
Example 16
Source Project: visualvm   Source File: ConnectionsTable.java    License: GNU General Public License v2.0 4 votes vote down vote up
public void addCellEditorListener(CellEditorListener l) {
    impl.addCellEditorListener(l);
}
 
Example 17
Source Project: swing_library   Source File: EditorTextField.java    License: MIT License 4 votes vote down vote up
public void removeCellEditorListener(CellEditorListener cel) {
	listeners.removeElement(cel);
}
 
Example 18
public void removeCellEditorListener( final CellEditorListener l ) {
  backend.removeCellEditorListener( l );
}
 
Example 19
Source Project: openAGV   Source File: SingleCellEditor.java    License: Apache License 2.0 4 votes vote down vote up
@Override
public void removeCellEditorListener(CellEditorListener l) {
  editor.removeCellEditorListener(l);
}
 
Example 20
@Override
public void removeCellEditorListener(CellEditorListener l) {
    listeners.remove(l);
}
 
Example 21
Source Project: openAGV   Source File: SingleCellEditor.java    License: Apache License 2.0 4 votes vote down vote up
@Override
public void removeCellEditorListener(CellEditorListener l) {
  editor.removeCellEditorListener(l);
}
 
Example 22
public void removeCellEditorListener(CellEditorListener listener) {
    evtListenerList.remove(CellEditorListener.class, listener);
}
 
Example 23
Source Project: dragonwell8_jdk   Source File: bug8023474.java    License: GNU General Public License v2.0 4 votes vote down vote up
public void addCellEditorListener(CellEditorListener l) {
}
 
Example 24
Source Project: dragonwell8_jdk   Source File: bug8023474.java    License: GNU General Public License v2.0 4 votes vote down vote up
public void removeCellEditorListener(CellEditorListener l) {
}
 
Example 25
public void addCellEditorListener(CellEditorListener listener) {
    evtListenerList.add(CellEditorListener.class,listener);
}
 
Example 26
Source Project: pcgen   Source File: JTreeTable.java    License: GNU Lesser General Public License v2.1 4 votes vote down vote up
@Override
public void addCellEditorListener(CellEditorListener l)
{
}
 
Example 27
Source Project: pcgen   Source File: JTreeTable.java    License: GNU Lesser General Public License v2.1 4 votes vote down vote up
@Override
public void removeCellEditorListener(CellEditorListener l)
{
}
 
Example 28
Source Project: TencentKona-8   Source File: bug8023474.java    License: GNU General Public License v2.0 4 votes vote down vote up
public void removeCellEditorListener(CellEditorListener l) {
}
 
Example 29
Source Project: opensim-gui   Source File: AbstractCellEditor.java    License: Apache License 2.0 4 votes vote down vote up
public void addCellEditorListener(CellEditorListener l) {
listenerList.add(CellEditorListener.class, l);
   }
 
Example 30
Source Project: aion-germany   Source File: RepoUsersTab.java    License: GNU General Public License v3.0 4 votes vote down vote up
public void addCellEditorListener(CellEditorListener l)
{
    // TODO Auto-generated method stub
    
}