Class ALcyActionBar

java.lang.Object
com.luciad.lucy.gui.ALcyActionBar
All Implemented Interfaces:
ILcyActionBar
Direct Known Subclasses:
TLcyComboBoxActionBar, TLcyMenuBar, TLcyPopupMenu, TLcyToolBar

public abstract class ALcyActionBar extends Object implements ILcyActionBar
Abstract implementation of ILcyActionBar. Subclasses only have to take care of:
  • Creating the main container (e.g. a JMenuBar)
  • Creating the containers for the (sub)menus (e.g. JMenu).
  • Creating the actual gui widgets representing actions or active settables (e.g. JMenuItem or JRadioButtonMenuItem or JCheckBoxMenuItem)
  • Inserting / removing separators (e.g. horizontal lines, for example JSeparator)
  • Providing a suitable implementation for getChildren(Container) and getParent(Component)

To make debugging easier, you can turn on trace logging for the TLcyActionBarUtil and ALcyActionBar classes: This will show blue borders around each of the action bars, adjust the tooltips of the action bars and their items

  • Show blue borders around the action bars
  • Add a tooltip to the action bar showing debug information
  • Replace the tooltip of the items in the action bar to display the group descriptors
  • Right-clicking on an action bar item will show a pop-up menu containing info on how to insert an item in that specific action bar at that specfic location.

Trace logging for those classes can be enabled by adding the following lines to your logging properties file:


   com.luciad.lucy.gui.TLcyActionBarUtil.level = FINEST
   com.luciad.lucy.gui.ALcyActionBar.level = FINEST
 
  • Constructor Details

  • Method Details

    • getHelpManager

      public ALcyHelpManager getHelpManager()
      Returns the help manager.
      Returns:
      the help manager.
      See Also:
    • setHelpManager

      public void setHelpManager(ALcyHelpManager aHelpManager)
      Sets the help manager. The help manager is used to associate the help id's of the actions and active settables with the components representing them (e.g. the button, menu item, ...) Therefore when the user needs context sensitive help about a button in this action bar (the button was added by added an action or an active settable), the help id associated with the action or active settable can be retrieved.
      Parameters:
      aHelpManager - The help manager.
    • addActionBarListener

      public void addActionBarListener(ILcyActionBarListener aActionBarListener)
      Description copied from interface: ILcyActionBar
      Adds an ILcyActionBarListener. This listener is informed when this ILcyActionBar is modified.
      Specified by:
      addActionBarListener in interface ILcyActionBar
      Parameters:
      aActionBarListener - The listener to add.
      See Also:
    • removeActionBarListener

      public void removeActionBarListener(ILcyActionBarListener aActionBarListener)
      Description copied from interface: ILcyActionBar
      Removes the given ILcyActionBarListener. If the listener was never added or was already removed, nothing will happen.
      Specified by:
      removeActionBarListener in interface ILcyActionBar
      Parameters:
      aActionBarListener - The listener to remove.
      See Also:
    • setProperties

      public final void setProperties(ALcyProperties aProperties)

      Sets the ALcyProperties instance containing the settings for this action bar.

      Example usage

      Typically those properties are obtained from parsing the configuration file of an add-on. If for example the configuration contains the following key-value pairs:

      
         TLcyDrawingAddOn.drawingToolBar.groupPriorities=LayerGroup, PersistenceGroup
         TLcyDrawingAddOn.drawingToolBar.menu.Edit.showActionName = false
         TLcyDrawingAddOn.drawingToolBar.menu.Edit.smallIcon = edit
       

      you would call this method as follows:

      
         ALcyProperties addOnProperties = drawingAddOn.getPreferences();
         //the addOnProperties contain keys which have the wrong prefix for this method
         //we need to strip the "TLcyDrawingAddOn.drawingToolBar." part
         //for this, we use the subset method
         ALcyProperties propertiesWithoutPrefix = addOnProperties.subset( "TLcyDrawingAddOn.drawingToolBar." );
      
         //set the properties on the tool bar
         drawingToolBar.setProperties( propertiesWithoutPrefix );
       

      Supported key-value pairs

      The following list describes which key-value pairs are currently supported, and what this method will do when the key is available. Note that support for new key-value pairs can be added in future releases.

      • groupPriorities: this key has a String[] as value. It defines the ordering of the different group descriptors, and the order of the different items in the same group. For example:
        
               groupPriorities=ControlsGroup, ProjectionsGroup, ScaleGroup
             
        See the Lucy developer guide for more information on the allowed values.
        When this property is specified, it will replace the current action bar item comparator and group descriptor comparator.
      • menu.xxx.smallIcon: this key has a String as value, and defines the icon for an item container. All strings which are accepted by TLcdIconFactory.create(String) are considered valid.
        The xxx part in the key must be replaced by a dot-separated list of the (sub)menus identifying the item container.
        For example, if you want to define an icon for the sub-menu Map | Data, you would use the following key-value pair:
        
               menu.Map.Data.smallIcon = path/to/the/icon.png
             
        These keys are not used directly. It is up to the implementation of createItemContainer(String[], TLcyGroupDescriptor[]) to use those icons (all the default ALyActionBar implementations do this).
      • menu.xxx.showActionName: this key has a Boolean as value, and defines whether the textual name for an item container should be shown.
        The xxx part in the key must be replaced by a dot-separated list of the (sub)menus identifying the item container.
        For example, if you do not want the text to show for the sub-menu Map | Data, you would use the following key-value pair:
        
               menu.Map.Data.showActionName = false
             
        These keys are not used directly. It is up to the implementation of createItemContainer(String[], TLcyGroupDescriptor[]) to respect these values (all the default ALyActionBar implementations do this).
      • menu.xxx.shortDescription: this key has a String as value, and defines the short description for an item container, which is typically used as its tool tip.
        The xxx part in the key must be replaced by a dot-separated list of the (sub)menus identifying the item container.
        For example, if you want to specify a tool tip for a 'More' sub-menu on a tool bar, you would use the following key-value pair:
        
               menu.More.shortDescription = Provides additional, less frequently used operations such union and difference.
             
        These keys are not used directly. It is up to the implementation of createItemContainer(String[], TLcyGroupDescriptor[]) to respect these values (all the default ALyActionBar implementations do this). Please refer to TLcyLang for information about translating these descriptions.

      All other key-value pairs present in the aProperties instance will be ignored.

      Parameters:
      aProperties - The properties
      Since:
      2016.0
    • getProperties

      protected final ALcyProperties getProperties()

      Returns the ALcyProperties instance containing the settings for this action bar.

      Returns:
      the ALcyProperties instance containing the settings for this action bar, possibly null
      Since:
      2016.0
      See Also:
    • insertAction

      public void insertAction(ILcdAction aAction, TLcyGroupDescriptor aGroupDescriptor)
      Description copied from interface: ILcyActionBar
      Same result as insertAction( aAction, aGroupDescriptor, null, null )
      Specified by:
      insertAction in interface ILcyActionBar
      See Also:
    • insertAction

      public void insertAction(ILcdAction aAction, TLcyGroupDescriptor aGroupDescriptor, String[] aMenus, TLcyGroupDescriptor[] aMenuGroupDescriptors)
      Description copied from interface: ILcyActionBar
      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.
      Specified by:
      insertAction in interface ILcyActionBar
      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.
    • removeAction

      public void removeAction(ILcdAction aAction)
      Description copied from interface: ILcyActionBar
      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.
      Specified by:
      removeAction in interface ILcyActionBar
      Parameters:
      aAction - The action to remove.
    • insertActiveSettable

      public void insertActiveSettable(ILcyActiveSettable aAction, TLcyGroupDescriptor aGroupDescriptor)
      Description copied from interface: ILcyActionBar
      Same result as insertActiveSettable( aActiveSettable, aGroupDescriptor, null, null )
      Specified by:
      insertActiveSettable in interface ILcyActionBar
      See Also:
    • insertActiveSettable

      public void insertActiveSettable(ILcyActiveSettable aAction, TLcyGroupDescriptor aGroupDescriptor, String[] aMenus, TLcyGroupDescriptor[] aMenuGroupDescriptors)
      Description copied from interface: ILcyActionBar
      Same result as insertActiveSettable( aActiveSettable, aGroupDescriptor, aMenus, aMenuGroupDescriptors, true )
      Specified by:
      insertActiveSettable in interface ILcyActionBar
      See Also:
    • insertActiveSettable

      public void insertActiveSettable(ILcyActiveSettable aAction, TLcyGroupDescriptor aGroupDescriptor, String[] aMenus, TLcyGroupDescriptor[] aMenuGroupDescriptors, boolean aDeactivatePossible)
      Description copied from interface: ILcyActionBar
      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.
      Specified by:
      insertActiveSettable in interface ILcyActionBar
      Parameters:
      aAction - 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.
    • removeActiveSettable

      public void removeActiveSettable(ILcyActiveSettable aActiveSettable)
      Description copied from interface: ILcyActionBar
      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.
      Specified by:
      removeActiveSettable in interface ILcyActionBar
      Parameters:
      aActiveSettable - The ILcyActiveSettable to remove.
    • setHelpIDString

      public void setHelpIDString(ILcyActiveSettable aActiveSettable, String aHelpIDString)
      Description copied from interface: ILcyActionBar
      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.
      Specified by:
      setHelpIDString in interface ILcyActionBar
      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:
    • setHelpIDString

      public void setHelpIDString(ILcdAction aAction, String aHelpIDString)
      Description copied from interface: ILcyActionBar
      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.
      Specified by:
      setHelpIDString in interface ILcyActionBar
      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:
    • insertComponent

      public void insertComponent(Component aComponent, TLcyGroupDescriptor aGroupDescriptor)
      Adds a Component to this ILcyActionBar
      Parameters:
      aComponent - The component to add. It will be added at the top level.
      aGroupDescriptor - The group descriptor of the component to add.
      See Also:
    • removeComponent

      public void removeComponent(Component aComponent)
      Remove the given Component from this ILcyActionBar
      Parameters:
      aComponent - The component to remove.
      See Also:
    • getActionBarItemCount

      public int getActionBarItemCount()
      Description copied from interface: ILcyActionBar
      Returns the number of ILcdActions and ILcyActiveSettables in the ILcyActionBar.
      Specified by:
      getActionBarItemCount in interface ILcyActionBar
      Returns:
      the number of ILcdActions and ILcyActiveSettables in the ILcyActionBar.
      See Also:
    • getActionBarItem

      public Object getActionBarItem(int aIndex)
      Description copied from interface: ILcyActionBar
      Returns the action or active settable at the given index.
      Specified by:
      getActionBarItem in interface ILcyActionBar
      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:
    • retrieveHelpIDString

      public String retrieveHelpIDString(ILcdAction aAction)
      Description copied from interface: ILcyActionBar
      Returns the set help id string for the given action.
      Specified by:
      retrieveHelpIDString in interface ILcyActionBar
      Parameters:
      aAction - The action to retrieve the help id for.
      Returns:
      the set help id string for the given action.
      See Also:
    • retrieveHelpIDString

      public String retrieveHelpIDString(ILcyActiveSettable aActiveSettable)
      Description copied from interface: ILcyActionBar
      Returns the set help id string for the given active settable.
      Specified by:
      retrieveHelpIDString in interface ILcyActionBar
      Parameters:
      aActiveSettable - The active settable to retrieve the help id for.
      Returns:
      the set help id string for the given active settable.
    • retrieveGroupDescriptor

      public TLcyGroupDescriptor retrieveGroupDescriptor(ILcdAction aAction)
      Description copied from interface: ILcyActionBar
      Returns the group descriptor that was used to add the given action to this ILcyActionBar.
      Specified by:
      retrieveGroupDescriptor in interface 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

      public TLcyGroupDescriptor retrieveGroupDescriptor(ILcyActiveSettable aActiveSettable)
      Description copied from interface: ILcyActionBar
      Returns the group descriptor that was used to add the given active settable to this ILcyActionBar.
      Specified by:
      retrieveGroupDescriptor in interface 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

      public String[] retrieveMenus(ILcdAction aAction)
      Description copied from interface: ILcyActionBar
      Returns the menus that were used to add the given active settable to this ILcyActionBar.
      Specified by:
      retrieveMenus in interface 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

      public String[] retrieveMenus(ILcyActiveSettable aActiveSettable)
      Description copied from interface: ILcyActionBar
      Returns the menus that were used to add the given active settable to this ILcyActionBar.
      Specified by:
      retrieveMenus in interface 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

      public TLcyGroupDescriptor[] retrieveMenuGroupDescriptors(ILcdAction aAction)
      Description copied from interface: ILcyActionBar
      Returns the menus group descriptors that were used to add the given active settable to this ILcyActionBar.
      Specified by:
      retrieveMenuGroupDescriptors in interface 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

      public TLcyGroupDescriptor[] retrieveMenuGroupDescriptors(ILcyActiveSettable aActiveSettable)
      Description copied from interface: ILcyActionBar
      Returns the menus group descriptors that were used to add the given active settable to this ILcyActionBar.
      Specified by:
      retrieveMenuGroupDescriptors in interface 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

      public boolean retrieveDeactivatePossible(ILcyActiveSettable aActiveSettable)
      Description copied from interface: ILcyActionBar
      Returns true if the given ILcyActiveSettable can be deactivated.
      Specified by:
      retrieveDeactivatePossible in interface ILcyActionBar
      Parameters:
      aActiveSettable - True if the
      Returns:
      true if the given ILcyActiveSettable can be deactivated.
    • getChildren

      protected Component[] getChildren(Container aParent)
      Returns all children of a given parent, including separators etc.

      This implementation returns aParent.getComponents(), but subclasses using for instance JMenus should be aware that they should return ( ( JMenu ) aParent ).getMenuComponents() when the given parent is a JMenu.

      Parameters:
      aParent - The parent to retrieve the children from.
      Returns:
      An array containing all children of the given parent.
    • getParent

      protected Container getParent(Component aComponent)
      Returns the parent of a given component.

      This implementation returns aComponent.getParent(), but subclasses using for instance JPopupMenus (these are used for example by JMenus) must return ( ( JPopupMenu ) aComponent ).getInvoker() when the given component is a JPopupMenu.

      Parameters:
      aComponent - The component to retrieve the parent for.
      Returns:
      The parent of the given component, or null.
    • getGroupDescriptorComparator

      @Deprecated public Comparator getGroupDescriptorComparator()
      Deprecated.
      Use getProperties() instead. As documented in the setGroupDescriptorComparator(Comparator) method, the comparator is derived from the properties. Extensions of this class which want to obtain the comparator should derive it from the properties.
      Return the current group descriptor comparator. Default is null.
      Returns:
      the current group descriptor comparator.
      See Also:
    • setGroupDescriptorComparator

      @Deprecated public void setGroupDescriptorComparator(Comparator aGroupDescriptorComparator)
      Deprecated.
      Use setProperties(ALcyProperties) instead, which will derive the group descriptor comparator from the properties
      When a new group needs to be inserted in an action bar, the new group is compared to all existing groups to find out where it should be added.

      The action bar loops over all existing groups and asks the comparator if the new group belongs before or after the current group. The default comparator is null. This means new groups are always added at the end.

      Parameters:
      aGroupDescriptorComparator - The new group comparator. It will be passed two instances of TLcyGroupDescriptor to compare.
      See Also:
    • getActionBarItemComparator

      @Deprecated public Comparator getActionBarItemComparator()
      Deprecated.
      Use getProperties() instead. As documented in the setActionBarItemComparator(Comparator) method, the comparator is derived from the properties. Extensions of this class which want to obtain the comparator should derive it from the properties.
      Returns the Comparator for action bar items.
      Returns:
      the Comparator for action bar items.
      See Also:
    • setActionBarItemComparator

      @Deprecated public void setActionBarItemComparator(Comparator aActionBarItemComparator)
      Deprecated.
      Use setProperties(ALcyProperties) instead, which will derive the action bar item comparator from the properties
      Sets the new Comparator to order the items within a single TLcyGroupDescriptor. Those items can be actions or active settables, but also components inserted using insertComponent or sub-menus. This comparator must be set before adding items.
      Parameters:
      aActionBarItemComparator - The new TLcyActionBarItemComparator to use.
      See Also:
    • insertChildInParent

      protected void insertChildInParent(Component aChild, TLcyGroupDescriptor aGroupDescriptor, int aIndex, Container aParentSFCT)
      Adds the given child to the given parent, but it respects the TLcyGroupDescriptor and the index. All items having the same TLcyGroupDescriptor are grouped together. The given index is relative in the group that belongs to the TLcyGroupDescriptor. Also takes care of adding the separators.
      Parameters:
      aChild - The child to add.
      aGroupDescriptor - The group descriptor of the child to add.
      aIndex - The index in the group that belongs to the given TLcyGroupDescriptor. -1 Means insert at the end.
      aParentSFCT - The parent to add the child to, this parent is changed as a side effect.
    • removeChildFromParent

      protected void removeChildFromParent(Component aChild, Container aParentSFCT)
      Removes the given child from the given parent. Also removes the parent from its parent (recursively) if it is empty. Also takes care of removing possible separators.
      Parameters:
      aChild - The child to remove.
      aParentSFCT - The parent to remove the child from, this parent is changed as a side effect.
    • insertSeparator

      protected abstract void insertSeparator(int aIndex, Container aContainerSFCT)
      Inserts a separator at the given index into the given component.

      Implementation can be left empty, but if and only if implementation of removeSeparator(int, java.awt.Container) is left empty as well.

      Parameters:
      aIndex - The index of where to insert the separator. -1 means insert it at the end.
      aContainerSFCT - The container to insert the separator into.
    • removeSeparator

      protected abstract void removeSeparator(int aIndex, Container aContainerSFCT)
      Removes the separator at the given index from the given component.

      Implementation can be left empty, but if and only if implementation of insertSeparator(int, java.awt.Container) is left empty as well.

      Parameters:
      aIndex - The index where to remove the separator from the given component.
      aContainerSFCT - The container to remove the separator from.
    • createItem

      protected abstract Component createItem(ILcdAction aAction, TLcyGroupDescriptor aGroupDescriptor, String[] aMenus, TLcyGroupDescriptor[] aMenuGroupDescriptors)
      Creates a gui widget to represent the given action. E.g. a menu bar could create a JMenuItem to represent the given action. A toolbar could create a JButton to represent the given action.
      Parameters:
      aAction - The action to create a gui widget for.
      aGroupDescriptor - The group descriptor, for information only.
      aMenus - The menus, for information only.
      aMenuGroupDescriptors - The menu group descriptors, for information only.
      Returns:
      The created gui widget.
    • createItem

      protected abstract Component createItem(ILcyActiveSettable aActiveSettable, TLcyGroupDescriptor aGroupDescriptor, String[] aMenus, TLcyGroupDescriptor[] aMenuGroupDescriptors, boolean aDeactivatePossible)
      Creates a gui widget to represent the given active settable. E.g. a menu bar could create a JCheckBoxMenuItem to represent the given action or a JRadioButtonMenuItem when aDeactivatePossible is false. A toolbar could create a JToggleButton to represent the given active settable.
      Parameters:
      aActiveSettable - The active settable to create a gui widget for.
      aGroupDescriptor - The group descriptor, for information only.
      aMenus - The menus, for information only.
      aMenuGroupDescriptors - The menu group descriptors, for information only.
      aDeactivatePossible - True means the active settable can be deactivated using the created gui widget (e.g. a checkbox), false means it cannot be deactivated by the created gui widget, probably only by another widget (e.g. radio button).
      Returns:
      The created gui widget.
    • getItemContainer

      protected abstract Container getItemContainer(String[] aMenus, TLcyGroupDescriptor[] aMenuGroupDescriptors)
      Retrieves the (sub)menu container that contains the actions or active settables at the given (sub)menus. If no such container exists, null is returned. If the aMenus is null or an empty array, it shall not return null but it must return the top level container.

      Parameters:
      aMenus - The (sub)menus to retrieve the container for. If null or an empty array, the top level container should be returned.
      aMenuGroupDescriptors - The menu group descriptors, just for information. Could be null, or the length of the array can possibly mismatch the length of the menus.
      Returns:
      the container that contains the actions or active settables at the given (sub)menus.
    • createItemContainer

      protected abstract Container createItemContainer(String[] aMenus, TLcyGroupDescriptor[] aMenuGroupDescriptors)
      Creates a new container for the given (sub)menus. The actions and active settables that need to be added to the given (sub)menus will be added to the created container. The created menu must not be inserted into its parent.

      An example implemention could look like this:

      return new JMenu( aMenus[ aMenus.length - 1 ] )
      Parameters:
      aMenus - The (sub)menus to create the menu item container for. Is never null and length of array is at least 1.
      aMenuGroupDescriptors - The menu group descriptors for the menus. Could be null, or the length of the array can possibly mismatch the length of the menus.
      Returns:
      a new container for the given (sub)menus.
    • isAutoHide

      public boolean isAutoHide()

      Returns the autoHide property of the action bar.

      When the autoHide property is true, the component of the action bar will become invisible when it is empty.

      Returns:
      the autoHide property of the action bar.
      See Also:
    • setAutoHide

      public void setAutoHide(boolean aAutoHide)

      Set the autoHide property of the action bar.

      When set to true, the component of the action bar will become invisible when the action bar is empty.

      The default implementation of this method considers an action bar empty when the component representing the action bar is a Container without any visible child components.

      Parameters:
      aAutoHide - true when the an empty action bar must be invisible, false otherwise.
      See Also: