Class BslTemplate
- java.lang.Object
-
- com.e1c.g5.v8.dt.bsl.ui.templates.impl.BslTemplate
-
- All Implemented Interfaces:
ITemplate
public class BslTemplate extends Object implements ITemplate
This class is basic implementation ofITemplate
with setters and parameterized withBslTemplateContext
that supports contexts of module environment and module contexts
-
-
Constructor Summary
Constructors Constructor Description BslTemplate()
Creates empty instance of template by calling another constructor with some default valuesBslTemplate(BslTemplate other)
Creates copy of given templateBslTemplate(String name, String description, BslTemplateContext context, String pattern, boolean isAutoinsertable)
Creates new instance of template with given preferences
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
getDescription()
Returns the description of the templateString
getName()
Returns the name of the template.String
getPattern()
Returns the pattern string for this template, which will be inserted after all variables are processedBslTemplateContext
getTemplateContext()
The template context that is used to check where template is applicableboolean
isAutoinsertable()
Whether this template can be inserted without calling content assist if previous text matches the namevoid
setDescription(String description)
Sets the description of the template to the given onevoid
setName(String name)
Sets the name of the template to the given onevoid
setPattern(String pattern)
Sets the pattern of the template to the given onevoid
setTemplateContext(ITemplateContext context)
Sets the template context to given context
-
-
-
Constructor Detail
-
BslTemplate
public BslTemplate(String name, String description, BslTemplateContext context, String pattern, boolean isAutoinsertable)
Creates new instance of template with given preferences- Parameters:
name
- The name of template, is a trigger-word as well. Has to be unique and does not contain any whitespaces, cannot benull
description
- The description of template, the user-readable representation of template, used in context assist, cannot benull
context
- The context of template, that is used to compute whether this template can be applied in the given position of the model, cannot benull
pattern
- The pattern is the code that is inserted, when the template is called. Also may contain some special keywords that are processed in some way during the template application, cannot benull
isAutoinsertable
- True means that this template will not call template assistant, when the written text matches the template name. False means that this template is called only as usual templates through content assist
-
BslTemplate
public BslTemplate(BslTemplate other)
Creates copy of given template- Parameters:
other
- The template to copy, cannot benull
-
BslTemplate
public BslTemplate()
Creates empty instance of template by calling another constructor with some default values
-
-
Method Detail
-
getName
public String getName()
Description copied from interface:ITemplate
Returns the name of the template. This is its id and its trigger-word
-
getDescription
public String getDescription()
Description copied from interface:ITemplate
Returns the description of the template- Specified by:
getDescription
in interfaceITemplate
- Returns:
- The description of template, cannot be
null
-
getTemplateContext
public BslTemplateContext getTemplateContext()
Description copied from interface:ITemplate
The template context that is used to check where template is applicable- Specified by:
getTemplateContext
in interfaceITemplate
- Returns:
- The context where this template is applicable, cannot be
null
-
getPattern
public String getPattern()
Description copied from interface:ITemplate
Returns the pattern string for this template, which will be inserted after all variables are processed- Specified by:
getPattern
in interfaceITemplate
- Returns:
- The pattern string, cannot be
null
-
isAutoinsertable
public boolean isAutoinsertable()
Description copied from interface:ITemplate
Whether this template can be inserted without calling content assist if previous text matches the name- Specified by:
isAutoinsertable
in interfaceITemplate
- Returns:
- Whether this template can be autoinserted
-
setName
public void setName(String name)
Description copied from interface:ITemplate
Sets the name of the template to the given one
-
setDescription
public void setDescription(String description)
Description copied from interface:ITemplate
Sets the description of the template to the given one- Specified by:
setDescription
in interfaceITemplate
- Parameters:
description
- The description to set, cannot benull
-
setTemplateContext
public void setTemplateContext(ITemplateContext context)
Description copied from interface:ITemplate
Sets the template context to given context- Specified by:
setTemplateContext
in interfaceITemplate
- Parameters:
context
- The context to set, cannot benull
-
setPattern
public void setPattern(String pattern)
Description copied from interface:ITemplate
Sets the pattern of the template to the given one- Specified by:
setPattern
in interfaceITemplate
- Parameters:
pattern
- The pattern to set, cannot benull
-
-