javax.swing.JComboBox.getActionListeners()方法的使用及代码示例

x33g5p2x  于2022-01-21 转载在 其他  
字(7.3k)|赞(0)|评价(0)|浏览(144)

本文整理了Java中javax.swing.JComboBox.getActionListeners()方法的一些代码示例,展示了JComboBox.getActionListeners()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。JComboBox.getActionListeners()方法的具体详情如下:
包路径:javax.swing.JComboBox
类名称:JComboBox
方法名:getActionListeners

JComboBox.getActionListeners介绍

暂无

代码示例

代码示例来源:origin: net.java.dev.glazedlists/glazedlists_java15

/**
 * A convenience method to unregister and return all {@link ActionListener}s
 * currently installed on the given <code>comboBox</code>. This is the only
 * technique we can rely on to prevent the <code>comboBox</code> from
 * broadcasting {@link ActionEvent}s at inappropriate times.
 *
 * This method is the logical inverse of {@link #registerAllActionListeners}.
 */
private static ActionListener[] unregisterAllActionListeners(JComboBox comboBox) {
  final ActionListener[] listeners = comboBox.getActionListeners();
  for (int i = 0; i < listeners.length; i++)
    comboBox.removeActionListener(listeners[i]);
  return listeners;
}

代码示例来源:origin: net.java.dev.glazedlists/glazedlists_java16

/**
 * A convenience method to unregister and return all {@link ActionListener}s
 * currently installed on the given <code>comboBox</code>. This is the only
 * technique we can rely on to prevent the <code>comboBox</code> from
 * broadcasting {@link ActionEvent}s at inappropriate times.
 *
 * This method is the logical inverse of {@link #registerAllActionListeners}.
 */
private static ActionListener[] unregisterAllActionListeners(JComboBox comboBox) {
  final ActionListener[] listeners = comboBox.getActionListeners();
  for (int i = 0; i < listeners.length; i++)
    comboBox.removeActionListener(listeners[i]);
  return listeners;
}

代码示例来源:origin: com.haulmont.thirdparty/glazedlists

/**
 * A convenience method to unregister and return all {@link ActionListener}s
 * currently installed on the given <code>comboBox</code>. This is the only
 * technique we can rely on to prevent the <code>comboBox</code> from
 * broadcasting {@link ActionEvent}s at inappropriate times.
 *
 * This method is the logical inverse of {@link #registerAllActionListeners}.
 */
private static ActionListener[] unregisterAllActionListeners(JComboBox comboBox) {
  final ActionListener[] listeners = comboBox.getActionListeners();
  for (int i = 0; i < listeners.length; i++)
    comboBox.removeActionListener(listeners[i]);
  return listeners;
}

代码示例来源:origin: sarahtattersall/PIPE

/**
 * Remove the listener from the zoomComboBox, so that when
 * the box's selected item is updated to keep track of ZoomActions
 * called from other sources, a duplicate ZoomAction is not called
 */
public void updateZoomCombo() {
  ActionListener zoomComboListener = zoomComboBox.getActionListeners()[0];
  zoomComboBox.removeActionListener(zoomComboListener);
  String zoomPercentage = zoomManager.getPercentageZoom() + "%";
  zoomComboBox.setSelectedItem(zoomPercentage);
  zoomComboBox.addActionListener(zoomComboListener);
}

代码示例来源:origin: senbox-org/snap-desktop

private final void showCellDataTypeComboBoxEditor(int columnIndex, int rowIndex) {
  Object cellValue = getValueAt(rowIndex, columnIndex);
  String cellValueAsString = (cellValue == null) ? "" : cellValue.toString();
  ActionListener[] listeners = this.cellDataTypesComboBox.getActionListeners();
  for (int i=0; i<listeners.length; i++) {
    this.cellDataTypesComboBox.removeActionListener(listeners[i]);
  }
  this.cellDataTypesComboBox.setSelectedItem(cellValueAsString);
  for (int i=0; i<listeners.length; i++) {
    this.cellDataTypesComboBox.addActionListener(listeners[i]);
  }
  setCurrentCellComponentEditor(columnIndex, rowIndex, this.cellDataTypesComboBox);
}

代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-cnd-debugger-common2

private void initEngine() {
  ActionListener engineComboBoxActionListener = engineComboBox.getActionListeners()[0];
  engineComboBox.removeActionListener(engineComboBoxActionListener);
  engineComboBox.removeAllItems();
  Collection<EngineType> engineTypes = EngineTypeManager.getEngineTypes(false);
  for (EngineType engineType : engineTypes) {
    engineComboBox.addItem(engineType.getDisplayName());
    if (engineType.equals(lastSelectedEngine)) {
      engineComboBox.setSelectedItem(engineType.getDisplayName());
    }
  }
  engineComboBox.addActionListener(engineComboBoxActionListener);
}

代码示例来源:origin: iTransformers/netTransformer

private void updateConnectionCombo() {
  ResourceType resource = getCurrentResource();
  ActionListener[] listeners = comboBox.getActionListeners();
  for (ActionListener listener : listeners) {
    comboBox.removeActionListener(listener);
  }
  comboBox.removeAllItems();
  if (resource != null) {
    List<ConnectionParamsType> connectionList = resource.getConnectionParams();
    for (ConnectionParamsType connectionParamsType : connectionList) {
      comboBox.addItem(connectionParamsType.getConnectionType());
    }
    if (connectionList.size() > 0){
      comboBox.setSelectedIndex(mCurrentConnectionTypeIndex);
    }
  }
  for (ActionListener listener : listeners) {
    comboBox.addActionListener(listener);
  }
}

代码示例来源:origin: girtel/Net2Plan

sortedSet.addAll(aux_implementations.keySet());
ActionListener[] listeners = algorithmSelector.getActionListeners();
for (ActionListener listener : listeners) algorithmSelector.removeActionListener(listener);

代码示例来源:origin: org.activecomponents.jadex/jadex-editor-bpmn

ActionListener[] als = mbox.getActionListeners();
for(ActionListener al: als)
  mbox.removeActionListener(al);

代码示例来源:origin: net.sourceforge.jadex/jadex-kernel-bpmn

ActionListener[] als = cbmethodname.getActionListeners();
for(ActionListener al: als)
  cbmethodname.removeActionListener(al);

代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-cnd-makeproject

private void initGui() {
  ActionListener projectComboBoxActionListener = projectComboBox.getActionListeners()[0];
  projectComboBox.removeActionListener(projectComboBoxActionListener);
  projectComboBox.removeAllItems();

代码示例来源:origin: net.sourceforge.jadex/jadex-kernel-bpmn

ActionListener[] als = cbmethodname.getActionListeners();
for(ActionListener al: als)
  cbmethodname.removeActionListener(al);

代码示例来源:origin: org.nuiton.jaxx/jaxx-widgets

for (ActionListener l : comboBox.getActionListeners()) {
  if (l instanceof ComboBoxAdaptor) {
    comboBox.removeActionListener(l);

代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-cnd-makeproject

ActionListener[] actionListeners = configurationComboBox.getActionListeners();
configurationComboBox.removeActionListener(actionListeners[0]); // assuming one and only one!
configurationComboBox.removeAllItems();

代码示例来源:origin: cytoscape/application

final ActionListener[] li = vsNameComboBox.getActionListeners();

代码示例来源:origin: net.sourceforge.jadex/jadex-kernel-bpmn

ActionListener[] als = cbsername.getActionListeners();
for(ActionListener al: als)
  cbsername.removeActionListener(al);

代码示例来源:origin: org.codehaus.jtstand/jtstand-ui

if (starterPanel.jComboBoxPartNumber().getActionListeners().length == 0) {
  starterPanel.jComboBoxPartNumber().addActionListener(new ActionListener() {
    @Override
if (starterPanel.jComboBoxPartRev().getActionListeners().length == 0) {
  starterPanel.jComboBoxPartRev().addActionListener(new ActionListener() {
    @Override
if (starterPanel.jComboBoxTestType().getActionListeners().length == 0) {
  starterPanel.jComboBoxTestType().addActionListener(new ActionListener() {
    @Override

代码示例来源:origin: org.swinglabs.swingx/swingx-all

for (ActionListener l : comboBox.getActionListeners()) {
  if (l instanceof ComboBoxAdaptor) {
    comboBox.removeActionListener(l);

代码示例来源:origin: tmyroadctfig/swingx

for (ActionListener l : comboBox.getActionListeners()) {
  if (l instanceof ComboBoxAdaptor) {
    comboBox.removeActionListener(l);

代码示例来源:origin: net.sourceforge.jadex/jadex-kernel-bpmn

ActionListener[] als = cbsername.getActionListeners();
for(ActionListener al: als)
  cbsername.removeActionListener(al);

相关文章

JComboBox类方法