Example usage for javax.swing Action NAME

List of usage examples for javax.swing Action NAME

Introduction

In this page you can find the example usage for javax.swing Action NAME.

Prototype

String NAME

To view the source code for javax.swing Action NAME.

Click Source Link

Document

The key used for storing the String name for the action, used for a menu or button.

Usage

From source file:Main.java

public ShowAction() {
    super("About");

    putValue(Action.MNEMONIC_KEY, new Integer(KeyEvent.VK_A));
    putValue(Action.NAME, "Go to number ");
    putValue(Action.LARGE_ICON_KEY, MetalIconFactory.getFileChooserHomeFolderIcon());

}

From source file:Main.java

public ShowAction() {
    super("About");

    putValue(Action.MNEMONIC_KEY, new Integer(KeyEvent.VK_A));
    putValue(Action.NAME, "Go to number ");
    putValue(Action.DISPLAYED_MNEMONIC_INDEX_KEY, 1);

}

From source file:ApkItem.java

public ApkItem(File file) {
    this.file = file;
    putValue(Action.NAME, "");
    this.apkState = new State(this);
    apkState.setState(State.Default);
}

From source file:CutPasteSample.java

public static Action findAction(Action actions[], String key) {
    Hashtable commands = new Hashtable();
    for (int i = 0; i < actions.length; i++) {
        Action action = actions[i];
        commands.put(action.getValue(Action.NAME), action);
    }/*  ww  w  .  j av  a2s  .c o  m*/
    return (Action) commands.get(key);
}

From source file:Main.java

public ShowAction() {
    super("About");
    PropertyChangeListener lis = new PropertyChangeListener() {
        @Override// ww  w .  j a va 2  s. com
        public void propertyChange(PropertyChangeEvent e) {
            System.out.println(e);
        }
    };
    addPropertyChangeListener(lis);

    putValue(Action.MNEMONIC_KEY, new Integer(KeyEvent.VK_A));
    putValue(Action.NAME, "Go to number ");
    putValue(Action.LONG_DESCRIPTION, "Change the number to ");

    removePropertyChangeListener(lis);

}

From source file:Main.java

/**
 * Search the given text component's list of actions for an action with the given name.
 * Returns {@code null} if no such action is found.  See {@link DefaultEditorKit} for a list of
 * action name constants.//from  ww  w. j a  va  2  s .  c  o m
 */
public static Action getAction(JTextComponent component, String actionName) {
    for (Action a : component.getActions()) {
        if (actionName.equals(a.getValue(Action.NAME))) {
            return a;
        }
    }
    return null;
}

From source file:pl.otros.logview.gui.actions.OpenLogInvestigationAction.java

public OpenLogInvestigationAction(OtrosApplication otrosApplication) {
    super(otrosApplication);
    putValue(Action.NAME, "Open log investigation");
    putValue(Action.SMALL_ICON, Icons.IMPORT);
}

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

public void setName(String name) {
    putValue(Action.NAME, messageWrapper.getMessage(name));
}

From source file:Main.java

/**
 * Create a map view of {@code component.getActions()}, where the keys are the action
 * names.  See {@link DefaultEditorKit} for a list of action name constants.
 *///from  w ww. j a  v a  2s. co  m
public static Map<String, Action> getActions(JTextComponent component) {
    Map<String, Action> result = new HashMap<String, Action>();
    for (Action a : component.getActions()) {
        // Documentation for Action.NAME asserts that it will always be a String
        result.put((String) a.getValue(Action.NAME), a);
    }
    return result;
}

From source file:lince.controladores.exportar.AbrirExportarHoisan.java

public AbrirExportarHoisan() {
    putValue(Action.NAME, ResourceBundleHelper.getI18NLabel("HOISAN"));
    putValue(Action.ACTION_COMMAND_KEY, EXPORT_HOISAN_COMMAND_ID);
    putValue(Action.SHORT_DESCRIPTION, ResourceBundleHelper.getI18NLabel("actions.export.Hoisan"));
}