Compiere 3.1

org.compiere.apps
Class AppsAction

java.lang.Object
  extended by javax.swing.AbstractAction
      extended by org.compiere.apps.AppsAction
All Implemented Interfaces:
ActionListener, Serializable, Cloneable, EventListener, Action

public final class AppsAction
extends AbstractAction

Application Action. Creates Action with MenuItem and Button The ActionCommand is translated for display If translated text contains &, the next character is the Mnemonic

Version:
$Id: AppsAction.java,v 1.2 2006/07/30 00:51:27 jjanke Exp $
Author:
Jorg Janke
See Also:
Serialized Form

Field Summary
static Insets BUTTON_INSETS
          Button Insets
static Dimension BUTTON_SIZE
          Button Size
 
Fields inherited from class javax.swing.AbstractAction
changeSupport, enabled
 
Fields inherited from interface javax.swing.Action
ACCELERATOR_KEY, ACTION_COMMAND_KEY, DEFAULT, DISPLAYED_MNEMONIC_INDEX_KEY, LARGE_ICON_KEY, LONG_DESCRIPTION, MNEMONIC_KEY, NAME, SELECTED_KEY, SHORT_DESCRIPTION, SMALL_ICON
 
Constructor Summary
AppsAction(String action, KeyStroke accelerator, boolean toggle)
          Application Action
AppsAction(String action, KeyStroke accelerator, String text)
          Application Action
AppsAction(String action, KeyStroke accelerator, String toolTipText, boolean toggle)
          Application Action
 
Method Summary
 void actionPerformed(ActionEvent e)
          ActionListener
 void dispose()
          Dispose
 AbstractButton getButton()
          Return Button
 JMenuItem getMenuItem()
          Return MenuItem
 Character getMnemonic()
          Get Mnemonic character
 String getName()
          Get Name/ActionCommand
 boolean isPressed()
          IsPressed
 void setDelegate(ActionListener al)
          Set Delegate to receive the actionPerformed calls
 void setPressed(boolean pressed)
          Toggle
 String toString()
          String Info
 
Methods inherited from class javax.swing.AbstractAction
addPropertyChangeListener, clone, firePropertyChange, getKeys, getPropertyChangeListeners, getValue, isEnabled, putValue, removePropertyChangeListener, setEnabled
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

BUTTON_SIZE

public static final Dimension BUTTON_SIZE
Button Size


BUTTON_INSETS

public static final Insets BUTTON_INSETS
Button Insets

Constructor Detail

AppsAction

public AppsAction(String action,
                  KeyStroke accelerator,
                  boolean toggle)
Application Action

Parameters:
action - base action command - used as AD_Message for Text and Icon name
accelerator - optional keystroke for accelerator
toggle - is toggle action (maintains state)

AppsAction

public AppsAction(String action,
                  KeyStroke accelerator,
                  String text)
Application Action

Parameters:
action - base action command - used as AD_Message for Text and Icon name
accelerator - optional keystroke for accelerator
text - text, if null defered from action

AppsAction

public AppsAction(String action,
                  KeyStroke accelerator,
                  String toolTipText,
                  boolean toggle)
Application Action

Parameters:
action - base action command - used as AD_Message for Text and Icon name
accelerator - optional keystroke for accelerator
toolTipText - text, if null defered from action
toggle - is toggle action (maintains state)
Method Detail

getName

public String getName()
Get Name/ActionCommand

Returns:
ActionName

getButton

public AbstractButton getButton()
Return Button

Returns:
Button

getMenuItem

public JMenuItem getMenuItem()
Return MenuItem

Returns:
MenuItem

setDelegate

public void setDelegate(ActionListener al)
Set Delegate to receive the actionPerformed calls

Parameters:
al - listener

setPressed

public void setPressed(boolean pressed)
Toggle

Parameters:
pressed - pressed

isPressed

public boolean isPressed()
IsPressed

Returns:
true if pressed

getMnemonic

public Character getMnemonic()
Get Mnemonic character

Returns:
character

actionPerformed

public void actionPerformed(ActionEvent e)
ActionListener

Parameters:
e - Event

dispose

public void dispose()
Dispose


toString

public String toString()
String Info

Overrides:
toString in class Object
Returns:
String Representation

Compiere 3.1

Compiere® is a registered trademark of ComPiere, Inc. ©2004-2008 HumanFlash.com All rights reserved.