Interface ILcyActionBar

All Known Subinterfaces:
ILcyMenuBar, ILcyPopupMenu, ILcyToolBar
All Known Implementing Classes:
ALcyActionBar, TLcyComboBoxActionBar, TLcyMenuBar, TLcyPopupMenu, TLcySkinnedToolBar, TLcyToolBar

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 ILcdActions and to add and remove ILcyActiveSettables. 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 Details

    • addActionBarListener

      void addActionBarListener(ILcyActionBarListener aActionBarListener)
      Adds an ILcyActionBarListener. This listener is informed when this ILcyActionBar is modified.
      Parameters:
      aActionBarListener - The listener to add.
      See Also:
    • removeActionBarListener

      void removeActionBarListener(ILcyActionBarListener aActionBarListener)
      Removes the given ILcyActionBarListener. If the listener was never added or was already removed, nothing will happen.
      Parameters:
      aActionBarListener - The listener to remove.
      See Also:
    • insertAction

      void insertAction(ILcdAction aAction, TLcyGroupDescriptor aGroupDescriptor)
      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 the 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.
      Parameters:
      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 TLcyGroupDescriptors. 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.
    • insertActiveSettable

      void insertActiveSettable(ILcyActiveSettable aActiveSettable, TLcyGroupDescriptor aGroupDescriptor)
      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 the 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.
      Parameters:
      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 TLcyGroupDescriptors. 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.
    • removeAction

      void removeAction(ILcdAction aAction)
      Removes the given action from the ILcyActionBar. No matter to which TLcyGroupDescriptor the action belongs. Has no effect if the given action was never added to this ILcyActionBar.
      Parameters:
      aAction - The action to remove.
    • removeActiveSettable

      void removeActiveSettable(ILcyActiveSettable aActiveSettable)
      Removes the given ILcyActiveSettable from the ILcyActionBar. No matter to which TLcyGroupDescriptor the ILcyActiveSettable belongs. Has no effect if the given ILcyActiveSettable was never added to this ILcyActionBar.
      Parameters:
      aActiveSettable - The ILcyActiveSettable to remove.
    • retrieveHelpIDString

      String retrieveHelpIDString(ILcdAction aAction)
      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

      void setHelpIDString(ILcdAction aAction, String aHelpIDString)
      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 string
      aHelpIDString - The help id string that allows for context sensitive help
      See Also:
    • retrieveHelpIDString

      String retrieveHelpIDString(ILcyActiveSettable aActiveSettable)
      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

      void setHelpIDString(ILcyActiveSettable aActiveSettable, String aHelpIDString)
      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 string
      aHelpIDString - The help id string that allows for context sensitive help
      See Also:
    • retrieveGroupDescriptor

      TLcyGroupDescriptor retrieveGroupDescriptor(ILcdAction aAction)
      Returns the group descriptor that was used to add the given action to this ILcyActionBar.
      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

      TLcyGroupDescriptor retrieveGroupDescriptor(ILcyActiveSettable aActiveSettable)
      Returns the group descriptor that was used to add the given active settable to this ILcyActionBar.
      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

      String[] retrieveMenus(ILcdAction aAction)
      Returns the menus that were used to add the given active settable to this ILcyActionBar.
      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

      String[] retrieveMenus(ILcyActiveSettable aActiveSettable)
      Returns the menus that were used to add the given active settable to this ILcyActionBar.
      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

      TLcyGroupDescriptor[] retrieveMenuGroupDescriptors(ILcdAction aAction)
      Returns the menus group descriptors that were used to add the given active settable to this ILcyActionBar.
      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

      TLcyGroupDescriptor[] retrieveMenuGroupDescriptors(ILcyActiveSettable aActiveSettable)
      Returns the menus group descriptors that were used to add the given active settable to this ILcyActionBar.
      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

      boolean retrieveDeactivatePossible(ILcyActiveSettable aActiveSettable)
      Returns true if the given ILcyActiveSettable 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 of ILcdActions and ILcyActiveSettables in the ILcyActionBar.
      Returns:
      the number of ILcdActions and ILcyActiveSettables in the ILcyActionBar.
      See Also:
    • getActionBarItem

      Object getActionBarItem(int aIndex)
      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 or ILcyActiveSettable at the given index.
      See Also: