org.kuali.rice.krad.uif.element
Class ToggleMenu

java.lang.Object
  extended by org.kuali.rice.krad.datadictionary.DictionaryBeanBase
      extended by org.kuali.rice.krad.datadictionary.uif.UifDictionaryBeanBase
          extended by org.kuali.rice.krad.uif.component.ComponentBase
              extended by org.kuali.rice.krad.uif.element.ContentElementBase
                  extended by org.kuali.rice.krad.uif.element.ToggleMenu
All Implemented Interfaces:
Serializable, Cloneable, Copyable, DictionaryBean, UifDictionaryBean, Component, ListAware, 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:
Serialized Form

Field Summary
 
Fields inherited from class org.kuali.rice.krad.uif.component.ComponentBase
templateOptions
 
Fields inherited from class org.kuali.rice.krad.datadictionary.DictionaryBeanBase
componentCode, namespaceCode
 
Fields inherited from interface org.kuali.rice.krad.uif.component.Ordered
INITIAL_ORDER_VALUE
 
Fields inherited from interface org.springframework.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
 
Constructor Summary
ToggleMenu()
           
 
Method Summary
 String getIconClass()
          Css class for an icon that will appear to the left of the toggleText
 Group getMenuGroup()
          Group instance that is rendered when the toggle menu is toggled.
 List<Component> getMenuItems()
          List of components that should be rendered for the toggle menu
 String getToggleCaretClass()
          Css class to use when rendering a caret icon which will appear to the right of the toggleText
 Message getToggleMessage()
          Message component that is associated with the toggle menu toggle text, can be used to adjust styling and so forth
 String getToggleText()
          Text to display as the toggle menu toggle link
 boolean isRenderedInList()
           
 boolean isRenderToggleButton()
          Indicates whether a caret button should be rendered to the right of the toggle text (if present)
 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
 void performInitialization(Object model)
          Initializes the component
 void setIconClass(String iconClass)
           
 void setMenuGroup(Group menuGroup)
           
 void setMenuItems(List<Component> menuItems)
           
 void setRenderedInList(boolean renderedInList)
          Sets the boolean indicator on the component that indicates whether it is being rendered in a list
 void setRenderToggleButton(boolean renderToggleButton)
           
 void setToggleCaretClass(String toggleCaretClass)
           
 void setToggleMessage(Message toggleMessage)
           
 void setToggleText(String toggleText)
           
 
Methods inherited from class org.kuali.rice.krad.uif.element.ContentElementBase
getComponentTypeName
 
Methods inherited from class org.kuali.rice.krad.uif.component.ComponentBase
addDataAttribute, addScriptDataAttribute, addStyleClass, addWrapperCssClass, appendToStyle, checkMutable, clone, completeValidation, getAdditionalComponentsToRefresh, getAdditionalComponentsToRefreshJs, getAdditionalCssClasses, getAdditionalTemplates, getAlign, getCellWidth, getColSpan, getComponentModifiers, getComponentSecurity, getConditionalRefresh, getConditionalRefreshConditionJs, getConditionalRefreshControlNames, getContext, getCssClasses, getDataAttributes, getEventHandlerScript, getFinalizeMethodAdditionalArguments, getFinalizeMethodInvoker, getFinalizeMethodToCall, getId, getLibraryCssClasses, getMethodToCallOnRefresh, getOnBlurScript, getOnChangeScript, getOnClickScript, getOnCloseScript, getOnDblClickScript, getOnDocumentReadyScript, getOnFocusScript, getOnInputScript, getOnKeyDownScript, getOnKeyPressScript, getOnKeyUpScript, getOnLoadScript, getOnMouseDownScript, getOnMouseMoveScript, getOnMouseOutScript, getOnMouseOverScript, getOnMouseUpScript, getOnSubmitScript, getOnUnloadScript, getOrder, getPhasePathMapping, getPostRenderContent, getPreRenderContent, getProgressiveDisclosureConditionJs, getProgressiveDisclosureControlNames, getProgressiveRender, getPropertyReplacerComponents, getPropertyReplacers, getRefreshTimer, getRefreshWhenChangedPropertyNames, getRenderedHtmlOutput, getRequired, getRowSpan, getScriptDataAttributes, getScriptDataAttributesJs, getSimpleDataAttributes, getStyle, getStyleClassesAsString, getTemplate, getTemplateName, getTemplateOptions, getTemplateOptionsJSString, getTitle, getToolTip, getValign, getViewPath, getViewStatus, getWidth, getWrapperCssClasses, getWrapperCssClassesAsString, getWrapperStyle, initializeComponentSecurity, initializePendingTasks, isDisableSessionPersistence, isDisclosedByAction, isEditAuthz, isFinal, isForceSessionPersistence, isHidden, isInitialized, isModelApplied, isMutable, isProgressiveRenderAndRefresh, isProgressiveRenderViaAJAX, isReadOnly, isRefreshedByAction, isRender, isRendered, isResetDataOnRefresh, isRetrieveViaAjax, isSelfRendered, isSkipInTabOrder, isViewAuthz, notifyCompleted, performFinalize, preventModification, pushAllToContext, pushObjectToContext, pushToPropertyReplacerContext, setAdditionalComponentsToRefresh, setAdditionalCssClasses, setAlign, setCellWidth, setColSpan, setComponentModifiers, setComponentSecurity, setConditionalRefresh, setContext, setCssClasses, setDataAttributes, setDisableSessionPersistence, setDisclosedByAction, setEditAuthz, setFinalizeMethodAdditionalArguments, setFinalizeMethodInvoker, setFinalizeMethodToCall, setForceSessionPersistence, setHidden, setId, setLibraryCssClasses, setMethodToCallOnRefresh, setOnBlurScript, setOnChangeScript, setOnClickScript, setOnCloseScript, setOnDblClickScript, setOnDocumentReadyScript, setOnFocusScript, setOnInputScript, setOnKeyDownScript, setOnKeyPressScript, setOnKeyUpScript, setOnLoadScript, setOnMouseDownScript, setOnMouseMoveScript, setOnMouseOutScript, setOnMouseOverScript, setOnMouseUpScript, setOnSubmitScript, setOnUnloadScript, setOrder, setPhasePathMapping, setPostRenderContent, setPreRenderContent, setProgressiveRender, setProgressiveRenderAndRefresh, setProgressiveRenderViaAJAX, setPropertyReplacers, setReadOnly, setRefreshedByAction, setRefreshTimer, setRefreshWhenChangedPropertyNames, setRender, setRenderedHtmlOutput, setRequired, setResetDataOnRefresh, setRetrieveViaAjax, setRowSpan, setScriptDataAttributes, setSelfRendered, setSkipInTabOrder, setStyle, setTemplate, setTemplateName, setTemplateOptions, setTemplateOptionsJSString, setTitle, setToolTip, setValign, setViewAuthz, setViewPath, setViewStatus, setViewStatus, setWidth, setWrapperCssClasses, setWrapperStyle, skipLifecycle
 
Methods inherited from class org.kuali.rice.krad.datadictionary.uif.UifDictionaryBeanBase
getExpressionGraph, getPropertyExpression, getPropertyExpressions, setExpressionGraph, setPropertyExpressions
 
Methods inherited from class org.kuali.rice.krad.datadictionary.DictionaryBeanBase
copy, dataDictionaryPostProcessing, getComponentCode, getNamespaceCode, setComponentCode, setNamespaceCode, unwrap
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.kuali.rice.krad.uif.component.Component
addDataAttribute, addScriptDataAttribute, addStyleClass, addWrapperCssClass, appendToStyle, completeValidation, getAdditionalComponentsToRefresh, getAdditionalComponentsToRefreshJs, getAdditionalCssClasses, getAdditionalTemplates, getAlign, getCellWidth, getColSpan, getComponentModifiers, getComponentSecurity, getConditionalRefresh, getConditionalRefreshConditionJs, getConditionalRefreshControlNames, getCssClasses, getDataAttributes, getEventHandlerScript, getFinalizeMethodAdditionalArguments, getFinalizeMethodInvoker, getFinalizeMethodToCall, getLibraryCssClasses, getMethodToCallOnRefresh, getOrder, getPostRenderContent, getPreRenderContent, getProgressiveDisclosureConditionJs, getProgressiveDisclosureControlNames, getProgressiveRender, getPropertyReplacerComponents, getPropertyReplacers, getRefreshTimer, getRefreshWhenChangedPropertyNames, getRenderedHtmlOutput, getRequired, getRowSpan, getScriptDataAttributes, getScriptDataAttributesJs, getSimpleDataAttributes, getStyle, getStyleClassesAsString, getTemplate, getTemplateName, getTemplateOptions, getTemplateOptionsJSString, getTitle, getToolTip, getValign, getWidth, getWrapperCssClasses, getWrapperStyle, isDisableSessionPersistence, isDisclosedByAction, isForceSessionPersistence, isHidden, isProgressiveRenderAndRefresh, isProgressiveRenderViaAJAX, isReadOnly, isRefreshedByAction, isRendered, isResetDataOnRefresh, isRetrieveViaAjax, isSelfRendered, setAdditionalComponentsToRefresh, setAdditionalCssClasses, setAlign, setCellWidth, setColSpan, setComponentModifiers, setComponentSecurity, setConditionalRefresh, setCssClasses, setDataAttributes, setDisableSessionPersistence, setDisclosedByAction, setForceSessionPersistence, setHidden, setLibraryCssClasses, setOrder, setPostRenderContent, setPreRenderContent, setProgressiveRender, setProgressiveRenderAndRefresh, setProgressiveRenderViaAJAX, setPropertyReplacers, setReadOnly, setRefreshedByAction, setRefreshTimer, setRefreshWhenChangedPropertyNames, setRenderedHtmlOutput, setRequired, setResetDataOnRefresh, setRetrieveViaAjax, setRowSpan, setScriptDataAttributes, setSelfRendered, setStyle, setTemplate, setTemplateName, setTemplateOptions, setTemplateOptionsJSString, setTitle, setToolTip, setValign, setViewStatus, setWidth, setWrapperCssClasses, setWrapperStyle
 
Methods inherited from interface org.kuali.rice.krad.datadictionary.uif.UifDictionaryBean
getExpressionGraph, getPropertyExpression, getPropertyExpressions, setExpressionGraph, setPropertyExpressions
 
Methods inherited from interface org.kuali.rice.krad.datadictionary.DictionaryBean
dataDictionaryPostProcessing, getComponentCode, getNamespaceCode
 
Methods inherited from interface org.kuali.rice.krad.uif.util.LifecycleElement
checkMutable, getContext, getId, getPhasePathMapping, getViewPath, getViewStatus, initializePendingTasks, isFinal, isInitialized, isModelApplied, isMutable, isRender, notifyCompleted, performFinalize, pushAllToContext, pushObjectToContext, setContext, setId, setPhasePathMapping, setRender, setViewPath, setViewStatus, skipLifecycle
 
Methods inherited from interface org.kuali.rice.krad.datadictionary.Copyable
clone, copy, preventModification, unwrap
 
Methods inherited from interface org.kuali.rice.krad.uif.component.ScriptEventSupport
getOnBlurScript, getOnChangeScript, getOnClickScript, getOnCloseScript, getOnDblClickScript, getOnDocumentReadyScript, getOnFocusScript, getOnInputScript, getOnKeyDownScript, getOnKeyPressScript, getOnKeyUpScript, getOnLoadScript, getOnMouseDownScript, getOnMouseMoveScript, getOnMouseOutScript, getOnMouseOverScript, getOnMouseUpScript, getOnSubmitScript, getOnUnloadScript, setOnBlurScript, setOnChangeScript, setOnClickScript, setOnCloseScript, setOnDblClickScript, setOnDocumentReadyScript, setOnFocusScript, setOnInputScript, setOnKeyDownScript, setOnKeyPressScript, setOnKeyUpScript, setOnLoadScript, setOnMouseDownScript, setOnMouseMoveScript, setOnMouseOutScript, setOnMouseOverScript, setOnMouseUpScript, setOnSubmitScript, setOnUnloadScript
 

Constructor Detail

ToggleMenu

public ToggleMenu()
Method Detail

performInitialization

public void performInitialization(Object model)
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:
ComponentDefaultInitializeTask

performApplyModel

public void performApplyModel(Object model,
                              LifecycleElement parent)
The following updates are done here: 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:
getToggleText()

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:
getToggleMessage()

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:
getToggleCaretClass()

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:
getIconClass()

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:
isRenderToggleButton()

isRenderedInList

public boolean isRenderedInList()
See Also:
ListAware.setRenderedInList(boolean)

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:
isRenderedInList()

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:
getMenuItems()

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:
getMenuGroup()


Copyright © 2005–2014 The Kuali Foundation. All rights reserved.