New Features of ZK Studio 0.9.2


Charles Pao, Engineer, Potix Corporation
ZK Studio 0.9.2 : January 16, 2009

Version

Installation

Introduction

In this article, I'll demonstrate those features in ZK Studio to facilitate developing Ajax application.

WYSIWYG Editor

The ZUL Visual Editor can let you preview the result of the currently edited zul file in Intelligent Editor. You can open the Visual Editor by clicking 'Window > Show View > Others > ZK > ZUL Visual Editor' in Eclipse menu.

The ZUL Visual Editor will display your changes in zul file instantly, and when you select certain component in Intelligent Editor, that component shown inside the ZUL Visual Editor will be marked with blue dash-line rectangle frame, and if you click certain component inside the ZUL Visual Editor, the corresponding code segment in Intelligent Editor and the component in Hierarchy View of ZUL Page will also be highlighted, if that component has an id attribute, there is a blue tag shown in the visualized content area for indication.

Library Quick Switch  New!

The ZUL Visual Editor can not only preview the result via the current project that the zul file reside in, but also the ZK packages that configured in ZK Package setting in Preference, you can easily change the applied package of ZUL Visual Editor by a drop-down menu that invoked by the triangular button on its toolbar.

Preview in Pure Java Project

You can preview the ZUL file result even if the project is only a pure Java Project. With the ZKs Package management, it is very convenient to manage ZK packages in Eclipse Global setting and the ZK Library using in your project via project Preference. Loading / unload ZK Library can be done without user manually removes JAR files in his project.

ZK Style Designer  New!

The ZK Style Designer (*Note: for ZK v3.5.2 and above only.) provides a friendly GUI interface to edit CSS styles for various ZUML components, used with ZUL Visual Editor, you can see customized result immediately.

Currently supported components are:
  • < image />
  • < label />
  • < hbox />
  • < vbox />
  • < panel />
  • < listbox /> default mold
  • < tabbox /> horizontal orient
Other components are continuously developing.

You can customize a component with Style Designer:

And you can apply the style to zul files and immediately inspect the rendering result in ZUL Visual Editor:

Ajax Widget Palette

Instead of directly typing code in Intelligent Editor, ZK Studio provides a drag-and-drop development to edit zul file.

ZUL Palette

ZUL Palette is a custom view of studio, you can open it by clicking 'Window > Show View > Others > ZK > ZUL Palette'.

ZUL Palette shows the full components/directives of ZK as an item in palette, those items are categorized in different groups.

You can select an item and drag it to ZUL Editor or Outline. When you drag an item to ZUL Editor, it will insert a template text to the position where you dragged. When you drag an item to Outline View on a special tree node, it will insert a template XML node to the position where you dragged.

Filtering

The ZUL Palette now supports filtering, which means you can type component's name and find it quickly. And with the aid of Visual Editor, it can boost the coding speed greatly.

Intelligent Editor

The Intelligent Editor is the file editor of ZUL pages for developing ajax application, it supports editing *.zul & *.zhtml files.

Content Assistance (a.k.a: Code Assist)

As the Content Assistance functionality in Java Editor and JSP Editor in Eclipse, Now just press the Content Assistance shortcut key (default in English version of Eclipse is ctrl + space), and the Intelligent Editor will pop up for you the proper suggestions in a list.

Content Assistance in ZUML & XML tag

The Intelligent Editor supports auto-complete.

Content Assistance in ZUML & XML tag

Content Assistance in Zscript

Works not only for ZUML tag, but also for Java codes in <zscript> and event code blocks!

Content Assistance in <zscript>

Content Assistance in EL Expression

The EL Expression in zul file is also supported.

Content Assistance in EL Expression

Content Assistance with Helper JAVA Doc

In addition to showing the proposals in Content Assistance, the supplementary Java Doc can be shown aside.

Show Java Doc next to Content Assistance pop-up menu

JAVA Doc Hovering

Just as the Java Editor in Eclipse, the Intelligent Editor will also pop up Java Doc when a user hovers the mouse pointer on the code.

Syntax Check

Codes in <zscript> element and <attribute> element, enclosed in <![CDATA[ and ]]> with default JAVA scripting language, are verified against Java syntax automatically. The indicators on the right side vertical ruler and the left side markers will show the appropriate message to guide you correct the code.

Syntax Coloring

Codes in <zscript> element and <attribute> element, enclosed in <![CDATA[ and ]]> with default JAVA scripting language are supported with syntax coloring.

Mark Occurrence

Mark Occurrence is a useful functionality when you need to trace certain variable or component accessing activities in code. It can show the variable both inside and outside zscript.

Hyperlink Navigation

Press Ctrl key and click mouse button on the portion of code you want to navigate to. Currently we support link to URL, Project Resource, and the Java class as specified in the use ZUML tag attribute and code inside the <zscript> with the default JAVA script language.

Ctrl-Click the URL, jump to that file!

Here is the Project Resource Hyperlink Navigation, certain attribute like src or image which has value of URI-like patterns, ZK Studio can open the resource that attribute value specified.

Ctrl-Click the path, jump to that resource file!

And you can navigate to the Java class specified in use="ClassName" attribute

Ctrl-Click the Class Name, jump to that source file!

You can use Hyperlink functionality just as Java Editor in Eclipse in <zscript>...</zscript> and <attribute name = "onEventName">...</attribute> code section which use the default JAVA script language. And the default keyboard shortcut F3 for the "Open Declaration"” function in Eclipse is also available.


And some special attribute which points to specific JAVA code can also have hyperlinking and "Open Declaration" function too.

Smart Assist

ZK studio supports the following features of smart assist:

Hierarchy View of ZUL Page

It can show you the whole zul page structure in a tree view like in Eclipse Outline View, with visual icons to distinguish different tag elements and an additional id notation in parentheses to distinguish the same kind of tag element.

Property View of ZUML Tag

When you select a ZUML tag element in Intelligent Editor or in Eclipse Outline View, the associated attribute information will be listed in the Eclipse's property view.

Certainly, you can edit the value directly. For some properties with enumeration attributes (e.g. true/false, normal/none, left/center/right), an informative combo box editor is used to help you input the correct value.

Preference Setting

There are many options for Intelligent ZUL Editor and WYSIWYG ZUL Visual Editor of ZK Studio that you can config based on using experience, and the library path used in project can be config in its preference setting.

Troubleshooting

  1. Q:
    Why I can't see the Syntax Colored zscript code in my zul page?
    A:
    You have to insert <![CDATA[ and ]]> inside the <zscript> and <attribute> code block.

  2. Q:
    I have installed the ZK Studio plugin in my Eclipse. When I open a zul file by double clicking the entry in Project Explorer in Eclipse, it is not opened by the Intelligent Editor (), but is opened by the Default Eclipse XML Editor(). What's wrong?
    A:

    In some our older smalltalks and documents, they instructed ZK developers to set *.zul file to be handled by Eclipse's built-in XML Editor; this should be cleared before install the plugin. If not, please open the Eclipse preference setting dialog ([Window]\[Preferences...]\General\Editors\File Associations) and set the "ZUL Editor" as the default editor for *.zul files.


    And You can force Eclipse to open zul file in ZUL Editor by right-click menu entry in Navigator, Package Explorer, Project Explorer View.


  3. Q:
    Why I always got JAVA Syntax Error mark in my code, even if it can run correctly on ZK?
    A:
    Currently you have to append two special comments: //@DECLARATION and //@IMPORT in zscript code block inside the <zscript>. The //@DECLARATION is used when declaring classes and functions; the //@IMPORT is used when there is a JAVA import directive; these two comments can only be used only once in one code section surrounded with <![CDATA[ ]]>.
    And if you define a class in zscript, don't use the access modifier public, just use the default access modifier.

  4. Q:
    I use the non-JAVA Syntax such as var zoom = self.zoom in my code. Why the ZUL Editor shows me that the code is wrong?
    A:
    Currently Syntax Check is for JAVA only, so the code like var zoom = self.zoom will cause warning.

  5. Q:
    Why the URL Hyperlink doesn't work when I use src="someFile.zul"?
    A:
    You have to specify Absolute URL Path. Such as src="/someFile.zul".
Comments
 
Gilles
2008-11-06

This really rocks!! Congrats to you. It's an amazing job. This is really going to make development faster

Thanks a lot
Gilles

Ricardo
2008-11-06

ZK Studio is getting better each version, congratulations.

But, after install ZK Studio 0.9.0 from http://studioupdate.zkoss.org/studio/update the Visual Editor is not shown in Window > Show View > Others > ZK > ZUL Visual Editor

Anybody else ?

Bernd
2008-11-06

Excellent work, as usually :-) !!!!!!!!!

Please keep up with it !!!

Greetings
Bernd

Ian Tsai
2008-11-07

to Ricardo

Can you provide the version info of your Eclipse?
And if you find any information about ZK Studio in Eclipse ErrorLog View, please post it too(it would be really, really helpful).

Finally I sinsearly invite you to post your problem to ZK Forum (Category: Studio), because ZK Engineer build a tracking system to monitor all new posts there but haven't built a same one on message board yet.

Ricardo
2008-11-07

To Ian Tsai

Eclipse: 3.4.1
Build id: M20080911-1700

Today eclipse notified me for auto-update to version 0.9.0.v200811051934 and after this update ZUL Visual Editor appeared.

Error log does not contain anything about Zk plugin.. (just verified after update)

Thanks

marcel
2008-11-08

I updated to Studio 0.9.
However, when I start the ZUL ve it loads with a HttP error 404!
The ZUL palette seems to work OK as it generates source code in my ZUL file.But nothing happens on the ve window.
Any hint ?

Marcel

David_Cheung
2008-11-10

Simply GREAT ! \\^O^//

Jack
2008-11-11

Awesome, totally.

eduardo
2008-11-11

Excelente!!! necesitamos más gente Latinoamericana metida en este framework es genial!!!

Gran trabajo equipo, Felicidades!!
Great Job team, Congratulations!!

VIVA ZK!

Dennis
2008-11-13

Maybe the workaround of VisualEdiotr 404 problem for 0.9.0.
http://www.zkoss.org/forum/index.zul#path%3DlistComment%3BdiscussionId%3D6201%3BcategoryId%3D18%3B

vicente
2008-11-13

how do I access the list of properties of a particular component ZK in the windows outline and ZUL palette?

SirX
2008-11-17

I want to know when ZK will fix the "VisualEdiotr 404 problem".
Thanks a lot! Zk is really really good~

Dennis
2008-11-17

A freshly version for VE 404 bug will be released asap.
I will post a notification in zk forum/studio after freshly released .

2008-11-19

a freshly version ready , it has fixed the 404 bug.

http://www.zkoss.org/forum/index.zul#path%3DlistComment%3BdiscussionId%3D6250%3BcategoryId%3D18%3B

Pedro
2008-11-19

El error 404, se elimina si se elimina(n) los bancos en el directorio de Eclipse, lo tenia en Eclipse GA, al colocar EclipseGA, quedo resuelto, tal como menciona Dennis, realmente es un framework insuperable, lo estamos utilizando en la universidad donde trabajo en un nuevo desarrollo y hemos avanzado velozmente

Ian Tsai
2008-11-26

Sorry, but I can't speak Spanish.
So if you faced any problem in ZK Studio, would you please kindly translate your comment to English?

thanks.

willy
2008-12-02

I get Syntax error on tokens "import", try to cover imports with CDATA but couldnt fix the problem, can you please give us a simple code

bernd
2009-01-15

AMAZING !!!!!!!!!!!!!!!!!!

congratulations
Bernd

Kursat
2009-01-16

I have just downloaded and tried to check css editor, but i am getting error:
"Failed to render : Unsupported child for Listbox : <Unsupported null>

Andy Susanto
2009-01-16

wow. it great man

thanks for you new feature tu handle css

Dennis
2009-01-19

Kursat, Please make sure your visual editor runtime was targeting on ZK 3.5.2

jamain
2009-02-12

没有中文啊 大哥.......

Peter
2009-02-13

The above comment said "No Available Chinese Version, Bro". Because ZK is aiming to be global, therefore we'll provide English version first. But anyone is welcome to translate it to his own language. And our wiki is an open space to share.

Carlos
2009-02-15

i am having problem with the visual editor and all my zk proect doesnt run on server. Once i have installed it on my eclipse euripe all these problem started

trusted gambling casinos
2009-03-18

Its a good article.Really the ZK Style Designer provides a friendly GUI interface to edit CSS styles for various ZUML components, used with ZUL VisualEditor.ZK Studio 0.9.2 introduced new features like Style Designer, and Theme Manager. Developers can customize the style of
user interface by setting properties, and see the result in seconds. http://www.trustedgamblingcasinos.com

 
 
Leave a Reply
 
Name (required)
Mail (will not be published) (required)
Website
(Case Insensitive)
Bold textItalic textUnderLine textSource CodeHorizontal rulerExternal Link
Post
Preview