org.zkoss.zk.ui
Class AbstractPage

java.lang.Object
  extended by org.zkoss.zk.ui.AbstractPage
All Implemented Interfaces:
java.io.Serializable, Scope, IdSpace, Page, PageCtrl
Direct Known Subclasses:
PageImpl

public abstract class AbstractPage
extends java.lang.Object
implements Page, PageCtrl, java.io.Serializable

A skeletal implementation of Page.

Since:
3.5.2
Author:
tomyeh
See Also:
Serialized Form

Field Summary
 
Fields inherited from interface org.zkoss.zk.ui.Page
APPLICATION_SCOPE, DESKTOP_SCOPE, PAGE_SCOPE, REQUEST_SCOPE, SESSION_SCOPE
 
Fields inherited from interface org.zkoss.zk.ui.sys.PageCtrl
ATTR_REDRAW_BY_INCLUDE
 
Constructor Summary
protected AbstractPage()
           
 
Method Summary
 void addFellow(Component comp)
          Adds a fellow.
 void addRoot(Component comp)
          Adds a root component to a page.
 void destroy()
          Called when this page is about to be detroyed.
 Component getFellow(java.lang.String compId)
          Returns a component of the specified ID in the same ID space.
 Component getFellowIfAny(java.lang.String compId)
          Returns a component of the specified ID in the same ID space, or null if not found.
 java.util.Collection getFellows()
          Returns all fellows in this ID space.
 Component getFirstRoot()
          Returns the first root component.
 Component getLastRoot()
          Returns the last root component.
 java.util.Collection getRoots()
          Returns a readonly list of the root components.
 boolean hasFellow(java.lang.String compId)
          Returns whether a fellow exists with the specified component ID.
 void moveRoot(Component comp, Component refRoot)
          Moves a root component before the reference component.
 void removeComponents()
          Removes all components in this page.
 void removeFellow(Component comp)
          Removes a fellow.
 void removeRoot(Component comp)
          Detaches a root component from this page.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.zkoss.zk.ui.Page
addEventListener, addFunctionMapper, addVariableResolver, containsVariable, getAttribute, getAttribute, getAttributes, getAttributes, getComponentDefinition, getComponentDefinition, getComponentDefinitionMap, getDesktop, getExpressionFactoryClass, getFunctionMapper, getId, getInterpreter, getLanguageDefinition, getListenerIterator, getLoadedInterpreters, getNamespace, getRequestPath, getStyle, getTitle, getUuid, getVariable, getXelVariable, getZScriptClass, getZScriptFunction, getZScriptFunction, getZScriptFunction, getZScriptLanguage, getZScriptVariable, getZScriptVariable, getZScriptVariable, interpret, invalidate, isComplete, isListenerAvailable, removeAttribute, removeAttribute, removeEventListener, removeVariableResolver, resolveClass, setAttribute, setAttribute, setComplete, setExpressionFactoryClass, setId, setStyle, setTitle, setVariable, setZScriptLanguage, unsetVariable
 
Methods inherited from interface org.zkoss.zk.ui.sys.PageCtrl
addDeferredZScript, getCacheable, getContentType, getDefaultParent, getDocType, getFirstLine, getHeaders, getOwner, getRootAttributes, init, preInit, redraw, sessionDidActivate, sessionWillPassivate, setCacheable, setContentType, setDefaultParent, setDocType, setFirstLine, setOwner, setRootAttributes
 

Constructor Detail

AbstractPage

protected AbstractPage()
Method Detail

getFirstRoot

public Component getFirstRoot()
Description copied from interface: Page
Returns the first root component.

Specified by:
getFirstRoot in interface Page

getLastRoot

public Component getLastRoot()
Description copied from interface: Page
Returns the last root component.

Specified by:
getLastRoot in interface Page

hasFellow

public boolean hasFellow(java.lang.String compId)
Description copied from interface: IdSpace
Returns whether a fellow exists with the specified component ID.

Specified by:
hasFellow in interface IdSpace
Specified by:
hasFellow in interface PageCtrl

getFellow

public Component getFellow(java.lang.String compId)
Description copied from interface: IdSpace
Returns a component of the specified ID in the same ID space. Components in the same ID space are called fellows.

Unlike IdSpace.getFellowIfAny(java.lang.String), it throws an exception if not found.

Specified by:
getFellow in interface IdSpace

getFellowIfAny

public Component getFellowIfAny(java.lang.String compId)
Description copied from interface: IdSpace
Returns a component of the specified ID in the same ID space, or null if not found.

Unlike IdSpace.getFellow(java.lang.String), it returns null if not found.

Specified by:
getFellowIfAny in interface IdSpace

getFellows

public java.util.Collection getFellows()
Description copied from interface: IdSpace
Returns all fellows in this ID space. The returned collection is readonly.

Specified by:
getFellows in interface IdSpace

addFellow

public void addFellow(Component comp)
Description copied from interface: PageCtrl
Adds a fellow.

Specified by:
addFellow in interface PageCtrl

removeFellow

public void removeFellow(Component comp)
Description copied from interface: PageCtrl
Removes a fellow.

Specified by:
removeFellow in interface PageCtrl

addRoot

public void addRoot(Component comp)
Description copied from interface: PageCtrl
Adds a root component to a page.

It is used internally and developers shall not invoke it explicityly.

Specified by:
addRoot in interface PageCtrl
See Also:
Component.setPage(org.zkoss.zk.ui.Page)

removeRoot

public void removeRoot(Component comp)
Description copied from interface: PageCtrl
Detaches a root component from this page.

It is used internally and developers shall not invoke it explicitly

Specified by:
removeRoot in interface PageCtrl
See Also:
Component.setPage(org.zkoss.zk.ui.Page)

moveRoot

public void moveRoot(Component comp,
                     Component refRoot)
Description copied from interface: PageCtrl
Moves a root component before the reference component.

Note: it assumes removeRoot was called before for comp. Otherwise, nothing happens.

It is used internally and developers shall not invoke it explicitly

Specified by:
moveRoot in interface PageCtrl
See Also:
Component.setPageBefore(org.zkoss.zk.ui.Page, org.zkoss.zk.ui.Component)

getRoots

public java.util.Collection getRoots()
Description copied from interface: Page
Returns a readonly list of the root components.

Specified by:
getRoots in interface Page

removeComponents

public void removeComponents()
Description copied from interface: Page
Removes all components in this page.

Specified by:
removeComponents in interface Page
See Also:
Execution.createComponents(String,Component,Map)

destroy

public void destroy()
Description copied from interface: PageCtrl
Called when this page is about to be detroyed. It is called by desktop, after removing it from the desktop.

Specified by:
destroy in interface PageCtrl


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