public class GridLayoutManagerBase extends LayoutManagerBase implements GridLayoutManager
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.
componentCode, namespaceCode
Constructor and Description |
---|
GridLayoutManagerBase() |
Modifier and Type | Method and Description |
---|---|
int |
getNumberOfColumns()
Indicates the number of columns that should make up one row of data
|
List<String> |
getRowCssClasses()
List of styles for each row.
|
List<String> |
getRowDataAttributes()
List of data attributes for each row.
|
Class<? extends Container> |
getSupportedContainer()
Default Impl
Determines what
Container classes are supported by the
LayoutManager |
boolean |
isApplyAlternatingRowStyles()
Indicates whether alternating row styles should be applied
|
boolean |
isApplyDefaultCellWidths()
Indicates whether the manager should default the cell widths
|
boolean |
isRenderAlternatingHeaderColumns()
Indicates whether header columns (th for tables) should be rendered for
every other item (alternating)
|
boolean |
isRenderFirstRowHeader()
Indicates whether the first row of items rendered should all be rendered as table header (th) cells
|
boolean |
isRenderRowFirstCellHeader()
Indicates whether the first cell of each row should be rendered as a header cell (th)
|
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
numberOfColumns
|
void |
performFinalize(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 rendered
|
void |
setApplyAlternatingRowStyles(boolean applyAlternatingRowStyles)
Setter for the alternating row styles indicator
|
void |
setApplyDefaultCellWidths(boolean applyDefaultCellWidths)
Setter for the default cell width indicator
|
protected void |
setCellAttributes(Component component)
Moves the width, align, and valign settings of the component to the corresponding cell properties (if not
already configured)
|
void |
setNumberOfColumns(int numberOfColumns)
Setter for the number of columns (each row)
|
void |
setRenderAlternatingHeaderColumns(boolean renderAlternatingHeaderColumns)
Setter for the render alternating header columns indicator
|
void |
setRenderFirstRowHeader(boolean renderFirstRowHeader)
Setter for the first row as header indicator
|
void |
setRenderRowFirstCellHeader(boolean renderRowFirstCellHeader)
Setter for render first row column as header indicator
|
void |
setRowCssClasses(List<String> rowCssClasses) |
void |
setRowDataAttributes(List<String> rowDataAttributes) |
void |
setSuppressLineWrapping(boolean suppressLineWrapping)
Setter for the suppressLineWrapping indicator
|
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, skipLifecycle
getExpressionGraph, getPropertyExpression, getPropertyExpressions, setExpressionGraph, setPropertyExpressions
copy, dataDictionaryPostProcessing, getComponentCode, getNamespaceCode, setComponentCode, setNamespaceCode
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
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, performApplyModel, performInitialization, pushAllToContext, pushObjectToContext, setContainerIdSuffix, setContext, setId, setPhasePathMapping, setRender, setViewPath, setViewStatus, skipLifecycle
public GridLayoutManagerBase()
public void performFinalize(Object model, LifecycleElement parent)
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 dataparent
- - parent componentprotected void setCellAttributes(Component component)
component
- instance to adjust settings forpublic Class<? extends Container> getSupportedContainer()
LayoutManagerBase
Container
classes are supported by the
LayoutManager
getSupportedContainer
in interface LayoutManager
getSupportedContainer
in class LayoutManagerBase
LayoutManagerBase.getSupportedContainer()
public int getNumberOfColumns()
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).
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).
getNumberOfColumns
in interface GridLayoutManager
public void setNumberOfColumns(int numberOfColumns)
setNumberOfColumns
in interface GridLayoutManager
public boolean isSuppressLineWrapping()
If 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
isSuppressLineWrapping
in interface GridLayoutManager
public void setSuppressLineWrapping(boolean suppressLineWrapping)
setSuppressLineWrapping
in interface GridLayoutManager
public boolean isApplyAlternatingRowStyles()
Indicator to layout manager templates to apply alternating row styles. See the configured template for the actual style classes used
isApplyAlternatingRowStyles
in interface GridLayoutManager
public void setApplyAlternatingRowStyles(boolean applyAlternatingRowStyles)
setApplyAlternatingRowStyles
in interface GridLayoutManager
public boolean isApplyDefaultCellWidths()
If true, the manager will set the cell width by equally dividing by the number of columns
isApplyDefaultCellWidths
in interface GridLayoutManager
public void setApplyDefaultCellWidths(boolean applyDefaultCellWidths)
setApplyDefaultCellWidths
in interface GridLayoutManager
public boolean isRenderRowFirstCellHeader()
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
isRenderRowFirstCellHeader
in interface GridLayoutManager
public void setRenderRowFirstCellHeader(boolean renderRowFirstCellHeader)
setRenderRowFirstCellHeader
in interface GridLayoutManager
public boolean isRenderFirstRowHeader()
Generally 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
isRenderFirstRowHeader
in interface GridLayoutManager
public void setRenderFirstRowHeader(boolean renderFirstRowHeader)
setRenderFirstRowHeader
in interface GridLayoutManager
public boolean isRenderAlternatingHeaderColumns()
If true the first cell of each row will be rendered as an header, with every other cell in the row as a header
isRenderAlternatingHeaderColumns
in interface GridLayoutManager
public void setRenderAlternatingHeaderColumns(boolean renderAlternatingHeaderColumns)
setRenderAlternatingHeaderColumns
in interface GridLayoutManager
public List<String> getRowCssClasses()
Each entry in the list gives the style for the row with the same index. This style will be added to the
getRowCssClasses
in interface GridLayoutManager
public void setRowCssClasses(List<String> rowCssClasses)
setRowCssClasses
in interface GridLayoutManager
GridLayoutManager.getRowCssClasses()
public List<String> getRowDataAttributes()
Each entry in the list gives the data attributes for the row with the same index. These data attributes will be added to the
getRowDataAttributes
in interface GridLayoutManager
public void setRowDataAttributes(List<String> rowDataAttributes)
setRowDataAttributes
in interface GridLayoutManager
GridLayoutManager.getRowDataAttributes()
Copyright © 2005–2014 The Kuali Foundation. All rights reserved.