org.eclipse.jface.text.templates
Class Template
java.lang.Object
org.eclipse.jface.text.templates.Template
-
public class Template
- extends
Object
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
|
Template
()
Creates an empty template. |
Template
(
String name,
String description,
String contextTypeId,
String pattern)
Deprecated. as of 3.1 replaced by
Template(String, String, String, String, boolean)
|
Template
(
String name,
String description,
String contextTypeId,
String pattern,
boolean isAutoInsertable)
Creates a template. |
Template
(
Template template)
Creates a copy of a template. |
Template
public Template()
- Creates an empty template.
Template
public Template(
Template template)
- Creates a copy of a template.
-
Parameters:
-
template
- the template to copy
Template
public Template(
String name,
String description,
String contextTypeId,
String pattern)
-
Deprecated. as of 3.1 replaced by
Template(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
Template
public 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
hashCode
public int hashCode()
-
-
Overrides:
-
hashCode
in class
Object
-
setDescription
public void setDescription(
String description)
-
Deprecated. Templates should never be modified
- Sets the description of the template.
-
-
Parameters:
-
description
- the new description
getDescription
public
String getDescription()
- Returns the description of the template.
-
-
Returns:
- the description of the template
setContextTypeId
public void setContextTypeId(
String contextTypeId)
-
Deprecated. Templates should never be modified
- Sets the name of the context type in which the template can be applied.
-
-
Parameters:
-
contextTypeId
- the new context type name
getContextTypeId
public
String 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
public void setName(
String name)
-
Deprecated. Templates should never be modified
- Sets the name of the template.
-
-
Parameters:
-
name
- the name of the template
getName
public
String getName()
- Returns the name of the template.
-
-
Returns:
- the name of the template
setPattern
public void setPattern(
String pattern)
-
Deprecated. Templates should never be modified
- Sets the pattern of the template.
-
-
Parameters:
-
pattern
- the new pattern of the template
getPattern
public
String getPattern()
- Returns the template pattern.
-
-
Returns:
- the template pattern
matches
public boolean matches(
String prefix,
String contextTypeId)
- Returns
true
if template is enabled and matches the context,
false
otherwise.
-
-
Parameters:
-
prefix
- the prefix (e.g. inside a document) to match -
contextTypeId
- the context type id to match
-
Returns:
-
true
if template is enabled and matches the context,
false
otherwise
equals
public boolean equals(
Object o)
-
-
Overrides:
-
equals
in class
Object
-
isAutoInsertable
public boolean isAutoInsertable()
- Returns the auto insertable property of the template.
-
-
Returns:
- the auto insertable property of the template
-
Since:
- 3.1
Guidelines for using Eclipse APIs.
Copyright (c) Eclipse contributors and others 2000, 2008. All rights reserved.