org.zkoss.zul.impl
Class MeshElement

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.impl.MeshElement
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, Component, Scope, ComponentCtrl, Paginated
Direct Known Subclasses:
Grid, Listbox, Tree

public abstract class MeshElement
extends XulElement
implements Paginated

The fundamental class for mesh elements such as Grid, Listbox, and Tree.

Since:
5.0.6
Author:
henrichen
See Also:
Serialized Form

Nested Class Summary
protected  class MeshElement.InternalPaging
           
 
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
 
Fields inherited from interface org.zkoss.zk.ui.Component
APPLICATION_SCOPE, COMPONENT_SCOPE, DESKTOP_SCOPE, PAGE_SCOPE, REQUEST_SCOPE, SESSION_SCOPE, SPACE_SCOPE
 
Fields inherited from interface org.zkoss.zk.ui.sys.ComponentCtrl
CE_BUSY_IGNORE, CE_DUPLICATE_IGNORE, CE_IMPORTANT, CE_NON_DEFERRABLE, CE_REPEAT_IGNORE
 
Constructor Summary
MeshElement()
           
 
Method Summary
 int getActivePage()
          Returns the active page (starting from 0).
 int getPageCount()
          Returns the number of pages.
 int getPageSize()
          Returns the page size, a.k.a., the number rows per page.
 java.lang.String getPagingPosition()
          Returns how to position the paging of mesh element at the client screen.
 java.lang.String getSpan()
          Return column span hint of this component.
protected abstract  boolean isAutohidePaging()
           
 boolean isAutopaging()
          Returns whether the auto-paging facility is turned on when mold is "paging".
 boolean isSizedByContent()
          Returns whether sizing grid/listbox/tree column width by its content.
 boolean isSpan()
          Returns whether distributes remaining empty space of this component to ANY column.
protected abstract  Paginal pgi()
          Returns the instance of the @{link Paginal}
protected  void renderProperties(ContentRenderer renderer)
          Renders the content of this component, excluding the enclosing tags and children.
 void setActivePage(int pg)
          Sets the active page (starting from 0).
 void setAutopaging(boolean autopaging)
          Sets whether the auto-paging facility is turned on when mold is "paging".
 void setPageSize(int pgsz)
          Sets the page size, a.k.a., the number rows per page.
 void setPagingPosition(java.lang.String pagingPosition)
          Sets how to position the paging of mesh element at the client screen.
 void setSizedByContent(boolean byContent)
          Sets whether sizing grid/listbox/tree column width by its content; it equals set hflex="min" on each column.
 void setSpan(boolean span)
          Sets whether distributes remaining empty space of this component to ALL columns proportionally.
 void setSpan(java.lang.String span)
          Sets column span hint of this component.
 
Methods inherited from class org.zkoss.zul.impl.XulElement
clone, getContext, getCtrlKeys, getPopup, getTooltip, setContext, setContext, setCtrlKeys, setPopup, setPopup, setTooltip, setTooltip
 
Methods inherited from class org.zkoss.zk.ui.HtmlBasedComponent
focus, getAction, getDraggable, getDroppable, getExtraCtrl, getHeight, getHflex, getLeft, getRenderdefer, getSclass, getStyle, getTooltiptext, getTop, getVflex, getWidth, getZclass, 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
 
Methods inherited from class org.zkoss.zk.ui.AbstractComponent
addAnnotation, addAnnotation, addClientEvent, addEventHandler, addEventListener, addEventListener, addForward, addForward, addForward, addForward, addMoved, addScopeListener, addSharedEventHandlerMap, appendChild, applyProperties, beforeChildAdded, beforeChildRemoved, beforeParentChanged, detach, didActivate, didActivate, didDeserialize, didDeserialize, disableClientUpdate, equals, getAnnotatedProperties, getAnnotatedPropertiesBy, getAnnotation, getAnnotation, getAnnotations, getAnnotations, getAnnotations, getAttribute, getAttribute, getAttribute, getAttributeOrFellow, getAttributes, getAttributes, getAuService, getAutag, getChildren, getClientEvents, getDefaultMold, getDefinition, getDesktop, getEventHandler, getEventHandlerNames, getEventListenerMap, getEventListeners, getFellow, getFellow, getFellowIfAny, getFellowIfAny, getFellows, getFirstChild, getId, getLastChild, getListenerIterator, getMold, getNextSibling, getPage, getParent, getPreviousSibling, getRoot, getSpaceOwner, getStubonly, getTemplate, getTemplateNames, getUuid, getWidgetAttribute, getWidgetAttributeNames, getWidgetClass, getWidgetListener, getWidgetListenerNames, getWidgetOverride, getWidgetOverrideNames, hasAttribute, hasAttribute, hasAttribute, hasAttributeOrFellow, hasFellow, hasFellow, insertBefore, invalidate, isChildable, isInvalidated, isListenerAvailable, isVisible, onChildAdded, onChildRemoved, onPageAttached, onPageDetached, onWrongValue, query, queryAll, redraw, redrawChildren, removeAttribute, removeAttribute, removeAttribute, removeChild, removeEventListener, removeForward, removeForward, removeScopeListener, render, render, render, replace, response, response, response, service, sessionDidActivate, sessionWillPassivate, setAttribute, setAttribute, setAttribute, setAuService, setAutag, setDefinition, setDefinition, setId, setMold, setPage, setPageBefore, setParent, setStubonly, setStubonly, setTemplate, setVisible, setVisibleDirectly, setWidgetAttribute, setWidgetClass, setWidgetListener, setWidgetOverride, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdateWidgetListener, smartUpdateWidgetOverride, toString, updateByClient, willPassivate, willPassivate, willSerialize, willSerialize
 
Methods inherited from class java.lang.Object
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MeshElement

public MeshElement()
Method Detail

getSpan

public java.lang.String getSpan()
Return column span hint of this component.

Default: null

Returns:
column span hint of this component.
Since:
5.0.6
See Also:
setSpan(java.lang.String)

setSpan

public void setSpan(java.lang.String span)
Sets column span hint of this component.

String number span indicates 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(), setSpan(boolean)

setSpan

public void setSpan(boolean span)
Sets whether distributes remaining empty space of this component to ALL columns proportionally.

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

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

Parameters:
span - whether to span the width of ALL columns to occupy the whole mesh element(grid/listbox/tree).
Since:
5.0.5

isSpan

public boolean isSpan()
Returns whether distributes remaining empty space of this component to ANY column.

Default: false.

Returns:
whether distributes remaining empty space of this component to ANY column.
Since:
5.0.5
See Also:
getSpan(), setSpan(boolean), setSpan(String)

setSizedByContent

public void setSizedByContent(boolean byContent)
Sets whether sizing grid/listbox/tree column width by its content; it equals set hflex="min" on each column.

Default: false.

Parameters:
byContent -
Since:
5.0.0

isSizedByContent

public boolean isSizedByContent()
Returns whether sizing grid/listbox/tree column width by its content. Default is false.

Since:
5.0.0
See Also:
setSizedByContent(boolean)

setAutopaging

public void setAutopaging(boolean autopaging)
Sets whether the auto-paging facility is turned on when mold is "paging". If it is set to true, the setPageSize(int) is ignored; rather, the page size is automatically determined by the height of the Listbox dynamically. Note: Due to performance concern, Autopaging functionality does not support Detail components.

Parameters:
autopaging - true to turn on the auto-paging facility.
Since:
5.0.2

isAutopaging

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

Returns:
whether the "autopaging" facility is turned on.
Since:
5.0.2

setPagingPosition

public void setPagingPosition(java.lang.String pagingPosition)
Sets how to position the paging of mesh element 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".
Since:
3.0.4

isAutohidePaging

protected abstract boolean isAutohidePaging()

getPagingPosition

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

Specified by:
getPagingPosition in interface Paginated
Since:
3.0.4

pgi

protected abstract Paginal pgi()
Returns the instance of the @{link Paginal}


getPageSize

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

Throws:
java.lang.IllegalStateException - if pgi() returns null, i.e., mold is not "paging" and no external controller is specified.

setPageSize

public void setPageSize(int pgsz)
                 throws WrongValueException
Sets the page size, a.k.a., the number rows per page.

Throws:
java.lang.IllegalStateException - if pgi() returns null, i.e., mold is not "paging" and no external controller is specified.
WrongValueException

getPageCount

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

Since:
3.0.4

getActivePage

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

Since:
3.0.4

setActivePage

public void setActivePage(int pg)
                   throws WrongValueException
Sets the active page (starting from 0).

Throws:
WrongValueException
Since:
3.0.4

renderProperties

protected void renderProperties(ContentRenderer renderer)
                         throws java.io.IOException
Description copied from class: HtmlBasedComponent
Renders the content of this component, excluding the enclosing tags and children.

See also ZK Client-side Reference: Property Rendering

Overrides:
renderProperties in class XulElement
Throws:
java.io.IOException


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