public class Box extends XulElement
Default getZclass()
: z-vbox.(since 3.5.0)
HtmlBasedComponent.ExtraCtrl
AbstractComponent.Children
_zclass
APPLICATION_SCOPE, COMPONENT_SCOPE, DESKTOP_SCOPE, PAGE_SCOPE, REQUEST_SCOPE, SESSION_SCOPE, SPACE_SCOPE
CE_BUSY_IGNORE, CE_DUPLICATE_IGNORE, CE_IMPORTANT, CE_NON_DEFERRABLE, CE_REPEAT_IGNORE
Constructor and Description |
---|
Box()
Default: vertical (
Vbox ). |
Box(Component[] children)
Constructor a box by assigning an array of children.
|
Box(java.lang.String orient) |
Box(java.lang.String orient,
Component[] children)
Constructor a box by assigning an array of children.
|
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getAlign()
Returns the alignment of cells of a box in the 'opposite' direction
(null, start, center, end).
|
java.lang.String |
getHeights()
Deprecated.
As of release 5.0.0, use
Cell instead. |
java.lang.String |
getOrient()
Returns the orient (the same as
AbstractComponent.getMold() ). |
java.lang.String |
getPack()
Returns the pack alignment of cells of this box
(start, center, end) plus an indication stretch option.
|
java.lang.String |
getSpacing()
Returns the spacing between adjacent children, or null if the default
spacing is used.
|
java.lang.String |
getWidths()
Deprecated.
As of release 5.0.0, use
Cell instead. |
java.lang.String |
getZclass()
Returns the ZK Cascading Style class(es) for this component.
|
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(ContentRenderer renderer)
Renders the content of this component, excluding the enclosing
tags and children.
|
void |
setAlign(java.lang.String align)
Sets the alignment of cells of this box in the 'opposite' direction
(start, center, end, stretch).
|
void |
setHeights(java.lang.String heights)
Deprecated.
As of release 5.0.0, use
Cell instead. |
void |
setOrient(java.lang.String orient)
Sets the orient.
|
void |
setPack(java.lang.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(java.lang.String spacing)
Sets the spacing between adjacent children.
|
void |
setWidths(java.lang.String widths)
Deprecated.
As of release 5.0.0, use
Cell instead. |
clone, getContext, getCtrlKeys, getPopup, getPropertyAccess, getTooltip, setContext, setContext, setCtrlKeys, setPopup, setPopup, setTooltip, setTooltip
focus, getAction, getDraggable, getDroppable, getExtraCtrl, getHeight, getHflex, getLeft, getRenderdefer, getSclass, getStyle, getTooltiptext, getTop, getVflex, getWidth, getZindex, getZIndex, service, setAction, setClass, setDraggable, setDroppable, setFocus, setHeight, setHeightDirectly, setHflex, setHflexDirectly, setLeft, setLeftDirectly, setRenderdefer, setSclass, setStyle, setTooltiptext, setTop, setTopDirectly, setVflex, setWidth, setWidthDirectly, setZclass, setZindex, setZIndex, setZIndexDirectly
addAnnotation, addAnnotation, 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, equals, getAnnotatedProperties, getAnnotatedPropertiesBy, getAnnotation, getAnnotation, getAnnotations, getAnnotations, getAnnotations, getAttribute, getAttribute, getAttribute, getAttributeOrFellow, getAttributes, getAttributes, getAuService, getAutag, 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, getShadowRoots, 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, isChildable, isInvalidated, isListenerAvailable, isVisible, onChildAdded, onChildRemoved, onPageAttached, onPageDetached, onWrongValue, query, queryAll, redraw, redrawChildren, removeAttribute, removeAttribute, removeAttribute, 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(java.lang.String orient)
orient
- either "horizontal" or "vertical".public Box(Component[] children)
children
- an array of children to be addedpublic Box(java.lang.String orient, Component[] children)
children
- an array of children to be addedpublic boolean isHorizontal()
public boolean isVertical()
public java.lang.String getOrient()
AbstractComponent.getMold()
).
Default: "vertical".
public void setOrient(java.lang.String orient) throws WrongValueException
orient
- either "horizontal" or "vertical".WrongValueException
public java.lang.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(java.lang.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 java.lang.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(java.lang.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 java.lang.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(java.lang.String pack)
pack
- the alignment. Allowed values: (start, center, end) plus an
stretch option. If empty or null, it defaults to "start".getPack()
public java.lang.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 java.lang.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(java.lang.String widths) throws 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.
WrongValueException
public void setHeights(java.lang.String heights) throws WrongValueException
Cell
instead.It is the same as setWidths(java.lang.String)
.
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 void renderProperties(ContentRenderer renderer) throws java.io.IOException
HtmlBasedComponent
renderProperties
in class XulElement
java.io.IOException
public java.lang.String getZclass()
HtmlBasedComponent
AbstractComponent.getMold()
).
Default: null (the default value depends on element).
HtmlBasedComponent.setZclass(java.lang.String)
) will completely replace the default style
of a component. In other words, the default style of a component
is associated with the default value of HtmlBasedComponent.getZclass()
.
Once it is changed, the default style won't be applied at all.
If you want to perform small adjustments, use HtmlBasedComponent.setSclass(java.lang.String)
instead.
getZclass
in class HtmlBasedComponent
HtmlBasedComponent.getSclass()
Copyright © 2005-2011 Potix Corporation. All Rights Reserved.