public class Box extends XulElement
Default getZclass()
: z-vbox.(since 3.5.0)
Constructor and Description |
---|
Box()
Default: vertical (
Vbox ). |
Box(org.zkoss.zk.ui.Component[] children)
Constructor a box by assigning an array of children.
|
Box(String orient) |
Box(String orient,
org.zkoss.zk.ui.Component[] children)
Constructor a box by assigning an array of children.
|
Modifier and Type | Method and Description |
---|---|
protected boolean |
evalCSSFlex() |
String |
getAlign()
Returns the alignment of cells of a box in the 'opposite' direction
(null, start, center, end).
|
String |
getHeights()
Deprecated.
As of release 5.0.0, use
Cell instead. |
String |
getOrient()
Returns the orient (the same as
AbstractComponent.getMold() ). |
String |
getPack()
Returns the pack alignment of cells of this box
(start, center, end) plus an indication stretch option.
|
String |
getSpacing()
Returns the spacing between adjacent children, or null if the default
spacing is used.
|
String |
getWidths()
Deprecated.
As of release 5.0.0, use
Cell instead. |
String |
getZclass() |
boolean |
isHorizontal()
Returns whether it is a horizontal box.
|
boolean |
isSizedByContent()
Returns whether sizing the cell's size by its content.
|
boolean |
isVertical()
Returns whether it is a vertical box.
|
protected void |
renderProperties(org.zkoss.zk.ui.sys.ContentRenderer renderer) |
void |
setAlign(String align)
Sets the alignment of cells of this box in the 'opposite' direction
(start, center, end, stretch).
|
void |
setHeights(String heights)
Deprecated.
As of release 5.0.0, use
Cell instead. |
void |
setOrient(String orient)
Sets the orient.
|
void |
setPack(String pack)
Sets the alignment of cells of this box
(start, center, end) plus an stretch option.
|
void |
setSizedByContent(boolean byContent)
Sets whether sizing the cell's size by its content.
|
void |
setSpacing(String spacing)
Sets the spacing between adjacent children.
|
void |
setWidths(String widths)
Deprecated.
As of release 5.0.0, use
Cell instead. |
clone, getContext, getCtrlKeys, getPopup, getPropertyAccess, getTooltip, setContext, setContext, setContextAttributes, setCtrlKeys, setPopup, setPopup, setPopupAttributes, setTooltip, setTooltip, setTooltipAttributes
addSclass, focus, getAction, getDraggable, getDroppable, getExtraCtrl, getHeight, getHflex, getLeft, getRenderdefer, getSclass, getStyle, getTabindex, getTabindexInteger, getTooltiptext, getTop, getVflex, getWidth, getZindex, getZIndex, removeSclass, removeSclass, service, setAction, setClass, setDraggable, setDroppable, setFocus, setHeight, setHeight0, setHeightDirectly, setHflex, setHflex0, setHflexDirectly, setLeft, setLeftDirectly, setRenderdefer, setSclass, setStyle, setTabindex, setTabindex, setTooltiptext, setTop, setTopDirectly, setVflex, setVflex0, setVflexDirectly, setWidth, setWidth0, setWidthDirectly, setZclass, setZindex, setZIndex, setZIndexDirectly
addAnnotation, addAnnotation, addCallback, addClientEvent, addEventHandler, addEventListener, addEventListener, addForward, addForward, addForward, addForward, addMoved, addRedrawCallback, addScopeListener, addShadowRoot, addShadowRootBefore, addSharedEventHandlerMap, appendChild, applyProperties, beforeChildAdded, beforeChildRemoved, beforeParentChanged, detach, didActivate, didActivate, didDeserialize, didDeserialize, disableBindingAnnotation, disableClientUpdate, enableBindingAnnotation, getAnnotatedProperties, getAnnotatedPropertiesBy, getAnnotation, getAnnotation, getAnnotations, getAnnotations, getAnnotations, getAttribute, getAttribute, getAttribute, getAttributeOrFellow, getAttributes, getAttributes, getAuService, getAutag, getCallback, getChildren, getClientAttribute, getClientDataAttribute, getClientEvents, getDefaultMold, getDefinition, getDesktop, getEventHandler, getEventHandlerNames, getEventListenerMap, getEventListeners, getFellow, getFellow, getFellowIfAny, getFellowIfAny, getFellows, getFirstChild, getId, getLastChild, getListenerIterator, getMold, getNextSibling, getPage, getParent, getPreviousSibling, getRedrawCallback, getRoot, getShadowFellowIfAny, getShadowRoots, getShadowVariable, getShadowVariable, getShadowVariable0, getSpaceOwner, getSpecialRendererOutput, getStubonly, getSubBindingAnnotationCount, getTemplate, getTemplateNames, getUuid, getWidgetAttribute, getWidgetAttributeNames, getWidgetClass, getWidgetListener, getWidgetListenerNames, getWidgetOverride, getWidgetOverrideNames, hasAttribute, hasAttribute, hasAttribute, hasAttributeOrFellow, hasBindingAnnotation, hasFellow, hasFellow, hasSubBindingAnnotation, insertBefore, invalidate, invalidatePartial, isChildable, isInvalidated, isListenerAvailable, isVisible, onChildAdded, onChildRemoved, onPageAttached, onPageDetached, onWrongValue, query, queryAll, redraw, redrawChildren, removeAttribute, removeAttribute, removeAttribute, removeCallback, removeChild, removeEventListener, removeForward, removeForward, removeRedrawCallback, removeScopeListener, removeShadowRoot, render, render, render, replace, response, response, response, service, sessionDidActivate, sessionWillPassivate, setAttribute, setAttribute, setAttribute, setAuService, setAutag, setClientAttribute, setClientDataAttribute, setDefinition, setDefinition, setId, setMold, setPage, setPageBefore, setParent, setStubonly, setStubonly, setSubBindingAnnotationCount, setTemplate, setVisible, setVisibleDirectly, setWidgetAttribute, setWidgetClass, setWidgetListener, setWidgetOverride, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdateWidgetListener, smartUpdateWidgetOverride, toString, updateByClient, updateSubBindingAnnotationCount, willPassivate, willPassivate, willSerialize, willSerialize
public Box()
Vbox
).public Box(String orient)
orient
- either "horizontal" or "vertical".public Box(org.zkoss.zk.ui.Component[] children)
children
- an array of children to be addedpublic Box(String orient, org.zkoss.zk.ui.Component[] children)
children
- an array of children to be addedpublic boolean isHorizontal()
public boolean isVertical()
public String getOrient()
AbstractComponent.getMold()
).
Default: "vertical".
public void setOrient(String orient) throws org.zkoss.zk.ui.WrongValueException
orient
- either "horizontal" or "vertical".org.zkoss.zk.ui.WrongValueException
public String getSpacing()
The default spacing depends on the definition of the style class called "xxx-sp", where xxx is
HtmlBasedComponent.getSclass()
if it is not null.HtmlBasedComponent.getSclass()
is null and it is a horizontal box.HtmlBasedComponent.getSclass()
is null and it is a vertical box.Default: null (means to use the default spacing).
public void setSpacing(String spacing)
spacing
- the spacing (such as "0", "5px", "3pt" or "1em").
If null, empty ("") or "auto", the default spacing is used (i.e.,
controlled by CSS alone)getSpacing()
public String getAlign()
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 aligned horizontally. The pack attribute
(getPack()
) is
related to the alignment but is used to specify the position in the
opposite direction.
public void setAlign(String align)
Refer to getAlign()
for more information
align
- the alignment in the 'opposite' direction.
Allowed values: start, center, end, stretch.
If empty or null, the browser's default is used
(IE center and FF left, if vertical).public String getPack()
Default: start.
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
(getAlign()
)is used to specify
the position in the opposite direction.
Splitter
child inside this Box,
then this Box behaves as if the pack attribute has been set the "stretch"
option; no matter you really specify "stretch" in pack attribute or not.
If you give null to the pack attribute, it is the same as "start". If simply
give "stretch" to this pack attribute then it is the same as "stretch,start"public void setPack(String pack)
pack
- the alignment. Allowed values: (start, center, end) plus an
stretch option. If empty or null, it defaults to "start".getPack()
public String getWidths()
Cell
instead.Hbox
(i.e., getOrient()
is horizontal),
it is a list of widths.
If Vbox
(i.e., getOrient()
is vertical),
it is a list of heights.
It is the same as getHeights()
.
Default: empty.
public String getHeights()
Cell
instead.Hbox
(i.e., getOrient()
is horizontal),
it is a list of widths.
If Vbox
(i.e., getOrient()
is vertical),
it is a list of heights.
It is the same as getWidths()
.
Default: empty.
public void setWidths(String widths) throws org.zkoss.zk.ui.WrongValueException
Cell
instead.It is the same as setHeights(java.lang.String)
.
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.
org.zkoss.zk.ui.WrongValueException
public void setHeights(String heights) throws org.zkoss.zk.ui.WrongValueException
Cell
instead.It is the same as setWidths(java.lang.String)
.
org.zkoss.zk.ui.WrongValueException
public void setSizedByContent(boolean byContent)
Default: true. It means the cell's size is depended on its content.
With Splitter
, you can specify the sizedByContent to be false
for resizing smoothly, if it contains a grid or other sophisticated
components.
byContent
- public boolean isSizedByContent()
Default: true.
setSizedByContent(boolean)
protected boolean evalCSSFlex()
evalCSSFlex
in class org.zkoss.zk.ui.HtmlBasedComponent
protected void renderProperties(org.zkoss.zk.ui.sys.ContentRenderer renderer) throws IOException
renderProperties
in class XulElement
IOException
public String getZclass()
getZclass
in class org.zkoss.zk.ui.HtmlBasedComponent
Copyright © 2019. All rights reserved.