Class ActionBuilder

  • All Implemented Interfaces:
    SimpleBeanStoreImpl.BeanContributor

    public class ActionBuilder
    extends Object
    implements SimpleBeanStoreImpl.BeanContributor

    A central data class used during the action builder process.

    This class holds all information needed during the processing of Jelly scripts with actions and related tags. An instance is stored in the Jelly context and can be accessed by all interested components. The role of this class is almost analogous to the ComponentBuilderData class in the form builder package.

    By implementing the BeanContributor interface this class makes some of its managed objects available to the dependency injection framework. These are the following:

    Version:
    $Id: ActionBuilder.java 205 2012-01-29 18:29:57Z oheger $
    Author:
    Oliver Heger
    • Field Detail

      • KEY_ACTION_STORE

        public static final String KEY_ACTION_STORE
        Constant for the key for accessing the action store from the builder's bean context.
        See Also:
        Constant Field Values
      • KEY_ACTION_BUILDER

        public static final String KEY_ACTION_BUILDER
        Constant for the key for accessing the instance of this class from the builder's bean context.
        See Also:
        Constant Field Values
      • KEY_ACTION_PREFIX

        public static final String KEY_ACTION_PREFIX
        Constant for the prefix used for accessing actions.
        See Also:
        Constant Field Values
    • Constructor Detail

      • ActionBuilder

        public ActionBuilder()
    • Method Detail

      • getActionStore

        public ActionStore getActionStore()
        Returns a reference to the current action store.
        Returns:
        the action store
      • setActionStore

        public void setActionStore​(ActionStore actionStore)
        Sets the action store. Newly created actions will be stored in this objects. If actions are requested, they will be looked up here, too.
        Parameters:
        actionStore - the action store
      • getActionManager

        public ActionManager getActionManager()
        Returns a reference to the action manager.
        Returns:
        the action manager
      • setActionManager

        public void setActionManager​(ActionManager actionManager)
        Sets the action manager. This is a GUI library specific component that knows how to create all affected objects.
        Parameters:
        actionManager - the action manager to use
      • isMenuIcon

        public boolean isMenuIcon()
        Returns the value of the menu icon flag.
        Returns:
        the menu icon flag
      • setMenuIcon

        public void setMenuIcon​(boolean menuIcon)
        Sets the value of the menu icon flag. If this flag is set, menu items will have an icon if one is defined. If set to false, these icons will be suppressed.
        Parameters:
        menuIcon - the value of the flag
      • isToolbarText

        public boolean isToolbarText()
        Returns the value of the toolbar text flag.
        Returns:
        the toolbar text flag
      • setToolbarText

        public void setToolbarText​(boolean toolbarText)
        Sets the value of the toolbar text flag. If this flag is set, toolbar buttons will display a text if one is defined. Otherwise the text is suppressed.
        Parameters:
        toolbarText - the value of the flag
      • getContext

        public org.apache.commons.jelly.JellyContext getContext()
        Returns the current JellyContext this object lives in. This property is initialized when this instance is stored in a context.
        Returns:
        the current JellyContext
        Since:
        1.3
      • beanNames

        public void beanNames​(Set<String> names)
        Obtains the names of the beans supported by this bean contributor. This implementation returns the names of the actions stored in the internal action store and some other helper objects.
        Specified by:
        beanNames in interface SimpleBeanStoreImpl.BeanContributor
        Parameters:
        names - the set to which to add the names
      • initBeanStore

        public void initBeanStore​(SimpleBeanStoreImpl store)
        Initializes the specified bean store object. This method is called by the builder when the BeanContext used during the builder operation is constructed. This implementation will add the static beans to the given store and register this object as BeanContributor.
        Parameters:
        store - the store to be initialized
      • put

        public void put​(org.apache.commons.jelly.JellyContext context)
        Stores this object in the given Jelly context.
        Parameters:
        context - the context (must not be null)
        Throws:
        IllegalArgumentException - if the context is null
      • get

        public static ActionBuilder get​(org.apache.commons.jelly.JellyContext context)
        Returns the instance of this class stored in the specified Jelly context. If no instance can be found, null will be returned.
        Parameters:
        context - the Jelly context
        Returns:
        the instance found in this context