|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--javax.swing.AbstractAction | +--com.glaivestone.javax.swing.OperationAction
A Swing Action
which is configured to perform an operation.
Typically used to configure UI elements which invoke operations, such as push buttons, toolbar buttons, and pulldown/popup menu commands. Multiple UI elements can be attached to a single operation action to ensure consistent presentation of properties such as labelling, accelerator keys, and activation when an operation is made available in the UI in multiple ways.
Field Summary |
Fields inherited from interface javax.swing.Action |
ACCELERATOR_KEY, ACTION_COMMAND_KEY, DEFAULT, LONG_DESCRIPTION, MNEMONIC_KEY, NAME, SHORT_DESCRIPTION, SMALL_ICON |
Constructor Summary | |
OperationAction(java.lang.String name,
java.awt.event.ActionListener operationHandler)
Creates an action with the specified name which performs the operation configured by the given handler. |
|
OperationAction(java.lang.String name,
char mnemonic,
java.awt.event.ActionListener operationHandler)
Creates an action with the specified name which performs the operation configured by the given handler. |
|
OperationAction(java.lang.String name,
char mnemonic,
java.lang.String shortDescription,
java.awt.event.ActionListener operationHandler)
Creates an action with the specified name which performs the operation configured by the given handler. |
|
OperationAction(java.lang.String name,
java.lang.String operationDescription,
java.awt.event.ActionListener operationHandler)
Creates an action with the specified name which performs the operation configured by the given handler. |
Method Summary | |
void |
actionPerformed(java.awt.event.ActionEvent event)
Invoked when an action occurs. |
javax.swing.JMenuItem |
appendTo(javax.swing.JMenu aMenu)
Append a menu item for this action to the menu. |
javax.swing.JMenuItem |
appendTo(javax.swing.JPopupMenu aMenu)
Append a menu item for this action to the menu. |
void |
attachTo(javax.swing.JButton aButton)
Deprecated. Use button setAction as of JDK 1.3 |
void |
attachTo(javax.swing.JMenuItem aMenuItem)
Attach this action to a menu item so its operation is performed when the menu item is selected. |
void |
installAccelerator(javax.swing.JMenuItem aComponent)
Install the accelerator key combination for this operation on the UI element to which it is attached. |
void |
installMnemonic(javax.swing.AbstractButton aComponent)
Install the mnemonic character for this operation on a button or menu item |
void |
installToolTip(javax.swing.JComponent aComponent)
Install the tool tip for this operation on a button or menu item |
void |
setAccelerator(javax.swing.KeyStroke keyStroke)
Specify the accelerator key combination for invoking the operation. |
void |
setDescription(java.lang.String operationDescription)
Specify the description of the operation. |
void |
setMnemonic(char mnemonic)
Specify the mnemonic character for this action. |
Methods inherited from class javax.swing.AbstractAction |
addPropertyChangeListener, getKeys, getPropertyChangeListeners, getValue, isEnabled, putValue, removePropertyChangeListener, setEnabled |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public OperationAction(java.lang.String name, java.awt.event.ActionListener operationHandler)
public OperationAction(java.lang.String name, char mnemonic, java.awt.event.ActionListener operationHandler)
public OperationAction(java.lang.String name, java.lang.String operationDescription, java.awt.event.ActionListener operationHandler)
public OperationAction(java.lang.String name, char mnemonic, java.lang.String shortDescription, java.awt.event.ActionListener operationHandler)
Method Detail |
public void actionPerformed(java.awt.event.ActionEvent event)
ActionListener.actionPerformed(java.awt.event.ActionEvent)
public javax.swing.JMenuItem appendTo(javax.swing.JMenu aMenu)
public javax.swing.JMenuItem appendTo(javax.swing.JPopupMenu aMenu)
public void attachTo(javax.swing.JButton aButton)
setAction
as of JDK 1.3
public void attachTo(javax.swing.JMenuItem aMenuItem)
public void installAccelerator(javax.swing.JMenuItem aComponent)
public void installMnemonic(javax.swing.AbstractButton aComponent)
public void installToolTip(javax.swing.JComponent aComponent)
public void setAccelerator(javax.swing.KeyStroke keyStroke)
public void setDescription(java.lang.String operationDescription)
public void setMnemonic(char mnemonic)
|
GFL 1.1 API | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |