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 Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
Returns 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.int
hashCode()
boolean
Returns the auto insertable property of the template.boolean
Returnstrue
if template is enabled and matches the context,false
otherwise.void
setContextTypeId
(String contextTypeId) Deprecated.Templates should never be modifiedvoid
setDescription
(String description) Deprecated.Templates should never be modifiedvoid
Deprecated.Templates should never be modifiedvoid
setPattern
(String pattern) Deprecated.Templates should never be modified
-
Constructor Details
-
Template
public Template()Creates an empty template. -
Template
Creates a copy of a template.- Parameters:
template
- the template to copy
-
Template
Deprecated.as of 3.1 replaced byTemplate(String, String, String, String, boolean)
Creates a template.- Parameters:
name
- the name of the templatedescription
- the description of the templatecontextTypeId
- the id of the context type in which the template can be appliedpattern
- the template pattern
-
Template
public Template(String name, String description, String contextTypeId, String pattern, boolean isAutoInsertable) Creates a template.- Parameters:
name
- the name of the templatedescription
- the description of the templatecontextTypeId
- the id of the context type in which the template can be appliedpattern
- the template patternisAutoInsertable
- the auto insertable property of the template- Since:
- 3.1
-
-
Method Details
-
hashCode
public int hashCode() -
setDescription
Deprecated.Templates should never be modifiedSets the description of the template.- Parameters:
description
- the new description
-
getDescription
Returns the description of the template.- Returns:
- the description of the template
-
setContextTypeId
Deprecated.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
-
getContextTypeId
Returns 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
-
setName
Deprecated.Templates should never be modifiedSets the name of the template.- Parameters:
name
- the name of the template
-
getName
Returns the name of the template.- Returns:
- the name of the template
-
setPattern
Deprecated.Templates should never be modifiedSets the pattern of the template.- Parameters:
pattern
- the new pattern of the template
-
getPattern
Returns the template pattern.- Returns:
- the template pattern
-
matches
Returnstrue
if template is enabled and matches the context,false
otherwise.- Parameters:
prefix
- the prefix (e.g. inside a document) to matchcontextTypeId
- the context type id to match- Returns:
true
if template is enabled and matches the context,false
otherwise
-
equals
-
isAutoInsertable
public 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)