javax.swing.AbstractButton.removeActionListener()方法的使用及代码示例

x33g5p2x  于2022-01-15 转载在 其他  
字(7.5k)|赞(0)|评价(0)|浏览(91)

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

AbstractButton.removeActionListener介绍

暂无

代码示例

代码示例来源:origin: org.netbeans.api/org-openide-dialogs

private static void removeOldListeners( AbstractButton button ) {
  ArrayList<ActionListener> toRem = new ArrayList<ActionListener>();
  for( ActionListener al : button.getActionListeners() ) {
    if( al instanceof StandardDialog.ButtonListener ) {
      toRem.add( al );
    }
  }
  for( ActionListener al : toRem ) {
    button.removeActionListener( al );
  }
          }

代码示例来源:origin: org.fudaa.framework.ebli/ebli-common

/**
 * Supprime un couteur d'action sur les 2 boutons.
 * @param _l L'couteur  supprimer.
 */
public void removeActionListener(final ActionListener _l){
 btOui_.removeActionListener(_l);
 btNon_.removeActionListener(_l);
}

代码示例来源:origin: xyz.cofe/gui.swing

@Override
public void close() throws IOException {
  button.removeActionListener(al);
}};

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

@Override
  public void windowClosing(WindowEvent e) {
    //remove the action listener
    closeButton.removeActionListener(closeAction);
    detailButton.removeActionListener(resizeListener);
    exitIfFatal();
  }
});

代码示例来源:origin: com.mchange/mchange-commons-java

public void remove(AbstractButton button)
{
button.removeActionListener( wcl );
super.remove( button );
}

代码示例来源:origin: org.bidib.jbidib.swinglabs.swingx/swingx-core

@Override
  public void windowClosing(WindowEvent e) {
    //remove the action listener
    closeButton.removeActionListener(closeAction);
    detailButton.removeActionListener(resizeListener);
    exitIfFatal();
  }
});

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

public void windowClosed(WindowEvent e) {
    //remove the action listener
    closeButton.removeActionListener(closeAction);
    detailButton.removeActionListener(resizeListener);
    exitIfFatal();
  }
});

代码示例来源:origin: com.haulmont.thirdparty/swingx-core

@Override
  public void windowClosing(WindowEvent e) {
    //remove the action listener
    closeButton.removeActionListener(closeAction);
    detailButton.removeActionListener(resizeListener);
    exitIfFatal();
  }
});

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

@Override
  public void windowClosing(WindowEvent e) {
    //remove the action listener
    closeButton.removeActionListener(closeAction);
    detailButton.removeActionListener(resizeListener);
    exitIfFatal();
  }
});

代码示例来源:origin: org.fudaa.business/fudaa-common-corba

public void subscribeTo(final AbstractButton _b) {
 _b.removeActionListener(this);
 _b.addActionListener(this);
}

代码示例来源:origin: uk.ac.ebi.pride.toolsuite/inspector-swing-utils

/**
 * Remove an action command from this panel
 *
 * @param actionCommand action command to be removed
 */
public void removeActionCommand(String actionCommand) {
  AbstractButton button = actionButtonMap.get(actionCommand);
  // remove the button
  if (button != null) {
    sideToolBar.remove(button);
    if (centralComponent != null && centralComponent instanceof ActionListener) {
      button.removeActionListener((ActionListener) centralComponent);
    }
  }
}

代码示例来源:origin: uk.ac.ebi.pride/pride-utilities

/**
 * Remove an action command from this panel
 *
 * @param actionCommand action command to be removed
 */
public void removeActionCommand(String actionCommand) {
  AbstractButton button = actionButtonMap.get(actionCommand);
  // remove the button
  if (button != null) {
    sideToolBar.remove(button);
    if (centralComponent != null && centralComponent instanceof ActionListener) {
      button.removeActionListener((ActionListener) centralComponent);
    }
  }
}

代码示例来源:origin: uk.ac.ebi.pride.toolsuite/inspector-swing-utils

/**
 * Remove an action from this panel, it also removes all its related components.
 *
 * @param action action command.
 */
public void removeAction(Object action) {
  AbstractButton button = actionButtonMap.get(action);
  // remove the button
  if (button != null) {
    sideToolBar.remove(button);
    if (centralComponent != null && centralComponent instanceof ActionListener) {
      button.removeActionListener((ActionListener) centralComponent);
    }
    // remove the side tool bar pane
    actionCommandMap.remove(action);
  }
}

代码示例来源:origin: uk.ac.ebi.pride/pride-utilities

/**
 * Remove an action from this panel, it also removes all its related components.
 *
 * @param action action command.
 */
public void removeAction(Object action) {
  AbstractButton button = actionButtonMap.get(action);
  // remove the button
  if (button != null) {
    sideToolBar.remove(button);
    if (centralComponent != null && centralComponent instanceof ActionListener) {
      button.removeActionListener((ActionListener) centralComponent);
    }
    // remove the side tool bar pane
    actionCommandMap.remove(action);
  }
}

代码示例来源:origin: prova/prova

public void unlisten(String type, Object target) {
  if( type.equals("action") )
    ((javax.swing.AbstractButton) target).removeActionListener(this);
  else if( type.equals("change") )
    ((javax.swing.AbstractButton) target).removeChangeListener(this);
  else if( type.equals("mouse") )
    ((java.awt.Component) target).removeMouseListener(this);
  else if( type.equals("motion") )
    ((java.awt.Component) target).removeMouseMotionListener(this);
}

代码示例来源:origin: org.seamless/seamless-swing

/**
 * Register an action that can be executed by this controller.
 *
 * @param source The prepared (== has action command assigned) action trigger source
 * @param action An actual action implementation.
 */
public void registerAction(AbstractButton source, DefaultAction action) {
  source.removeActionListener(this);
  source.addActionListener(this);
  this.actions.put(source.getActionCommand(), action);
}

代码示例来源:origin: org.fudaa.framework.ctulu/ctulu-ui

private void removeListeners() {
 final Enumeration e = BuLib.getAllSubComponents(view_).elements();
 while (e.hasMoreElements()) {
  final Object c = e.nextElement();
  if (c instanceof AbstractButton) {
   ((AbstractButton) c).removeActionListener(updater_);
  } else if (c instanceof JList) {
   ((JList) c).removeListSelectionListener(updater_);
  } else if (c instanceof JTree) {
   ((JTree) c).removeTreeSelectionListener(updater_);
  } else if (c instanceof JTextComponent) {
   ((JTextComponent) c).getDocument().removeDocumentListener(updater_);
  } else if (c instanceof JTable) {
   ((JTable) c).getSelectionModel().removeListSelectionListener(updater_);
  }
 }
}

代码示例来源:origin: com.anrisoftware.prefdialog/prefdialog-corefields

/**
 * Removed the action listener to the radio button.
 *
 * @param listener
 *            the {@link ActionListener}.
 *
 * @throws NullPointerException
 *             if the specified listener is {@code null}.
 */
public void removeActionListener(ActionListener listener) {
  log.checkActionListener(this, listener);
  getComponent().removeActionListener(listener);
  log.actionRemoved(this, listener);
}

代码示例来源:origin: t28hub/json2java4idea

@Override
public void dispose() {
  Collections.list(styleGroup.getElements()).forEach(button -> button.removeActionListener(this));
  classNamePrefixField.getDocument().removeDocumentListener(this);
  classNameSuffixField.getDocument().removeDocumentListener(this);
  generatedAnnotationCheckBox.removeActionListener(this);
  suppressWarningsAnnotationCheckBox.removeActionListener(this);
  if (previewEditor == null || previewEditor.isDisposed()) {
    return;
  }
  EditorFactory.getInstance().releaseEditor(previewEditor);
}

代码示例来源:origin: JetBrains/jediterm

public static void dispose(final Component c) {
  if (c == null) return;
  final MouseListener[] mouseListeners = c.getMouseListeners();
  for (MouseListener each : mouseListeners) {
    c.removeMouseListener(each);
  }
  final MouseMotionListener[] motionListeners = c.getMouseMotionListeners();
  for (MouseMotionListener each : motionListeners) {
    c.removeMouseMotionListener(each);
  }
  final MouseWheelListener[] mouseWheelListeners = c.getMouseWheelListeners();
  for (MouseWheelListener each : mouseWheelListeners) {
    c.removeMouseWheelListener(each);
  }
  if (c instanceof AbstractButton) {
    final ActionListener[] listeners = ((AbstractButton) c).getActionListeners();
    for (ActionListener listener : listeners) {
      ((AbstractButton) c).removeActionListener(listener);
    }
  }
}

相关文章

微信公众号

最新文章

更多

AbstractButton类方法