Example usage for javax.swing Action SMALL_ICON

List of usage examples for javax.swing Action SMALL_ICON

Introduction

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

Prototype

String SMALL_ICON

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

Click Source Link

Document

The key used for storing a small Icon, such as ImageIcon.

Usage

From source file:org.pmedv.blackboard.commands.OpenBoardCommand.java

public OpenBoardCommand(String title) {
    this.title = title;
    putValue(Action.NAME, title);
    putValue(Action.SMALL_ICON, resources.getIcon("icon.open"));
    putValue(Action.SHORT_DESCRIPTION, resources.getResourceByKey("OpenBoardCommand.description"));
}

From source file:org.pmedv.blackboard.commands.PasteCommand.java

public PasteCommand() {
    putValue(Action.NAME, resources.getResourceByKey("PasteCommand.name"));
    putValue(Action.SMALL_ICON, resources.getIcon("icon.paste"));
    putValue(Action.SHORT_DESCRIPTION, resources.getResourceByKey("PasteCommand.description"));
    putValue(Action.ACCELERATOR_KEY, KeyStroke.getKeyStroke(KeyEvent.VK_V, InputEvent.CTRL_DOWN_MASK));
    setEnabled(false);/*from  w w w  . j av a2s .  co m*/
}

From source file:org.pmedv.blackboard.commands.RedoCommand.java

public RedoCommand() {
    putValue(Action.NAME, resources.getResourceByKey("RedoCommand.name"));
    putValue(Action.SMALL_ICON, resources.getIcon("icon.redo"));
    putValue(Action.SHORT_DESCRIPTION, resources.getResourceByKey("RedoCommand.description"));
    putValue(Action.ACCELERATOR_KEY, KeyStroke.getKeyStroke(KeyEvent.VK_Y, InputEvent.CTRL_DOWN_MASK));
    setEnabled(false);/*from w ww .j a  v  a  2s .com*/
}

From source file:org.pmedv.blackboard.commands.RotateCCWCommand.java

public RotateCCWCommand() {
    putValue(Action.NAME, resources.getResourceByKey("RotateCCWCommand.name"));
    putValue(Action.SMALL_ICON, resources.getIcon("icon.rotateccw"));
    putValue(Action.SHORT_DESCRIPTION, resources.getResourceByKey("RotateCCWCommand.description"));
    putValue(Action.ACCELERATOR_KEY, KeyStroke.getKeyStroke(KeyEvent.VK_L, 0));
    setEnabled(false);//from  w ww  . j a  va2s.c om
}

From source file:org.pmedv.blackboard.commands.RotateCWCommand.java

public RotateCWCommand() {
    putValue(Action.NAME, resources.getResourceByKey("RotateCWCommand.name"));
    putValue(Action.SMALL_ICON, resources.getIcon("icon.rotatecw"));
    putValue(Action.SHORT_DESCRIPTION, resources.getResourceByKey("RotateCWCommand.description"));
    putValue(Action.ACCELERATOR_KEY, KeyStroke.getKeyStroke(KeyEvent.VK_R, 0));
    setEnabled(false);/*from w w w  .j  a  va2s  . c o  m*/
}

From source file:org.pmedv.blackboard.commands.SaveNetlistCommand.java

public SaveNetlistCommand() {
    putValue(Action.NAME, resources.getResourceByKey("SaveNetlistCommand.name"));
    putValue(Action.SMALL_ICON, resources.getIcon("icon.save"));
    putValue(Action.SHORT_DESCRIPTION, resources.getResourceByKey("SaveNetlistCommand.description"));
}

From source file:org.pmedv.blackboard.commands.UndoCommand.java

public UndoCommand() {
    putValue(Action.NAME, resources.getResourceByKey("UndoCommand.name"));
    putValue(Action.SMALL_ICON, resources.getIcon("icon.undo"));
    putValue(Action.SHORT_DESCRIPTION, resources.getResourceByKey("UndoCommand.description"));
    putValue(Action.ACCELERATOR_KEY, KeyStroke.getKeyStroke(KeyEvent.VK_Z, InputEvent.CTRL_DOWN_MASK));
    setEnabled(false);/*  w w w.  j  a v a2s. c  om*/
}

From source file:org.roche.antibody.ui.actions.menu.AntibodySaveXmlAction.java

public AntibodySaveXmlAction(JFrame parentFrame) {
    super(parentFrame, NAME);

    ImageIcon icon = getImageIcon(IMAGE_PATH);
    if (icon != null) {
        this.putValue(Action.SMALL_ICON, icon);
    }//  w  w  w . ja  va2  s  . c  o  m
    this.putValue(Action.SHORT_DESCRIPTION, SHORT_DESCRIPTION);
}

From source file:org.wings.SAbstractButton.java

protected void configurePropertiesFromAction(Action a) {
    // uncomment if compiled against < jdk 1.3
    //   setActionCommand((a != null
    //                  ? (String)a.getValue(Action.ACTION_COMMAND_KEY)
    //                  : null));
    setText((a != null ? (String) a.getValue(Action.NAME) : null));
    setIcon((a != null ? (SIcon) a.getValue(Action.SMALL_ICON) : null));
    setEnabled((a != null ? a.isEnabled() : true));
    setToolTipText((a != null ? (String) a.getValue(Action.SHORT_DESCRIPTION) : null));
}

From source file:org.wings.SAbstractButton.java

public SIcon getIcon() {
    if (action == null)
        return super.getIcon();
    final SIcon actionIcon = (SIcon) action.getValue(Action.SMALL_ICON);
    return (actionIcon != null) ? actionIcon : super.getIcon();
}