Example usage for java.awt.event ActionEvent ACTION_PERFORMED

List of usage examples for java.awt.event ActionEvent ACTION_PERFORMED

Introduction

In this page you can find the example usage for java.awt.event ActionEvent ACTION_PERFORMED.

Prototype

int ACTION_PERFORMED

To view the source code for java.awt.event ActionEvent ACTION_PERFORMED.

Click Source Link

Document

This event id indicates that a meaningful action occurred.

Usage

From source file:ColorComboBoxEditor.java

protected void fireActionEvent(Color color) {
    Object listeners[] = listenerList.getListenerList();
    for (int i = listeners.length - 2; i >= 0; i -= 2) {
        if (listeners[i] == ActionListener.class) {
            ActionEvent actionEvent = new ActionEvent(editor, ActionEvent.ACTION_PERFORMED, color.toString());
            ((ActionListener) listeners[i + 1]).actionPerformed(actionEvent);
        }/* w ww  .j a  va2  s .  co m*/
    }
}

From source file:DualListener.java

protected void fireAChanged() {
    Object[] listeners = events.getListenerList();
    for (int i = listeners.length - 2; i >= 0; i -= 2) {
        if (listeners[i] == ActionListener.class) {
            if (actionEvent == null) {
                actionEvent = new ActionEvent(this, ActionEvent.ACTION_PERFORMED, "a");
            }//from  ww w  .j a  v  a 2 s  .c  o m
            ((ActionListener) listeners[i + 1]).actionPerformed(actionEvent);
        }
    }
}

From source file:ColorMenu.java

public void doSelection() {
    fireActionPerformed(new ActionEvent(this, ActionEvent.ACTION_PERFORMED, getActionCommand()));
}

From source file:Main.java

/**
 * Fires a {@link ActionListener}. This is useful for firing 
 * {@link ApplicationAction}s to show blocking dialog.
 *
 * @param source the source of the event.
 * @param listener the listener to fire.
 * @param command a string that may specify a command (possibly one 
 * of several) associated with the event.
 * @param modifiers the modifier keys held down during this action.
 * @see ActionEvent#ActionEvent(Object, int, String, long, int)
 *///w w w  . j  a  va  2  s .  c  o  m
public static void fireAction(final Object source, final ActionListener listener, final String command,
        final int modifiers) {
    fireAction(listener, new ActionEvent(source, ActionEvent.ACTION_PERFORMED, command,
            System.currentTimeMillis(), modifiers));
}

From source file:de.fhg.igd.swingrcp.ActionAdapter.java

/**
 * @see Action#run()/*from  ww  w .ja  v a2s . c o m*/
 */
@Override
public void run() {
    // execute action
    SwingUtilities.invokeLater(new Runnable() {

        /**
         * @see Runnable#run()
         */
        @Override
        public void run() {
            action.actionPerformed(new ActionEvent(this, ActionEvent.ACTION_PERFORMED, null));
        }

    });
}

From source file:com.mirth.connect.client.ui.editors.BasicModeSettingsDialog.java

private void changeAbbreviation(DocumentEvent evt) {
    String text = "";

    try {/*  w  w w . j  a  va2s.  c  o m*/
        text = evt.getDocument().getText(0, evt.getDocument().getLength()).trim();
    } catch (BadLocationException e) {
    }

    if (evt.getDocument().equals(startOfMessageBytesField.getDocument())) {
        startOfMessageAbbreviation = TcpUtil.convertHexToAbbreviation(text);
        actionListener.actionPerformed(new ActionEvent(startOfMessageBytesField, ActionEvent.ACTION_PERFORMED,
                BasicModePlugin.CHANGE_START_BYTES_COMMAND));
    } else if (evt.getDocument().equals(endOfMessageBytesField.getDocument())) {
        endOfMessageAbbreviation = TcpUtil.convertHexToAbbreviation(text);
        actionListener.actionPerformed(new ActionEvent(endOfMessageBytesField, ActionEvent.ACTION_PERFORMED,
                BasicModePlugin.CHANGE_END_BYTES_COMMAND));
    }

    changeAbbreviation();
}

From source file:com.emr.schemas.ButtonColumn.java

public void actionPerformed(ActionEvent e) {
    int row = table.convertRowIndexToModel(table.getEditingRow());
    fireEditingStopped();/*from  w ww  .  ja  v a  2s  . c o m*/

    //  Invoke the Action

    ActionEvent event = new ActionEvent(table, ActionEvent.ACTION_PERFORMED, "" + row);
    action.actionPerformed(event);
}

From source file:com.googlecode.commons.swing.component.datetime.MiniDateCalendar.java

protected void fireActionListener() {
    ActionListener[] listeners = listenerList.getListeners(ActionListener.class);
    for (ActionListener l : listeners) {
        l.actionPerformed(new ActionEvent(this, ActionEvent.ACTION_PERFORMED, ""));
    }// w w  w  . j  av  a  2s .  c  o m
}

From source file:com.mirth.connect.plugins.mllpmode.MLLPModeSettingsDialog.java

private void changeAbbreviation(DocumentEvent evt) {
    String text = "";

    try {//  ww  w .j a  va 2 s  . c o m
        text = evt.getDocument().getText(0, evt.getDocument().getLength()).trim();
    } catch (BadLocationException e) {
    }

    if (evt.getDocument().equals(startOfMessageBytesField.getDocument())) {
        startOfMessageAbbreviation = TcpUtil.convertHexToAbbreviation(text);
        actionListener.actionPerformed(new ActionEvent(startOfMessageBytesField, ActionEvent.ACTION_PERFORMED,
                MLLPModeClientProvider.CHANGE_START_BYTES_COMMAND));
    } else if (evt.getDocument().equals(endOfMessageBytesField.getDocument())) {
        endOfMessageAbbreviation = TcpUtil.convertHexToAbbreviation(text);
        actionListener.actionPerformed(new ActionEvent(endOfMessageBytesField, ActionEvent.ACTION_PERFORMED,
                MLLPModeClientProvider.CHANGE_END_BYTES_COMMAND));
    } else if (evt.getDocument().equals(ackBytesField.getDocument())) {
        ackAbbreviation = TcpUtil.convertHexToAbbreviation(text);
    } else {
        nackAbbreviation = TcpUtil.convertHexToAbbreviation(text);
    }

    changeAbbreviation();
}

From source file:org.jdal.swing.Selector.java

/**
 * Notify listeners that selected values changes
 *///ww w. ja  v  a 2 s . c o m
protected void fireActionEvent() {
    if (!firingActionEvent) {
        firingActionEvent = true;
        ActionEvent event = new ActionEvent(this, ActionEvent.ACTION_PERFORMED, "selectorChanged");

        for (ActionListener listener : listenerList.getListeners(ActionListener.class))
            listener.actionPerformed(event);

        firingActionEvent = false;
    }
}