|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface ComponentCtrl
An addition interface to Component
that is used for implementation or tools.
Application developers rarely need to access methods in this interface.
| Method Summary | |
|---|---|
void |
addAnnotation(java.lang.String annotName,
java.util.Map annotAttrs)
Associates an annotation to this component. |
void |
addAnnotation(java.lang.String propName,
java.lang.String annotName,
java.util.Map annotAttrs)
Adds an annotation to the specified proeprty of this component. |
void |
addEventHandler(java.lang.String name,
EventHandler evthd)
Adds an event handler. |
void |
addSharedAnnotationMap(AnnotationMap annots)
Add a map of annotations which is shared by other components. |
void |
addSharedEventHandlerMap(EventHandlerMap evthds)
Adds a map of event handlers which is shared by other components. |
java.util.List |
getAnnotatedProperties()
Returns a read-only list of the name (String) of properties that are associated at least one annotation (never null). |
java.util.List |
getAnnotatedPropertiesBy(java.lang.String annotName)
Returns a read-only list of the names (String) of the properties that are associated with the specified annotation (never null). |
Annotation |
getAnnotation(java.lang.String annotName)
Returns the annotation associated with the component, or null if not available. |
Annotation |
getAnnotation(java.lang.String propName,
java.lang.String annotName)
Returns the annotation associated with the definition of the specified property, or null if not available. |
java.util.Collection |
getAnnotations()
Returns a read-only collection of all annotations associated with this component (never null). |
java.util.Collection |
getAnnotations(java.lang.String propName)
Returns a read-only collection of all annotations associated with the specified property (never null). |
ZScript |
getEventHandler(java.lang.String evtnm)
Returns the event handler of the specified name, or null if not found. |
java.lang.Object |
getExtraCtrl()
Returns the extra controls that tell ZK how to handle this component specially. |
WrongValueException |
onWrongValue(WrongValueException ex)
Notifies that an WrongValueException instance is thrown,
and WrongValueException.getComponent() is this component. |
void |
sessionDidActivate(Page page)
Notification that the session, which owns this component, has just been activated (aka., deserialized). |
void |
sessionWillPassivate(Page page)
Notification that the session, which owns this component, is about to be passivated (aka., serialized). |
void |
setComponentDefinition(ComponentDefinition compdef)
Sets the component definition. |
| Method Detail |
|---|
void setComponentDefinition(ComponentDefinition compdef)
The component definition affects how a component behaves. Developers rarely need to call this method. If a wrong definition is assigned, the result is unpredictable (and hard to debug). It is mainly designed for developing tools.
java.lang.IllegalArgumentException - if compdef is nullZScript getEventHandler(java.lang.String evtnm)
void addEventHandler(java.lang.String name,
EventHandler evthd)
void addSharedEventHandlerMap(EventHandlerMap evthds)
evthds - a map of event handlerAnnotation getAnnotation(java.lang.String annotName)
annotName - the annotation name
Annotation getAnnotation(java.lang.String propName,
java.lang.String annotName)
annotName - the annotation namepropName - the property name, e.g., "value".
java.lang.IllegalArgumentException - if propName is null or emptyjava.util.Collection getAnnotations()
java.util.Collection getAnnotations(java.lang.String propName)
propName - the property name, e.g., "value".
java.lang.IllegalArgumentException - if propName is null or emptyjava.util.List getAnnotatedPropertiesBy(java.lang.String annotName)
java.util.List getAnnotatedProperties()
void addSharedAnnotationMap(AnnotationMap annots)
annots - a annotation map.
void addAnnotation(java.lang.String annotName,
java.util.Map annotAttrs)
Unlike Java, you can add annotations dynamically, and each component has its own annotations.
annotName - the annotation name (never null, nor empty).annotAttrs - a map of attributes, or null if no attribute.
The attribute must be in a pair of strings (String name, String value).
void addAnnotation(java.lang.String propName,
java.lang.String annotName,
java.util.Map annotAttrs)
propName - the property name (never nul, nor empty).annotName - the annotation name (never null, nor empty).annotAttrs - a map of attributes, or null if no attribute at all.
The attribute must be in a pair of strings (String name, String value).void sessionWillPassivate(Page page)
Note: only root components are notified by this method.
void sessionDidActivate(Page page)
Note: only root components are notified by this method.
java.lang.Object getExtraCtrl()
Application developers need NOT to access this method.
There are two set of extra controls: org.zkoss.zk.ui.ext.client and org.zkoss.zk.ui.ext.render.
The first package is used if the content of a component can be changed by the user at the client. It is so-called the client controls.
The second package is used to control how to render a component specially.
Override this method only if you want to return the extra controls.
Cropper
and Inputable.WrongValueException onWrongValue(WrongValueException ex)
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.
ex - the exception being thrown (never null)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||