ZK - Open Source Ajax Java FrameworkZK - Open Source Ajax Java Framework

code completion / content assist for custom components in Eclipse IDE

liebomat
3 Mar 2010 08:36:57 GMT
3 Mar 2010 08:36:57 GMT

Hi, I have been wondering whether code completion is available for custom components.

Previously I added a custom taglib "metainfo/tld/config.xml" (in my src folder). It perfectly plugged together with "metainfo/tld/config.xml (in zk jar)".

Now I want to combine zul.xsd files, namely: "metainfo/xml/zul.xsd" (in my src folder) and "metainfo/xml/zul.xsd" in (in zul jar) in order to have autocomplete feature for the custom components.

I found that hint on ZK 5 Component development - the Imagepicker but it does not seem to work.

The example below tries to overwrite the component definition of the "image" component which does not work. I also tried to define a new component "custom-image" instead so the component and it's xsd definition would not be overwritten, but no luck so far.


The definition of the component in "zk-language-global.xml":

<component>
<component-name>image</component-name>
<component-class>utils.zk.CustomImage</component-class>
<extends>image</extends>
<annotation>
<annotation-name>default-bind</annotation-name>
<property-name>byteData</property-name>
<attribute>
<attribute-name>access</attribute-name>
<attribute-value>both</attribute-value>
</attribute>
<attribute>
<attribute-name>save-when</attribute-name>
<attribute-value>self.onChange</attribute-value>
</attribute>
</annotation>
</component>


the zul.xsd in folder "src/metainfo/xml" :

<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns="http://www.zkoss.org/2005/zul"
targetNamespace="http://www.zkoss.org/2005/zul" elementFormDefault="qualified">

<!-- image -->
<xs:element name="image" type="imageType" />
<xs:complexType name="imageTypeC">
<xs:group ref="baseGroup" minOccurs="0" maxOccurs="unbounded" />
<xs:attributeGroup ref="xulElementAttrGroup" />
<xs:attribute name="border" type="xs:string" use="optional" />
<xs:attribute name="src" type="xs:string" use="optional" />
<xs:attribute name="content" type="xs:string" use="optional" />
<xs:attribute name="byteData" type="xs:string" use="optional" />
<xs:attribute name="hover" type="xs:string" use="optional" />
<xs:attribute name="hoverContent" type="xs:string" use="optional" />
<xs:attribute name="align" type="alignAttrType" use="optional" />
<xs:attribute name="hspace" type="xs:string" use="optional" />
<xs:attribute name="vspace" type="xs:string" use="optional" />
<xs:attributeGroup ref="mouseExtAttrGroup" />
<xs:attributeGroup ref="rootAttrGroup" />
</xs:complexType>

</xs:schema>


My zul pages start with the "<window>" tag without specifying the zul.xsd in a <zk> tag. I have changed the Preferences of ZUL Editor to "Use plugin build-in zul.xsd" as described in Studio userguide Preference

Since this component is already in the zul palette this great idea (How to add custom components to the Zul Pallete) also does not solve autocomplete.

Hints would be great! Thanks in advance!

samchuang
18 Mar 2010 22:02:35 GMT
18 Mar 2010 22:02:35 GMT

Hi

The zk studio doesn't use the xsd file in jar file, if you need this feature

you could post to feature request of zk studio.

liebomat
9 Apr 2010 04:01:14 GMT
9 Apr 2010 04:01:14 GMT

for others, that would also like to have this feature, I now have posted the feature request.

https://sourceforge.net/tracker/?func=detail&aid=2984377&group_id=152762&atid=785194