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 InsetsBUTTON_INSETSButton Insetsstatic DimensionBUTTON_SIZEButton 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 voidactionPerformed(ActionEvent e)ActionListenervoiddispose()DisposeAbstractButtongetButton()Return ButtonJMenuItemgetMenuItem()Return MenuItemCharactergetMnemonic()Get Mnemonic characterStringgetName()Get Name/ActionCommandbooleanisPressed()IsPressedvoidsetDelegate(ActionListener al)Set Delegate to receive the actionPerformed callsvoidsetPressed(boolean pressed)ToggleStringtoString()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
-
-