Java Doc for AbstractComponent.java in  » Ajax » zk » org » zkoss » zk » ui » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Ajax » zk » org.zkoss.zk.ui 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


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,
AbstractComponent
public class AbstractComponent implements Component,ComponentCtrl,java.io.Serializable(Code)
A skeletal implementation of Component . Though it is OK to implement Component from scratch, this class simplifies some of the chores.
author:
   tomyeh



Constructor Summary
protected  AbstractComponent()
     Constructs a component with auto-generated ID.

Method Summary
public  voidaddAnnotation(String annotName, Map annotAttrs)
    
public  voidaddAnnotation(String propName, String annotName, Map annotAttrs)
    
public  voidaddEventHandler(String name, EventHandler evthd)
    
public  booleanaddEventListener(String evtnm, EventListener listener)
    
public  booleanaddForward(String orgEvent, Component target, String targetEvent)
    
public  booleanaddForward(String orgEvent, String targetPath, String targetEvent)
    
protected  voidaddMoved(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  voidaddSharedAnnotationMap(AnnotationMap annots)
    
public  voidaddSharedEventHandlerMap(EventHandlerMap evthds)
    
protected  StringBufferappendAsapAttr(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  booleanappendChild(Component child)
     Appends a child to the end of all children.
public  voidapplyProperties()
    
public  Objectclone()
    
public  booleancontainsVariable(String name, boolean local)
    
public  voiddetach()
    
final public  booleanequals(Object o)
    
public  ListgetAnnotatedProperties()
    
public  ListgetAnnotatedPropertiesBy(String annotName)
    
public  AnnotationgetAnnotation(String annotName)
    
public  AnnotationgetAnnotation(String propName, String annotName)
    
public  CollectiongetAnnotations()
    
public  CollectiongetAnnotations(String propName)
    
public  ObjectgetAttribute(String name, int scope)
    
final public  ObjectgetAttribute(String name)
    
public  MapgetAttributes(int scope)
    
final public  MapgetAttributes()
    
public  ListgetChildren()
    
public  ComponentDefinitiongetDefinition()
    
final public  DesktopgetDesktop()
    
public  ZScriptgetEventHandler(String evtnm)
    
public  SetgetEventHandlerNames()
    
public  ObjectgetExtraCtrl()
     Returns the extra controls that tell ZK how to handle this component specially.
public  ComponentgetFellow(String compId)
    
public  ComponentgetFellowIfAny(String compId)
    
public  ComponentgetFirstChild()
    
public  StringgetId()
    
public  ComponentgetLastChild()
    
public  IteratorgetListenerIterator(String evtnm)
    
final public  StringgetMold()
     Returns the mold used to render this component.
protected  ObjectgetMoldURI()
     Returns the mold URI based on AbstractComponent.getMold and the molds defined in the component definition ( ComponentDefinition ).
public  NamespacegetNamespace()
    
public  ComponentgetNextSibling()
    
final public  PagegetPage()
    
public  ComponentgetParent()
    
public  ComponentgetPreviousSibling()
    
public  ComponentgetPropagatee(String evtnm)
     Default: null (no propagation at all).
public  ComponentgetRoot()
     Returns the root of the specified component.
final public  IdSpacegetSpaceOwner()
    
final public  StringgetUuid()
    
public  ObjectgetVariable(String name, boolean local)
    
public  booleaninsertBefore(Component newChild, Component refChild)
    
public  voidinvalidate()
    
protected  booleanisAsapRequired(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  booleanisChildable()
     Default: return true (allows to have children).
public  booleanisListenerAvailable(String evtnm, boolean asap)
    
public  booleanisVisible()
    
protected  ObjectnewExtraCtrl()
     Used by AbstractComponent.getExtraCtrl to create a client control.
public  voidonChildAdded(Component child)
     Default: does nothing.
public  voidonChildRemoved(Component child)
     Default: does nothing.
public  voidonDrawNewChild(Component child, StringBuffer out)
    
public  voidonPageAttached(Page newpage, Page oldpage)
     Default: handles special event listeners.
public  voidonPageDetached(Page page)
     Default: handles special event listeners.
public  WrongValueExceptiononWrongValue(WrongValueException ex)
     Notifies that an WrongValueException instance is thrown, and WrongValueException.getComponent is this component.
public  voidredraw(Writer out)
     Redraws this component. This method implements the mold mechanism.
  1. It first invokes AbstractComponent.getMoldURI to retrieve the mold to redraw.
public  ObjectremoveAttribute(String name, int scope)
    
final public  ObjectremoveAttribute(String name)
    
public  booleanremoveChild(Component child)
    
public  booleanremoveEventListener(String evtnm, EventListener listener)
    
public  booleanremoveForward(String orgEvent, Component target, String targetEvent)
    
public  booleanremoveForward(String orgEvent, String targetPath, String targetEvent)
    
public  voidresponse(String key, AuResponse response)
    
public  voidsessionDidActivate(Page page)
    
public  voidsessionWillPassivate(Page page)
    
public  ObjectsetAttribute(String name, Object value, int scope)
    
final public  ObjectsetAttribute(String name, Object value)
    
public  voidsetComponentDefinition(ComponentDefinition compdef)
    
public  voidsetId(String id)
    
public  voidsetMold(String mold)
    
public  voidsetPage(Page page)
    
public  voidsetPageBefore(Page page, Component refRoot)
    
public  voidsetParent(Component parent)
    
public  voidsetVariable(String name, Object val, boolean local)
    
public  booleansetVisible(boolean visible)
    
public  voidsmartUpdate(String attr, String value)
    
public  voidsmartUpdate(String attr, int value)
     A special smart-update that update a value in int.
public  voidsmartUpdate(String attr, boolean value)
     A special smart-update that update a value in boolean.
public  voidsmartUpdateDeferred(String attr, DeferredValue value)
     Smart-updates a property with a deferred value.
public  StringtoString()
    
public  voidunsetVariable(String name, boolean local)
    


Constructor Detail
AbstractComponent
protected AbstractComponent()(Code)
Constructs a component with auto-generated ID.




Method Detail
addAnnotation
public void addAnnotation(String annotName, Map annotAttrs)(Code)



addAnnotation
public void addAnnotation(String propName, String annotName, Map annotAttrs)(Code)



addEventHandler
public void addEventHandler(String name, EventHandler evthd)(Code)



addEventListener
public boolean addEventListener(String evtnm, EventListener listener)(Code)



addForward
public boolean addForward(String orgEvent, Component target, String targetEvent)(Code)



addForward
public boolean addForward(String orgEvent, String targetPath, String targetEvent)(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.




addSharedAnnotationMap
public void addSharedAnnotationMap(AnnotationMap annots)(Code)



addSharedEventHandlerMap
public void addSharedEventHandlerMap(EventHandlerMap evthds)(Code)



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




appendChild
final public boolean appendChild(Component child)(Code)
Appends a child to the end of all children. It calls AbstractComponent.insertBefore with refChild to be null. Derives cannot override this method, and they shall override AbstractComponent.insertBefore instead.



applyProperties
public void applyProperties()(Code)



clone
public Object clone()(Code)



containsVariable
public boolean containsVariable(String name, boolean local)(Code)



detach
public void detach()(Code)



equals
final public boolean equals(Object o)(Code)



getAnnotatedProperties
public List getAnnotatedProperties()(Code)



getAnnotatedPropertiesBy
public List getAnnotatedPropertiesBy(String annotName)(Code)



getAnnotation
public Annotation getAnnotation(String annotName)(Code)



getAnnotation
public Annotation getAnnotation(String propName, String annotName)(Code)



getAnnotations
public Collection getAnnotations()(Code)



getAnnotations
public Collection getAnnotations(String propName)(Code)



getAttribute
public Object getAttribute(String name, int scope)(Code)



getAttribute
final public Object getAttribute(String name)(Code)



getAttributes
public Map getAttributes(int scope)(Code)



getAttributes
final public Map getAttributes()(Code)



getChildren
public List getChildren()(Code)



getDefinition
public ComponentDefinition getDefinition()(Code)



getDesktop
final public Desktop getDesktop()(Code)



getEventHandler
public ZScript getEventHandler(String evtnm)(Code)



getEventHandlerNames
public Set getEventHandlerNames()(Code)



getExtraCtrl
public Object getExtraCtrl()(Code)
Returns the extra controls that tell ZK how to handle this component specially. It is used only by component developers.

It is simpler to override AbstractComponent.newExtraCtrl instead of this. By use of AbstractComponent.newExtraCtrl , you don't need to care of cloning and serialization.

Default: return the object being created by AbstractComponent.newExtraCtrl , if any.
See Also:   ComponentCtrl.getExtraCtrl




getFellow
public Component getFellow(String compId)(Code)



getFellowIfAny
public Component getFellowIfAny(String compId)(Code)



getFirstChild
public Component getFirstChild()(Code)



getId
public String getId()(Code)



getLastChild
public Component getLastChild()(Code)



getListenerIterator
public Iterator getListenerIterator(String evtnm)(Code)



getMold
final public String getMold()(Code)
Returns the mold used to render this component. Default: "default"



getMoldURI
protected Object getMoldURI()(Code)
Returns the mold URI based on AbstractComponent.getMold and the molds defined in the component definition ( ComponentDefinition ).

As of release 3.0.0, it may return a String instance representing the URI, or a ComponentRenderer instance responsible for redrawing.

Used only for component implementation.




getNamespace
public Namespace getNamespace()(Code)



getNextSibling
public Component getNextSibling()(Code)



getPage
final public Page getPage()(Code)



getParent
public Component getParent()(Code)



getPreviousSibling
public Component getPreviousSibling()(Code)



getPropagatee
public Component getPropagatee(String evtnm)(Code)
Default: null (no propagation at all).



getRoot
public Component getRoot()(Code)
Returns the root of the specified component.



getSpaceOwner
final public IdSpace getSpaceOwner()(Code)



getUuid
final public String getUuid()(Code)



getVariable
public Object getVariable(String name, boolean local)(Code)



insertBefore
public boolean insertBefore(Component newChild, Component refChild)(Code)



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)



newExtraCtrl
protected Object newExtraCtrl()(Code)
Used by AbstractComponent.getExtraCtrl to create a client control. It is used only by component developers.

Default: return null.

To provide extra controls, it is simpler to override this method instead of AbstractComponent.getExtraCtrl . By use of AbstractComponent.newExtraCtrl , you don't need to care of cloning and serialization.




onChildAdded
public void onChildAdded(Component child)(Code)
Default: does nothing.
See Also:   Component.onChildAdded



onChildRemoved
public void onChildRemoved(Component child)(Code)
Default: does nothing.
See Also:   Component.onChildRemoved



onDrawNewChild
public void onDrawNewChild(Component child, StringBuffer out) throws IOException(Code)



onPageAttached
public void onPageAttached(Page newpage, Page oldpage)(Code)
Default: handles special event listeners.
See Also:   Component.onPageAttached
since:
   3.0.0



onPageDetached
public void onPageDetached(Page page)(Code)
Default: handles special event listeners.
See Also:   Component.onPageDetached
since:
   3.0.0



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




redraw
public void redraw(Writer out) throws IOException(Code)
Redraws this component. This method implements the mold mechanism.
  1. It first invokes AbstractComponent.getMoldURI to retrieve the mold to redraw. The mold is either an URI (String) or a ComponentRenderer instance.
  2. If URI, it invokes Execution.include to generate the output.
  3. If a ComponentRenderer instance, ComponentRenderer.render is called to generate the output.



removeAttribute
public Object removeAttribute(String name, int scope)(Code)



removeAttribute
final public Object removeAttribute(String name)(Code)



removeChild
public boolean removeChild(Component child)(Code)



removeEventListener
public boolean removeEventListener(String evtnm, EventListener listener)(Code)



removeForward
public boolean removeForward(String orgEvent, Component target, String targetEvent)(Code)



removeForward
public boolean removeForward(String orgEvent, String targetPath, String targetEvent)(Code)



response
public void response(String key, AuResponse response)(Code)



sessionDidActivate
public void sessionDidActivate(Page page)(Code)



sessionWillPassivate
public void sessionWillPassivate(Page page)(Code)



setAttribute
public Object setAttribute(String name, Object value, int scope)(Code)



setAttribute
final public Object setAttribute(String name, Object value)(Code)



setComponentDefinition
public void setComponentDefinition(ComponentDefinition compdef)(Code)



setId
public void setId(String id)(Code)



setMold
public void setMold(String mold)(Code)



setPage
public void setPage(Page page)(Code)



setPageBefore
public void setPageBefore(Page page, Component refRoot)(Code)



setParent
public void setParent(Component parent)(Code)



setVariable
public void setVariable(String name, Object val, boolean local)(Code)



setVisible
public boolean setVisible(boolean visible)(Code)



smartUpdate
public void smartUpdate(String attr, String value)(Code)



smartUpdate
public void smartUpdate(String attr, int value)(Code)
A special smart-update that update a value in int.

It will invoke AbstractComponent.smartUpdate(String,String) to update the attribute eventually.




smartUpdate
public void smartUpdate(String attr, boolean value)(Code)
A special smart-update that update a value in boolean.

It will invoke AbstractComponent.smartUpdate(String,String) to update the attribute eventually.




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



toString
public String toString()(Code)



unsetVariable
public void unsetVariable(String name, boolean local)(Code)



Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.