JBoss.comEnterprise Documentation

Visual Web Tools Reference Guide

Version: 1.1.0.CR1

April 2008


1. Visual Web Tools
1.1. Key Features of Visual Web Tools
1.2. Other relevant resources on the topic
2. Spring Tools
2.1. Spring IDE guide
2.1.1. Add Spring Project Nature
2.1.2. Create New Spring Project
2.1.3. Add References To Other Spring Projects
2.1.4. Add Spring Beans Config Files
2.1.5. Create Spring Beans Config Sets
2.1.6. Open Spring Explorer
2.1.7. Validate Spring Beans Config
2.1.8. Open Spring Beans Graph
2.1.9. Search Spring Beans
3. Editors
3.1. Editors Features
3.1.1. OpenOn
3.1.2. Content Assist
3.1.3. Synchronized Source and Visual Editing
3.2. Visual Page Editor
3.2.1. Advanced Settings
3.2.2. Setup notes for Linux
3.2.3. JSP syntax validation
3.2.4. JSP Page Preview
3.3. More Editors
3.3.1. Graphical Properties Editor
3.3.2. Graphical TLD Editor
3.3.3. Graphical Web Application File (web.xml) Editor
3.3.4. CSS Editor
3.3.5. JavaScript Editor
3.3.6. XSD Editor
3.3.7. Support for XML Schema
4. JBoss Tools Palette
4.1. Palette Options
4.1.1. Palette Editor
4.1.2. Show/Hide
4.1.3. Import
4.2. Using the Palette
4.2.1. Inserting Tags into a JSP File
4.2.2. Adding Custom JSF Tags to the JBoss Tools Palette
4.3. Rich Faces Support
5. Web Projects View
5.1. Project Organization
5.2. Drag and Drop
5.2.1. For a Property
5.2.2. For Managed Bean Attributes
5.2.3. Navigation Rules
5.2.4. For a Tag Library File Declaration
5.2.5. For JSP Pages
5.3. Developing the Application
5.4. Expanding Tag Library Files
5.5. Drag and Drop Tag Libraries on to JBoss Tools Palette
5.6. Create and Import JSF and Struts Projects
6. JBoss Tools Preferences
6.1. CodeAssist
6.2. Editors
6.3. JBoss Servers
6.4. JSF
6.5. JSF Flow Diagram
6.6. JSF Page
6.7. JSF Propject
6.8. Packaging Archives
6.9. Plug-in Insets
6.10. Resource Insets
6.11. Seam
6.12. Seam Validator
6.13. Struts
6.14. Struts Automatic
6.15. Struts Customization
6.16. Struts Flow Diagram
6.17. Struts Pages
6.18. Struts Project
6.19. Struts Support
6.20. Title Diagram
6.21. Verification
6.22. View
6.23. Visual Page Editor
6.24. XDoclet
6.25. XDoclet Templates
6.26. XDoclets Variables
6.27. Changing Default Environment During Project Creation
6.28. Changing Default Project Template During Project Creation

This guide covers the usage of Visual Web Tools in JBoss Developer Studio and JBoss Tools. The difference between these products is that JBoss Tools are just a set of Eclipse plugins where JBoss Developer Studio adds the following functionality:

  • an installer

  • Eclipse and Web Tools preconfigured

  • JBoss EAP with JBoss AS and Seam preconfigured

  • 3rd party plugins bundled and configured

  • access to RHEL and Red Hat Network

  • access to the JBoss/Red Hat supported software

For additional information, please visit the JBoss Developer Studio home page at: http://www.jboss.com/products/devstudio.

In JBoss Tools there is an extensive collection of specialized wizards, editors and views that can be used in various scenarios while developing Web applications. The following chapters walk through these features.

Here is the table of the main features of Visual Web Tools:

Table 1.1. Key Functionality for Visual Web Tools

FeatureBenefitChapter
Visual Page EditorPowerful and customizable visual page editor. Possibility to develop an application using any web technology: jsf, seam, struts, jsp, html and others. Developing using four tabs: visual/source, visual, source and preview. Fast and easy switching between these tabs. Split screen design of visual and source views. Full and instant synchronization between source and visual views. Integration with properties and outline views. Graphical toolbar to add inline styling to any tag. visual page editor
JBoss Tools PaletteOrganizing various tags by groups, inserting tags into a jsp or xhtml page with one click, adding custom or 3rd party tag libraries into the palette, easy controling the number of tag groups shown on the palette. jboss tools palette
Web Projects ViewVisualizing and displaying projects by function. Easy selecting of different kinds of items and dropping them into jsp pages. Using context menus to develop the application. Using icon shortcuts to create and import JSF and Struts projects. Expanding and inspecting tag library files. Selecting custom and third-party tag libraries to drag and drop onto the JBoss Tools Palette. web projects view
OpenOnEasy navigation between views and other parts of your projects. openOn
Content AssistCode completion proposals while working in java, xml, jsp, xhtml, xhtml, seam project and jsf configuration files. Content assist based on project data (dynamic code assist); with graphical editor. Code completion for values from property files, beans attributes and methods, navigation rule outcomes and jsf variables. content assist
Drag-and-DropPossibility of inserting any tag onto the page you are editing by just drag-and-droping it from the palette to this page. Adding any properties, managed bean attributes, navigation rules, tag library file declarations, jsp files from web projects view by clicking them and draging to source code. visual page editor drag-and-drop
Rich Faces SupportTight integration between JBDS and RichFaces frameworks. Easy managing RichFaces components in any web application. Support for RichFaces and Ajax4jsf libraries in JBoss Tools Palette. Rendering RichFaces components in Visual Page Editor. rich faces support

JBoss Developer Studio is bundled with Spring IDE for Eclipse. Visit Spring IDE site for the latest versions and documentation.

In the JSF Tools Reference Guide and Struts Tools Reference Guide you had possibility to read about Graphical Editor for JSF and Struts configuration files, Graphical Editor for Tiles Files, Graphical Editor for Struts Validation Files. All these editors have OpenOn and Content Assist features, which are described in more details in this document. In addition you get to know a Visual Page Editor for combined visual and source editing of Web pages and many other editors for different types of files.

JBoss Developer Studio has powerful editor features that help you easily navigate within your application and make use of content and code assist no matter what project file (jsp, xhtml, xml, css, etc...) you are working on.

Content assist is available when working with

When working with JSF project in JBoss Developer Studio, you can use various Content Assist features while developing:

Here is what you need to do to add project based code assist to a custom component added in JBoss Developer Studio:

Follow these steps to set what is available for code assist:


<AttributeType ...>
       <proposal type="jsfVariables"/>
</AttributeType>

<AttributeType ...>
       <proposal type="bundleProperty"/>
</AttributeType>

<AttributeType ...>
       <proposal type="beanProperty"/>
</AttributeType>

<AttributeType ...>
       <proposal type="beanProperty">
          <param name="type" value="java.lang.Boolean"/>
       </proposal>
</AttributeType>

<AttributeType ...>
       <proposal type="beanMethodBySignature">
          <param name="paramType" value="javax.faces.context.FacesContext"/>
          <param name="paramType" value="javax.faces.component.UIComponent"/>
          <param name="paramType" value="java.lang.Object"/>
          <param name="returnType" value="void"/>
       </proposal>
</AttributeType>

JBoss Developer Studio comes with a powerful and customizable Visual Page Editor (VPE). You can use the Visual Page Editor to develop an application using any technology: JSF, Struts, JSP, HTML and others.

Current VPE version has two tabs: Visual/Source and Preview.

Here is shown a split screen design with instant synchronization between Source and Visual views:


Preview view is read-only, it shows how the page will look like in a browser.


The Visual Page Editor has a split pane with toggle buttons for quickly moving between source, visual or source/visual modes instead of multiple tabs.

You can use Shift + F6 and Alt + Shift + F6 as shortcuts to toggle between the various states of the split pane.

Tip:

When editing large documents hiding the visual part will speed up the editing.


No matter what view you select, you get a full integration with Properties and Outline views:


The VPE allows you to insert any tags from the palette to the page you are editing with just a click or drag-and-drop.


In the visual part of VPE there is a graphical toolbar, use it to add inline styling to any tag. The toolbar can be hidden by clicking on arrow sign in the upper left corner.


In the left vertical pane there are three buttons: Preferences, Refresh, Page Design Options.


Preferences button provides a quick access to Visual Page Editor preferences.


Clicking on Refresh button you refresh the displaying information.

Page Design Options button leads to page design options.


This dialog let's you set resources which are usually only resolved in runtime. To set a stylesheet, click Add (for CSS File Path section) and add your stylesheet. It works when CSS is defined on your page in the following way:

Code:


<link rel="stylesheet" type="text/css"  
    href="#{facesContext.externalContext.requestContextPath}/style.css"/>

This will work fine in runtime, but the Visual Page Editor doesn't know what requestContextPath in design time is.

The next section (URI), let's you add URI taglibs if you are using includes so that the editor knows where to find the tag libraries.

The first two sections let you define actual runtime folders. Here is an example.

Let's say you have the following project structure:


WebContent/
  pages/
    img/
       a.gif
    header.jsp
  main.jsp

header.jsp content:


My Header
<img src="img/a.gif"/>

main.jsp:


<jsp:include page="pages/header.jsp" />

When you open main.jsp in Visual Page Editor, it will not be able to resolve the image from the header, however, it will work fine in runtime. To fix this in design time, click the Page Design Options button and set Actual Run-Time Relative Folder to <project>WebContent > pages and you will see the image appear.

At the bottom of VPE there is a Selection bar.

By clicking on the component in Visual view or selecting a code snippet in Source mode you see the tags tree. If you want to hide the selection bar, use the "Hide Selection Bar" button on the lower right side.


Besides Visual Page Editor JBDS is supplied with a huge range of various editors for different file types: properties, TLD, web.xml, tiles, and so on.

This chapter will introduce you to the functionality provided by JBoss Tools Palette. The Palette allows you to quickly and easily create your JSP or JSF pages. Now you can do it more faster without additional knowledge.

The JBoss Tools Palette allows you to:

  • Insert tags into a JSP or JSF page with one click

  • Add custom and 3rd party tags

The JBoss Tools Palette contains a developer's project tag libraries and provides possibility to add any tag libraries to it. Also you can choose a necessary one from the list of already existed tag libraries:

  • HTML

  • JBoss

  • JSF

  • JSTL

  • MyFaces

  • Oracle ADF Faces

  • Struts

  • XHTML


By default the Palette is represented in Web Development Perspective with four groups. If you can't see it, select Window > Show View Other... > JBoss Tools Web > JBoss Tools Palette from the menu bar.

To facilitate your work, you can configure the Palette in your own way, by selecting the corresponding icon on the Palette toolbar.

There is a possibility to configure the JBoss Tools Palette:


JBoss Tools Palette contains existing libraries of tags, thus the Palette editor is intended to work with them or create your new one, as well.

To open the editor, click on the Palette Editor icon:


The window has two parts. There is a reflected grouped list of components on the left side of the palette editor. Each group is divided into multiple groups, every of which is a tag library. The right side of the palette editor is an editing window where it's possible to change values of group or tag library attributes that you've chosen on the left part of the window.

It can also be done by right click and using Edit… option.

For example, JSF group consists of Core, Facelets, HTML tag libraries and the attributes as name, description and hidden which are available for editing:


The Palette Editor provides the following possibilities when working with existing tags or icons:

There are two ways to add any custom or 3rd party tag library to the JBoss Tools Palette:

Before you can add your custom component library, you need to make sure it is included in your project. Either place the ".tld" file or the ".jar" that includes your tag library under the lib folder in your project.

The same you can do with Import button. You can see this button at the top right side of the JBoss Tools Palette.


By clicking on the Import button you will see the Import Tag window a similar like in the Drag-and-Drop method. Set the name and prefix of the library and Library URL. Also you need to set the Group name to which you'd like to add your tag library. And like in the previous method you can add it to an existing Group or create a new one. On this Import Tag form you can use Browse... button to locate the tag library that you want to add:


Web Projects is a special view that comes with JBoss Developer Studio.

If the Web Projects view's tab is not visible next to the Package Explorer tab, select Window > Show View > Other > JBoss Tools Web > Web Projects from the menu bar.

With the Web Projects view, you can:

  • Visualize the project better because the project artifacts for JSF and Struts projects are organized and displayed by function.

  • Select these kinds of items to drag and drop into JSP pages:

    • JSF managed bean attributes

    • JSF navigation rules outcomes

    • Property file values

    • Tag library files

    • Tags from tag libraries

    • JSP page links

  • Use context menus to develop the application (all create and edit functions are available)

  • Use icon shortcuts to create and import JSF and Struts projects

  • Expand and inspect tag library files

  • Select custom and third-party tag libraries to drag and drop onto the JBoss Tools Palette

Web Projects View has a drag and drop option that can be used for property, managed bean attributes, navigation rules, tag library file declaration and JSP Pages.

Configuring the various JBoss Developer Studio features is done via the Preferences screen by selecting Window > Preferences > JBoss Tools from the menu bar.


From this screen, you can select these more specific sets of JBoss Tools preferences:

Selecting JBoss Tools > Web > Editors > JSF Flow Diagram allows you to specify some aspects of the Diagram mode of the JSF configuration file editor.


The first two items control the background grid for the diagram. The next two items allow you to control the appearance of the labels for views (pages) and the transitions between views. For these two items, clicking the Change... button allows you to assign a font with a dialog box.

The first check box determines whether a view in the diagram that doesn't have a transition connecting it to another view yet should be written to the source code as a partial navigation rule. The next check box determines whether the diagram cursor reverts immediately to the standard selection mode after it's used in the transition-drawing mode to draw a transition. Finally, the last two check boxes concern shortcuts. A shortcut is a transition that is there but isn't actually displayed in the diagram as going all the way to the target view it's connected to, in order to make the diagram clearer. With the check boxes, you can decide whether to display a small shortcut icon as part of the shortcut and also whether to display the target view as a label or not.


Selecting the Add Page tab in the JSF Flow Diagram screen allows you to determine the default template and file extension for views (pages) you add directly into the diagram using a context menu or the view-adding mode of the diagram cursor.