Web 2.0 cloud taglib ver. 1.2

    Custom JSP taglib lets you display Web 2.0 cloud. Cloud here is a set of hyperlinks where font size depends on the element's weight. For example:
 


<%@ taglib uri="taglib.tld" prefix="c" %>

<style type="text/css">
.link
{
  color: #333399;
  text-decoration: none;
  font-family: Geneva, Arial, Helvetica, sans-serif;

}

a.link a.link:visited
{
  color: #333399;
  text-decoration: none;
  font-family: Geneva, Arial, Helvetica, sans-serif;
}

a.link:hover
{
  color: #FF8C00;
  text-decoration: none;
  font-family: Geneva, Arial, Helvetica, sans-serif;
}

</style>

Tags are:

<div style="position:relative;left:200px;width:300px">

<c:cloud className="link">
  <c:element url="http://www.servletsuite.com" weight="2">Coldbeans</c:element>
  <c:element url="http://www.servletsuite.com/jsp.htm" weight="6">Coldtags suite</c:element>
  <c:element url="http://www.servletsuite.com/servlets.htm" weight="3">JSOS</c:element>
  <c:element url="http://www.servletsuite.com/servlets/caltag.htm" weight="1">Calendar</c:element>
  <c:element url="http://www.servletsuite.com/jmx" weight="4">JMX</c:element>
</c:cloud>

</div>

and you will get some like this:
 

· Coldbeans · Coldtags suite · JSOS · Calendar · JMX ·

Your cloud contains a set of hyperlinks. And size for the element depends on its weight. You can directly provide a set of elements (see example above) or prepare that set on your server side and pass to the tag a collection of elements. Your collection can keep elements of com.cj.cloud.ElementBean type. This bean has got the following properties (as well as the appropriate get/set methods):
 


String url;
String text;
String target;
String onClick;
String title;
String className;
int weight;

There are two ways for passing the collection. Attribute value lets you directly provide collection, iterator, enumeration or array with elements. Attribute name lets you provide a name for your collection (iterator, enumeration etc.) in the request (page, session, application) scope.

Tags are:

cloud

Body tag lets you display Web 2.0 cloud. Parameters are:

1) value Optional parameter. Describes collection, iterator, enumeration or array with elements.
2) name Optional parameter. Describes a name for the request (page, session, application) scope variable with cloud's elements.
3) className Optional parameter. Describes a CSS class for your elements
4) dot Optional parameter. Possible values are true or false. Enables/disables a separator between elements. Default value is true.
5) max Optional parameter. Describes a maximal value for the displayed elements. By default all the elements will be showed.

element

Body tag describes an individual element. Parameters are:

1) url Optional parameter. Describes an url for this hyperlink
2) title Optional parameter. Describes a title (tooltip) for your hyperlink
3) target Optional parameter. Describes a target frame
4) onClick Optional parameter. Describes a JavaScript code for your hyperlink
5) className Optional parameter. Describes a CSS class for your element
6) weight Optional parameter. Describes a weight for this element. Default value is 1.

for downloading:

Library: cloudtag.jar    Description: taglib.tld

© Coldbeans      Comments?

See also Coldtags suite - the largest collection of custom JSP tags.

Also in Coldtags: