templates.library
Class TemplateDescriptor

java.lang.Object
  extended by templates.library.TemplateDescriptor

public class TemplateDescriptor
extends java.lang.Object

Encapsulates the visual description of a Template.

Author:
Lenko Grigorov

Field Summary
 java.awt.Color color
          The color of the icon of the template.
 java.lang.String description
          The description of the template.
 java.lang.String tag
          The "ID" of the template.
 
Constructor Summary
TemplateDescriptor()
           
 
Method Summary
static java.lang.String shortDescription(java.lang.String d)
          Produce a shortened version of the description of a template.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

tag

public java.lang.String tag
The "ID" of the template. This is a short string which can be used to identify the template, e.g., by displaying it inside the template icon.


color

public java.awt.Color color
The color of the icon of the template.


description

public java.lang.String description
The description of the template. This can be a longer piece of text including any notes about the template.

Constructor Detail

TemplateDescriptor

public TemplateDescriptor()
Method Detail

shortDescription

public static java.lang.String shortDescription(java.lang.String d)
Produce a shortened version of the description of a template. The shortened version consists of the first 47 characters of the first line of the description appended with "..." (in case the first line contains more than 50 characters), or all characters of the first line of the description (in case the first line contains not more than 50 characters).

Parameters:
d - the original description of the template
Returns:
the shortened version of the description of the template