The language-addon"

From Documentation
m (Created page with '{{ZKComponentDevelopmentEssentialsPageHeader}} The language-addon contains a description of the relation between the component and widget referred to as the component definition…')
 
m
(6 intermediate revisions by 3 users not shown)
Line 1: Line 1:
 
{{ZKComponentDevelopmentEssentialsPageHeader}}
 
{{ZKComponentDevelopmentEssentialsPageHeader}}
  
The language-addon contains a description of the relation between the component and widget referred to as the component definition.  The path of the file must be <mp>/metainfo/zk/lang-addon.xml</mp> and be located in the Java class path.
+
The language-addon contains a description of the relation between the component and widget referred to as the component definition.  The path of the file must be '''/metainfo/zk/lang-addon.xml''' and be located in the Java class path.
  
 
<source lang="xml">
 
<source lang="xml">
Line 15: Line 15:
 
<mold-name>default</mold-name>
 
<mold-name>default</mold-name>
 
<mold-uri>mold/simple-label.js</mold-uri>
 
<mold-uri>mold/simple-label.js</mold-uri>
 +
<css-uri>css/simple-label.css.dsp</css-uri>
 
</mold>
 
</mold>
 
</component>
 
</component>
Line 21: Line 22:
  
 
The table below describes the elements used within the above XML and their descriptions.
 
The table below describes the elements used within the above XML and their descriptions.
 +
 +
{| border="1"
 +
! Name !! Description
 +
|-
 +
| addon-name
 +
| A unique name for this addon
 +
|-
 +
| annotation
 +
| [[ZK Component Reference/Annotation/Data Binding|Annotation setting for Data Binding]]
 +
|-
 +
| language-name
 +
| The language name that this addon belongs to (for instance, xul/html or zhtml)
 +
|-
 +
| component-name
 +
| A unique name of the component in the language of this addon
 +
|-
 +
| component-class
 +
| The name of the component class (Java class)
 +
|-
 +
| widget-class
 +
| The name of the widget class (JavaScript class)
 +
|-
 +
| mold
 +
| A mold definition (optional)
 +
|-
 +
| mold-name
 +
| The name of the mold. The default mold is named default.
 +
|-
 +
| mold-uri
 +
| The URI of the mold
 +
 +
|-
 +
| css-uri
 +
| The URI of the CSS file for the mold
 +
|}
 +
 +
A component may have multiple molds which may or may not have different widget classes. To handle this you may specify the '''<widget-class>''' inside '''<mold>'''. You can specify more than one mold.
 +
 +
After creating the component descriptor language-addon we need to create the widget package descriptor.
 +
 +
For more information, please refer to [[ZK Client-side Reference/Language Definition|ZK Client-side Reference: Language Definition]].
  
 
{{ZKComponentDevelopmentEssentialsPageFooter}}
 
{{ZKComponentDevelopmentEssentialsPageFooter}}

Revision as of 03:56, 9 August 2012


The language-addon contains a description of the relation between the component and widget referred to as the component definition. The path of the file must be /metainfo/zk/lang-addon.xml and be located in the Java class path.

<language-addon>
	<addon-name>simplelabel</addon-name>
	<language-name>xul/html</language-name>
 
	<component>
		<component-name>simplelabel</component-name>
		<component-class>com.foo.SimpleLabel</component-class>
		<widget-class>com.foo.SimpleLabel</widget-class>
		<mold>
			<mold-name>default</mold-name>
			<mold-uri>mold/simple-label.js</mold-uri>
			<css-uri>css/simple-label.css.dsp</css-uri>
		</mold>
	</component>
</language-addon>

The table below describes the elements used within the above XML and their descriptions.

Name Description
addon-name A unique name for this addon
annotation Annotation setting for Data Binding
language-name The language name that this addon belongs to (for instance, xul/html or zhtml)
component-name A unique name of the component in the language of this addon
component-class The name of the component class (Java class)
widget-class The name of the widget class (JavaScript class)
mold A mold definition (optional)
mold-name The name of the mold. The default mold is named default.
mold-uri The URI of the mold
css-uri The URI of the CSS file for the mold

A component may have multiple molds which may or may not have different widget classes. To handle this you may specify the <widget-class> inside <mold>. You can specify more than one mold.

After creating the component descriptor language-addon we need to create the widget package descriptor.

For more information, please refer to ZK Client-side Reference: Language Definition.



Last Update : 2012/08/09

Copyright © Potix Corporation. This article is licensed under GNU Free Documentation License.