FeaturesPluginsDocs & SupportCommunityPartners

Tag Toolbar
User View Proposal

Version: 0.1 DRAFT
Author: Milan Kuchtiak, Sun Microsystems/Czech

Abstract: This document describes User View for JSP(Html,Xml) editor toolbar, that will enable user to insert different JSP(HTML, XML) tags into the opened text document.
Related Documents :
Editor Toolbar Proposal
Contents:
1. Motivation
2. Requirements
3. Description
3.1 The placement of the toolbar
3.2 Basic Functionality
3.3 Advanced Functionality

1. Motivation

Currently the support for web developers creating their own web application is focused on the ability to develop all individual web components like :
  • HTML and JSP pages
  • Tag libraries
  • WAR files
  • Web modules
  • Deployment descriptor
and on the ability to provide different actions on these components :
  • edit component (JSP page, deployment descriptor)
  • compile (parse) component
  • execute component (JSP page, Web module)
  • deploy component (Web module)
The support for developing JSP pages (HTML pages) using IDE text editor is rather poor (html, jsp coloring, code completion).
There is no support for :
  1. inserting the most common tags from the predefined tag palette and creating user specific tags and tag collections - customize the predefined tag-palette
  2. developing the web application as a whole complex (something like Apache Struts Project)
Tag Toolbar Feature schould fill mainly the frst hole and particulary the second.
Because of the fact that most of the web application development tools (STRUTS) use the big collection of predefined tags and tag libraries - Tag Toolbar Support is one of the most important IDE feature necessary for supporting these tools.

2. Requirements

  1. user should have possibility to insert JSP(HTML, XML) tags from Tag Palette into the text document
  2. user should have possibility to add his own specific tags and group of tags into the palette
  3. user should have possibility to choice which groups of tags and which tags inside the group will be displayed in the Tag Toolbar

3. Description

3.1 The placement of the toolbar

The problem is, where the toolbar should be placed. One possibility is to dock it in the editor window. See image :

Tag Toolbar in Editor Window

Advantages :

  • Each JSP page (HTML,XML document) could have it's own customized Tag palette
Disadvantages :
  • Tag Toolbar takes quite a big space from editor window
  • when user splits the editor window 2 or more identical toolbars could be on the screen
  • Each JSP page(HTML,XML document) requires to create a new instance of Tag Toolbar class.

Another proposal is to place toolbar to NetBeans' main window. See image :

Tag Toolbar in Main Window

Advantages :

  • There is only one instance of the Tag Toolbar Class
  • Toolbar does not take place from editor window
Disadvantages :
  • Tag Toolbar could not be customized specially for each JSP page
  • there are some issues how to protect other documents (like java sources, text files) from "Tag placement"

I think that the second solution is better for IDE - mainly from performance point of view.

3.2 Basic Functionality

Tags should be divided into the groups :

  • HTML tags - for HTML documents, JSP pages, (Struts pages)
    • Basic HTML Tags : like <B>, <I>, <U>, <H1>, <H2>, <A>,<IMG>, ...
    • Advanced HTML Tags : like <TABLE>, <TR>, <TD>, ...
  • JSP tags - for JSP pages, (Struts pages)
    • JSP Tags and directives : like <jsp:useBean>, <jsp:setProperty>, <jsp:getProperty>, <@ page>, <@ include>, ...
  • STRUTS tags
    • STRUTS bean tags
    • STRUTS HTML tags
    • STRUTS logic tags
    • STRUTS template tags
  • ...

There should be diffrent categories of tag according to the functionality :

  • html pair tags : like <B></B>, <A href=""></A>
  • html unpair tags : like <BR>, <IMG SRC="" HEIGHT="" WIDTH="" ALT="">, ...
  • JSP tags : like like <jsp:getProperty name="" property="" />, ...
  • JSP directives : like like <%@ taglib uri="" prefix="" %>, ...
  • special tags : like <!--    -->, <%--    --%>, <%=    %>
  • XML tags with prefix: like <xsl:template match=""></xsl:template>, <xsl:sort data-type=""select="" /> ...
  • XML tags without prefix : the same like html pair tags

Tags schould be able to work with selected text :

  • in case of tag without attributes (<B> , <BR>) clicking on tab button should place tags directly into the text at cursor position (or in case of selected text, this text should be enclosed by pair tags). See the picture :

    Tags around the selected text

  • in case of tags attributes - the dialog window should apear and ask for attributes . See example with <jsp:useBean> tag :

    Tag wit attributes

    (see that mandatory attributes are marked with asterisk)
    After filling attributes and confirmation, tag is inserted into the text - see the picture :

    Inserted tag after confirmation

3.3 Advanced Functionality

User should be able to choose with which categories of tags and which tags he wants to have at his disposal.

  • In case of JSP page user could check whether he wants to use HTML basic tags, HTML advanced tags, or JSP tags
  • In case of STRUTS document user could choose from all categories above plus from all STRUTS categories
There is an issue what object should keep and serialize that choice :
In case that each jsp page has its own TagToolbar - the setlection of tags could be kept in JspDataObject.
In case that there is only one instance of Tag Toolbar - the selection could be serialized as JSP option

User should be able to add/remove Tag category - new Tag group in Tag Toolbar. (like in Form Editor Toolbar)
User should be able to add/remove Tags to/from the category.
It would be nice if user could change the order of categories and order of tags inside the category in Tag Toolbar

Another appropriate functionality - as maybe feature is :

  • possibility to modify the existing tags
  • some keystroke combination (<CTRL>T) when the cursor is pointing at some tag in text editor could display the dialog where user can see all tag attributes and description how to use this tag - see the dialog above. In dialog- user can modify these attributes.

Companion
Projects:
MySQL Database Server   Open JDK: an Open SourceJDK   GlassFish Community: an Open Source Application Server    Mobile & Embedded Community    Open Solaris   java.net - The Source for Java Technology Collaboration   Virtual Box - full virtualizer  Open ESB - The Open Enterprise Service Bus Powered by