Editing Non-Java Files
Each editor provides syntax coloring and code-completion, as well as a convenient tree-view of the document structure in the Outline view (see Figure 2). The majority of these editors, such as the HTML, JSP, JSTL, JSF, and the other XML-family editors, will raise warnings and/or errors if your file is badly structured or incorrect. All of these features contribute to increasing productivity and improving the user experience when developing with these kinds of files.
|Figure 2. Editing a JSP/JSTL File with a WTP Editor|
|Figure 3. Editing a CSS Stylesheet with a WTP Editor|
Working with XML
Rare is the J2EE developer who does not need to tinker with XML from time to time. Until now, plug-ins such as XML-Buddy
were required for syntax coloring and document validation features.
To remedy this, the WTP project has provided a comprehensive set of editors for XML and XML-related documents. The standard XML editor provides a convenient three-fold view of the XML document (see Figure 4).
The XML source code is displayed and edited in the central panel, which also supports the indispensable syntax coloring and checks that the document is well formed (the XML syntax is correct) and valid (the document structure respects the XML schema or DTD for this document type). The Outline view displays the structure of the document in a tree view. At the bottom of the screen, the Properties panel listsand lets you editthe attributes for a selected XML element. This last feature is handy if you don't remember all of the possible attributes for elements in complex XML documents, such as Spring configuration files or Hibernate mappings.
WTP also provides good support for XML schema documents, allowing you to view and edit an XML schema in both textual and graphical form (see Figure 5).
The Properties view lets you see at a glance and modify element types and cardinalities. And, as usual, the Outline view gives you a good summary of the document structure. Although you still need a good knowledge of XSD to create new schema effectively, the WTP graphical editor does make working with this sort of file easier and more productive.