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 applicablebooleanWhether this template can be inserted without calling content assist if previous text matches the namevoidsetDescription(String description) Sets the description of the template to the given onevoidSets the name of the template to the given onevoidsetPattern(String pattern) Sets the pattern of the template to the given onevoidsetTemplateContext(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 benulldescription- The description of template, the user-readable representation of template, used in context assist, cannot benullcontext- The context of template, that is used to compute whether this template can be applied in the given position of the model, cannot benullpattern- 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 benullisAutoinsertable- 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:ITemplateReturns the name of the template. This is its id and its trigger-word -
getDescription
Description copied from interface:ITemplateReturns the description of the template- Specified by:
getDescriptionin interfaceITemplate- Returns:
- The description of template, cannot be
null
-
getTemplateContext
Description copied from interface:ITemplateThe template context that is used to check where template is applicable- Specified by:
getTemplateContextin interfaceITemplate- Returns:
- The context where this template is applicable, cannot be
null
-
getPattern
Description copied from interface:ITemplateReturns the pattern string for this template, which will be inserted after all variables are processed- Specified by:
getPatternin interfaceITemplate- Returns:
- The pattern string, cannot be
null
-
isAutoinsertable
public boolean isAutoinsertable()Description copied from interface:ITemplateWhether this template can be inserted without calling content assist if previous text matches the name- Specified by:
isAutoinsertablein interfaceITemplate- Returns:
- Whether this template can be autoinserted
-
setName
Description copied from interface:ITemplateSets the name of the template to the given one -
setDescription
Description copied from interface:ITemplateSets the description of the template to the given one- Specified by:
setDescriptionin interfaceITemplate- Parameters:
description- The description to set, cannot benull
-
setTemplateContext
Description copied from interface:ITemplateSets the template context to given context- Specified by:
setTemplateContextin interfaceITemplate- Parameters:
context- The context to set, cannot benull
-
setPattern
Description copied from interface:ITemplateSets the pattern of the template to the given one- Specified by:
setPatternin interfaceITemplate- Parameters:
pattern- The pattern to set, cannot benull
-