|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.vizzini.ui.ActionManager
public final class ActionManager
Provides a factory for creating Swing actions and Swing button-type components. Actions are cached by name so subsequent accesses return the same object. Components created with this are cached by action, so subsequent accesses return the same object.
Nested Class Summary | |
---|---|
(package private) static class |
ActionManager.CallbackAction
Provides an action which looks up the method to call. |
Field Summary | |
---|---|
static String |
CALLBACK_PROPERTY
Callback property. |
static String |
NAME_PROPERTY
Name property. |
static String |
TARGET_PROPERTY
Target property. |
static String |
USES_CALLBACK_PROPERTY
Uses callback property. |
Method Summary | |
---|---|
void |
clear()
Clear all actions and controls. |
static void |
clearInstances()
Clear all instances. |
static Action |
configureAction(Action action,
Object target,
String name,
boolean useIcon,
boolean useText,
boolean useMnemonic,
boolean useAccelerator)
Configure the given action. |
static KeyStroke |
getAcceleratorFor(String string)
Return the accelerator for the given string. |
static Action |
getAction(Object target,
String name)
Return an action for the given name, creating it if necessary. |
static Action |
getAction(Object target,
String name,
boolean useIcon,
boolean useText,
boolean useMnemonic,
boolean useAccelerator)
Return an action for the given name, creating it if necessary. |
static Action |
getAction(Object target,
String name,
boolean useIcon,
boolean useText,
boolean useMnemonic,
boolean useAccelerator,
boolean useCallback)
Return an action for the given name, creating it if necessary. |
static JButton |
getButton(Object target,
Action action)
Return a button for the given action, creating it if necessary. |
static JButton |
getButton(Object target,
String actionName,
boolean useIcon,
boolean useText,
boolean useMnemonic,
boolean useAccelerator,
boolean useCallback)
Return a button for the given action parameters, creating it if necessary. |
static JCheckBox |
getCheckBox(Object target,
Action action)
Return a check box for the given action, creating it if necessary. |
static JCheckBox |
getCheckBox(Object target,
String actionName,
boolean useIcon,
boolean useText,
boolean useMnemonic,
boolean useAccelerator,
boolean useCallback)
Return a check box for the given action parameters, creating it if necessary. |
static JCheckBoxMenuItem |
getCheckBoxMenuItem(Object target,
Action action)
Return a check box menu item for the given action, creating it if necessary. |
static JCheckBoxMenuItem |
getCheckBoxMenuItem(Object target,
String actionName,
boolean useIcon,
boolean useText,
boolean useMnemonic,
boolean useAccelerator,
boolean useCallback)
Return a check box menu item for the given action parameters, creating it if necessary. |
static int |
getKeyCodeFor(String string)
Return the key code for the given string. |
static JMenu |
getMenu(Object target,
Action action)
Return a menu for the given action, creating it if necessary. |
static JMenu |
getMenu(Object target,
String actionName,
boolean useIcon,
boolean useText,
boolean useMnemonic,
boolean useAccelerator)
Return a menu for the given action parameters, creating it if necessary. |
static MenuButton |
getMenuButton(Object target,
Action action)
Return a menu button for the given action, creating it if necessary. |
static MenuButton |
getMenuButton(Object target,
String actionName,
boolean useIcon,
boolean useText,
boolean useMnemonic,
boolean useAccelerator)
Return a menu button for the given action parameters, creating it if necessary. |
static JMenuItem |
getMenuItem(Object target,
Action action)
Return a menu item for the given action, creating it if necessary. |
static JMenuItem |
getMenuItem(Object target,
String actionName,
boolean useIcon,
boolean useText,
boolean useMnemonic,
boolean useAccelerator,
boolean useCallback)
Return a menu item for the given action parameters, creating it if necessary. |
static JRadioButton |
getRadioButton(Object target,
Action action)
Return a radio button for the given action, creating it if necessary. |
static JRadioButton |
getRadioButton(Object target,
String actionName,
boolean useIcon,
boolean useText,
boolean useMnemonic,
boolean useAccelerator,
boolean useCallback)
Return a radio button for the given action parameters, creating it if necessary. |
static JRadioButtonMenuItem |
getRadioButtonMenuItem(Object target,
Action action)
Return a radio button menu item for the given action, creating it if necessary. |
static JRadioButtonMenuItem |
getRadioButtonMenuItem(Object target,
String actionName,
boolean useIcon,
boolean useText,
boolean useMnemonic,
boolean useAccelerator,
boolean useCallback)
Return a radio button menu item for the given action parameters, creating it if necessary. |
static JToggleButton |
getToggleButton(Object target,
Action action)
Return a toggle button for the given action, creating it if necessary. |
static JToggleButton |
getToggleButton(Object target,
String actionName,
boolean useIcon,
boolean useText,
boolean useMnemonic,
boolean useAccelerator,
boolean useCallback)
Return a toggle button for the given action parameters, creating it if necessary. |
static boolean |
isMacApp()
Return true if this is a Macintosh app in the sense used by this class. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String USES_CALLBACK_PROPERTY
public static final String CALLBACK_PROPERTY
public static final String NAME_PROPERTY
public static final String TARGET_PROPERTY
Method Detail |
---|
public static void clearInstances()
public static Action configureAction(Action action, Object target, String name, boolean useIcon, boolean useText, boolean useMnemonic, boolean useAccelerator)
public static KeyStroke getAcceleratorFor(String string)
public static Action getAction(Object target, String name)
IllegalArgumentException
- if target is null.
IllegalArgumentException
- if name is null.getAction( Object, String, boolean, boolean, boolean, boolean,
boolean )
public static Action getAction(Object target, String name, boolean useIcon, boolean useText, boolean useMnemonic, boolean useAccelerator)
target
- The target object.name
- The name of the action, used for reference and
to obtain resources.useIcon
- If true, use either the resource icon or the
default icon. If false, don't use an icon.useText
- If true, use either the resource text or the
default text. If false, don't use text.useMnemonic
- If true, use the resource mnemonic. If false,
don't use a mnemonic.useAccelerator
- If true, use the resource accelerator. If false,
don't use an accelerator.
IllegalArgumentException
- if target is null.
IllegalArgumentException
- if name is null.public static Action getAction(Object target, String name, boolean useIcon, boolean useText, boolean useMnemonic, boolean useAccelerator, boolean useCallback)
target
- The target object.name
- The name of the action, used for reference and
to obtain resources.useIcon
- If true, use either the resource icon or the
default icon. If false, don't use an icon.useText
- If true, use either the resource text or the
default text. If false, don't use text.useMnemonic
- If true, use the resource mnemonic. If false,
don't use a mnemonic.useAccelerator
- If true, use the resource accelerator. If false,
don't use an accelerator.useCallback
- Flag indicating whether to associate a callback
method.
IllegalArgumentException
- if target is null.
IllegalArgumentException
- if name is null.public static JButton getButton(Object target, Action action)
target
- The target object.action
- The action of interest.
IllegalArgumentException
- if target or action is null.public static JButton getButton(Object target, String actionName, boolean useIcon, boolean useText, boolean useMnemonic, boolean useAccelerator, boolean useCallback)
getAction( Object, String, boolean, boolean, boolean, boolean,
boolean )
public static JCheckBox getCheckBox(Object target, Action action)
target
- The target object.action
- The action of interest.
IllegalArgumentException
- if target or action is null.public static JCheckBox getCheckBox(Object target, String actionName, boolean useIcon, boolean useText, boolean useMnemonic, boolean useAccelerator, boolean useCallback)
getAction( Object, String, boolean, boolean, boolean, boolean,
boolean )
public static JCheckBoxMenuItem getCheckBoxMenuItem(Object target, Action action)
target
- The target object.action
- The action of interest.
IllegalArgumentException
- if target or action is null.public static JCheckBoxMenuItem getCheckBoxMenuItem(Object target, String actionName, boolean useIcon, boolean useText, boolean useMnemonic, boolean useAccelerator, boolean useCallback)
getAction( Object, String, boolean, boolean, boolean, boolean,
boolean )
public static int getKeyCodeFor(String string)
public static JMenu getMenu(Object target, Action action)
target
- The target object.action
- The action of interest.
IllegalArgumentException
- if target or action is null.public static JMenu getMenu(Object target, String actionName, boolean useIcon, boolean useText, boolean useMnemonic, boolean useAccelerator)
getAction( Object, String, boolean, boolean, boolean, boolean,
boolean )
public static MenuButton getMenuButton(Object target, Action action)
target
- The target object.action
- The action of interest.
IllegalArgumentException
- if target or action is null.public static MenuButton getMenuButton(Object target, String actionName, boolean useIcon, boolean useText, boolean useMnemonic, boolean useAccelerator)
getAction( Object, String, boolean, boolean, boolean, boolean,
boolean )
public static JMenuItem getMenuItem(Object target, Action action)
target
- The target object.action
- The action of interest.
IllegalArgumentException
- if target or action is null.public static JMenuItem getMenuItem(Object target, String actionName, boolean useIcon, boolean useText, boolean useMnemonic, boolean useAccelerator, boolean useCallback)
getAction( Object, String, boolean, boolean, boolean, boolean,
boolean )
public static JRadioButton getRadioButton(Object target, Action action)
target
- The target object.action
- The action of interest.
IllegalArgumentException
- if target or action is null.public static JRadioButton getRadioButton(Object target, String actionName, boolean useIcon, boolean useText, boolean useMnemonic, boolean useAccelerator, boolean useCallback)
getAction( Object, String, boolean, boolean, boolean, boolean,
boolean )
public static JRadioButtonMenuItem getRadioButtonMenuItem(Object target, Action action)
target
- The target object.action
- The action of interest.
IllegalArgumentException
- if target or action is null.public static JRadioButtonMenuItem getRadioButtonMenuItem(Object target, String actionName, boolean useIcon, boolean useText, boolean useMnemonic, boolean useAccelerator, boolean useCallback)
getAction( Object, String, boolean, boolean, boolean, boolean,
boolean )
public static JToggleButton getToggleButton(Object target, Action action)
target
- The target object.action
- The action of interest.
IllegalArgumentException
- if target or action is null.public static JToggleButton getToggleButton(Object target, String actionName, boolean useIcon, boolean useText, boolean useMnemonic, boolean useAccelerator, boolean useCallback)
getAction( Object, String, boolean, boolean, boolean, boolean,
boolean )
public static boolean isMacApp()
public void clear()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Copyright © 2007 Vizzini.org. All Rights Reserved. | 2007.12.25.03.00.02 |