public class Template extends Object
Clients may instantiate this class. May become final in the future.
Constructor and Description |
---|
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.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object o) |
String |
getContextTypeId()
Returns the id of the context type in which the template can be applied.
|
String |
getDescription()
Returns the description of the template.
|
String |
getName()
Returns the name of the template.
|
String |
getPattern()
Returns the template pattern.
|
int |
hashCode() |
boolean |
isAutoInsertable()
Returns the auto insertable property of the template.
|
boolean |
matches(String prefix,
String contextTypeId)
Returns
true if template is enabled and matches the context,
false otherwise. |
void |
setContextTypeId(String contextTypeId)
Deprecated.
Templates should never be modified
|
void |
setDescription(String description)
Deprecated.
Templates should never be modified
|
void |
setName(String name)
Deprecated.
Templates should never be modified
|
void |
setPattern(String pattern)
Deprecated.
Templates should never be modified
|
public Template()
public Template(Template template)
template
- the template to copypublic Template(String name, String description, String contextTypeId, String pattern)
Template(String, String, String, String, boolean)
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 patternpublic Template(String name, String description, String contextTypeId, String pattern, boolean isAutoInsertable)
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 templatepublic void setDescription(String description)
description
- the new descriptionpublic String getDescription()
public void setContextTypeId(String contextTypeId)
contextTypeId
- the new context type namepublic String getContextTypeId()
public void setName(String name)
name
- the name of the templatepublic String getName()
public void setPattern(String pattern)
pattern
- the new pattern of the templatepublic String getPattern()
public boolean matches(String prefix, String contextTypeId)
true
if template is enabled and matches the context,
false
otherwise.prefix
- the prefix (e.g. inside a document) to matchcontextTypeId
- the context type id to matchtrue
if template is enabled and matches the context,
false
otherwisepublic boolean isAutoInsertable()
Copyright (c) 2000, 2015 Eclipse Contributors and others. All rights reserved.Guidelines for using Eclipse APIs.