Class GridLayoutManagerBase
- All Implemented Interfaces:
Serializable,Cloneable,Copyable,DictionaryBean,UifDictionaryBean,GridLayoutManager,LayoutManager,LifecycleElement
Items are laid out from left to right (with each item taking up one column) until the configured number of columns is reached. If the item count is greater than the number of columns, a new row will be created to render the remaining items (and so on until all items are placed). Labels for the fields can be pulled out (default) and rendered as a separate column. The manager also supports the column span and row span options for the field items. If not specified the default is 1.
- 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 TypeMethodDescriptionintIndicates the number of columns that should make up one row of dataList of styles for each row.List of data attributes for each row.Default Impl Default Impl Determines whatContainerclasses are supported by theLayoutManagerbooleanIndicates whether alternating row styles should be appliedbooleanIndicates whether the manager should default the cell widthsbooleanIndicates whether header columns (th for tables) should be rendered for every other item (alternating)booleanIndicates whether the first row of items rendered should all be rendered as table header (th) cellsbooleanIndicates whether the first cell of each row should be rendered as a header cell (th)booleanIndicates whether the number of columns for the table data should match the number of fields given in the container's items list (so that each field takes up one column without wrapping), this overrides the configured numberOfColumnsvoidperformFinalize(Object model, LifecycleElement parent) The following finalization is performed: If suppressLineWrapping is true, sets the number of columns to the container's items list size Adjust the cell attributes for the container items The last phase before the view is renderedvoidsetApplyAlternatingRowStyles(boolean applyAlternatingRowStyles) Setter for the alternating row styles indicatorvoidsetApplyDefaultCellWidths(boolean applyDefaultCellWidths) Setter for the default cell width indicatorprotected voidsetCellAttributes(Component component) Moves the width, align, and valign settings of the component to the corresponding cell properties (if not already configured)voidsetNumberOfColumns(int numberOfColumns) Setter for the number of columns (each row)voidsetRenderAlternatingHeaderColumns(boolean renderAlternatingHeaderColumns) Setter for the render alternating header columns indicatorvoidsetRenderFirstRowHeader(boolean renderFirstRowHeader) Setter for the first row as header indicatorvoidsetRenderRowFirstCellHeader(boolean renderRowFirstCellHeader) Setter for render first row column as header indicatorvoidsetRowCssClasses(List<String> rowCssClasses) voidsetRowDataAttributes(List<String> rowDataAttributes) voidsetSuppressLineWrapping(boolean suppressLineWrapping) Setter for the suppressLineWrapping indicatorMethods 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, performApplyModel, performInitialization, 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.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, performApplyModel, performInitialization, pushAllToContext, pushObjectToContext, setContainerIdSuffix, setContext, setId, setPhasePathMapping, setRender, setViewPath, setViewStatus, skipLifecycleMethods inherited from interface org.kuali.rice.krad.datadictionary.uif.UifDictionaryBean
getExpressionGraph, getPropertyExpression, getPropertyExpressions, setExpressionGraph, setPropertyExpressions
-
Constructor Details
-
GridLayoutManagerBase
public GridLayoutManagerBase()
-
-
Method Details
-
performFinalize
The following finalization is performed:- If suppressLineWrapping is true, sets the number of columns to the container's items list size
- Adjust the cell attributes for the container items
Here 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 dataparent- - parent component
-
setCellAttributes
Moves the width, align, and valign settings of the component to the corresponding cell properties (if not already configured)- Parameters:
component- instance to adjust settings for
-
getSupportedContainer
Description copied from class:LayoutManagerBaseDefault Impl Determines whatContainerclasses are supported by theLayoutManager- Specified by:
getSupportedContainerin interfaceLayoutManager- Overrides:
getSupportedContainerin classLayoutManagerBase- Returns:
- Classinvalid input: '<'? extends Container> container class supported
- See Also:
-
getNumberOfColumns
public int getNumberOfColumns()Indicates the number of columns that should make up one row of dataIf the item count is greater than the number of columns, a new row will be created to render the remaining items (and so on until all items are placed).
Note this does not include any generated columns by the layout manager, so the final column count could be greater (if label fields are separate).
- Specified by:
getNumberOfColumnsin interfaceGridLayoutManager- Returns:
- int
-
setNumberOfColumns
public void setNumberOfColumns(int numberOfColumns) Setter for the number of columns (each row)- Specified by:
setNumberOfColumnsin interfaceGridLayoutManager- Parameters:
numberOfColumns-
-
isSuppressLineWrapping
public boolean isSuppressLineWrapping()Indicates whether the number of columns for the table data should match the number of fields given in the container's items list (so that each field takes up one column without wrapping), this overrides the configured numberOfColumnsIf set to true during the initialize phase the number of columns will be set to the size of the container's field list, if false the configured number of columns is used
- Specified by:
isSuppressLineWrappingin interfaceGridLayoutManager- Returns:
- true if the column count should match the container's field count, false to use the configured number of columns
-
setSuppressLineWrapping
public void setSuppressLineWrapping(boolean suppressLineWrapping) Setter for the suppressLineWrapping indicator- Specified by:
setSuppressLineWrappingin interfaceGridLayoutManager- Parameters:
suppressLineWrapping-
-
isApplyAlternatingRowStyles
public boolean isApplyAlternatingRowStyles()Indicates whether alternating row styles should be appliedIndicator to layout manager templates to apply alternating row styles. See the configured template for the actual style classes used
- Specified by:
isApplyAlternatingRowStylesin interfaceGridLayoutManager- Returns:
- true if alternating styles should be applied, false if all rows should have the same style
-
setApplyAlternatingRowStyles
public void setApplyAlternatingRowStyles(boolean applyAlternatingRowStyles) Setter for the alternating row styles indicator- Specified by:
setApplyAlternatingRowStylesin interfaceGridLayoutManager- Parameters:
applyAlternatingRowStyles-
-
isApplyDefaultCellWidths
public boolean isApplyDefaultCellWidths()Indicates whether the manager should default the cell widthsIf true, the manager will set the cell width by equally dividing by the number of columns
- Specified by:
isApplyDefaultCellWidthsin interfaceGridLayoutManager- Returns:
- true if default cell widths should be applied, false if no defaults should be applied
-
setApplyDefaultCellWidths
public void setApplyDefaultCellWidths(boolean applyDefaultCellWidths) Setter for the default cell width indicator- Specified by:
setApplyDefaultCellWidthsin interfaceGridLayoutManager- Parameters:
applyDefaultCellWidths-
-
isRenderRowFirstCellHeader
public boolean isRenderRowFirstCellHeader()Indicates whether the first cell of each row should be rendered as a header cell (th)When this flag is turned on, the first cell for each row will be rendered as a header cell. If
GridLayoutManager.isRenderAlternatingHeaderColumns()is false, the remaining cells for the row will be rendered as data cells, else they will alternate between cell headers- Specified by:
isRenderRowFirstCellHeaderin interfaceGridLayoutManager- Returns:
- true if first cell of each row should be rendered as a header cell
-
setRenderRowFirstCellHeader
public void setRenderRowFirstCellHeader(boolean renderRowFirstCellHeader) Setter for render first row column as header indicator- Specified by:
setRenderRowFirstCellHeaderin interfaceGridLayoutManager- Parameters:
renderRowFirstCellHeader-
-
isRenderFirstRowHeader
public boolean isRenderFirstRowHeader()Indicates whether the first row of items rendered should all be rendered as table header (th) cellsGenerally when using a grid layout all the cells will be tds or alternating th/td (with the label in the th cell). However in some cases it might be desired to display the labels in one row as table header cells (th) followed by a row with the corresponding fields in td cells. When this is enabled this type of layout is possible
- Specified by:
isRenderFirstRowHeaderin interfaceGridLayoutManager- Returns:
- true if first row should be rendered as header cells
-
setRenderFirstRowHeader
public void setRenderFirstRowHeader(boolean renderFirstRowHeader) Setter for the first row as header indicator- Specified by:
setRenderFirstRowHeaderin interfaceGridLayoutManager- Parameters:
renderFirstRowHeader-
-
isRenderAlternatingHeaderColumns
public boolean isRenderAlternatingHeaderColumns()Indicates whether header columns (th for tables) should be rendered for every other item (alternating)If true the first cell of each row will be rendered as an header, with every other cell in the row as a header
- Specified by:
isRenderAlternatingHeaderColumnsin interfaceGridLayoutManager- Returns:
- true if alternating headers should be rendered, false if not
-
setRenderAlternatingHeaderColumns
public void setRenderAlternatingHeaderColumns(boolean renderAlternatingHeaderColumns) Setter for the render alternating header columns indicator- Specified by:
setRenderAlternatingHeaderColumnsin interfaceGridLayoutManager- Parameters:
renderAlternatingHeaderColumns-
-
getRowCssClasses
List of styles for each row.Each entry in the list gives the style for the row with the same index. This style will be added to the <tr> tag when the table rows are rendered in the grid.tag. This is used to store the styles for newly added lines and other special cases like the add item row.
- Specified by:
getRowCssClassesin interfaceGridLayoutManager- Returns:
- list of styles for the rows
-
setRowCssClasses
- Specified by:
setRowCssClassesin interfaceGridLayoutManager- See Also:
-
getRowDataAttributes
List of data attributes for each row.Each entry in the list gives the data attributes for the row with the same index. These data attributes will be added to the <tr> tag when the table rows are rendered in the grid.tag. This is used to store the data attributes for newly added lines and other special cases like the add item row.
- Specified by:
getRowDataAttributesin interfaceGridLayoutManager- Returns:
- list of styles for the rows
-
setRowDataAttributes
- Specified by:
setRowDataAttributesin interfaceGridLayoutManager- See Also:
-