com.borland.primetime.insight.template
Class TemplateSet

java.lang.Object
  |
  +--com.borland.primetime.insight.template.TemplateSet

public class TemplateSet
extends java.lang.Object

This class manages one set of CodeTemplates.


Field Summary
protected static int maxDescriptionLength
          The maximum length of a description.
protected static int maxNameLength
          The maximum length of a template name.
protected static CodeTemplate[] templateMap
          The set of templates this class manages.
 
Constructor Summary
TemplateSet()
           
 
Method Summary
static void addTemplate(CodeTemplate template)
          Add a new CodeTemplate belonging to the collection of templates this class manages.
static int getMaxDescriptionLength()
          What is the maximum length of a description.
static int getMaxNameLength()
          What is the maximum length of a template name.
static CodeTemplate[] getStockTemplates(boolean namesOnly)
          Get the collection of stock templates, which is a hardcoded collection of templates usually displayed in the editor options window on the templates tab.
static CodeTemplate[] getTemplates()
          Return the array of CodeTemplates belonging to this class.
static boolean isStockTemplate(java.lang.String name)
          Does there exist a stock template with the given name.
static void setTemplates(CodeTemplate[] templates)
          Set the array of CodeTemplates belonging to this class.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

templateMap

protected static CodeTemplate[] templateMap
The set of templates this class manages.

maxNameLength

protected static int maxNameLength
The maximum length of a template name.

maxDescriptionLength

protected static int maxDescriptionLength
The maximum length of a description.
Constructor Detail

TemplateSet

public TemplateSet()
Method Detail

getTemplates

public static CodeTemplate[] getTemplates()
Return the array of CodeTemplates belonging to this class.
Returns:
The array of templates belonging to this class.

setTemplates

public static void setTemplates(CodeTemplate[] templates)
Set the array of CodeTemplates belonging to this class.
Parameters:
The - new collection of templates this class manages.

addTemplate

public static void addTemplate(CodeTemplate template)
Add a new CodeTemplate belonging to the collection of templates this class manages.
Parameters:
The - new template.

getMaxNameLength

public static int getMaxNameLength()
What is the maximum length of a template name. Names longer than this length are truncated.
Returns:
The maximum length of a name.

getMaxDescriptionLength

public static int getMaxDescriptionLength()
What is the maximum length of a description. Descriptions longer than this length are truncated.
Returns:
The maximum length of a description.

getStockTemplates

public static CodeTemplate[] getStockTemplates(boolean namesOnly)
Get the collection of stock templates, which is a hardcoded collection of templates usually displayed in the editor options window on the templates tab.
Parameters:
namesOnly - If true, the templates only have their names filled in.
Returns:
The collection of built-in stock templates.

isStockTemplate

public static boolean isStockTemplate(java.lang.String name)
Does there exist a stock template with the given name.
Parameters:
The - name of a template
Returns:
True if there is a stocktemplate with that name, False otherwise.