Class BslTemplate
java.lang.Object
com.e1c.g5.v8.dt.bsl.ui.templates.impl.BslTemplate
- All Implemented Interfaces:
ITemplate
This class is basic implementation of
ITemplate
with setters and parameterized with BslTemplateContext
that supports contexts of module environment and module contexts-
Constructor Summary
ConstructorsConstructorDescriptionCreates 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
Modifier and TypeMethodDescriptionReturns the description of the templategetName()
Returns the name of the template.Returns the pattern string for this template, which will be inserted after all variables are processedThe template context that is used to check where template is applicableboolean
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
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 Details
-
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
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 Details
-
getName
Description copied from interface:ITemplate
Returns the name of the template. This is its id and its trigger-word -
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
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
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
Description copied from interface:ITemplate
Sets the name of the template to the given one -
setDescription
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
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
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
-