|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.zkoss.zk.ui.AbstractComponent
org.zkoss.zk.ui.HtmlBasedComponent
org.zkoss.zul.impl.XulElement
org.zkoss.zul.Row
public class Row
A single row in a Rows element.
Each child of the Row element is placed in each successive cell
of the grid. The row with the most child elements determines the number
of columns in each row.
Default getZclass(): z-row. (since 3.5.0)
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class org.zkoss.zk.ui.HtmlBasedComponent |
|---|
HtmlBasedComponent.ExtraCtrl |
| Nested classes/interfaces inherited from class org.zkoss.zk.ui.AbstractComponent |
|---|
AbstractComponent.Children |
| Field Summary |
|---|
| Fields inherited from class org.zkoss.zk.ui.HtmlBasedComponent |
|---|
_zclass, RS_NO_DISPLAY, RS_NO_HEIGHT, RS_NO_WIDTH |
| Fields inherited from class org.zkoss.zk.ui.AbstractComponent |
|---|
_visible |
| 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 | |
|---|---|
Row()
|
|
| Method Summary | |
|---|---|
void |
beforeChildAdded(Component newChild,
Component refChild)
Default: does nothing. |
void |
beforeParentChanged(Component parent)
Default: does nothing. |
java.lang.Object |
clone()
Clones the component. |
java.lang.String |
getAlign()
Returns the horizontal alignment of the whole row. |
java.lang.String |
getChildAttrs(int index)
Returns the HTML attributes for the child of the specified index. |
Detail |
getDetailChild()
Returns the child detail component. |
Detail |
getDetailChildApi()
Returns the child detail component. |
Grid |
getGrid()
Returns the grid that contains this row. |
Grid |
getGridApi()
Returns the grid that contains this row. |
Group |
getGroup()
Returns the group that this row belongs to, or null. |
Group |
getGroupApi()
Returns the group that this row belongs to, or null. |
java.lang.String |
getOuterAttrs()
Returns the exterior attributes for generating the enclosing HTML tag; never return null. |
protected java.lang.String |
getRealSclass()
Returns the real style class that will be generated to the client (when HtmlBasedComponent.getOuterAttrs() is called). |
protected java.lang.String |
getRealStyle()
Returns the real style that will be generated to client (when HtmlBasedComponent.getOuterAttrs() is called). |
protected int |
getRealStyleFlags()
Returns a combination of HtmlBasedComponent.RS_NO_WIDTH and HtmlBasedComponent.RS_NO_HEIGHT. |
java.lang.String |
getSclass()
Returns the style class. |
java.lang.String |
getSpans()
Returns the spans, which is a list of numbers separated by comma. |
java.lang.String |
getValign()
Returns the vertical alignment of the whole row. |
java.lang.Object |
getValue()
Returns the value. |
java.lang.String |
getZclass()
Returns the ZK Cascading Style class(es) for this component. |
boolean |
insertBefore(Component newChild,
Component refChild)
Inserts a child before the reference child. |
boolean |
isNowrap()
Returns the nowrap. |
void |
onChildRemoved(Component child)
Default: does nothing. |
void |
onDrawNewChild(Component child,
java.lang.StringBuffer out)
Called when a new-created child is about to render. |
void |
setAlign(java.lang.String align)
Sets the horizontal alignment of the whole row. |
void |
setNowrap(boolean nowrap)
Sets the nowrap. |
void |
setSclass(java.lang.String sclass)
Sets the CSS class. |
void |
setSpans(java.lang.String spans)
Sets the spans, which is a list of numbers separated by comma. |
void |
setStyle(java.lang.String style)
Sets the CSS style. |
void |
setValign(java.lang.String valign)
Sets the vertical alignment of the whole row. |
void |
setValue(java.lang.Object value)
Sets the value. |
boolean |
setVisible(boolean visible)
Sets whether this component is visible. |
| Methods inherited from class org.zkoss.zul.impl.XulElement |
|---|
getAction, getActionAttrs, getAllOnClickAttrs, getContext, getCtrlKeys, getInnerAttrs, getPopup, getTooltip, setAction, setContext, setContext, setCtrlKeys, setPopup, setPopup, setTooltip, setTooltip |
| Methods inherited from class org.zkoss.zk.ui.HtmlBasedComponent |
|---|
focus, getAllOnClickAttrs, getDraggable, getDroppable, getHeight, getLeft, getMoldSclass, getStyle, getTooltiptext, getTop, getWidth, getZindex, getZIndex, newExtraCtrl, redraw, setClass, setDraggable, setDroppable, setFocus, setHeight, setLeft, setMoldSclass, setTooltiptext, setTop, setWidth, setZclass, setZindex, setZIndex |
| Methods inherited from class java.lang.Object |
|---|
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface org.zkoss.zul.impl.api.XulElement |
|---|
getAction, getContext, getCtrlKeys, getPopup, getTooltip, setAction, setContext, setContext, setCtrlKeys, setPopup, setPopup, setTooltip, setTooltip |
| Methods inherited from interface org.zkoss.zk.ui.api.HtmlBasedComponent |
|---|
focus, getHeight, getLeft, getStyle, getTooltiptext, getTop, getWidth, getZindex, getZIndex, setDraggable, setDroppable, setFocus, setHeight, setLeft, setTooltiptext, setTop, setWidth, setZclass, setZindex, setZIndex |
| Constructor Detail |
|---|
public Row()
| Method Detail |
|---|
public Detail getDetailChild()
public Detail getDetailChildApi()
getDetailChildApi in interface Rowpublic Grid getGrid()
public Grid getGridApi()
getGridApi in interface Rowpublic java.lang.String getAlign()
Default: null (system default: left unless CSS specified).
getAlign in interface Rowpublic void setAlign(java.lang.String align)
setAlign in interface Rowpublic boolean isNowrap()
Default: null (system default: wrap).
isNowrap in interface Rowpublic void setNowrap(boolean nowrap)
setNowrap in interface Rowpublic java.lang.String getValign()
Default: null (system default: top).
getValign in interface Rowpublic void setValign(java.lang.String valign)
setValign in interface Rowpublic boolean setVisible(boolean visible)
Component
setVisible in interface ComponentsetVisible in class AbstractComponentpublic java.lang.Object getValue()
Default: null.
Note: the value is application dependent, you can place whatever value you want.
getValue in interface Rowpublic void setValue(java.lang.Object value)
setValue in interface Rowvalue - the value.
Note: the value is application dependent, you can place whatever value you want.
public java.lang.String getSpans()
Default: empty.
getSpans in interface Row
public void setSpans(java.lang.String spans)
throws WrongValueException
For example, "1,2,3" means the second column will span two columns and the following column span three columns, while others occupies one column.
setSpans in interface RowWrongValueExceptionprotected java.lang.String getRealSclass()
HtmlBasedComponentHtmlBasedComponent.getOuterAttrs() is called).
Default: it simply returns the catenation of HtmlBasedComponent.getSclass()
and HtmlBasedComponent.getZclass() (since 3.5.0).
Derived classes might override it to provide, say, dual style classes. For example,
final String sclass = getSclass();
return sclass != null ? sclass + " my-addon": "myaddon";
getRealSclass in class HtmlBasedComponentHtmlBasedComponent.getZclass()public java.lang.String getZclass()
HtmlBasedComponentDefault: 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 interface HtmlBasedComponentgetZclass in class HtmlBasedComponentHtmlBasedComponent.getSclass(),
HtmlBasedComponent.getRealSclass()protected java.lang.String getRealStyle()
HtmlBasedComponentHtmlBasedComponent.getOuterAttrs() is called).
Default: this method will append width, height and others
to HtmlBasedComponent.setStyle(java.lang.String) (never null).
Use HtmlBasedComponent.getRealStyleFlags() to control what attributes to
exclude.
getRealStyle in class HtmlBasedComponentpublic Group getGroup()
public Group getGroupApi()
getGroupApi in interface Rowpublic java.lang.String getChildAttrs(int index)
protected int getRealStyleFlags()
HtmlBasedComponentHtmlBasedComponent.RS_NO_WIDTH and HtmlBasedComponent.RS_NO_HEIGHT.
Default: return 0.
getRealStyleFlags in class HtmlBasedComponentpublic java.lang.String getOuterAttrs()
HtmlBasedComponentUsed only by component developers.
Default: Generates the tooltip text, style, sclass, draggable
and droppable attribute if necessary.
In other words, the corresponding attribute is generated if
HtmlBasedComponent.getTooltiptext(), HtmlBasedComponent.getRealStyle(),
HtmlBasedComponent.getSclass(), HtmlBasedComponent.getDraggable(), HtmlBasedComponent.getDroppable()
are defined.
You have to call both HtmlBasedComponent.getOuterAttrs() and
HtmlBasedComponent.getInnerAttrs() to generate complete attributes.
For simple components that all attributes are put on the outest HTML element, all you need is as follows.
<xx id="${self.uuid}"${self.outerAttrs}${self.innerAttrs}>
If you want to put attributes in a nested HTML element, you
shall use the following pattern. Notice: if HtmlBasedComponent.getInnerAttrs()
in a different tag, the tag must be named with "${self.uuid}!real".
<xx id="${self.uuid}"${self.outerAttrs}>
<yy id="${self.uuid}!real"${self.innerAttrs}>...
Note: This class handles non-deferrable event listeners automatically.
However, you have to invoke AbstractComponent.appendAsapAttr(java.lang.StringBuffer, java.lang.String) for each event
the component handles in HtmlBasedComponent.getOuterAttrs() as follows.
appendAsapAttr(sb, Events.ON_OPEN);
appendAsapAttr(sb, Events.ON_CHANGE);
Theorectically, you could put any attributes in either
HtmlBasedComponent.getInnerAttrs() or HtmlBasedComponent.getOuterAttrs().
However, zkau.js assumes all attributes are put at the outer one.
If you want something different, you have to provide your own
setAttr (refer to how checkbox is implemented).
getOuterAttrs in class XulElementpublic void setStyle(java.lang.String style)
HtmlBasedComponent
setStyle in interface HtmlBasedComponentsetStyle in class HtmlBasedComponentpublic void setSclass(java.lang.String sclass)
HtmlBasedComponent
setSclass in interface HtmlBasedComponentsetSclass in class HtmlBasedComponentHtmlBasedComponent.setZclass(java.lang.String)public java.lang.String getSclass()
setSclass(java.lang.String) is called with non-empty value.
getSclass in interface HtmlBasedComponentgetSclass in class HtmlBasedComponentHtmlBasedComponent.getRealSclass(),
HtmlBasedComponent.getZclass()public void beforeParentChanged(Component parent)
AbstractComponent
beforeParentChanged in interface ComponentCtrlbeforeParentChanged in class AbstractComponentparent - the new parent. If null, it means detachment.ComponentCtrl.beforeParentChanged(org.zkoss.zk.ui.Component)
public void beforeChildAdded(Component newChild,
Component refChild)
AbstractComponent
beforeChildAdded in interface ComponentCtrlbeforeChildAdded in class AbstractComponentnewChild - the child to be added (never null).refChild - another child component that the new child
will be inserted before it. If null, the new child will be the
last child.ComponentCtrl.beforeChildAdded(org.zkoss.zk.ui.Component, org.zkoss.zk.ui.Component)
public boolean insertBefore(Component newChild,
Component refChild)
ComponentYou could use Component.setParent(org.zkoss.zk.ui.Component) or Component.appendChild(org.zkoss.zk.ui.Component)
instead of this method, unless
you want to control where to put the child.
Note: Component.setParent(org.zkoss.zk.ui.Component) always calls back Component.insertBefore(org.zkoss.zk.ui.Component, org.zkoss.zk.ui.Component)
and/or Component.removeChild(org.zkoss.zk.ui.Component),
while Component.insertBefore(org.zkoss.zk.ui.Component, org.zkoss.zk.ui.Component) and Component.removeChild(org.zkoss.zk.ui.Component)
always calls back Component.setParent(org.zkoss.zk.ui.Component),
if the parent is changed. Thus, you don't need to override
both Component.insertBefore(org.zkoss.zk.ui.Component, org.zkoss.zk.ui.Component) and Component.setParent(org.zkoss.zk.ui.Component), if you want
to customize the behavior.
insertBefore in interface ComponentinsertBefore in class AbstractComponentnewChild - the new child to be inserted.refChild - the child before which you want the new child
being inserted. If null, the new child is append to the end.
public void onChildRemoved(Component child)
AbstractComponent
onChildRemoved in interface ComponentCtrlonChildRemoved in class AbstractComponentComponentCtrl.onChildRemoved(org.zkoss.zk.ui.Component)public java.lang.Object clone()
Component
clone in interface Componentclone in class AbstractComponent
public void onDrawNewChild(Component child,
java.lang.StringBuffer out)
throws java.io.IOException
ComponentCtrlIt is called in the redrawing phase by the kernel, so it is too late
to call Component.invalidate() or ComponentCtrl.smartUpdate(java.lang.String, java.lang.String) in this method.
Note: ComponentCtrl.onChildAdded(org.zkoss.zk.ui.Component) is called in the request-processing
phase, while ComponentCtrl.onDrawNewChild(org.zkoss.zk.ui.Component, java.lang.StringBuffer) is called in the redrawing phase.
Component developer might do one of the follows:
ComponentCtrl.onDrawNewChild(org.zkoss.zk.ui.Component, java.lang.StringBuffer) to add special tags, if
new child needs to be added an exterior with some tags before
insertion.ComponentCtrl.onChildAdded(org.zkoss.zk.ui.Component) and calls Component.invalidate()
onDrawNewChild in interface ComponentCtrlonDrawNewChild in class AbstractComponentchild - the child being renderedout - the rendered result of the child.
java.io.IOException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||