| org.zkoss.zk.ui.sys.ComponentCtrl
All known Subclasses: org.zkoss.zk.ui.AbstractComponent,
ComponentCtrl | public interface ComponentCtrl (Code) | | An addition interface to
org.zkoss.zk.ui.Component that is used for implementation or tools.
Application developers rarely need to access methods in this interface.
author: tomyeh |
Method Summary | |
public void | addAnnotation(String annotName, Map annotAttrs) Associates an annotation to this component. | public void | addAnnotation(String propName, String annotName, Map annotAttrs) Adds an annotation to the specified proeprty of this component. | public void | addEventHandler(String name, EventHandler evthd) Adds an event handler. | public void | addSharedAnnotationMap(AnnotationMap annots) Add a map of annotations which is shared by other components.
In other words, this component shall have all annotations
defined in the specified map, annots. | public void | addSharedEventHandlerMap(EventHandlerMap evthds) Adds a map of event handlers which is shared by other components.
In other words, this component shall have all event handlers
defined in the specified map, evthds. | public List | getAnnotatedProperties() Returns a read-only list of the name (String) of properties that
are associated at least one annotation (never null). | public List | getAnnotatedPropertiesBy(String annotName) Returns a read-only list of the names (String) of the properties
that are associated with the specified annotation (never null). | public Annotation | getAnnotation(String annotName) Returns the annotation associated with the component,
or null if not available. | public Annotation | getAnnotation(String propName, String annotName) Returns the annotation associated with the definition of the specified
property, or null if not available. | public Collection | getAnnotations() Returns a read-only collection of all annotations associated with this
component (never null). | public Collection | getAnnotations(String propName) Returns a read-only collection of all annotations associated with the
specified property (never null). | public ZScript | getEventHandler(String evtnm) Returns the event handler of the specified name, or null
if not found. | public Set | getEventHandlerNames() Returns a readonly collection of event names (String), or
an empty collection if no event name is registered. | public Object | getExtraCtrl() Returns the extra controls that tell ZK how to handle this component
specially.
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. | public WrongValueException | onWrongValue(WrongValueException ex) Notifies that an
WrongValueException instance is thrown,
and
WrongValueException.getComponent is the component
causing the exception. | public void | sessionDidActivate(Page page) Notification that the session, which owns this component,
has just been activated (aka., deserialized). | public void | sessionWillPassivate(Page page) Notification that the session, which owns this component,
is about to be passivated (aka., serialized). | public void | setComponentDefinition(ComponentDefinition compdef) Sets the component definition.
The component definition affects how a component behaves.
Developers rarely need to call this method. |
addAnnotation | public void addAnnotation(String annotName, Map annotAttrs)(Code) | | Associates an annotation to this component.
Unlike Java, you can add annotations dynamically, and each component
has its own annotations.
Parameters: annotName - the annotation name (never null, nor empty). Parameters: annotAttrs - a map of attributes, or null if no attribute.The attribute must be in a pair of strings (String name, String value). |
addAnnotation | public void addAnnotation(String propName, String annotName, Map annotAttrs)(Code) | | Adds an annotation to the specified proeprty of this component.
Parameters: propName - the property name (never nul, nor empty). Parameters: annotName - the annotation name (never null, nor empty). Parameters: 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). |
addSharedAnnotationMap | public void addSharedAnnotationMap(AnnotationMap annots)(Code) | | Add a map of annotations which is shared by other components.
In other words, this component shall have all annotations
defined in the specified map, annots. Meanwhile, this component
shall not modify annots, since it is shared.
The caller shall not change annots after the invocation, too
Parameters: annots - a annotation map. |
addSharedEventHandlerMap | public void addSharedEventHandlerMap(EventHandlerMap evthds)(Code) | | Adds a map of event handlers which is shared by other components.
In other words, this component shall have all event handlers
defined in the specified map, evthds. Meanwhile, this component
shall not modify evthds, since it is shared.
The caller shall not change annots after the invocation, too
Parameters: evthds - a map of event handler |
getAnnotatedProperties | public List getAnnotatedProperties()(Code) | | Returns a read-only list of the name (String) of properties that
are associated at least one annotation (never null).
|
getAnnotatedPropertiesBy | public List getAnnotatedPropertiesBy(String annotName)(Code) | | Returns a read-only list of the names (String) of the properties
that are associated with the specified annotation (never null).
|
getAnnotation | public Annotation getAnnotation(String annotName)(Code) | | Returns the annotation associated with the component,
or null if not available.
Parameters: annotName - the annotation name |
getAnnotation | public Annotation getAnnotation(String propName, String annotName)(Code) | | Returns the annotation associated with the definition of the specified
property, or null if not available.
Parameters: annotName - the annotation name Parameters: propName - the property name, e.g., "value". exception: IllegalArgumentException - if propName is null or empty |
getAnnotations | public Collection getAnnotations()(Code) | | Returns a read-only collection of all annotations associated with this
component (never null).
|
getAnnotations | public Collection getAnnotations(String propName)(Code) | | Returns a read-only collection of all annotations associated with the
specified property (never null).
Parameters: propName - the property name, e.g., "value". exception: IllegalArgumentException - if propName is null or empty |
getEventHandler | public ZScript getEventHandler(String evtnm)(Code) | | Returns the event handler of the specified name, or null
if not found.
|
getEventHandlerNames | public Set getEventHandlerNames()(Code) | | Returns a readonly collection of event names (String), or
an empty collection if no event name is registered.
since: 3.0.2 |
getExtraCtrl | public Object getExtraCtrl()(Code) | | Returns the extra controls that tell ZK how to handle this component
specially.
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.
null if no special handling required. If the componentrequires some special controls, it could return an object thatimplements one or several interfaces in the org.zkoss.zk.ui.ext.renderand org.zkoss.zk.ui.ext.client packages.For example, org.zkoss.zk.ui.ext.render.Cropperand org.zkoss.zk.ui.ext.client.InputableX. |
onWrongValue | public WrongValueException onWrongValue(WrongValueException ex)(Code) | | Notifies that an
WrongValueException instance is thrown,
and
WrongValueException.getComponent is the component
causing the exception.
It is a callback and the component can store the error message,
show up the custom information, or even 'eat' the exception.
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) | | Notification that the session, which owns this component,
has just been activated (aka., deserialized).
Note: only root components are notified by this method.
|
sessionWillPassivate | public void sessionWillPassivate(Page page)(Code) | | Notification that the session, which owns this component,
is about to be passivated (aka., serialized).
Note: only root components are notified by this method.
|
setComponentDefinition | public void setComponentDefinition(ComponentDefinition compdef)(Code) | | Sets the component definition.
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.
exception: IllegalArgumentException - if compdef is null |
|
|