當前位置: 首頁>>代碼示例>>Java>>正文


Java CellEditorListener類代碼示例

本文整理匯總了Java中javax.swing.event.CellEditorListener的典型用法代碼示例。如果您正苦於以下問題:Java CellEditorListener類的具體用法?Java CellEditorListener怎麽用?Java CellEditorListener使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


CellEditorListener類屬於javax.swing.event包,在下文中一共展示了CellEditorListener類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: processKeyEvent

import javax.swing.event.CellEditorListener; //導入依賴的package包/類
@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);
    }
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:34,代碼來源:WatchesColumnModels.java

示例2: fireEditingStopped

import javax.swing.event.CellEditorListener; //導入依賴的package包/類
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);
    }
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:12,代碼來源:ComponentsSelectionPanel.java

示例3: fireEditingCanceled

import javax.swing.event.CellEditorListener; //導入依賴的package包/類
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);
    }
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:12,代碼來源:ComponentsSelectionPanel.java

示例4: fireEditingStopped

import javax.swing.event.CellEditorListener; //導入依賴的package包/類
private void fireEditingStopped() {
    synchronized(listeners) {
        List<CellEditorListener> list = new ArrayList<CellEditorListener>(listeners);
        for (CellEditorListener listener : list) {
            listener.editingStopped(new ChangeEvent(this));
        }
    }
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:9,代碼來源:WatchesColumnModels.java

示例5: removeCellEditorListener

import javax.swing.event.CellEditorListener; //導入依賴的package包/類
@Override
public void removeCellEditorListener(CellEditorListener l) {
    TableCellEditor editor = currentEditor;
    if (editor == null && canceledEditorRef != null) {
        editor = canceledEditorRef.get();
    }
    if (editor != null) {
        editor.removeCellEditorListener(l);
    }
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:11,代碼來源:DelegatingCellEditor.java

示例6: fireEditingCanceled

import javax.swing.event.CellEditorListener; //導入依賴的package包/類
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));
        }
    }
}
 
開發者ID:Audiveris,項目名稱:audiveris,代碼行數:14,代碼來源:AbstractCellEditor.java

示例7: fireEditingStopped

import javax.swing.event.CellEditorListener; //導入依賴的package包/類
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));
        }
    }
}
 
開發者ID:Audiveris,項目名稱:audiveris,代碼行數:14,代碼來源:AbstractCellEditor.java

示例8: EditorDelegate

import javax.swing.event.CellEditorListener; //導入依賴的package包/類
/**
 * 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);
}
 
開發者ID:epics-extensions,項目名稱:VisualDCT,代碼行數:39,代碼來源:InspectorCellEditor.java

示例9: fireEditingCanceled

import javax.swing.event.CellEditorListener; //導入依賴的package包/類
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);
		}	       
	}
}
 
開發者ID:epics-extensions,項目名稱:VisualDCT,代碼行數:16,代碼來源:InspectorCellEditor.java

示例10: fireEditingStopped

import javax.swing.event.CellEditorListener; //導入依賴的package包/類
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);
		}	       
	}
}
 
開發者ID:epics-extensions,項目名稱:VisualDCT,代碼行數:16,代碼來源:InspectorCellEditor.java

示例11: fireEditingStopped

import javax.swing.event.CellEditorListener; //導入依賴的package包/類
/**
 * 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));
        }
    }
}
 
開發者ID:rnveach,項目名稱:checkstyle-backport-jre6,代碼行數:17,代碼來源:BaseCellEditor.java

示例12: fireEditingCanceled

import javax.swing.event.CellEditorListener; //導入依賴的package包/類
/**
 * 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));
        }
    }
}
 
開發者ID:rnveach,項目名稱:checkstyle-backport-jre6,代碼行數:17,代碼來源:BaseCellEditor.java

示例13: fireEditingStopped

import javax.swing.event.CellEditorListener; //導入依賴的package包/類
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));
    }	       
}
   }
 
開發者ID:cst316,項目名稱:spring16project-Modula-2,代碼行數:12,代碼來源:AbstractCellEditor.java

示例14: fireEditingCanceled

import javax.swing.event.CellEditorListener; //導入依賴的package包/類
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));
    }	       
}
   }
 
開發者ID:cst316,項目名稱:spring16project-Modula-2,代碼行數:12,代碼來源:AbstractCellEditor.java

示例15: addCellEditorListener

import javax.swing.event.CellEditorListener; //導入依賴的package包/類
public void addCellEditorListener(CellEditorListener l)
{

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

	moduleEditor.addCellEditorListener(l);

	declarationEditor.addCellEditorListener(l);
	super.addCellEditorListener(l);
}
 
開發者ID:musaeed,項目名稱:Prism-gsoc16,代碼行數:12,代碼來源:GUIMultiModelTree.java


注:本文中的javax.swing.event.CellEditorListener類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。