Package org.compiere.apps
Class AppsAction
- java.lang.Object
-
- javax.swing.AbstractAction
-
- 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, delegate execution of action to an attached ActionListener instance 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
Fields Modifier and Type Field Description static Insets
BUTTON_INSETS
Button Insetsstatic 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
Constructors Constructor Description AppsAction(String action, KeyStroke accelerator, boolean toggle)
Application ActionAppsAction(String action, KeyStroke accelerator, String text)
Application ActionAppsAction(String action, KeyStroke accelerator, String toolTipText, boolean toggle)
Application Action
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
actionPerformed(ActionEvent e)
ActionListenervoid
dispose()
DisposeAbstractButton
getButton()
Return ButtonJMenuItem
getMenuItem()
Return MenuItemCharacter
getMnemonic()
Get Mnemonic characterString
getName()
Get Name/ActionCommandboolean
isPressed()
IsPressedvoid
setDelegate(ActionListener al)
Set Delegate to receive the actionPerformed callsvoid
setPressed(boolean pressed)
ToggleString
toString()
String Info-
Methods inherited from class javax.swing.AbstractAction
addPropertyChangeListener, clone, firePropertyChange, getKeys, getPropertyChangeListeners, getValue, isEnabled, putValue, removePropertyChangeListener, setEnabled
-
-
-
-
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 nameaccelerator
- optional keystroke for acceleratortoggle
- 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 nameaccelerator
- optional keystroke for acceleratortext
- 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 nameaccelerator
- optional keystroke for acceleratortoolTipText
- text, if null defered from actiontoggle
- 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
-
-