public interface ILcyActionBar
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:
TLcyGroupDescriptor
: actions or active settables are grouped together
based or their group descriptor.
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.
Modifier and Type | Method and Description |
---|---|
void |
addActionBarListener(ILcyActionBarListener aActionBarListener)
Adds an
ILcyActionBarListener . |
Object |
getActionBarItem(int aIndex)
Returns the action or active settable at the given index.
|
int |
getActionBarItemCount()
Returns the number of
ILcdAction s and
ILcyActiveSettable s in the ILcyActionBar . |
Component |
getComponent()
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 the
ILcyActionBar . |
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 the
ILcyActionBar . |
void |
removeAction(ILcdAction aAction)
Removes the given action from the ILcyActionBar.
|
void |
removeActionBarListener(ILcyActionBarListener aActionBarListener)
Removes the given
ILcyActionBarListener . |
void |
removeActiveSettable(ILcyActiveSettable aActiveSettable)
Removes the given ILcyActiveSettable from the ILcyActionBar.
|
boolean |
retrieveDeactivatePossible(ILcyActiveSettable aActiveSettable)
Returns true if the given
ILcyActiveSettable can be deactivated. |
TLcyGroupDescriptor |
retrieveGroupDescriptor(ILcdAction aAction)
Returns the group descriptor that was used to add the given action to this
ILcyActionBar . |
TLcyGroupDescriptor |
retrieveGroupDescriptor(ILcyActiveSettable aActiveSettable)
Returns the group descriptor that was used to add the given active
settable to this
ILcyActionBar . |
String |
retrieveHelpIDString(ILcdAction aAction)
Returns the set help id string for the given action.
|
String |
retrieveHelpIDString(ILcyActiveSettable aActiveSettable)
Returns the set help id string for the given active settable.
|
TLcyGroupDescriptor[] |
retrieveMenuGroupDescriptors(ILcdAction aAction)
Returns the menus group descriptors that were used to add the given active
settable to this
ILcyActionBar . |
TLcyGroupDescriptor[] |
retrieveMenuGroupDescriptors(ILcyActiveSettable aActiveSettable)
Returns the menus group descriptors that were used to add the given active
settable to this
ILcyActionBar . |
String[] |
retrieveMenus(ILcdAction aAction)
Returns the menus that were used to add the given active
settable to this
ILcyActionBar . |
String[] |
retrieveMenus(ILcyActiveSettable aActiveSettable)
Returns the menus that were used to add the given active
settable to this
ILcyActionBar . |
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.
|
void addActionBarListener(ILcyActionBarListener aActionBarListener)
ILcyActionBarListener
. This listener is informed when
this ILcyActionBar
is modified.aActionBarListener
- The listener to add.removeActionBarListener(com.luciad.lucy.gui.ILcyActionBarListener)
void removeActionBarListener(ILcyActionBarListener aActionBarListener)
ILcyActionBarListener
. If the listener was never added
or was already removed, nothing will happen.aActionBarListener
- The listener to remove.addActionBarListener(com.luciad.lucy.gui.ILcyActionBarListener)
void insertAction(ILcdAction aAction, TLcyGroupDescriptor aGroupDescriptor)
void insertAction(ILcdAction aAction, TLcyGroupDescriptor aGroupDescriptor, String[] aMenus, TLcyGroupDescriptor[] aMenuGroupDescriptors)
ILcyActionBar
. The action (or
actually its visual representation, e.g. a button) will be grouped
together with other actions with the same TLcyGroupDescriptor
.
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.aAction
- The action to add. Must not be null.aGroupDescriptor
- The TLcyGroupDescriptor
of the action
to add. Actions are grouped together based on their
TLcyGroupDescriptor
. Use null for default behaviour. 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.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 their TLcyGroupDescriptor
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 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.void insertActiveSettable(ILcyActiveSettable aActiveSettable, TLcyGroupDescriptor aGroupDescriptor)
void insertActiveSettable(ILcyActiveSettable aActiveSettable, TLcyGroupDescriptor aGroupDescriptor, String[] aMenus, TLcyGroupDescriptor[] aMenuGroupDescriptors)
void insertActiveSettable(ILcyActiveSettable aActiveSettable, TLcyGroupDescriptor aGroupDescriptor, String[] aMenus, TLcyGroupDescriptor[] aMenuGroupDescriptors, boolean aDeactivatePossible)
ILcyActionBar
. The
active settable (or actually its visual representation, e.g. a button)
will be grouped together with other actions or active settables with the
same TLcyGroupDescriptor
. 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.aActiveSettable
- The active settable to add. Must not be null.aGroupDescriptor
- The TLcyGroupDescriptor
of the active
settable to add. Active settables are grouped together based on their
TLcyGroupDescriptor
. Use null for default behaviour. 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.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 their TLcyGroupDescriptor
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 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.aDeactivatePossible
- True if the active settable can be set unactive
through the action bar, false otherwise. A typical implementation of
ILcyActionBar
might represent an active settable that can be
deactivated as a checkbox, and an active settable that cannot be
deactivated as a radio button.void removeAction(ILcdAction aAction)
TLcyGroupDescriptor
the action belongs. Has no effect if the given action was never added to this ILcyActionBar.aAction
- The action to remove.void removeActiveSettable(ILcyActiveSettable aActiveSettable)
TLcyGroupDescriptor
the ILcyActiveSettable belongs. Has no effect if
the given ILcyActiveSettable was never added to this ILcyActionBar.aActiveSettable
- The ILcyActiveSettable to remove.String retrieveHelpIDString(ILcdAction aAction)
aAction
- The action to retrieve the help id for.setHelpIDString(com.luciad.gui.ILcdAction, java.lang.String)
void setHelpIDString(ILcdAction aAction, String aHelpIDString)
aAction
- The action whose gui representation will be associated
with the help id stringaHelpIDString
- The help id string that allows for context sensitive helpretrieveHelpIDString(com.luciad.gui.ILcdAction)
,
ALcyHelpManager
String retrieveHelpIDString(ILcyActiveSettable aActiveSettable)
aActiveSettable
- The active settable to retrieve the help id for.void setHelpIDString(ILcyActiveSettable aActiveSettable, String aHelpIDString)
aActiveSettable
- The ILcyActiveSettable whose gui representation will be associated
with the help id stringaHelpIDString
- The help id string that allows for context sensitive helpretrieveHelpIDString(com.luciad.gui.ILcdAction)
,
ALcyHelpManager
TLcyGroupDescriptor retrieveGroupDescriptor(ILcdAction aAction)
ILcyActionBar
.aAction
- The action to retrieve the group descriptor for.ILcyActionBar
.insertAction(com.luciad.gui.ILcdAction, com.luciad.lucy.gui.TLcyGroupDescriptor)
TLcyGroupDescriptor retrieveGroupDescriptor(ILcyActiveSettable aActiveSettable)
ILcyActionBar
.aActiveSettable
- The active settable to retrieve the group descriptor for.ILcyActionBar
.insertActiveSettable(com.luciad.lucy.gui.ILcyActiveSettable, com.luciad.lucy.gui.TLcyGroupDescriptor)
String[] retrieveMenus(ILcdAction aAction)
ILcyActionBar
.aAction
- The action to retrieve the menus for.ILcyActionBar
.insertAction(com.luciad.gui.ILcdAction, com.luciad.lucy.gui.TLcyGroupDescriptor)
String[] retrieveMenus(ILcyActiveSettable aActiveSettable)
ILcyActionBar
.aActiveSettable
- The active settable to retrieve the menus for.ILcyActionBar
.insertActiveSettable(com.luciad.lucy.gui.ILcyActiveSettable, com.luciad.lucy.gui.TLcyGroupDescriptor)
TLcyGroupDescriptor[] retrieveMenuGroupDescriptors(ILcdAction aAction)
ILcyActionBar
.aAction
- The action to retrieve the menu group descriptors for.ILcyActionBar
.insertAction(com.luciad.gui.ILcdAction, com.luciad.lucy.gui.TLcyGroupDescriptor)
TLcyGroupDescriptor[] retrieveMenuGroupDescriptors(ILcyActiveSettable aActiveSettable)
ILcyActionBar
.aActiveSettable
- The active settable to retrieve the menu group descriptors for.ILcyActionBar
.insertActiveSettable(com.luciad.lucy.gui.ILcyActiveSettable, com.luciad.lucy.gui.TLcyGroupDescriptor)
boolean retrieveDeactivatePossible(ILcyActiveSettable aActiveSettable)
ILcyActiveSettable
can be deactivated.aActiveSettable
- True if theILcyActiveSettable
can be deactivated.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.
int getActionBarItemCount()
ILcdAction
s and
ILcyActiveSettable
s in the ILcyActionBar
.ILcdAction
s and
ILcyActiveSettable
s in the ILcyActionBar
.getActionBarItem(int)
Object getActionBarItem(int aIndex)
aIndex
- The index of the action or active settable to return.
0 <= aIndex < getActionBarItemCount()ILcdAction
or ILcyActiveSettable
at the given index.getActionBarItemCount()