zul.mesh
Class MeshWidget

java.lang.Object
  extended by zk.Object
      extended by zk.Widget
          extended by zul.Widget
              extended by zul.mesh.MeshWidget
Direct Known Subclasses:
Grid, SelectWidget

public class MeshWidget
extends Widget

A skeletal implementation for a mesh widget.

See Also:
Grid, Tree, Listbox

Field Summary
 
Fields inherited from class zk.Widget
$weave, auDelay, autag, bindLevel, className, desktop, effects_, firstChild, id, insertingBefore_, inServer, lastChild, nChildren, nextSibling, parent, previousSibling, uuid, widgetName
 
Fields inherited from class zk.Object
$class, $oid
 
Method Summary
 void calcSize()
          Calculates the size.
 int getActivePage()
          Returns the active page (starting from 0).
 int getFocusCell(DOMElement el)
          Returns the index of the cell including the child got focus.
 HeadWidget getHeadWidget()
          Returns the self's head widget.
 String getInnerWidth()
          Returns the inner width of this component.
 int getPageCount()
          Returns the number of pages.
 int getPageSize()
          Returns the page size, aka., the number rows per page.
 Paging getPaginal()
          Returns the external Paging widget, if any.
 String getPagingPosition()
          Returns how to position the paging of the widget at the client screen.
 String getSpan()
          Return column span hint of this widget.
 boolean inPagingMold()
          Returns whether the widget is in paging mold.
 boolean isAutopaging()
          Returns whether turn on auto-paging facility when mold is "paging".
 boolean isModel()
          Returns whether the widget is in model mode or not.
 boolean isSizedByContent()
          Returns whether sizing the widget column width by its content.
 void setActivePage(int activePage)
          Sets the active page (starting from 0).
 void setAutopaging(boolean autopaging)
          Sets whether turn on auto-paging facility when mold is "paging".
 void setInnerWidth(String innerWidth)
          Sets the inner width of this component.
 void setModel(boolean inModel)
          Sets whether the widget is in model mode.
 void setPageSize(int pageSize)
          Sets the page size, aka., the number rows per page.
 void setPaginal(Paging paging)
          Sets the external Paging widget.
 void setPagingPosition(String pagingPosition)
          Sets how to position the paging of the widget at the client screen.
 void setSizedByContent(boolean byContent)
          Sets whether sizing the widget column width by its content.
 void setSpan(String span)
          Sets column span hint of this mesh widget.
 void syncSize()
          Synchronizes the size immediately.
 
Methods inherited from class zul.Widget
afterKeyDown_, beforeCtrlKeys_, getContext, getCtrlKeys, getOpenTooltip, getPopup, getTooltip, setContext, setContext, setCtrlKeys, setPopup, setPopup, setTooltip, setTooltip
 
Methods inherited from class zk.Widget
$, $f, $f, $f, $init, $n, $n, $o, afterAnima_, afterParentChanged_, appendChild, appendChild, beforeParentChanged_, beforeSendAU_, bind_, bind, bindChildren_, canActivate, cleanDrag_, clear, clearCache, cloneDrag_, deferRedrawHTML_, detach, doBlur_, doClick_, doDoubleClick_, doFocus_, doKeyDown_, doKeyPress_, doKeyUp_, domAttrs_, domClass_, domListen_, doMouseDown_, doMouseMove_, doMouseOut_, doMouseOver_, doMouseUp_, domStyle_, domTextStyleAttr_, domTooltiptext_, domUnlisten_, doRightClick_, doSelect_, doTooltipOut_, doTooltipOver_, dropEffect_, extraBind_, fire, fireX, focus_, focus, forcerender, fromPageCoord, get, getAction, getCaveNode, getChildAt, getChildIndex, getClass, getDraggable, getDragMessage_, getDragNode, getDragOptions_, getDrop_, getDroppable, getElementsById, getElementsByName, getFirstNode_, getFloatZIndex_, getHeight, getHflex, getId, getLeft, getMold, getOldWidget_, getPage, getRenderdefer, getSclass, getScrollLeft, getScrollTop, getStyle, getTextNode, getTooltiptext, getTop, getTopWidget, getVflex, getWidth, getZclass, getZIndex, hide, ignoreDescendantFloatUp_, ignoreDrag_, initDrag_, insertBefore, insertChildHTML_, isAutoId, isBinding, isFloating_, isListen, isRealVisible, isRealVisible, isVisible, isVisible, isWatchable_, listen, listenOnFitSize_, mimicMouseDown_, newInstance, nextUuid, onChildAdded_, onChildRemoved_, onChildReplaced_, onChildVisible_, onDrop_, redraw, redrawHTML_, register, removeChild, removeChild, removeChildHTML_, removeHTML_, replaceCavedChildren_, replaceChildHTML_, replaceHTML, replaceWidget, rerender, rerender, scrollIntoView, sendAU_, set, set, setAction, setChildren, setDomVisible_, setDraggable, setDroppable, setFloating_, setFloatZIndex_, setHeight, setHflex, setId, setLeft, setListener, setListener, setListeners, setMold, setRenderdefer, setSclass, setScrollLeft, setScrollTop, setStyle, setTooltiptext, setTop, setTopmost, setVflex, setVisible, setWidth, setZclass, setZIndex, shallChildROD_, shallIgnoreClick_, show, smartUpdate, unbind_, unbind, unbindChildren_, uncloneDrag_, unlisten, unlistenOnFitSize_, updateDomClass_, updateDomStyle_, uuid, zsync
 
Methods inherited from class zk.Object
$init, $instanceof, $super, $super, $supers, $supers, afterInit, isAssignableFrom, isInstance, proxy
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

setPagingPosition

public void setPagingPosition(String pagingPosition)
Sets how to position the paging of the widget at the client screen. It is meaningless if the mold is not in "paging".

Parameters:
pagingPosition - how to position. It can only be "bottom" (the default), or "top", or "both".

getPagingPosition

public String getPagingPosition()
Returns how to position the paging of the widget at the client screen. It is meaningless if the mold is not in "paging".

Returns:
String

setSizedByContent

public void setSizedByContent(boolean byContent)
Sets whether sizing the widget column width by its content. Default is false, i.e. the outline of the widget is dependent on browser. It means, we don't calculate the width of each cell. If set to true, the outline will count on the content of body. In other words, the outline of the widget will be like ZK version 2.4.1 that the header's width is only for reference.

You can also specify the "sized-by-content" attribute of component in lang-addon.xml directly, it will then take higher priority.

Parameters:
byContent -

isSizedByContent

public boolean isSizedByContent()
Returns whether sizing the widget column width by its content. Default is false.

Note: if the "sized-by-content" attribute of component is specified, it's prior to the original value.

Returns:
boolean
See Also:
setSizedByContent(boolean)

setSpan

public void setSpan(String span)
Sets column span hint of this mesh widget.

The parameter span is a number in String type indicating how this component distributes remaining empty space to the specified column(0-based). "0" means distribute remaining empty space to the 1st column; "1" means distribute remaining empty space to the 2nd column, etc.. The spanning column will grow to fit the extra remaining space.

Special span hint with "true" means span ALL columns proportionally per their original widths while null or "false" means NOT spanning any column.

Default: null. That is, NOT span any column.

Note span is meaningful only if there is remaining empty space for columns.

Parameters:
span - the column span hint.
Since:
5.0.6
See Also:
getSpan()

getSpan

public String getSpan()
Return column span hint of this widget.

Default: null

Returns:
String column span hint of this widget.
Since:
5.0.6
See Also:
setSpan(_global_.String)

setAutopaging

public void setAutopaging(boolean autopaging)
Sets whether turn on auto-paging facility when mold is "paging". If it is set to true, the setPageSize(int) is ignored; rather, the page size(number of item count) is automatically determined by the height of this widget dynamically.

Parameters:
autopaging -

isAutopaging

public boolean isAutopaging()
Returns whether turn on auto-paging facility when mold is "paging". If it is set to true, the setPageSize(int) is ignored; rather, the page size(number of item count) is automatically determined by the height of this widget dynamically.

Returns:
boolean
See Also:
setAutopaging(boolean)

setPaginal

public void setPaginal(Paging paging)
Sets the external Paging widget.

Parameters:
paging -

getPaginal

public Paging getPaginal()
Returns the external Paging widget, if any.

Returns:
Paging

setModel

public void setModel(boolean inModel)
Sets whether the widget is in model mode.

Parameters:
inModel -

isModel

public boolean isModel()
Returns whether the widget is in model mode or not.

Returns:
boolean

setInnerWidth

public void setInnerWidth(String innerWidth)
Sets the inner width of this component. The inner width is the width of the inner table. By default, it is 100%. That is, it is the same as the width of this component. However, it is changed when the user is sizing the column's width.

Application developers rarely call this method, unless they want to preserve the widths of sizable columns changed by the user. To preserve the widths, the developer have to store the widths of all columns and the inner width (getInnerWidth()), and then restore them when re-creating this component.

Parameters:
innerWidth - the inner width. If null, "100%" is assumed.

getInnerWidth

public String getInnerWidth()
Returns the inner width of this component. The inner width is the width of the inner table.

Default: "100%"

Returns:
String
See Also:
setInnerWidth(_global_.String)

getPageSize

public int getPageSize()
Returns the page size, aka., the number rows per page.

Returns:
int
See Also:
Paging.getPageSize()

setPageSize

public void setPageSize(int pageSize)
Sets the page size, aka., the number rows per page.

Parameters:
pageSize -
See Also:
Paging.setPageSize(int)

getPageCount

public int getPageCount()
Returns the number of pages. Note: there is at least one page even no item at all.

Returns:
int
See Also:
Paging.getPageCount()

getActivePage

public int getActivePage()
Returns the active page (starting from 0).

Returns:
int
See Also:
Paging.getActivePage()

setActivePage

public void setActivePage(int activePage)
Sets the active page (starting from 0).

Parameters:
activePage -
See Also:
Paging.setActivePage(int)

inPagingMold

public boolean inPagingMold()
Returns whether the widget is in paging mold.

Returns:
boolean

getHeadWidget

public HeadWidget getHeadWidget()
Returns the self's head widget.

Returns:
zul.mesh.HeadWidget
Since:
5.0.4

getFocusCell

public int getFocusCell(DOMElement el)
Returns the index of the cell including the child got focus.

Parameters:
el - the element got focus.
Returns:
int the cell index.
Since:
5.0.7

syncSize

public void syncSize()
Synchronizes the size immediately. This method is called automatically if the widget is created at the server (i.e., Widget.inServer is true). You have to invoke this method only if you create this widget at client and add or remove children from this widget.

Since:
5.0.8

calcSize

public void calcSize()
Calculates the size.



Copyright © 2005-2011 Potix Corporation. All Rights Reserved. SourceForge.net Logo