Annotate in Java"
From Documentation
(ZK 6) |
m (remove empty version history (via JWB)) |
||
(3 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
{{ZKDevelopersReferencePageHeader}} | {{ZKDevelopersReferencePageHeader}} | ||
− | You could annotate a component in Java by the use of | + | You could annotate a component or a property in Java by the use of <javadoc method="addAnnotation(java.lang.String, java.lang.String, java.util.Map)" type="interface">org.zkoss.zk.ui.sys.ComponentCtrl</javadoc>. |
For example, | For example, | ||
<source lang="java" > | <source lang="java" > | ||
Listbox listbox = new Listbox(); | Listbox listbox = new Listbox(); | ||
− | listbox.addAnnotation(null, "foo", null); //annotate listbox | + | listbox.addAnnotation(null, "foo", null); //null in the first argument means to annotate listbox |
Label label = new Label(); | Label label = new Label(); | ||
label.addAnnotation("value", "fun", null); //annotate the value property of label | label.addAnnotation("value", "fun", null); //annotate the value property of label | ||
</source> | </source> | ||
− | + | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
{{ZKDevelopersReferencePageFooter}} | {{ZKDevelopersReferencePageFooter}} |
Latest revision as of 04:32, 5 February 2024
You could annotate a component or a property in Java by the use of ComponentCtrl.addAnnotation(String, String, Map).
For example,
Listbox listbox = new Listbox();
listbox.addAnnotation(null, "foo", null); //null in the first argument means to annotate listbox
Label label = new Label();
label.addAnnotation("value", "fun", null); //annotate the value property of label