Example usage for javax.swing AbstractButton setAction

List of usage examples for javax.swing AbstractButton setAction

Introduction

In this page you can find the example usage for javax.swing AbstractButton setAction.

Prototype

@BeanProperty(visualUpdate = true, description = "the Action instance connected with this ActionEvent source")
public void setAction(Action a) 

Source Link

Document

Sets the Action.

Usage

From source file:org.colombbus.tangara.commons.resinject.ActionResourceImpl.java

@Override
public void injectAction(AbstractButton button, Command command) {
    checkCommandExist(command);/* w w w . j  a  v a2s . co m*/
    Validate.notNull(button, "button argument is null"); //$NON-NLS-1$
    Action action = getAction(command);
    button.setAction(action);
}

From source file:org.openmicroscopy.shoola.agents.imviewer.view.ImViewerUI.java

/**
 * Updates UI components when a new color model is selected.
 * /*from   ww  w  .jav  a2  s  .  c  o  m*/
 * @param key The index of the color model.
 */
void setColorModel(int key) {
    controlPane.setColorModel();
    AbstractButton b;
    Action a;
    Enumeration<AbstractButton> e;
    for (e = colorModelGroup.getElements(); e.hasMoreElements();) {
        b = e.nextElement();
        a = b.getAction();
        if (a instanceof ColorModelAction) {
            b.removeActionListener(a);
            b.setSelected(((ColorModelAction) a).getIndex() == key);
            b.setAction(a);
        }
    }
}

From source file:org.pentaho.reporting.designer.core.xul.ActionSwingButton.java

protected void setButton(final AbstractButton button) {
    final AbstractButton oldButton = getButton();
    oldButton.setAction(null);
    super.setButton(button);
    if (parentIsToolbar) {
        button.putClientProperty("hideActionText", Boolean.TRUE);//NON-NLS
    }//ww  w .  j  a v  a  2s. c o m
    button.setAction(action);
}