Class ToggleMenu

All Implemented Interfaces:
Serializable, Cloneable, Copyable, DictionaryBean, UifDictionaryBean, Component, ListAware, Ordered, ScriptEventSupport, ContentElement, LifecycleElement, org.springframework.core.Ordered

public class ToggleMenu extends ContentElementBase implements ListAware
Renders a toggle menu (aka sub menu, dropdown menu) of items.

The toggle menu component can be used to build context menus or full application menus. Essentially the component is configured by first setting the text that will appear as a link (optionally with a caret). When the user clicks the link, the items (getMenuItems() will be presented.

Author:
Kuali Rice Team (rice.collab@kuali.org)
See Also:
  • Constructor Details

    • ToggleMenu

      public ToggleMenu()
  • Method Details

    • performInitialization

      public void performInitialization(Object model)
      The following updates are done here:
      • Invoke performInitialize on component modifiers
      Initializes the component

      Where components can set defaults and setup other necessary state. The initialize method should only be called once per component lifecycle and is invoked within the initialize phase of the view lifecylce.

      Specified by:
      performInitialization in interface LifecycleElement
      Overrides:
      performInitialization in class ComponentBase
      Parameters:
      model - - object instance containing the view data
      See Also:
    • performApplyModel

      public void performApplyModel(Object model, LifecycleElement parent)
      The following updates are done here:
      • Evaluate the progressive render condition (if set) and combine with the current render status to set the render status
      Called after the initialize phase to perform conditional logic based on the model data

      Where components can perform conditional logic such as dynamically generating new fields or setting field state based on the given data

      Specified by:
      performApplyModel in interface LifecycleElement
      Overrides:
      performApplyModel in class ComponentBase
      Parameters:
      model - - Top level object containing the data (could be the form or a top level business object, dto)
      parent - parent lifecycle element
    • getToggleText

      public String getToggleText()
      Text to display as the toggle menu toggle link

      This text will appear as a link for the user to click on, which then will bring up the toggle menu menu. This property is a shortcut for getToggleMessage() .setMessageText. This text is not required, in which case only the caret will render

      Returns:
      text to display for the toggle menu toggle link
    • setToggleText

      public void setToggleText(String toggleText)
      See Also:
    • getToggleMessage

      public Message getToggleMessage()
      Message component that is associated with the toggle menu toggle text, can be used to adjust styling and so forth
      Returns:
      Message instance for toggle text
    • setToggleMessage

      public void setToggleMessage(Message toggleMessage)
      See Also:
    • getToggleCaretClass

      public String getToggleCaretClass()
      Css class to use when rendering a caret icon which will appear to the right of the toggleText
      Returns:
      the caret icon class
    • setToggleCaretClass

      public void setToggleCaretClass(String toggleCaretClass)
      See Also:
    • getIconClass

      public String getIconClass()
      Css class for an icon that will appear to the left of the toggleText
      Returns:
      the css class for an icon
    • setIconClass

      public void setIconClass(String iconClass)
      See Also:
    • isRenderToggleButton

      public boolean isRenderToggleButton()
      Indicates whether a caret button should be rendered to the right of the toggle text (if present)
      Returns:
      boolean true if caret button should be rendered, false if not
    • setRenderToggleButton

      public void setRenderToggleButton(boolean renderToggleButton)
      See Also:
    • isRenderedInList

      public boolean isRenderedInList()
      See Also:
    • setRenderedInList

      public void setRenderedInList(boolean renderedInList)
      Description copied from interface: ListAware
      Sets the boolean indicator on the component that indicates whether it is being rendered in a list
      Specified by:
      setRenderedInList in interface ListAware
      Parameters:
      renderedInList - boolean true if rendered in a list, false if not
      See Also:
    • getMenuItems

      @ViewLifecycleRestriction public List<Component> getMenuItems()
      List of components that should be rendered for the toggle menu.

      Items for the menu are configured through this list. The order of the items within the list is the order they will appear in the toggle menu

      Returns:
      List of menu items for the toggle menu
    • setMenuItems

      public void setMenuItems(List<Component> menuItems)
      See Also:
    • getMenuGroup

      public Group getMenuGroup()
      Group instance that is rendered when the toggle menu is toggled.

      Note in most cases this group will be a simple list group. The component allows for the list group to be initialized in a base bean, then child beans can simply define the item using getMenuItems()

      Returns:
      Group instance
    • setMenuGroup

      public void setMenuGroup(Group menuGroup)
      See Also: