public class StackedLayoutManagerBase extends CollectionLayoutManagerBase implements StackedLayoutManager
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
componentCode, namespaceCode
Constructor and Description |
---|
StackedLayoutManagerBase() |
Modifier and Type | Method and Description |
---|---|
void |
buildLine(LineBuilderContext lineBuilderContext)
Call to the layout manager to build the components necessary for the given collection line,
within an active view lifecycle.
|
protected String |
buildLineHeaderText(Object line,
Group lineGroup)
Builds the header text for the collection line
|
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
|
Group |
getAddLineGroup()
Returns the parent
CollectionLayoutManagerBase 's add line group |
Group |
getLineGroupPrototype()
Group instance that is used as a prototype for creating the collection
line groups.
|
List<Group> |
getStackedGroups()
Final
List of Groups to render for the collection |
List<Group> |
getStackedGroupsNoWrapper()
Used by reflection during the lifecycle to get groups for the lifecycle when not using a wrapper group
|
List<String> |
getSummaryFields()
List of attribute names from the collection line class that should be
used to build the line summary.
|
String |
getSummaryTitle()
Text to appears in the header for each collection lines Group.
|
Class<? extends Container> |
getSupportedContainer()
Default Impl
Determines what
Container classes are supported by the
LayoutManager |
Group |
getWrapperGroup()
Group that will 'wrap' the generated collection lines so that they have a different layout from the general
stacked layout
|
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.
|
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
|
void |
performApplyModel(Object model,
LifecycleElement component)
Called after the initialize phase to perform conditional logic based on the model data
|
void |
performFinalize(Object model,
LifecycleElement element)
The last phase before the view is rendered
|
void |
performInitialization(Object model)
Initializes the component
|
void |
processPagingRequest(Object model,
CollectionGroup collectionGroup)
Invokes
CollectionPagingHelper to carry out the
paging request. |
void |
setLineGroupPrototype(Group lineGroupPrototype)
Setter for the line group prototype
|
void |
setRenderLineActionsInHeader(boolean renderLineActionsInHeader) |
void |
setRenderLineActionsInLineGroup(boolean renderLineActionsInLineGroup)
Set flag to add actions in the same group as the line items
|
void |
setStackedGroups(List<Group> stackedGroups)
Setter for the collection groups
|
void |
setSummaryFields(List<String> summaryFields)
Setter for the summary field name list
|
void |
setSummaryTitle(String summaryTitle)
Setter for the summary title text
|
void |
setWrapperGroup(Group wrapperGroup)
Setter for the wrapper group that will receive the generated line groups
|
addEnterKeyDataAttributeToGroup, getPagerWidget, getSelectFieldPrototype, getSubCollectionFieldGroupPrototype, setAddLineGroup, setPagerWidget, setSelectFieldPrototype, setSubCollectionFieldGroupPrototype
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, skipLifecycle
getExpressionGraph, getPropertyExpression, getPropertyExpressions, setExpressionGraph, setPropertyExpressions
copy, dataDictionaryPostProcessing, getComponentCode, getNamespaceCode, setComponentCode, setNamespaceCode
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getStyleClassesAsString
getPagerWidget, getSelectFieldPrototype, getSubCollectionFieldGroupPrototype, setAddLineGroup, setPagerWidget, setSelectFieldPrototype, setSubCollectionFieldGroupPrototype
addStyleClass, appendToStyle, getAdditionalCssClasses, getCssClasses, getLibraryCssClasses, getPropertyReplacers, getStyle, getTemplate, getTemplateName, setAdditionalCssClasses, setCssClasses, setLibraryCssClasses, setPropertyReplacers, setStyle, setTemplate, setTemplateName
getExpressionGraph, getPropertyExpression, getPropertyExpressions, setExpressionGraph, setPropertyExpressions
dataDictionaryPostProcessing, getComponentCode, getNamespaceCode
checkMutable, getContainerIdSuffix, getContext, getId, getPhasePathMapping, getViewPath, getViewStatus, isFinal, isInitialized, isModelApplied, isMutable, isRender, notifyCompleted, pushAllToContext, pushObjectToContext, setContainerIdSuffix, setContext, setId, setPhasePathMapping, setRender, setViewPath, setViewStatus, skipLifecycle
public StackedLayoutManagerBase()
public void performInitialization(Object model)
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.
performInitialization
in interface LifecycleElement
performInitialization
in class LayoutManagerBase
model
- - object instance containing the view dataComponentDefaultInitializeTask
public void performApplyModel(Object model, LifecycleElement component)
Where components can perform conditional logic such as dynamically generating new fields or setting field state based on the given data
performApplyModel
in interface LifecycleElement
performApplyModel
in class LayoutManagerBase
model
- - Top level object containing the data (could be the form or a
top level business object, dto)component
- parent lifecycle elementpublic void performFinalize(Object model, LifecycleElement element)
Here final preparations can be made based on the updated view state.
performFinalize
in interface LifecycleElement
performFinalize
in class LayoutManagerBase
model
- - top level object containing the dataelement
- - parent componentpublic void buildLine(LineBuilderContext lineBuilderContext)
As the collection is being iterated over by the CollectionGroupLineBuilder
this 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
buildLine
in interface CollectionLayoutManager
lineBuilderContext
- context for the line to be builtprotected void determineLineActionPlacement(Group lineGroup, CollectionGroup collectionGroup, LineBuilderContext lineBuilderContext, List<Component> groupFields)
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 groupprotected String buildLineHeaderText(Object line, Group lineGroup)
Header 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)
line
- Collection line containing datalineGroup
- Group instance for rendering the line and whose title should be builtpublic void processPagingRequest(Object model, CollectionGroup collectionGroup)
CollectionPagingHelper
to carry out the
paging request.
Invoked when a paging request occurs to carry out the paging request.processPagingRequest
in interface CollectionLayoutManager
model
- object containing the view's datacollectionGroup
- collection group the request was made for@ViewLifecycleRestriction(value="INITIALIZE") public Group getAddLineGroup()
CollectionLayoutManagerBase
's add line group
This 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.
getAddLineGroup
in interface CollectionLayoutManager
getAddLineGroup
in class CollectionLayoutManagerBase
public Class<? extends Container> getSupportedContainer()
Container
classes are supported by the
LayoutManager
getSupportedContainer
in interface LayoutManager
getSupportedContainer
in class LayoutManagerBase
public String getSummaryTitle()
StackedLayoutManager.getSummaryFields()
to build up the final header
textgetSummaryTitle
in interface StackedLayoutManager
public void setSummaryTitle(String summaryTitle)
setSummaryTitle
in interface StackedLayoutManager
public List<String> getSummaryFields()
getSummaryFields
in interface StackedLayoutManager
buildLineHeaderText(Object, org.kuali.rice.krad.uif.container.Group)
public void setSummaryFields(List<String> summaryFields)
setSummaryFields
in interface StackedLayoutManager
@ViewLifecycleRestriction(value="INITIALIZE") public Group getLineGroupPrototype()
getLineGroupPrototype
in interface StackedLayoutManager
public void setLineGroupPrototype(Group lineGroupPrototype)
setLineGroupPrototype
in interface StackedLayoutManager
public Group getWrapperGroup()
By 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.
getWrapperGroup
in interface StackedLayoutManager
public void setWrapperGroup(Group wrapperGroup)
setWrapperGroup
in interface StackedLayoutManager
@ViewLifecycleRestriction public List<Group> getStackedGroups()
List
of Groups to render for the collectiongetStackedGroups
in interface StackedLayoutManager
public List<Group> getStackedGroupsNoWrapper()
There are no references to this method in the code, this is intentional. DO NOT REMOVE.
getStackedGroupsNoWrapper
in interface StackedLayoutManager
public void setStackedGroups(List<Group> stackedGroups)
setStackedGroups
in interface StackedLayoutManager
public boolean isRenderLineActionsInLineGroup()
isRenderLineActionsInLineGroup
in interface StackedLayoutManager
public void setRenderLineActionsInLineGroup(boolean renderLineActionsInLineGroup)
setRenderLineActionsInLineGroup
in interface StackedLayoutManager
public boolean isRenderLineActionsInHeader()
isRenderLineActionsInHeader
in interface StackedLayoutManager
public void setRenderLineActionsInHeader(boolean renderLineActionsInHeader)
setRenderLineActionsInHeader
in interface StackedLayoutManager
StackedLayoutManager.isRenderLineActionsInHeader()
Copyright © 2005–2015 The Kuali Foundation. All rights reserved.