Via Cà Matta 2 - Peschiera Borromeo (MI)
+39 02 00704272
info@synaptica.info

Eclipse + zk

Eclipse + zk


Needed application running

• java virtual machine (if you are running ubuntu i suggest the ubuntu package “openjdk-6-jdk”)

Needed files
• eclipse-jee-ganymede-linux-gtk.tar.gz from http://www.eclipse.org/downloads/
• zk-studio-0.5.1.zip from http://downloads.sourceforge.net/zk1/zk-studio-0.5.1.zip
• zk-bin-3.0.7.tar.gz from http://www.zkoss.org/download/zk.dsp

Operation
• unpack eclipse somewhere.
• put the jar file contained in the zk-studio-0.5.1.zip into the directory /plugins
• restart eclipse if opened

# Define a Server Runtime

* From menu Window/Preferences…

* In Server > Runtime Envinronments, Click “Add”
* Select Apache > Apache Tomcat v5.5 and click Next
* Browse to and select your Tomcat root directory e.g. C:\Program Files\Apache Software Foundation\Tomcat 5.5
* Select JDK 1.5
* Finish & OK

# Define a Server Instance

* From menu, Windows/Show Views/Others…,
* Select Servers/Servers
* In the “Servers” view, right click mouse(context menu) to add a new server

follow this point from this guide http://www.zkoss.org/smalltalks/zkstudioI/index.dsp
ZK Package Managements in Eclipse Preferenece Dialog

1. In your Eclipse IDE, click toolbar “Window” and select “Preferences…”.
2. at preference tree, select “ZK” category then chose “Installed ZKs”.
3. Currently there are no installed ZKs, so we need to prepare one. Preparing a ZK package is very simple:
1. download ZK’s binary distribution from SourceForge.net (use zk-bin-3.0.7.tar.gz if you have downloaded the needed files)
2. Unpack it as a folder, put it in a proper place like: “C:\ZK\”
3. Thats all you need to do.
4. Back to Eclipse IDE’s preference dialog. In “Installed ZKs” click “Add…” button and chose the package you prepared.
5. Press “apply”, “ok” to quit preference dialog.

Now you can install a ZK package you just added into a ‘Dynamic Web Project’ after all these settings.

Add ZK while creating Dynamic Web Project

The way to create a new ‘Dynamic Web Project’ is still the same:

1. In Eclipse IDE, click on ‘File’, select ‘New’->’Project’ and chose ‘Web’->’Dynamic Web Project’ in new project dialog.
2. Then, Eclipse will open a new project wizard, type the project name and press next.
3. In “Project Facets” page, check “ZK WebApp” facet.
4. In “Web Module” page, do your configuration and press “next” button.
5. In “Select Project’s ZK Version” page, select the ZK version you want to use in this project.
6. Click on “finish”, and Eclipse will generate a new project with ZK inside.

zul file extension with XML editor

* From menu, Window/Preferences…
* General > Content Types > XML, add “*.zul” file extension

# Your first ZK file, helloworld.zul

select Run > Run On Server > Tomcat 5.5

Tags: , , ,

Lascia un commento