Package org.eclipse.jface.text.templates
Class Template
java.lang.Object
org.eclipse.jface.text.templates.Template
A template consisting of a name and a pattern.
 
Clients may instantiate this class. May become final in the future.
- Since:
- 3.0
- Restriction:
- This class is not intended to be subclassed by clients.
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionbooleanReturns the id of the context type in which the template can be applied.Returns the description of the template.getName()Returns the name of the template.Returns the template pattern.inthashCode()booleanReturns the auto insertable property of the template.booleanReturnstrueif template is enabled and matches the context,falseotherwise.voidsetContextTypeId(String contextTypeId) Deprecated.Templates should never be modifiedvoidsetDescription(String description) Deprecated.Templates should never be modifiedvoidDeprecated.Templates should never be modifiedvoidsetPattern(String pattern) Deprecated.Templates should never be modified
- 
Constructor Details- 
Templatepublic Template()Creates an empty template.
- 
TemplateCreates a copy of a template.- Parameters:
- template- the template to copy
 
- 
TemplateDeprecated.as of 3.1 replaced byTemplate(String, String, String, String, boolean)Creates a template.- Parameters:
- name- the name of the template
- description- the description of the template
- contextTypeId- the id of the context type in which the template can be applied
- pattern- the template pattern
 
- 
Templatepublic Template(String name, String description, String contextTypeId, String pattern, boolean isAutoInsertable) Creates a template.- Parameters:
- name- the name of the template
- description- the description of the template
- contextTypeId- the id of the context type in which the template can be applied
- pattern- the template pattern
- isAutoInsertable- the auto insertable property of the template
- Since:
- 3.1
 
 
- 
- 
Method Details- 
hashCodepublic int hashCode()
- 
setDescriptionDeprecated.Templates should never be modifiedSets the description of the template.- Parameters:
- description- the new description
 
- 
getDescriptionReturns the description of the template.- Returns:
- the description of the template
 
- 
setContextTypeIdDeprecated.Templates should never be modifiedSets the name of the context type in which the template can be applied.- Parameters:
- contextTypeId- the new context type name
 
- 
getContextTypeIdReturns the id of the context type in which the template can be applied.- Returns:
- the id of the context type in which the template can be applied
 
- 
setNameDeprecated.Templates should never be modifiedSets the name of the template.- Parameters:
- name- the name of the template
 
- 
getNameReturns the name of the template.- Returns:
- the name of the template
 
- 
setPatternDeprecated.Templates should never be modifiedSets the pattern of the template.- Parameters:
- pattern- the new pattern of the template
 
- 
getPatternReturns the template pattern.- Returns:
- the template pattern
 
- 
matchesReturnstrueif template is enabled and matches the context,falseotherwise.- Parameters:
- prefix- the prefix (e.g. inside a document) to match
- contextTypeId- the context type id to match
- Returns:
- trueif template is enabled and matches the context,- falseotherwise
 
- 
equals
- 
isAutoInsertablepublic boolean isAutoInsertable()Returns the auto insertable property of the template.- Returns:
- the auto insertable property of the template
- Since:
- 3.1
 
 
- 
Template(String, String, String, String, boolean)