The ICEfaces Eclipse Integration provides ICEfaces support for developers who use the Eclipse IDE for Java EE. The integration allows you to quickly start developing ICEfaces applications. Design view integration allows you to easily work with ICEfaces components.
The following tools are used in this tutorial:
- Eclipse IDE for Java EE Developers
- Tomcat 7.x Web Server
- Java 6.x
- Latest ICEfaces Integration for Eclipse
Download the Eclipse plugin from http://www.icesoft.org/downloads/icefaces-downloads.jsf under Tools Support -> Eclipse.
Place the zip file in a local directory.
Unable to render embedded object: File (download1.png) not found.
Start Eclipse. From the Eclipse main menu bar, select Help -> Install New Software... -> Add --> Archive...
Select the plugin (zip file) from your local directory, give it a name and click Ok.
Unable to render embedded object: File (plugin1.png) not found.
Select the checkbox beside ICEfaces Update Site, click Next, accept Licenses and click Finish.
Unable to render embedded object: File (plugin2.png) not found.
This will require a restart of Eclipse.
Now that we have the ICEfaces plugin installed, we can create a new project with ICEfaces capabilities.
From the Eclipse main menu bar, select File -> New -> Dynamic Web Project
Type in the Project name and select a Target runtime. For Configuration, select 'ICEfaces 3 Default Project Configuration' and click Next>
Unable to render embedded object: File (newprojectdialog.png) not found.
In the JSF Capabilities dialog, there is a download button (with the arrow pointing down) available to download the required JSF and ICEfaces jars. Click on the button to launch the Download Library dialog.
Unable to render embedded object: File (jsfcapabilitiesbefore.png) not found.
Once you click the button you will see a list of selections similar to those in the image below. Libraries have to be downloaded one at a time. To download a library, highlight it and click Next> to accept the license. Finally, click Finish.
The JSF 2 (Mojarra 2.1.3) jars are required.
Unable to render embedded object: File (jarselection.png) not found.
After the libraries have been downloaded select the libraries you want to include in your project by checking the checkbox beside each library. Click Next>
Unable to render embedded object: File (jsfcapabilitiesafter.png) not found.
The next dialog is related to ICEfaces configurations. Accept the defaults and Click Finish:
Unable to render embedded object: File (icefacesconfigurations.png) not found.
The new project should show up in the Project Explorer:
Unable to render embedded object: File (projectexplorer.png) not found.
We have created an ICEfaces/JSF 2 project, now lets run the project. Right click on the project in Project Explorer:
Unable to render embedded object: File (runonserver.png) not found.
If you have downloaded and extracted Tomcat 7 locally, in the Run On Server dialog choose Tomcat 7. The first time you do this, you will be asked to browse to the location of Tomcat 7 on your file system:
Unable to render embedded object: File (runonserverdialog.png) not found.
After clicking on the Finish button, Eclipse will launch the application in the browser you have selected under Window -> Web Browser:
Unable to render embedded object: File (runninginbrowser.png) not found.
The Eclipse Visual JSF Page Designer has been added since Eclipse 3.3 as part of WTP 2.0. The Design Time Canvas provides an intuitive close-to-WYSIWIG editing experience. It allows you to visually manipulate JSF page layout and components using drag and drop.
The ICEfaces plugin includes design time support for ICEfaces Advanced Components (ICEfaces 2+) and ICEfaces Components (ICEfaces 1.8.2 compatible with ICEfaces 2+). This includes the palette view and property view when opening your ICEfaces pages with the Web Page Editor.
To open your page with the Web Page Editor:
Right click on the ICEfaces xhtml page
Select Open With -> Web Page Editor
Unable to render embedded object: File (webpageeditor1.png) not found.
You can select ICEfaces Advanced Components and/or ICEfaces components from the Palette. In this case we select a dateTimeEntry component from the ICEfaces Advanced components:
Unable to render embedded object: File (paletteselection1.png) not found.
Drag and Drop the component on to the Design Time Canvas:
Unable to render embedded object: File (dragdrop1.png) not found.
The component will automatically be rendered in the Design Time Canvas:
Unable to render embedded object: File (dropped1.png) not found.
Create a new Java class file called YourBean in the package org.icefaces.view and paste the code below:
This bean model has an instance variable to back the field on our page. The dateSelectListener method will set the instance variable to the value what was submitted, but otherwise the class is simple.
We can now run the application and see the added component rendered out to the browser:
Unable to render embedded object: File (browserrendering.png) not found.