org.zkoss.zul
Class Box

java.lang.Object
  extended by org.zkoss.zk.ui.AbstractComponent
      extended by org.zkoss.zk.ui.HtmlBasedComponent
          extended by org.zkoss.zul.impl.XulElement
              extended by org.zkoss.zul.Box
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, org.zkoss.zk.ui.Component, org.zkoss.zk.ui.sys.ComponentCtrl
Direct Known Subclasses:
Hbox, Vbox

public class Box
extends XulElement

A box.

Author:
tomyeh
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class org.zkoss.zk.ui.HtmlBasedComponent
org.zkoss.zk.ui.HtmlBasedComponent.ExtraCtrl
 
Field Summary
 
Fields inherited from class org.zkoss.zk.ui.HtmlBasedComponent
RS_NO_DISPLAY, RS_NO_HEIGHT, RS_NO_WIDTH
 
Fields inherited from interface org.zkoss.zk.ui.Component
APPLICATION_SCOPE, COMPONENT_SCOPE, DESKTOP_SCOPE, PAGE_SCOPE, REQUEST_SCOPE, SESSION_SCOPE, SPACE_SCOPE
 
Constructor Summary
Box()
          Default: vertical (Vbox).
Box(org.zkoss.zk.ui.Component[] children)
          Constructor a box by assigning an array of children.
Box(java.lang.String orient)
           
Box(java.lang.String orient, org.zkoss.zk.ui.Component[] children)
          Constructor a box by assigning an array of children.
 
Method Summary
 java.lang.String getChildInnerAttrs(org.zkoss.zk.ui.Component child)
          Returns the inner attributes used to wrap the children (never null).
 java.lang.String getChildOuterAttrs(org.zkoss.zk.ui.Component child)
          Returns the outer attributes used to wrap the children (never null).
 java.lang.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.
 java.lang.String getOrient()
          Returns the orient (the same as AbstractComponent.getMold()).
 java.lang.String getSpacing()
          Returns the spacing.
 java.lang.String getValign()
          Returns the vertical alignment of the adjacent cells of a box.
 java.lang.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.
 void onDrawNewChild(org.zkoss.zk.ui.Component child, java.lang.StringBuffer out)
           
 void setHeights(java.lang.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.
 void setOrient(java.lang.String orient)
          Sets the orient.
 void setSpacing(java.lang.String spacing)
          Sets the spacing.
 void setValign(java.lang.String valign)
          Sets the vertical alignment of the adjacent cells of a box.
 void setWidths(java.lang.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.
 
Methods inherited from class org.zkoss.zul.impl.XulElement
getAction, getAllOnClickAttrs, getContext, getInnerAttrs, getOuterAttrs, getPopup, getTooltip, setAction, setContext, setPopup, setTooltip
 
Methods inherited from class org.zkoss.zk.ui.HtmlBasedComponent
addEventListener, appendAsapAttr, focus, getDraggable, getDroppable, getHeight, getLeft, getRealStyle, getRealStyleFlags, getSclass, getStyle, getTooltiptext, getTop, getWidth, getZIndex, isAsapRequired, newExtraCtrl, removeEventListener, setClass, setDraggable, setDroppable, setHeight, setLeft, setSclass, setStyle, setTooltiptext, setTop, setWidth, setZIndex
 
Methods inherited from class org.zkoss.zk.ui.AbstractComponent
addAnnotation, addAnnotation, addEventHandler, addSharedAnnotationMap, addSharedEventHandlerMap, appendChild, applyProperties, clone, containsVariable, detach, equals, getAnnotatedProperties, getAnnotatedPropertiesBy, getAnnotation, getAnnotation, getAnnotations, getAnnotations, getAttribute, getAttribute, getAttributes, getAttributes, getChildren, getDefinition, getDesktop, getEventHandler, getExtraCtrl, getFellow, getFellowIfAny, getId, getListenerIterator, getMold, getMoldURI, getNamespace, getPage, getParent, getPropagatee, getRoot, getSpaceOwner, getUuid, getVariable, insertBefore, invalidate, isChildable, isListenerAvailable, isVisible, onChildAdded, onChildRemoved, onWrongValue, redraw, removeAttribute, removeAttribute, removeChild, response, sessionDidActivate, sessionWillPassivate, setAttribute, setAttribute, setComponentDefinition, setId, setMold, setPage, setParent, setVariable, setVisible, smartUpdate, smartUpdate, smartUpdate, toString, unsetVariable
 
Methods inherited from class java.lang.Object
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Box

public Box()
Default: vertical (Vbox).


Box

public Box(java.lang.String orient)
Parameters:
orient - either "horizontal" or "vertical".

Box

public Box(org.zkoss.zk.ui.Component[] children)
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(java.lang.String orient,
           org.zkoss.zk.ui.Component[] children)
Constructor a box by assigning an array of children.

Parameters:
children - an array of children to be added
Since:
2.4.0
Method Detail

getOrient

public java.lang.String getOrient()
Returns the orient (the same as AbstractComponent.getMold()).

Default: "vertical".


setOrient

public void setOrient(java.lang.String orient)
               throws org.zkoss.zk.ui.WrongValueException
Sets the orient.

Parameters:
orient - either "horizontal" or "vertical".
Throws:
org.zkoss.zk.ui.WrongValueException

getSpacing

public java.lang.String getSpacing()
Returns the spacing.

Default: null (depending on CSS).


setSpacing

public void setSpacing(java.lang.String spacing)
Sets the spacing.

Parameters:
spacing - the spacing (such as "0", "5px", "3pt" or "1em")

getValign

public java.lang.String getValign()
Returns the vertical alignment of the adjacent cells of a box. It is meaningful only if getOrient() is horizontal (i.e., Hbox).

Default: top.


setValign

public void setValign(java.lang.String valign)
Sets the vertical alignment of the adjacent cells of a box.

Parameters:
valign - the vertical alignment: top, middle and bottom. If empty or null, the system default is used (usually middle).

getWidths

public java.lang.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. If 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.


getHeights

public java.lang.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. If 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.


setWidths

public void setWidths(java.lang.String widths)
               throws org.zkoss.zk.ui.WrongValueException
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 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.

Throws:
org.zkoss.zk.ui.WrongValueException

setHeights

public void setHeights(java.lang.String heights)
                throws org.zkoss.zk.ui.WrongValueException
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 setWidths(java.lang.String).

Throws:
org.zkoss.zk.ui.WrongValueException

getChildOuterAttrs

public java.lang.String getChildOuterAttrs(org.zkoss.zk.ui.Component child)
Returns the outer attributes used to wrap the children (never null). It is used only for the vertical layout.


getChildInnerAttrs

public java.lang.String getChildInnerAttrs(org.zkoss.zk.ui.Component child)
Returns the inner attributes used to wrap the children (never null). Used only by component development to generate HTML tags.


onDrawNewChild

public void onDrawNewChild(org.zkoss.zk.ui.Component child,
                           java.lang.StringBuffer out)
                    throws java.io.IOException
Specified by:
onDrawNewChild in interface org.zkoss.zk.ui.Component
Overrides:
onDrawNewChild in class org.zkoss.zk.ui.AbstractComponent
Throws:
java.io.IOException


Copyright © 2005-2007 Potix Corporation. All Rights Reserved.