Interface ILcyActionBar
- All Known Subinterfaces:
ILcyMenuBar
,ILcyPopupMenu
,ILcyToolBar
- All Known Implementing Classes:
ALcyActionBar
,TLcyComboBoxActionBar
,TLcyMenuBar
,TLcyPopupMenu
,TLcySkinnedToolBar
,TLcyToolBar
Represents a container for actions and active settables that have a gui representation. Typical implementations are a menu bar, a tool bar, a popup menu, ...
Allows to add and remove ILcdAction
s and to add and remove
ILcyActiveSettable
s. Furthermore it allows to set a help id to
the gui widget representing an action or active settable if there is one.
To add an action or active settable, one can specify the following:
- The
TLcyGroupDescriptor
: actions or active settables are grouped together based or their group descriptor. - The menus: the menus to put the action or active settable in, if not specified a default will be used.
- The menu group descriptors: the group descriptors, one for every (sub)menu. (Sub)menus are grouped the same way as actions.
Grouping actions, active settables and submenus together means that they are
kept together. E.g. no other actions, active settables or submenus that have
a different group will be added inbetween. Typical implementations of
ILcyActionBar
will visually separate the groups. E.g. a menu
bar will add horizontal lines inbetween the groups, a toolbar will add
vertical lines, or leave some open space.
ILcyCustomizableRepresentationAction
and
ILcyCustomizableRepresentationActiveSettable
can be used to tune or replace
the UI that is used to represent an action.
Please refer to the developer's guide for a more detailed description of how to work with action bars.
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addActionBarListener
(ILcyActionBarListener aActionBarListener) Adds anILcyActionBarListener
.getActionBarItem
(int aIndex) Returns the action or active settable at the given index.int
Returns the number ofILcdAction
s andILcyActiveSettable
s in theILcyActionBar
.Returns the visual component representing this action bar, so that it can be added to the application UI.void
insertAction
(ILcdAction aAction, TLcyGroupDescriptor aGroupDescriptor) Same result as insertAction( aAction, aGroupDescriptor, null, null )void
insertAction
(ILcdAction aAction, TLcyGroupDescriptor aGroupDescriptor, String[] aMenus, TLcyGroupDescriptor[] aMenuGroupDescriptors) Adds the given action in theILcyActionBar
.void
insertActiveSettable
(ILcyActiveSettable aActiveSettable, TLcyGroupDescriptor aGroupDescriptor) Same result as insertActiveSettable( aActiveSettable, aGroupDescriptor, null, null )void
insertActiveSettable
(ILcyActiveSettable aActiveSettable, TLcyGroupDescriptor aGroupDescriptor, String[] aMenus, TLcyGroupDescriptor[] aMenuGroupDescriptors) Same result as insertActiveSettable( aActiveSettable, aGroupDescriptor, aMenus, aMenuGroupDescriptors, true )void
insertActiveSettable
(ILcyActiveSettable aActiveSettable, TLcyGroupDescriptor aGroupDescriptor, String[] aMenus, TLcyGroupDescriptor[] aMenuGroupDescriptors, boolean aDeactivatePossible) Adds the given active settable in theILcyActionBar
.void
removeAction
(ILcdAction aAction) Removes the given action from the ILcyActionBar.void
removeActionBarListener
(ILcyActionBarListener aActionBarListener) Removes the givenILcyActionBarListener
.void
removeActiveSettable
(ILcyActiveSettable aActiveSettable) Removes the given ILcyActiveSettable from the ILcyActionBar.boolean
retrieveDeactivatePossible
(ILcyActiveSettable aActiveSettable) Returns true if the givenILcyActiveSettable
can be deactivated.retrieveGroupDescriptor
(ILcdAction aAction) Returns the group descriptor that was used to add the given action to thisILcyActionBar
.retrieveGroupDescriptor
(ILcyActiveSettable aActiveSettable) Returns the group descriptor that was used to add the given active settable to thisILcyActionBar
.retrieveHelpIDString
(ILcdAction aAction) Returns the set help id string for the given action.retrieveHelpIDString
(ILcyActiveSettable aActiveSettable) Returns the set help id string for the given active settable.retrieveMenuGroupDescriptors
(ILcdAction aAction) Returns the menus group descriptors that were used to add the given active settable to thisILcyActionBar
.retrieveMenuGroupDescriptors
(ILcyActiveSettable aActiveSettable) Returns the menus group descriptors that were used to add the given active settable to thisILcyActionBar
.String[]
retrieveMenus
(ILcdAction aAction) Returns the menus that were used to add the given active settable to thisILcyActionBar
.String[]
retrieveMenus
(ILcyActiveSettable aActiveSettable) Returns the menus that were used to add the given active settable to thisILcyActionBar
.void
setHelpIDString
(ILcdAction aAction, String aHelpIDString) Associates the given help id string to the gui representation corresponding to the given action.void
setHelpIDString
(ILcyActiveSettable aActiveSettable, String aHelpIDString) Associates the given help id string to the gui representation corresponding to the given ILcyActiveSettable.
-
Method Details
-
addActionBarListener
Adds anILcyActionBarListener
. This listener is informed when thisILcyActionBar
is modified.- Parameters:
aActionBarListener
- The listener to add.- See Also:
-
removeActionBarListener
Removes the givenILcyActionBarListener
. If the listener was never added or was already removed, nothing will happen.- Parameters:
aActionBarListener
- The listener to remove.- See Also:
-
insertAction
Same result as insertAction( aAction, aGroupDescriptor, null, null )- See Also:
-
insertAction
void insertAction(ILcdAction aAction, TLcyGroupDescriptor aGroupDescriptor, String[] aMenus, TLcyGroupDescriptor[] aMenuGroupDescriptors) Adds the given action in theILcyActionBar
. The action (or actually its visual representation, e.g. a button) will be grouped together with other actions with the sameTLcyGroupDescriptor
. The action will be inserted considering the given menus (and submenus). If these menus don't exist yet, they will be created. When they are created, they are grouped together with other actions or menus with the same group descriptor as the given group descriptors.- Parameters:
aAction
- The action to add. Must not be null.aGroupDescriptor
- TheTLcyGroupDescriptor
of the action to add. Actions are grouped together based on theirTLcyGroupDescriptor
. Use null for default behaviour. Typical implementations ofILcyActionBar
will visually separate the groups. E.g. a menu bar will add horizontal lines inbetween the groups, a toolbar will add vertical lines, or leave some open space.aMenus
- The menus to put the action in. If the menus do not exist, they will be created. Use null when you don't want submenus.aMenuGroupDescriptors
- A group descriptor for every menu. When menus or submenus are created, they are grouped together with existing actions and submenus based on theirTLcyGroupDescriptor
s. You can use null for default behaviour, but if you want the items to be correctly grouped and ordened, you might have to set this parameter to a correct value. Please refer to 'lucy.cfg' for some examples. Typical implementations ofILcyActionBar
will visually separate the groups. E.g. a menu bar will add horizontal lines inbetween the groups, a toolbar will add vertical lines, or leave some open space.
-
insertActiveSettable
Same result as insertActiveSettable( aActiveSettable, aGroupDescriptor, null, null )- See Also:
-
insertActiveSettable
void insertActiveSettable(ILcyActiveSettable aActiveSettable, TLcyGroupDescriptor aGroupDescriptor, String[] aMenus, TLcyGroupDescriptor[] aMenuGroupDescriptors) Same result as insertActiveSettable( aActiveSettable, aGroupDescriptor, aMenus, aMenuGroupDescriptors, true )- See Also:
-
insertActiveSettable
void insertActiveSettable(ILcyActiveSettable aActiveSettable, TLcyGroupDescriptor aGroupDescriptor, String[] aMenus, TLcyGroupDescriptor[] aMenuGroupDescriptors, boolean aDeactivatePossible) Adds the given active settable in theILcyActionBar
. The active settable (or actually its visual representation, e.g. a button) will be grouped together with other actions or active settables with the sameTLcyGroupDescriptor
. The active settable will be inserted considering the given menus (and submenus). If these menus don't exist yet, they will be created. When they are created, they are grouped together with other actions or menus with the same group descriptor as the given group descriptors.- Parameters:
aActiveSettable
- The active settable to add. Must not be null.aGroupDescriptor
- TheTLcyGroupDescriptor
of the active settable to add. Active settables are grouped together based on theirTLcyGroupDescriptor
. Use null for default behaviour. Typical implementations ofILcyActionBar
will visually separate the groups. E.g. a menu bar will add horizontal lines inbetween the groups, a toolbar will add vertical lines, or leave some open space.aMenus
- The menus to put the action in. If the menus do not exist, they will be created. Use null when you don't want submenus.aMenuGroupDescriptors
- A group descriptor for every menu. When menus or submenus are created, they are grouped together with existing actions and submenus based on theirTLcyGroupDescriptor
s. You can use null for default behaviour, but if you want the items to be correctly grouped and ordened, you might have to set this parameter to a correct value. Please refer to 'lucy.cfg' for some examples. Typical implementations ofILcyActionBar
will visually separate the groups. E.g. a menu bar will add horizontal lines inbetween the groups, a toolbar will add vertical lines, or leave some open space.aDeactivatePossible
- True if the active settable can be set unactive through the action bar, false otherwise. A typical implementation ofILcyActionBar
might represent an active settable that can be deactivated as a checkbox, and an active settable that cannot be deactivated as a radio button.
-
removeAction
Removes the given action from the ILcyActionBar. No matter to whichTLcyGroupDescriptor
the action belongs. Has no effect if the given action was never added to this ILcyActionBar.- Parameters:
aAction
- The action to remove.
-
removeActiveSettable
Removes the given ILcyActiveSettable from the ILcyActionBar. No matter to whichTLcyGroupDescriptor
the ILcyActiveSettable belongs. Has no effect if the given ILcyActiveSettable was never added to this ILcyActionBar.- Parameters:
aActiveSettable
- The ILcyActiveSettable to remove.
-
retrieveHelpIDString
Returns the set help id string for the given action.- Parameters:
aAction
- The action to retrieve the help id for.- Returns:
- the set help id string for the given action.
- See Also:
-
setHelpIDString
Associates the given help id string to the gui representation corresponding to the given action. Note that this method should only be used for actions that have no help id associated to them. One can associate a help id to an action by setting the value com.luciad.lucy.gui.help.ALcyHelpManager.HELP_ID_KEY.- Parameters:
aAction
- The action whose gui representation will be associated with the help id stringaHelpIDString
- The help id string that allows for context sensitive help- See Also:
-
retrieveHelpIDString
Returns the set help id string for the given active settable.- Parameters:
aActiveSettable
- The active settable to retrieve the help id for.- Returns:
- the set help id string for the given active settable.
-
setHelpIDString
Associates the given help id string to the gui representation corresponding to the given ILcyActiveSettable. Note that this method should only be used for ILcyActiveSettables that have no help id associated to them. One can associate a help id to an ILcyActiveSettable by setting the value com.luciad.lucy.gui.help.ALcyHelpManager.HELP_ID_KEY.- Parameters:
aActiveSettable
- The ILcyActiveSettable whose gui representation will be associated with the help id stringaHelpIDString
- The help id string that allows for context sensitive help- See Also:
-
retrieveGroupDescriptor
Returns the group descriptor that was used to add the given action to thisILcyActionBar
.- Parameters:
aAction
- The action to retrieve the group descriptor for.- Returns:
- the group descriptor that was used to add the given action to this
ILcyActionBar
. - See Also:
-
retrieveGroupDescriptor
Returns the group descriptor that was used to add the given active settable to thisILcyActionBar
.- Parameters:
aActiveSettable
- The active settable to retrieve the group descriptor for.- Returns:
- the group descriptor that was used to add the given active settable to this
ILcyActionBar
. - See Also:
-
retrieveMenus
Returns the menus that were used to add the given active settable to thisILcyActionBar
.- Parameters:
aAction
- The action to retrieve the menus for.- Returns:
- the menus that were used to add the given action to this
ILcyActionBar
. - See Also:
-
retrieveMenus
Returns the menus that were used to add the given active settable to thisILcyActionBar
.- Parameters:
aActiveSettable
- The active settable to retrieve the menus for.- Returns:
- the menus that were used to add the given active settable to this
ILcyActionBar
. - See Also:
-
retrieveMenuGroupDescriptors
Returns the menus group descriptors that were used to add the given active settable to thisILcyActionBar
.- Parameters:
aAction
- The action to retrieve the menu group descriptors for.- Returns:
- the menus group descriptors that were used to add the given active
settable to this
ILcyActionBar
. - See Also:
-
retrieveMenuGroupDescriptors
Returns the menus group descriptors that were used to add the given active settable to thisILcyActionBar
.- Parameters:
aActiveSettable
- The active settable to retrieve the menu group descriptors for.- Returns:
- the menus group descriptors that were used to add the given active
settable to this
ILcyActionBar
. - See Also:
-
retrieveDeactivatePossible
Returns true if the givenILcyActiveSettable
can be deactivated.- Parameters:
aActiveSettable
- True if the- Returns:
- true if the given
ILcyActiveSettable
can be deactivated.
-
getComponent
Component getComponent()Returns the visual component representing this action bar, so that it can be added to the application UI.
Components should not be added to it or removed from it directly using Swing. Use the various insert methods instead.
- Returns:
- the visual component representing this action bar.
-
getActionBarItemCount
int getActionBarItemCount()Returns the number ofILcdAction
s andILcyActiveSettable
s in theILcyActionBar
.- Returns:
- the number of
ILcdAction
s andILcyActiveSettable
s in theILcyActionBar
. - See Also:
-
getActionBarItem
Returns the action or active settable at the given index.- Parameters:
aIndex
- The index of the action or active settable to return. 0 <= aIndex < getActionBarItemCount()- Returns:
- The
ILcdAction
orILcyActiveSettable
at the given index. - See Also:
-