| java.lang.Object org.zkoss.zk.ui.AbstractComponent
All known Subclasses: org.zkoss.zul.Style, org.zkoss.mil.MilComponent, org.zkoss.zhtml.Text, org.zkoss.zk.ui.HtmlBasedComponent, org.zkforge.dojo.Fisheyeitem, org.zkoss.zul.Area, org.zkoss.zml.XmlMacroComponent, org.zkoss.zul.Script, org.zkoss.zhtml.impl.AbstractTag, org.zkoss.zk.ui.HtmlNativeComponent, org.zkoss.zml.Transformer, org.zkforge.fckez.FCKeditor, org.zkoss.jsp.zul.impl.Inline,
Constructor Summary | |
protected | AbstractComponent() Constructs a component with auto-generated ID. |
Method Summary | |
public void | addAnnotation(String annotName, Map annotAttrs) | public void | addAnnotation(String propName, String annotName, Map annotAttrs) | public void | addEventHandler(String name, EventHandler evthd) | public boolean | addEventListener(String evtnm, EventListener listener) | public boolean | addForward(String orgEvent, Component target, String targetEvent) | public boolean | addForward(String orgEvent, String targetPath, String targetEvent) | protected void | addMoved(Component oldparent, Page oldpg, Page newpg) Called when this component is moved from the specified parent
and/or page to the new page.
Default: it notifies
UiEngine to update the component
at the client (usually remove-and-add).
It is designed to let derived classes overriding this method
to disable this update. | public void | addSharedAnnotationMap(AnnotationMap annots) | public void | addSharedEventHandlerMap(EventHandlerMap evthds) | protected StringBuffer | appendAsapAttr(StringBuffer sb, String evtnm) Appends an attribute for the specified event name, say, onChange,
if a non-deferrable listener is registered.
The format of the generated attribute is as follows:
onChange="true" .
This method is moved from
HtmlBasedComponent to
AbstractComponent since 3.0.0.
Parameters: sb - the string buffer to hold the HTML attribute. | final public boolean | appendChild(Component child) Appends a child to the end of all children. | public void | applyProperties() | public Object | clone() | public boolean | containsVariable(String name, boolean local) | public void | detach() | final public boolean | equals(Object o) | public List | getAnnotatedProperties() | public List | getAnnotatedPropertiesBy(String annotName) | public Annotation | getAnnotation(String annotName) | public Annotation | getAnnotation(String propName, String annotName) | public Collection | getAnnotations() | public Collection | getAnnotations(String propName) | public Object | getAttribute(String name, int scope) | final public Object | getAttribute(String name) | public Map | getAttributes(int scope) | final public Map | getAttributes() | public List | getChildren() | public ComponentDefinition | getDefinition() | final public Desktop | getDesktop() | public ZScript | getEventHandler(String evtnm) | public Set | getEventHandlerNames() | public Object | getExtraCtrl() Returns the extra controls that tell ZK how to handle this component
specially. | public Component | getFellow(String compId) | public Component | getFellowIfAny(String compId) | public Component | getFirstChild() | public String | getId() | public Component | getLastChild() | public Iterator | getListenerIterator(String evtnm) | final public String | getMold() Returns the mold used to render this component. | protected Object | getMoldURI() Returns the mold URI based on
AbstractComponent.getMold and the molds defined in the component definition
(
ComponentDefinition ). | public Namespace | getNamespace() | public Component | getNextSibling() | final public Page | getPage() | public Component | getParent() | public Component | getPreviousSibling() | public Component | getPropagatee(String evtnm) Default: null (no propagation at all). | public Component | getRoot() Returns the root of the specified component. | final public IdSpace | getSpaceOwner() | final public String | getUuid() | public Object | getVariable(String name, boolean local) | public boolean | insertBefore(Component newChild, Component refChild) | public void | invalidate() | protected boolean | isAsapRequired(String evtnm) Returns whether to send back the request of the specified event
immediately -- i.e., non-deferrable.
Returns true if you want the component (on the server)
to process the event immediately.
Default: return true if any non-deferable event listener of
the specified event is found. | public boolean | isChildable() Default: return true (allows to have children). | public boolean | isListenerAvailable(String evtnm, boolean asap) | public boolean | isVisible() | protected Object | newExtraCtrl() Used by
AbstractComponent.getExtraCtrl to create a client control. | public void | onChildAdded(Component child) Default: does nothing. | public void | onChildRemoved(Component child) Default: does nothing. | public void | onDrawNewChild(Component child, StringBuffer out) | public void | onPageAttached(Page newpage, Page oldpage) Default: handles special event listeners. | public void | onPageDetached(Page page) Default: handles special event listeners. | public WrongValueException | onWrongValue(WrongValueException ex) Notifies that an
WrongValueException instance is thrown,
and
WrongValueException.getComponent is this component. | public void | redraw(Writer out) Redraws this component.
This method implements the mold mechanism.
- It first invokes
AbstractComponent.getMoldURI to retrieve the mold
to redraw.
| public Object | removeAttribute(String name, int scope) | final public Object | removeAttribute(String name) | public boolean | removeChild(Component child) | public boolean | removeEventListener(String evtnm, EventListener listener) | public boolean | removeForward(String orgEvent, Component target, String targetEvent) | public boolean | removeForward(String orgEvent, String targetPath, String targetEvent) | public void | response(String key, AuResponse response) | public void | sessionDidActivate(Page page) | public void | sessionWillPassivate(Page page) | public Object | setAttribute(String name, Object value, int scope) | final public Object | setAttribute(String name, Object value) | public void | setComponentDefinition(ComponentDefinition compdef) | public void | setId(String id) | public void | setMold(String mold) | public void | setPage(Page page) | public void | setPageBefore(Page page, Component refRoot) | public void | setParent(Component parent) | public void | setVariable(String name, Object val, boolean local) | public boolean | setVisible(boolean visible) | public void | smartUpdate(String attr, String value) | public void | smartUpdate(String attr, int value) A special smart-update that update a value in int. | public void | smartUpdate(String attr, boolean value) A special smart-update that update a value in boolean. | public void | smartUpdateDeferred(String attr, DeferredValue value) Smart-updates a property with a deferred value. | public String | toString() | public void | unsetVariable(String name, boolean local) |
AbstractComponent | protected AbstractComponent()(Code) | | Constructs a component with auto-generated ID.
|
addAnnotation | public void addAnnotation(String annotName, Map annotAttrs)(Code) | | |
addMoved | protected void addMoved(Component oldparent, Page oldpg, Page newpg)(Code) | | Called when this component is moved from the specified parent
and/or page to the new page.
Default: it notifies
UiEngine to update the component
at the client (usually remove-and-add).
It is designed to let derived classes overriding this method
to disable this update. However, you rarely need to override it.
One possible but rare case: the component's
visual part at the client updates the visual representation
at the client and then notify the component at the server
to update its children accordingly. In this case, it is redudant
if we ask UI Engine to send the updates to client.
Parameters: oldparent - the parent before moved.The new parent can be found by calling AbstractComponent.getParent. Parameters: oldpg - the parent before moved. Parameters: newpg - the new page. AbstractComponent.getPage might returnthe old page. |
appendAsapAttr | protected StringBuffer appendAsapAttr(StringBuffer sb, String evtnm)(Code) | | Appends an attribute for the specified event name, say, onChange,
if a non-deferrable listener is registered.
The format of the generated attribute is as follows:
onChange="true" .
This method is moved from
HtmlBasedComponent to
AbstractComponent since 3.0.0.
Parameters: sb - the string buffer to hold the HTML attribute. If null andAbstractComponent.isAsapRequired is true, a string buffer is created and returned. Parameters: evtnm - the event name, such as onClick the string buffer. If sb is null and AbstractComponent.isAsapRequiredreturns false, null is returned.If the caller passed non-null sb, the returned value must be the sameas sb (so it usually ignores the returned value). since: 3.0.0 |
applyProperties | public void applyProperties()(Code) | | |
containsVariable | public boolean containsVariable(String name, boolean local)(Code) | | |
detach | public void detach()(Code) | | |
getAnnotatedProperties | public List getAnnotatedProperties()(Code) | | |
getAnnotatedPropertiesBy | public List getAnnotatedPropertiesBy(String annotName)(Code) | | |
getAttributes | public Map getAttributes(int scope)(Code) | | |
getAttributes | final public Map getAttributes()(Code) | | |
getEventHandlerNames | public Set getEventHandlerNames()(Code) | | |
getMold | final public String getMold()(Code) | | Returns the mold used to render this component.
Default: "default"
|
getRoot | public Component getRoot()(Code) | | Returns the root of the specified component.
|
invalidate | public void invalidate()(Code) | | |
isAsapRequired | protected boolean isAsapRequired(String evtnm)(Code) | | Returns whether to send back the request of the specified event
immediately -- i.e., non-deferrable.
Returns true if you want the component (on the server)
to process the event immediately.
Default: return true if any non-deferable event listener of
the specified event is found. In other words, it returns
Events.isListened with asap = true.
This method is moved from
HtmlBasedComponent to
AbstractComponent since 3.0.0.
Parameters: evtnm - the event name, such as onClick since: 3.0.0 |
isChildable | public boolean isChildable()(Code) | | Default: return true (allows to have children).
|
isListenerAvailable | public boolean isListenerAvailable(String evtnm, boolean asap)(Code) | | |
isVisible | public boolean isVisible()(Code) | | |
onWrongValue | public WrongValueException onWrongValue(WrongValueException ex)(Code) | | Notifies that an
WrongValueException instance is thrown,
and
WrongValueException.getComponent is this component.
It is a callback and the component can store the error message,
show up the custom information, or even 'eat' the exception.
Default: does nothing but returns ex.
Parameters: ex - the exception being thrown (never null) the exception to throw, or null to ignore the exceptionIn most cases, just return ex since: 2.4.0 |
sessionDidActivate | public void sessionDidActivate(Page page)(Code) | | |
sessionWillPassivate | public void sessionWillPassivate(Page page)(Code) | | |
setVisible | public boolean setVisible(boolean visible)(Code) | | |
smartUpdateDeferred | public void smartUpdateDeferred(String attr, DeferredValue value)(Code) | | Smart-updates a property with a deferred value.
A deferred value is used to encapsulate a value that shall be retrieved
only in the rendering phase.
since: 3.0.1 |
unsetVariable | public void unsetVariable(String name, boolean local)(Code) | | |
|
|