Class StackedLayoutManagerBase
- All Implemented Interfaces:
Serializable,Cloneable,Copyable,DictionaryBean,UifDictionaryBean,CollectionLayoutManager,LayoutManager,StackedLayoutManager,LifecycleElement
CollectionGroup containers and
renders the collection lines in a vertical row
For each line of the collection, a Group instance is created.
The group header contains a label for the line (summary information), the
group fields are the collection line fields, and the group footer contains
the line actions. All the groups are rendered using the
BoxLayoutManager with vertical orientation.
Modify the lineGroupPrototype to change header/footer styles or any other customization for the line groups
- Author:
- Kuali Rice Team (rice.collab@kuali.org)
- See Also:
-
Field Summary
Fields inherited from class org.kuali.rice.krad.datadictionary.DictionaryBeanBase
componentCode, namespaceCode -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidbuildLine(LineBuilderContext lineBuilderContext) Call to the layout manager to build the components necessary for the given collection line, within an active view lifecycle.protected StringbuildLineHeaderText(Object line, Group lineGroup) Builds the header text for the collection lineprotected voiddetermineLineActionPlacement(Group lineGroup, CollectionGroup collectionGroup, LineBuilderContext lineBuilderContext, List<Component> groupFields) Places actions in the appropriate location for the stacked group line based on placement flags set on this layout managerReturns the parentCollectionLayoutManagerBase's add line groupGroup instance that is used as a prototype for creating the collection line groups.FinalListof Groups to render for the collectionUsed by reflection during the lifecycle to get groups for the lifecycle when not using a wrapper groupList of attribute names from the collection line class that should be used to build the line summary.Text to appears in the header for each collection lines Group.Default Impl Determines whatContainerclasses are supported by theLayoutManagerGroup that will 'wrap' the generated collection lines so that they have a different layout from the general stacked layoutbooleanWhen true, actions specified in lineActions will appear to the very right of the header (appears in the corner of the stacked item) by placing the actions in the Header's rightGroup.booleanFlag that indicates whether actions will be added in the same group as the line items instead of in the footer of the line groupvoidperformApplyModel(Object model, LifecycleElement component) Called after the initialize phase to perform conditional logic based on the model datavoidperformFinalize(Object model, LifecycleElement element) The last phase before the view is renderedvoidperformInitialization(Object model) Initializes the componentvoidprocessPagingRequest(Object model, CollectionGroup collectionGroup) InvokesCollectionPagingHelperto carry out the paging request.voidsetLineGroupPrototype(Group lineGroupPrototype) Setter for the line group prototypevoidsetRenderLineActionsInHeader(boolean renderLineActionsInHeader) voidsetRenderLineActionsInLineGroup(boolean renderLineActionsInLineGroup) Set flag to add actions in the same group as the line itemsvoidsetStackedGroups(List<Group> stackedGroups) Setter for the collection groupsvoidsetSummaryFields(List<String> summaryFields) Setter for the summary field name listvoidsetSummaryTitle(String summaryTitle) Setter for the summary title textvoidsetWrapperGroup(Group wrapperGroup) Setter for the wrapper group that will receive the generated line groupsMethods inherited from class org.kuali.rice.krad.uif.layout.collections.CollectionLayoutManagerBase
addEnterKeyDataAttributeToGroup, getPagerWidget, getSelectFieldPrototype, getSubCollectionFieldGroupPrototype, setAddLineGroup, setPagerWidget, setSelectFieldPrototype, setSubCollectionFieldGroupPrototypeMethods inherited from class org.kuali.rice.krad.uif.layout.LayoutManagerBase
addStyleClass, appendToStyle, checkMutable, clone, getAdditionalCssClasses, getContainerIdSuffix, getContext, getCssClasses, getId, getLibraryCssClasses, getPhasePathMapping, getPropertyReplacers, getStyle, getStyleClassesAsString, getTemplate, getTemplateName, getViewPath, getViewStatus, isFinal, isInitialized, isModelApplied, isMutable, isRender, notifyCompleted, pushAllToContext, pushObjectToContext, setAdditionalCssClasses, setContainerIdSuffix, setContext, setCssClasses, setId, setLibraryCssClasses, setPhasePathMapping, setPropertyReplacers, setRender, setStyle, setStyleClasses, setTemplate, setTemplateName, setViewPath, setViewStatus, skipLifecycleMethods inherited from class org.kuali.rice.krad.datadictionary.uif.UifDictionaryBeanBase
getExpressionGraph, getPropertyExpression, getPropertyExpressions, setExpressionGraph, setPropertyExpressionsMethods inherited from class org.kuali.rice.krad.datadictionary.DictionaryBeanBase
copy, dataDictionaryPostProcessing, getComponentCode, getNamespaceCode, setComponentCode, setNamespaceCodeMethods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.kuali.rice.krad.uif.layout.CollectionLayoutManager
getPagerWidget, getSelectFieldPrototype, getSubCollectionFieldGroupPrototype, setAddLineGroup, setPagerWidget, setSelectFieldPrototype, setSubCollectionFieldGroupPrototypeMethods inherited from interface org.kuali.rice.krad.datadictionary.DictionaryBean
dataDictionaryPostProcessing, getComponentCode, getNamespaceCodeMethods inherited from interface org.kuali.rice.krad.uif.layout.LayoutManager
addStyleClass, appendToStyle, getAdditionalCssClasses, getCssClasses, getLibraryCssClasses, getPropertyReplacers, getStyle, getTemplate, getTemplateName, setAdditionalCssClasses, setCssClasses, setLibraryCssClasses, setPropertyReplacers, setStyle, setTemplate, setTemplateNameMethods inherited from interface org.kuali.rice.krad.uif.util.LifecycleElement
checkMutable, getContainerIdSuffix, getContext, getId, getPhasePathMapping, getViewPath, getViewStatus, isFinal, isInitialized, isModelApplied, isMutable, isRender, notifyCompleted, pushAllToContext, pushObjectToContext, setContainerIdSuffix, setContext, setId, setPhasePathMapping, setRender, setViewPath, setViewStatus, skipLifecycleMethods inherited from interface org.kuali.rice.krad.uif.layout.StackedLayoutManager
getStyleClassesAsStringMethods inherited from interface org.kuali.rice.krad.datadictionary.uif.UifDictionaryBean
getExpressionGraph, getPropertyExpression, getPropertyExpressions, setExpressionGraph, setPropertyExpressions
-
Constructor Details
-
StackedLayoutManagerBase
public StackedLayoutManagerBase()
-
-
Method Details
-
performInitialization
Initializes the componentWhere 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:
performInitializationin interfaceLifecycleElement- Overrides:
performInitializationin classLayoutManagerBase- Parameters:
model- - object instance containing the view data- See Also:
-
performApplyModel
Called after the initialize phase to perform conditional logic based on the model dataWhere components can perform conditional logic such as dynamically generating new fields or setting field state based on the given data
- Specified by:
performApplyModelin interfaceLifecycleElement- Overrides:
performApplyModelin classLayoutManagerBase- Parameters:
model- - Top level object containing the data (could be the form or a top level business object, dto)component- parent lifecycle element
-
performFinalize
The last phase before the view is renderedHere final preparations can be made based on the updated view state.
- Specified by:
performFinalizein interfaceLifecycleElement- Overrides:
performFinalizein classLayoutManagerBase- Parameters:
model- - top level object containing the dataelement- - parent component
-
buildLine
Call to the layout manager to build the components necessary for the given collection line, within an active view lifecycle.As the collection is being iterated over by the
CollectionGroupLineBuilderthis method is invoked for each line. The builder will create copies of the configured fields and actions for the line and pass into the layout manager so they can be assembled- Specified by:
buildLinein interfaceCollectionLayoutManager- Parameters:
lineBuilderContext- context for the line to be built
-
determineLineActionPlacement
protected void determineLineActionPlacement(Group lineGroup, CollectionGroup collectionGroup, LineBuilderContext lineBuilderContext, List<Component> groupFields) Places actions in the appropriate location for the stacked group line based on placement flags set on this layout manager- Parameters:
lineGroup- the current line groupcollectionGroup- the current collection grouplineBuilderContext- the line's building contextgroupFields- the list of fields which will be added to the line group
-
buildLineHeaderText
Builds the header text for the collection lineHeader text is built up by first the collection label, either specified on the collection definition or retrieved from the dictionary. Then for each summary field defined, the value from the model is retrieved and added to the header.
Note the
getSummaryTitle()field may have expressions defined, in which cause it will be copied to the property expressions map to set the title for the line group (which will have the item context variable set)- Parameters:
line- Collection line containing datalineGroup- Group instance for rendering the line and whose title should be built- Returns:
- header text for line
-
processPagingRequest
InvokesCollectionPagingHelperto carry out the paging request. Invoked when a paging request occurs to carry out the paging request.- Specified by:
processPagingRequestin interfaceCollectionLayoutManager- Parameters:
model- object containing the view's datacollectionGroup- collection group the request was made for
-
getAddLineGroup
Returns the parentCollectionLayoutManagerBase's add line groupThis method is overridden to restrict the lifecycle of the add line group as a resolution to avoid duplicate components from being added to the view, for example, quickfinders.
Group for rendering the add line when separate (always the case for stacked layout, and a configuration for table layout).This group can be used to configure how the add line will be rendered. For example the layout manager configured on the group will be used to rendered the add line fields. If the header (title) is not set on the group, it will be set from
CollectionGroup.getAddLabel(). In addition,CollectionGroup.getAddLineActions()will be added to the group footer items.- Specified by:
getAddLineGroupin interfaceCollectionLayoutManager- Overrides:
getAddLineGroupin classCollectionLayoutManagerBase- Returns:
- Group instance for the collection add line
-
getSupportedContainer
Default Impl Determines whatContainerclasses are supported by theLayoutManager- Specified by:
getSupportedContainerin interfaceLayoutManager- Overrides:
getSupportedContainerin classLayoutManagerBase- Returns:
- Classinvalid input: '<'? extends Container> container class supported
-
getSummaryTitle
Text to appears in the header for each collection lines Group. Used in conjunction withStackedLayoutManager.getSummaryFields()to build up the final header text- Specified by:
getSummaryTitlein interfaceStackedLayoutManager- Returns:
- summary title text
-
setSummaryTitle
Setter for the summary title text- Specified by:
setSummaryTitlein interfaceStackedLayoutManager- Parameters:
summaryTitle-
-
getSummaryFields
List of attribute names from the collection line class that should be used to build the line summary. To build the summary the value for each attribute is retrieved from the line instance. All the values are then placed together with a separator.- Specified by:
getSummaryFieldsin interfaceStackedLayoutManager- Returns:
- summary field names
- See Also:
-
setSummaryFields
Setter for the summary field name list- Specified by:
setSummaryFieldsin interfaceStackedLayoutManager- Parameters:
summaryFields-
-
getLineGroupPrototype
Group instance that is used as a prototype for creating the collection line groups. For each line a copy of the prototype is made and then adjusted as necessary- Specified by:
getLineGroupPrototypein interfaceStackedLayoutManager- Returns:
- Group instance to use as prototype
-
setLineGroupPrototype
Setter for the line group prototype- Specified by:
setLineGroupPrototypein interfaceStackedLayoutManager- Parameters:
lineGroupPrototype-
-
getWrapperGroup
Group that will 'wrap' the generated collection lines so that they have a different layout from the general stacked layoutBy default (when the wrapper group is null), each collection line will become a group and the groups are rendered one after another. If the wrapper group is configured, the generated groups will be inserted as the items for the wrapper group, and the layout manager configured for the wrapper group will determine how they are rendered. For example, the layout manager could be a grid layout configured for three columns, which would layout the first three lines horizontally then break to a new row.
- Specified by:
getWrapperGroupin interfaceStackedLayoutManager- Returns:
- Group instance whose items list should be populated with the generated groups, or null to use the default layout
-
setWrapperGroup
Setter for the wrapper group that will receive the generated line groups- Specified by:
setWrapperGroupin interfaceStackedLayoutManager- Parameters:
wrapperGroup-
-
getStackedGroups
FinalListof Groups to render for the collection- Specified by:
getStackedGroupsin interfaceStackedLayoutManager- Returns:
- collection groups
-
getStackedGroupsNoWrapper
Used by reflection during the lifecycle to get groups for the lifecycle when not using a wrapper groupThere are no references to this method in the code, this is intentional. DO NOT REMOVE.
- Specified by:
getStackedGroupsNoWrapperin interfaceStackedLayoutManager- Returns:
- the stacked groups, if any
-
setStackedGroups
Setter for the collection groups- Specified by:
setStackedGroupsin interfaceStackedLayoutManager- Parameters:
stackedGroups-
-
isRenderLineActionsInLineGroup
public boolean isRenderLineActionsInLineGroup()Flag that indicates whether actions will be added in the same group as the line items instead of in the footer of the line group- Specified by:
isRenderLineActionsInLineGroupin interfaceStackedLayoutManager- Returns:
- boolean
-
setRenderLineActionsInLineGroup
public void setRenderLineActionsInLineGroup(boolean renderLineActionsInLineGroup) Set flag to add actions in the same group as the line items- Specified by:
setRenderLineActionsInLineGroupin interfaceStackedLayoutManager- Parameters:
renderLineActionsInLineGroup-
-
isRenderLineActionsInHeader
public boolean isRenderLineActionsInHeader()When true, actions specified in lineActions will appear to the very right of the header (appears in the corner of the stacked item) by placing the actions in the Header's rightGroup.- Specified by:
isRenderLineActionsInHeaderin interfaceStackedLayoutManager- Returns:
- true if rendering actions at the header level, false otherwise
-
setRenderLineActionsInHeader
public void setRenderLineActionsInHeader(boolean renderLineActionsInHeader) - Specified by:
setRenderLineActionsInHeaderin interfaceStackedLayoutManager- See Also:
-