ilog.views.appframe
Class IlvAction

java.lang.Object
  extended by javax.swing.AbstractAction
      extended by ilog.views.appframe.IlvAction
All Implemented Interfaces:
ActionListener, Serializable, Cloneable, EventListener, Action

public class IlvAction
extends AbstractAction

Defines actions that read their properties from the settings of the application. The IlvAction also enriches predefined Swing action properties with new properties that it allows for, for example, checking menu items or toolbar buttons associated with the action.
All the IlvAction properties can be accessed through static methods of the IlvAction class, so that those properties can be applied to actions that are not IlvAction actions.

You can find task-oriented documentation and examples of using IlvAction in the ILOG JViews Application Framework User's Manual, in the chapter on How to Use Swing Actions in JAppFrame.

See Also:
Serialized Form

Field Summary
static String ACTION_ACCELERATOR_LIST
          The key used for storing the list of accelerators that trigger an action event for the action.
static String ACTION_APPLICATION
          The key used for storing the application of the action.
static String ACTION_AUTOMATIC
          Determines whether the action events for the action should be processed by the application or by the actionPerformed method of the action.
static String ACTION_CHECK_GROUP
          The key used for storing the name of the group of checkable actions that the action belongs to.
static String ACTION_CHECK_LOOK
          Action property read only for checkable actions.
static String ACTION_CHECK_ONE_SHOT
          Action property read only for checkable actions.
static String ACTION_CHECK_STATE
          The key of the property that determines whether the action is checked.
static String ACTION_CHECKABLE
          The key of the property that determines whether the action is checkable.
static String ACTION_CHECKED_ICON
          Action property read only for checkable actions with the ACTION_CHECK_LOOK property set to "new".
static String ACTION_DEPENDING_ACTIONS
          The key for storing the actions with state that must change when an action event for the action is being processed.
static String ACTION_LIST
          Determines whether the action is a list action.
static String ACTION_LIST_CHECK_SELECTION
          Boolean list action property that determines whether the selected menu item of the list should be marked with a check.
static String ACTION_LIST_DYNAMIC_CONTENT
          Property accessed only for list actions where ACTION_LIST_IN_SUBMENU property has been set.
static String ACTION_LIST_IN_SUBMENU
          Property accessed only for list actions.
static String ACTION_LIST_ITEMS
          The key used for storing the list items of a list action.
static String ACTION_LIST_MENU_EMPTYSTRING
          Property accessed only for list actions.
static String ACTION_LIST_MENU_FIRSTNUMBER
          Property accessed only for list actions that have the property ACTION_LIST_MENU_USENUMBERING set to Boolean.TRUE.
static String ACTION_LIST_MENU_MAXLENGTH
          Property accessed only for list actions.
static String ACTION_LIST_MENU_USENUMBERING
          Property accessed only for list actions.
static String ACTION_LIST_SELECTION
          Property accessed only for list actions.
static String ACTION_LOCK_ON_DOUBLECLICK
          Action property read only for checkable actions that are "one shot".
static String ACTION_PROCESSED_IN_NEW_THREAD
          Determines whether the process of the action should be performed in a separate thread.
static String ACTION_UNCHECKED_ICON
          Action property read only for checkable actions with the ACTION_CHECK_LOOK property set to "new".
static String ACTION_UPDATE_AFTER_PROCESSING
          Determines whether the action state should be updated after an event for this action has been processed.
static int BIG_ICONS
          Constant value that specifies the use of big icons (32x32).
static String DOUBLE_CLICK_ACTION
          The key used for storing the command of the action that is used for notifying that a button built with the action parameters has been double-clicked.
static int SMALL_ICONS
          Constant value that specifies the use of small icons (16x16).
 
Fields inherited from class javax.swing.AbstractAction
changeSupport, enabled
 
Fields inherited from interface javax.swing.Action
ACCELERATOR_KEY, ACTION_COMMAND_KEY, DEFAULT, LONG_DESCRIPTION, MNEMONIC_KEY, NAME, SHORT_DESCRIPTION, SMALL_ICON
 
Constructor Summary
IlvAction()
          Constructs a new IlvAction.
 
Method Summary
static KeyStroke AcceleratorFromString(String s)
          Returns an accelerator from its specified string representation.
static String AcceleratorToString(KeyStroke accelerator)
          Returns a string representation of the specified accelerator.
 void actionPerformed(ActionEvent e)
          Invoked when an action occurs.
static void ActionProcessTerminated(Action action)
          Must be invoked after the process of the action event for the specified action has been terminated.
 IlvApplication getApplication()
          Returns the application associated with this action.
static String[] GetCategories(Action action)
          Returns the categories the specified action belongs to.
static String GetGroup(Action action)
          Returns the check group that the specified action belongs to.
static Object[] GetListItems(Action action)
          Returns the array of items stored by the specified list action in the ACTION_LIST_ITEMS property.
static char GetMnemonic(Action action, IlvApplication application)
          Returns the mnemonic character that should be set to the menu items associated with the specified action.
static Action GetSelectedGroupAction(IlvApplication application, String group)
          Returns the action currently selected in the specified group of actions.
static Object GetSelectedItem(Action action)
          Returns the item currently selected among the items stored in the specified list action.
static int GetSelectionIndex(Action action)
          Returns the index of the item currently selected among the items stored in the specified list action.
static boolean HasCategory(Action action, String category)
          Determines whether the specified action has the specified category.
static boolean IsActionList(Action action)
          Determines whether the specified action is a list action.
static boolean IsActionLocked(Action action)
          Determines whether the specified action has been locked.
static boolean IsAutomatic(Action action)
          Determines whether the action events of the specified action are handled by the action handlers registered with the application.
static boolean IsChecked(Action action)
          Determines whether the specified action is checked.
static boolean IsListMenuNumbering(Action action)
          Determines whether the specified action is a list action and whether the stored items in it appear with a prefix number in menu items created for those items.
static void LockAction(Action action)
          Locks the specified action.
 void readSettings(IlvSettingsElement element, IlvApplication application)
          Reads the settings of the action from the specified settings element.
static void RegisterActionInGroup(Action action, Component child)
          Register the component that represents the given action in the action group, if this is in the action configuration.
static void SetAction(AbstractButton button, Action action, IlvApplication application, int iconsSize)
          Sets the action to a specified button, taking care of internationalization issues.
static void SetAction(Component component, Action action, IlvApplication application)
          Sets the action to a specified component, taking care of internationalization issues.
static boolean SetAutomatic(Action action, boolean automatic)
          Sets the specified action as automatic or not, depending on the value of the specified automatic parameter.
static void SetChecked(Action action, boolean state)
          Changes the check state of the specified action by setting its ACTION_CHECK_STATE property.
static void SetChecked(Component component, Action action, boolean state)
          Sets the specified component checked or unchecked, depending on the specified check state.
static void SetListItems(Action action, Object[] items)
          Sets the array of items to the specified list action.
static void SetSelectedItem(Action action, Object item)
          Selects one item among the items stored in the specified list action.
static void SetSelectionIndex(Action action, int index)
          Selects one item among the items stored in the specified list action.
static void UnlockAction(Action action)
          Unlocks the specified action, previously locked with the method LockAction(javax.swing.Action).
static void UnregisterActionInGroup(Component child)
          Removes the given component from the action group.
static void UpdateButtonProperties(AbstractButton button, IlvApplication application)
          Updates the button properties according to the parameters of its associated action.
 
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, toString, wait, wait, wait
 

Field Detail

SMALL_ICONS

public static final int SMALL_ICONS
Constant value that specifies the use of small icons (16x16).

See Also:
SetAction(java.awt.Component, javax.swing.Action, ilog.views.appframe.IlvApplication), Constant Field Values

BIG_ICONS

public static final int BIG_ICONS
Constant value that specifies the use of big icons (32x32).

See Also:
SetAction(java.awt.Component, javax.swing.Action, ilog.views.appframe.IlvApplication), Constant Field Values

ACTION_APPLICATION

public static final String ACTION_APPLICATION
The key used for storing the application of the action.

See Also:
Constant Field Values

ACTION_PROCESSED_IN_NEW_THREAD

public static final String ACTION_PROCESSED_IN_NEW_THREAD
Determines whether the process of the action should be performed in a separate thread. If the value of the action property is equal to Boolean.TRUE, the processing of action events will be performed in a separate thread. Otherwise, the action is performed in the current thread.

See Also:
Constant Field Values

ACTION_AUTOMATIC

public static final String ACTION_AUTOMATIC
Determines whether the action events for the action should be processed by the application or by the actionPerformed method of the action.

If the value of the property is equal to Boolean.TRUE, the action will be automatic and its events will be handled by the application that fires them to its registered action handlers. Otherwise, the actionPerformed method of the action is called.

By default, any IlvAction instantiated by the application when initializing its actions from the settings is set to automatic.

See Also:
Constant Field Values

ACTION_UPDATE_AFTER_PROCESSING

public static final String ACTION_UPDATE_AFTER_PROCESSING
Determines whether the action state should be updated after an event for this action has been processed.
If the value of the property is equal to Boolean.TRUE, the action state will be updated by a call to IlvApplication.updateAction(Action). Otherwise, the state of the action is updated using the standard JAppFrame action update mechanism.

See Also:
Constant Field Values

DOUBLE_CLICK_ACTION

public static final String DOUBLE_CLICK_ACTION
The key used for storing the command of the action that is used for notifying that a button built with the action parameters has been double-clicked.

See Also:
Constant Field Values

ACTION_LIST

public static final String ACTION_LIST
Determines whether the action is a list action. If the value of the property is equal to Boolean.TRUE, the action will be a list action. Otherwise, it is not a list action.

See Also:
Constant Field Values

ACTION_LIST_ITEMS

public static final String ACTION_LIST_ITEMS
The key used for storing the list items of a list action.

See Also:
SetListItems(javax.swing.Action, java.lang.Object[]), GetListItems(javax.swing.Action), Constant Field Values

ACTION_LIST_IN_SUBMENU

public static final String ACTION_LIST_IN_SUBMENU
Property accessed only for list actions. It determines whether list items of the action should be displayed in a sub pop-up menu when the action is set to a menu item. If the value of the property is equal to Boolean.TRUE, list items will appear in a sub pop-up menu. Otherwise, menu items appear below the menu item associated with the list action.

See Also:
IsActionList(javax.swing.Action), Constant Field Values

ACTION_LIST_MENU_MAXLENGTH

public static final String ACTION_LIST_MENU_MAXLENGTH
Property accessed only for list actions. It stores an Integer value for the maximum length of the text of menu items that are generated for the list items of the action.

See Also:
IsActionList(javax.swing.Action), Constant Field Values

ACTION_LIST_SELECTION

public static final String ACTION_LIST_SELECTION
Property accessed only for list actions. It stores the storage index of the currently selected list item.

See Also:
IsActionList(javax.swing.Action), GetSelectionIndex(javax.swing.Action), Constant Field Values

ACTION_LIST_MENU_USENUMBERING

public static final String ACTION_LIST_MENU_USENUMBERING
Property accessed only for list actions. It determines whether menu items that are generated for the list items of the action have a prefix text. If the value of the property is equal to true, the text of generated menu items will be prefixed as specified with the ACTION_LIST_MENU_FIRSTNUMBER property. Otherwise, the text is not prefixed.

See Also:
IsActionList(javax.swing.Action), ACTION_LIST_MENU_FIRSTNUMBER, Constant Field Values

ACTION_LIST_MENU_FIRSTNUMBER

public static final String ACTION_LIST_MENU_FIRSTNUMBER
Property accessed only for list actions that have the property ACTION_LIST_MENU_USENUMBERING set to Boolean.TRUE. It stores the text used as the prefix for the text of the menu item corresponding to the item given by GetListItems(Action)[0]. This text should only contain one character. The prefix string that corresponds to the item of index n in the list is then determined as follows:
 String prefix = (String)action.getProperty(IlvAction.ACTION_LIST_MENU_FIRSTNUMBER);
 prefix = new String(new char[]{prefix.charAt(0) + n)});
 
For example, if the property contains the string "A", menu items generated for list items will be prefixed with the strings "A", "B",... for the list items of index 0, 1, ... respectively.

See Also:
IsActionList(javax.swing.Action), ACTION_LIST_MENU_FIRSTNUMBER, Constant Field Values

ACTION_LIST_MENU_EMPTYSTRING

public static final String ACTION_LIST_MENU_EMPTYSTRING
Property accessed only for list actions. It stores the text of the menu item that is added when the action does not contain any list items. For example, if the list action contains the list of windows currently open in the application, the text could be "No windows" (or a key to a string resource) to indicate there is no open window.

See Also:
IsActionList(javax.swing.Action), Constant Field Values

ACTION_LIST_CHECK_SELECTION

public static final String ACTION_LIST_CHECK_SELECTION
Boolean list action property that determines whether the selected menu item of the list should be marked with a check. If the property value is equal to Boolean.TRUE, the selected menu item will be marked with a checkbox; if the value is Boolean.FALSE, the selected item will not be marked.

See Also:
IsActionList(javax.swing.Action), Constant Field Values

ACTION_LIST_DYNAMIC_CONTENT

public static final String ACTION_LIST_DYNAMIC_CONTENT
Property accessed only for list actions where ACTION_LIST_IN_SUBMENU property has been set. It determines whether the list items of the action should be calculated dynamically. If the value of the property is equal to Boolean.TRUE, the method IlvApplication.updateAction(Action) will be invoked before the pop-up menu listing the action list items is displayed. An action handler registered with the application can then set the new list items of the action in its method ActionHandler.updateAction(Action). Otherwise, it is the responsibility of the JAppFrame user to determine when the list items should be set to the action.

See Also:
IsActionList(javax.swing.Action), ACTION_LIST_IN_SUBMENU, Constant Field Values

ACTION_CHECKABLE

public static final String ACTION_CHECKABLE
The key of the property that determines whether the action is checkable. If its value is equal to Boolean.TRUE, it will be a checkable action. Otherwise, the action cannot be checked.

See Also:
SetChecked(Action, boolean), IsChecked(Action), ACTION_CHECK_STATE, Constant Field Values

ACTION_CHECK_STATE

public static final String ACTION_CHECK_STATE
The key of the property that determines whether the action is checked. If its value is equal to Boolean.TRUE, the action will be checked. Otherwise, the action is not checked.

See Also:
SetChecked(Action, boolean), IsChecked(Action), ACTION_CHECKABLE, Constant Field Values

ACTION_CHECK_GROUP

public static final String ACTION_CHECK_GROUP
The key used for storing the name of the group of checkable actions that the action belongs to.

See Also:
SetChecked(Action, boolean), IsChecked(Action), ACTION_CHECKABLE, Constant Field Values

ACTION_CHECK_ONE_SHOT

public static final String ACTION_CHECK_ONE_SHOT
Action property read only for checkable actions. Determines whether the action should remain checked after the processing of a corresponding event has terminated. If the value of this property is equal to Boolean.TRUE, the action will be unchecked after the action process terminates. Otherwise, the action remains checked.

See Also:
ACTION_CHECKABLE, ActionProcessTerminated(Action), Constant Field Values

ACTION_LOCK_ON_DOUBLECLICK

public static final String ACTION_LOCK_ON_DOUBLECLICK
Action property read only for checkable actions that are "one shot". If the value of the property is equal to Boolean.TRUE, the action will be locked after the application user double-clicks a button associated with the action. Otherwise, the button is unchecked and the action is not locked.

See Also:
ACTION_CHECK_ONE_SHOT, Constant Field Values

ACTION_CHECK_LOOK

public static final String ACTION_CHECK_LOOK
Action property read only for checkable actions. It stores the way a menu item associated with the action should display the check state of the action. If the value of the property is equal to "new", the menu item will be set a check icon if the action is checked and an unchecked icon if the action is unchecked. The check icons are specified with the ACTION_CHECKED_ICON and ACTION_UNCHECKED_ICON properties.

Otherwise, if the value of the property is not equal to Boolean.TRUE, a JCheckBoxMenuItem will be instantiated to represent the action. The check state of this JCheckBoxMenuItem is associated with the check state of the action.

See Also:
ACTION_CHECKABLE, Constant Field Values

ACTION_CHECKED_ICON

public static final String ACTION_CHECKED_ICON
Action property read only for checkable actions with the ACTION_CHECK_LOOK property set to "new". It specifies the check icon to be set to a menu item associated with the action, if the action is checked. If the property is not defined from the settings, it will be set to a default icon.

See Also:
ACTION_UNCHECKED_ICON, ACTION_CHECKABLE, ACTION_CHECK_LOOK, Constant Field Values

ACTION_UNCHECKED_ICON

public static final String ACTION_UNCHECKED_ICON
Action property read only for checkable actions with the ACTION_CHECK_LOOK property set to "new". It specifies the uncheck icon to be set to a menu item associated with the action, if the action is unchecked. If the property is not defined from the settings, it will be set to a default icon.

See Also:
ACTION_CHECKED_ICON, ACTION_CHECKABLE, ACTION_CHECK_LOOK, Constant Field Values

ACTION_DEPENDING_ACTIONS

public static final String ACTION_DEPENDING_ACTIONS
The key for storing the actions with state that must change when an action event for the action is being processed. Dependent actions are typically used for actions, such as loading or compiling a document, that, when they are processed, freeze modification actions of the application.

The value of the property is a HashMap instance with keys that are the action command of the dependent actions and values that indicate the state the dependent action must have while the action is being processed: Boolean.TRUE to enable the dependent action and Boolean.FALSE to set it disabled.

Consider as an example a "Compile" action that compiles the currently active Java document in the application. We may have three dependent actions for this action: cut, copy, and stopCompilation. If we set the variable dependentActions to:

HashMap dependentActions = (HashMap)application.getAction("Compile").getValue(IlvAction.ACTION_DEPENDING_ACTIONS);
we may have:
dependentActions.get("cut") == Boolean.FALSE and dependentActions.get("copy") == Boolean.FALSE to indicate that the cut and copy modification actions should be disabled while compiling the Java document and we may have:
dependentActions.get("stopCompilation") == Boolean.TRUE to indicate that the stopCompilation action is enabled when compiling a Java document.

See Also:
Constant Field Values

ACTION_ACCELERATOR_LIST

public static final String ACTION_ACCELERATOR_LIST
The key used for storing the list of accelerators that trigger an action event for the action. The value of the property is an array of KeyStroke instances.

See Also:
Constant Field Values
Constructor Detail

IlvAction

public IlvAction()
Constructs a new IlvAction.

Method Detail

actionPerformed

public void actionPerformed(ActionEvent e)
Invoked when an action occurs. This method is empty, as the action event is processed by the action handlers registered to the application.


readSettings

public void readSettings(IlvSettingsElement element,
                         IlvApplication application)
Reads the settings of the action from the specified settings element.

Parameters:
element - The settings element to read the settings of the action from.
application - The application of the action.

HasCategory

public static boolean HasCategory(Action action,
                                  String category)
Determines whether the specified action has the specified category.

Parameters:
action - The action for testing whether it belongs to the specified category.
category - The category.
Returns:
true if the action has the category; false otherwise.
See Also:
GetCategories(javax.swing.Action)

GetCategories

public static String[] GetCategories(Action action)
Returns the categories the specified action belongs to.

Parameters:
action - The action to retrieve categories from.
Returns:
The array of categories of the specified action.

SetSelectionIndex

public static void SetSelectionIndex(Action action,
                                     int index)
Selects one item among the items stored in the specified list action. The specified action must be a list action, with the property ACTION_LIST set.

Parameters:
action - The action to set the selected item to.
index - The index of the item to select.
See Also:
SetSelectedItem(Action, Object), GetSelectionIndex(javax.swing.Action)

SetSelectedItem

public static void SetSelectedItem(Action action,
                                   Object item)
Selects one item among the items stored in the specified list action. The specified action must be a list action, with the property ACTION_LIST set.

Parameters:
action - The action to set the selected item to.
item - The new item to select.
See Also:
GetSelectedItem(Action), SetSelectionIndex(Action, int)

GetSelectionIndex

public static int GetSelectionIndex(Action action)
Returns the index of the item currently selected among the items stored in the specified list action. The specified action must be a list action, with the property ACTION_LIST set.

Parameters:
action - The action to get the selection index from.
Returns:
The index of the selected item; -1 if no item has been previously selected.
See Also:
GetSelectedItem(Action), SetSelectionIndex(Action, int), SetSelectedItem(Action, Object)

GetSelectedItem

public static Object GetSelectedItem(Action action)
Returns the item currently selected among the items stored in the specified list action. The specified action must be a list action, with the property ACTION_LIST set.

Parameters:
action - The action to get the selected item from.
Returns:
The selected item or null if no item has been previously selected.
See Also:
SetSelectionIndex(Action, int), SetSelectedItem(Action, Object), GetSelectionIndex(Action)

GetListItems

public static Object[] GetListItems(Action action)
Returns the array of items stored by the specified list action in the ACTION_LIST_ITEMS property.

See Also:
SetListItems(javax.swing.Action, java.lang.Object[])

SetListItems

public static void SetListItems(Action action,
                                Object[] items)
Sets the array of items to the specified list action. The ACTION_LIST_ITEMS property is set to the new array of items.

See Also:
GetListItems(javax.swing.Action)

IsListMenuNumbering

public static boolean IsListMenuNumbering(Action action)
Determines whether the specified action is a list action and whether the stored items in it appear with a prefix number in menu items created for those items.

Parameters:
action - The action to test the list menu numbering property of.
Returns:
true if the menu items associated with the stored objects of the list action are numbered; false otherwise.

IsAutomatic

public static boolean IsAutomatic(Action action)
Determines whether the action events of the specified action are handled by the action handlers registered with the application. See ACTION_AUTOMATIC for a more detailed description of automatic actions.

Returns:
true if action events of the specified action are handled by the application; false otherwise.
See Also:
ACTION_AUTOMATIC, SetAutomatic(javax.swing.Action, boolean)

SetAutomatic

public static boolean SetAutomatic(Action action,
                                   boolean automatic)
Sets the specified action as automatic or not, depending on the value of the specified automatic parameter.

Parameters:
action - The action to set the automatic mode to.
automatic - If true, the action will be set automatic; if false, the action will not be automatic.
Returns:
true if the specified action was previously automatic. Otherwise, this method returns false.
See Also:
ACTION_AUTOMATIC, IsAutomatic(javax.swing.Action)

IsActionList

public static boolean IsActionList(Action action)
Determines whether the specified action is a list action.

Returns:
true if the specified action is a list action; false otherwise.

getApplication

public IlvApplication getApplication()
Returns the application associated with this action.

Returns:
The application of this action.

SetAction

public static void SetAction(Component component,
                             Action action,
                             IlvApplication application)
Sets the action to a specified component, taking care of internationalization issues.

Parameters:
component - The component to set the action to.
action - The action to set to the button.
application - The application to retrieve locale and icons from.

SetAction

public static void SetAction(AbstractButton button,
                             Action action,
                             IlvApplication application,
                             int iconsSize)
Sets the action to a specified button, taking care of internationalization issues.

Parameters:
button - The button to set the action to.
action - The action to set to the button.
application - The application associated with the button.
iconsSize - The size of icons to set to the button. It can have one of these values:.

UpdateButtonProperties

public static void UpdateButtonProperties(AbstractButton button,
                                          IlvApplication application)
Updates the button properties according to the parameters of its associated action. For example, after some locale parameters have changed, this method can be invoked to update the button display parameters accordingly.

Parameters:
button - The button to update the properties from.
application - The application of the button.

SetChecked

public static void SetChecked(Action action,
                              boolean state)
Changes the check state of the specified action by setting its ACTION_CHECK_STATE property. The action must have the ACTION_CHECKABLE property set to Boolean.TRUE.

Parameters:
action - The action to change the check state of.
state - The new check state of the action.
See Also:
IsChecked(javax.swing.Action)

IsChecked

public static boolean IsChecked(Action action)
Determines whether the specified action is checked. To be checkable, the action must have the ACTION_CHECKABLE property set to Boolean.TRUE.

Parameters:
action - The action to get the check state from.
Returns:
true if the action is checked; false otherwise.
See Also:
SetChecked(Action, boolean)

ActionProcessTerminated

public static void ActionProcessTerminated(Action action)
Must be invoked after the process of the action event for the specified action has been terminated.
This method should be called only for checkable actions. If the specified action has the ACTION_CHECK_ONE_SHOT property set to Boolean.TRUE, it will be unchecked.

Parameters:
action - The action with the process that has terminated.
See Also:
ACTION_CHECK_ONE_SHOT, GetGroup(javax.swing.Action)

GetGroup

public static String GetGroup(Action action)
Returns the check group that the specified action belongs to.

Returns:
The check group of the action or null if the action does not belong to any check group.

GetSelectedGroupAction

public static Action GetSelectedGroupAction(IlvApplication application,
                                            String group)
Returns the action currently selected in the specified group of actions.

Parameters:
application - The application.
group - The name of the group to return the selected action from.
Returns:
The selected action or null if no action is currently selected.

LockAction

public static void LockAction(Action action)
Locks the specified action. This method should only be invoked for checkable actions with the ACTION_CHECK_ONE_SHOT property set. It forces the action to remain checked after an event for this action has been processed. The action is unlocked using the method UnlockAction(javax.swing.Action). If the action belongs to an action group, it can also be unlocked when another action of this group has been selected.

Parameters:
action - The action to lock.
See Also:
UnlockAction(javax.swing.Action), IsActionLocked(javax.swing.Action)

UnlockAction

public static void UnlockAction(Action action)
Unlocks the specified action, previously locked with the method LockAction(javax.swing.Action).

See Also:
LockAction(javax.swing.Action), IsActionLocked(javax.swing.Action)

IsActionLocked

public static boolean IsActionLocked(Action action)
Determines whether the specified action has been locked.

Parameters:
action - The action to determine the lock state of.
Returns:
true if the action has been locked; false otherwise.
See Also:
LockAction(javax.swing.Action), UnlockAction(javax.swing.Action)

SetChecked

public static void SetChecked(Component component,
                              Action action,
                              boolean state)
Sets the specified component checked or unchecked, depending on the specified check state.

Parameters:
component - The component to set a check icon to.
action - The action associated with the component. It provides the check display attributes for checking the component.
state - The check state of the component.

RegisterActionInGroup

public static void RegisterActionInGroup(Action action,
                                         Component child)
Register the component that represents the given action in the action group, if this is in the action configuration.

Parameters:
action - Action
child - Component to be registered in the action group
Since:
JViews 8.1

UnregisterActionInGroup

public static void UnregisterActionInGroup(Component child)
Removes the given component from the action group.

Since:
JViews 8.1

GetMnemonic

public static char GetMnemonic(Action action,
                               IlvApplication application)
Returns the mnemonic character that should be set to the menu items associated with the specified action.

Parameters:
action - The action to retrieve the mnemonic from.
application - The current application.
Returns:
The mnemonic character of the action or null if not specified in the settings of the action.

AcceleratorFromString

public static KeyStroke AcceleratorFromString(String s)
Returns an accelerator from its specified string representation.

Parameters:
s - The string representation of the accelerator to return.
Returns:
The accelerator corresponding to the specified string representation or null if the string representation has an invalid format.
See Also:
AcceleratorToString(javax.swing.KeyStroke)

AcceleratorToString

public static String AcceleratorToString(KeyStroke accelerator)
Returns a string representation of the specified accelerator.

Parameters:
accelerator - The accelerator to provide a string representation from.
Returns:
The string representation of the specified accelerator.
See Also:
AcceleratorFromString(java.lang.String)


Copyright © 1996-2007 ILOG S.A. All rights reserved.   Documentation homepage.