Class PercentLayoutTag
- java.lang.Object
-
- org.apache.commons.jelly.TagSupport
-
- net.sf.jguiraffe.gui.builder.components.tags.FormBaseTag
-
- net.sf.jguiraffe.gui.builder.components.tags.LayoutTag
-
- net.sf.jguiraffe.gui.builder.components.tags.PercentLayoutTag
-
- All Implemented Interfaces:
ConditionalTag
,org.apache.commons.jelly.Tag
public class PercentLayoutTag extends LayoutTag
A specific layout tag that creates a Percent Layout manager.
With this tag an instance of the powerful percent layout can be created and fully initialized. Configuration of the layout is done by nested tags that define cell constraints (
PercentColConstraintsTag
orPercentRowConstraintsTag
) and cell groups (PercentColGroupTag
orPercentRowGroupTag
). As an alternative, cell constraints can also be specified using the attributescolumns
androws
(which override constraints set by nested tags). These attributes can take strings that must match the format expected by percent layout. The constraints must be defined either as string attributes or by nested tags; a mixture of both is not allowed.As an additional attribute the
canShrink
attribute can be specified. It determines thecanShrink
property of thePercentLayout
created by this tag, i.e. the flag whether the layout can shrink below its preferred size. Default value is false.- Version:
- $Id: PercentLayoutTag.java 205 2012-01-29 18:29:57Z oheger $
- Author:
- Oliver Heger
-
-
Constructor Summary
Constructors Constructor Description PercentLayoutTag()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addColConstraints(CellConstraints c)
Adds the specified constraints object to the list of column constraints.void
addColGroup(CellGroup g)
Adds the specified cell group object to the list of column groups.void
addRowConstraints(CellConstraints c)
Adds the specified constraints object to the list of row constraints.void
addRowGroup(CellGroup g)
Adds the specified cell group object to the list of row groups.protected Object
createLayout(ComponentManager manager)
Creates the percent layout object.protected PercentLayoutBase
createPercentLayout()
Creates thePercentLayoutBase
object based on the data stored in this tag.Collection<CellConstraints>
getColConstraints()
Returns the collection with the column constraints.Collection<CellGroup>
getColGroups()
Returns the collection with the column groups definition.String
getColumns()
Returns the definition of column constraints as string.PercentLayoutBase
getPercentLayout()
Returns the percent layout object managed by this tag.Collection<CellConstraints>
getRowConstraints()
Returns the collection with the row constraints.Collection<CellGroup>
getRowGroups()
Returns the collection with the row groups definition.String
getRows()
Returns the definition of row constraints as string.boolean
isCanShrink()
Returns the value of thecanShrink
flag.void
setCanShrink(boolean canShrink)
Sets method of thecanShrink
attribute.void
setColumns(String columns)
Setter method of the columns attribute.void
setRows(String rows)
Setter method of the rows attribute.-
Methods inherited from class net.sf.jguiraffe.gui.builder.components.tags.FormBaseTag
canProcess, canProcess, convertToClass, convertToNumberWithUnit, convertToNumberWithUnit, doTag, findContainer, getBuilderData, getBuilderData, getIfName, getResourceText, getResourceText, getUnlessName, processBeforeBody, setIfName, setUnlessName
-
Methods inherited from class org.apache.commons.jelly.TagSupport
findAncestorWithClass, findAncestorWithClass, findAncestorWithClass, findAncestorWithClass, findAncestorWithClass, findAncestorWithClass, getBody, getBodyText, getBodyText, getContext, getParent, invokeBody, isEscapeText, isTrim, setBody, setContext, setEscapeText, setParent, setTrim, trimBody
-
-
-
-
Method Detail
-
getColumns
public String getColumns()
Returns the definition of column constraints as string.- Returns:
- the column constraints definition as string
-
setColumns
public void setColumns(String columns)
Setter method of the columns attribute.- Parameters:
columns
- the attribute value
-
getRows
public String getRows()
Returns the definition of row constraints as string.- Returns:
- the row constraints definition as string
-
setRows
public void setRows(String rows)
Setter method of the rows attribute.- Parameters:
rows
- the attribute value
-
isCanShrink
public boolean isCanShrink()
Returns the value of thecanShrink
flag.- Returns:
- the flag whether the layout can shrink below its preferred size
-
setCanShrink
public void setCanShrink(boolean canShrink)
Sets method of thecanShrink
attribute.- Parameters:
canShrink
- the attribute's value
-
getColGroups
public Collection<CellGroup> getColGroups()
Returns the collection with the column groups definition.- Returns:
- the column groups
-
getColConstraints
public Collection<CellConstraints> getColConstraints()
Returns the collection with the column constraints.- Returns:
- the column constraints
-
getRowConstraints
public Collection<CellConstraints> getRowConstraints()
Returns the collection with the row constraints.- Returns:
- the row constraints
-
getRowGroups
public Collection<CellGroup> getRowGroups()
Returns the collection with the row groups definition.- Returns:
- the row groups
-
addColConstraints
public void addColConstraints(CellConstraints c)
Adds the specified constraints object to the list of column constraints.- Parameters:
c
- the constraints
-
addRowConstraints
public void addRowConstraints(CellConstraints c)
Adds the specified constraints object to the list of row constraints.- Parameters:
c
- the constraints
-
addColGroup
public void addColGroup(CellGroup g)
Adds the specified cell group object to the list of column groups.- Parameters:
g
- the cell group
-
addRowGroup
public void addRowGroup(CellGroup g)
Adds the specified cell group object to the list of row groups.- Parameters:
g
- the cell group
-
getPercentLayout
public PercentLayoutBase getPercentLayout()
Returns the percent layout object managed by this tag.- Returns:
- the percent layout object
-
createLayout
protected Object createLayout(ComponentManager manager) throws FormBuilderException, org.apache.commons.jelly.MissingAttributeException
Creates the percent layout object.- Specified by:
createLayout
in classLayoutTag
- Parameters:
manager
- the component manager- Returns:
- the newly created layout object
- Throws:
org.apache.commons.jelly.MissingAttributeException
- if a required attribute is missingFormBuilderException
- if an error occurs
-
createPercentLayout
protected PercentLayoutBase createPercentLayout()
Creates thePercentLayoutBase
object based on the data stored in this tag.- Returns:
- the newly created layout object
-
-