| org.zkoss.zul.impl.XulElement org.zkoss.zul.Box
All known Subclasses: org.zkoss.zul.Hbox, org.zkoss.zul.Vbox,
Constructor Summary | |
public | Box() Default: vertical (
Vbox ). | public | Box(String orient) | public | Box(Component[] children) Constructor a box by assigning an array of children. | public | Box(String orient, Component[] children) Constructor a box by assigning an array of children. |
Method Summary | |
public String | getAlign() Returns the alignment of cells of a box in the 'opposite' direction
(null, start, center, end).
Default: start
The align attribute specifies how child elements of the box are aligned,
when the size of the box is larger than the total size of the children. | public String | getCaveAttrs() Returns the attributes used by the 'cave' element (never null). | public String | getChildInnerAttrs(Component child) Returns the inner attributes used to wrap the children (never null). | public String | getChildOuterAttrs(Component child) Returns the outer attributes used to wrap the children (never null). | public String | getHeights() Returns the heights/widths, which is a list of numbers separated by comma
to denote the height/width of each cell in a box. | public String | getOrient() Returns the orient (the same as
Box.getMold ). | public String | getPack() Returns the alignment of cells of this box
(null, start, center, end).
Default: null.
The pack attribute specifies where child elements of the box are placed
when the box is larger that the size of the children. | public String | getSpacing() Returns the spacing between adjacent children, or null if the default
spacing is used. | public String | getValign() Returns the vertical alignment of the adjacent cells of a box
(top, middle or bottom). | public String | getWidths() Returns the widths/heights, which is a list of numbers separated by comma
to denote the width/height of each cell in a box. | public boolean | insertBefore(Component newChild, Component refChild) | public boolean | isHorizontal() Returns whether it is a horizontal box. | public boolean | isVertical() Returns whether it is a vertical box. | public void | onChildRemoved(Component child) | public void | onDrawNewChild(Component child, StringBuffer out) | public void | setAlign(String align) Sets the alignment of cells of this box in the 'opposite' direction
(null, start, center, end). | public void | setHeights(String heights) Sets the widths/heights, which is a list of numbers separated
by comma to denote the width/height of each cell in a box. | public void | setOrient(String orient) Sets the orient. | public void | setPack(String pack) Sets the alignment of cells of this box
(null, start, center, end).
Parameters: pack - the alignment. | public void | setSpacing(String spacing) Sets the spacing between adjacent children. | public void | setValign(String valign) Sets the vertical alignment of the adjacent cells of a box. | public void | setWidths(String widths) Sets the widths/heights, which is a list of numbers separated
by comma to denote the width/height of each cell in a box. |
Box | public Box(String orient)(Code) | | Parameters: orient - either "horizontal" or "vertical". |
Box | public Box(Component[] children)(Code) | | Constructor a box by assigning an array of children.
Parameters: children - an array of children to be added since: 2.4.0 |
Box | public Box(String orient, Component[] children)(Code) | | Constructor a box by assigning an array of children.
Parameters: children - an array of children to be added since: 2.4.0 |
getAlign | public String getAlign()(Code) | | Returns the alignment of cells of a box in the 'opposite' direction
(null, start, center, end).
Default: start
The align attribute specifies how child elements of the box are aligned,
when the size of the box is larger than the total size of the children. For
boxes that have horizontal orientation, it specifies how its children will
be aligned vertically. For boxes that have vertical orientation, it is used
to specify how its children are algined horizontally. The pack attribute
(
Box.getPack ) is
related to the alignment but is used to specify the position in the
opposite direction.
- start
- Child elements are aligned starting from the left or top edge of
the box. If the box is larger than the total size of the children, the
extra space is placed on the right or bottom side.
- center
- Extra space is split equally along each side of the child
elements, resulting in the children being placed in the center of the box.
- end
- Child elements are placed on the right or bottom edge of the box. If
the box is larger than the total size of the children, the extra space is
placed on the left or top side.
since: 3.0.0 |
getCaveAttrs | public String getCaveAttrs()(Code) | | Returns the attributes used by the 'cave' element (never null).
Used only by component development to generate HTML tags.
since: 3.0.0 |
getChildInnerAttrs | public String getChildInnerAttrs(Component child)(Code) | | Returns the inner attributes used to wrap the children (never null).
Used only by component development to generate HTML tags.
|
getChildOuterAttrs | public String getChildOuterAttrs(Component child)(Code) | | Returns the outer attributes used to wrap the children (never null).
It is used only for the vertical layout.
|
getHeights | public String getHeights()(Code) | | Returns the heights/widths, which is a list of numbers separated by comma
to denote the height/width of each cell in a box.
If
Hbox (i.e.,
Box.getOrient is horizontal),
it is a list of widths.
If
Vbox (i.e.,
Box.getOrient is vertical),
it is a list of heights.
It is the same as
Box.getWidths .
Default: empty.
|
getPack | public String getPack()(Code) | | Returns the alignment of cells of this box
(null, start, center, end).
Default: null.
The pack attribute specifies where child elements of the box are placed
when the box is larger that the size of the children. For boxes with
horizontal orientation, it is used to indicate the position of children
horizontally. For boxes with vertical orientation, it is used to indicate
the position of children vertically. The align attribute
(
Box.getAlign )is used to specify
the position in the opposite direction.
- start
- Child elements are aligned starting from the left or top edge of
the box. If the box is larger than the total size of the children, the
extra space is placed on the right or bottom side.
- center
- Extra space is split equally along each side of the child
elements, resulting in the children being placed in the center of the box.
- end
- Child elements are placed on the right or bottom edge of the box. If
the box is larger than the total size of the children, the extra space is
placed on the left or top side.
since: 3.0.0 |
getSpacing | public String getSpacing()(Code) | | Returns the spacing between adjacent children, or null if the default
spacing is used.
The default spacing depends on the definition of the style class
called "xxx-sp", where xxx is
-
Box.getSclass if it is not null.
- hbox if
Box.getSclass is null and it is a horizontal box.
- vbox if
Box.getSclass is null and it is a vertical box.
Default: null (means to use the default spacing).
|
getValign | public String getValign()(Code) | | Returns the vertical alignment of the adjacent cells of a box
(top, middle or bottom).
Default: null (i.e., use the browser default, usually middle).
Box.getAlignBox.getPack |
getWidths | public String getWidths()(Code) | | Returns the widths/heights, which is a list of numbers separated by comma
to denote the width/height of each cell in a box.
If
Hbox (i.e.,
Box.getOrient is horizontal),
it is a list of widths.
If
Vbox (i.e.,
Box.getOrient is vertical),
it is a list of heights.
It is the same as
Box.getHeights .
Default: empty.
|
isHorizontal | public boolean isHorizontal()(Code) | | Returns whether it is a horizontal box.
since: 3.0.0 |
isVertical | public boolean isVertical()(Code) | | Returns whether it is a vertical box.
since: 3.0.0 |
setAlign | public void setAlign(String align)(Code) | | Sets the alignment of cells of this box in the 'opposite' direction
(null, start, center, end).
Parameters: align - the alignment in the 'opposite' direction.Allowed values: start, center, end.If empty or null, the browser's default is used(IE center and FF left, if vertical). since: 3.0.0 |
setHeights | public void setHeights(String heights) throws WrongValueException(Code) | | Sets the widths/heights, which is a list of numbers separated
by comma to denote the width/height of each cell in a box.
It is the same as
Box.setWidths .
|
setPack | public void setPack(String pack)(Code) | | Sets the alignment of cells of this box
(null, start, center, end).
Parameters: pack - the alignment. Allowed values: start, center, end.If empty or null, the browser's default is used. since: 3.0.0 |
setSpacing | public void setSpacing(String spacing)(Code) | | Sets the spacing between adjacent children.
Parameters: spacing - the spacing (such as "0", "5px", "3pt" or "1em"),or null to use the default spacing See Also: Box.getSpacing |
setValign | public void setValign(String valign)(Code) | | Sets the vertical alignment of the adjacent cells of a box.
Parameters: valign - the vertical alignment: top, middle and bottom.Box.setAlignBox.setPack |
setWidths | public void setWidths(String widths) throws WrongValueException(Code) | | Sets the widths/heights, which is a list of numbers separated
by comma to denote the width/height of each cell in a box.
It is the same as
Box.setHeights .
For example, "10%,20%,30%" means the second cell shall
occupy 10% width, the second cell 20%, the third cell 30%,
and the following cells don't specify any width.
Note: the splitters are ignored, i.e., they are not cells.
Another example, ",,30%" means the third cell shall occupy
30% width, and the rest of cells don't specify any width.
Of course, the real widths depend on the interpretation of
the browser.
|
|
|