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 ofITemplatewith setters and parameterized withBslTemplateContextthat 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 StringgetDescription()Returns the description of the templateStringgetName()Returns the name of the template.StringgetPattern()Returns the pattern string for this template, which will be inserted after all variables are processedBslTemplateContextgetTemplateContext()The template context that is used to check where template is applicablebooleanisAutoinsertable()Whether 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 onevoidsetName(String name)Sets 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 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 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
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:ITemplateReturns the name of the template. This is its id and its trigger-word
-
getDescription
public String getDescription()
Description copied from interface:ITemplateReturns the description of the template- Specified by:
getDescriptionin interfaceITemplate- Returns:
- The description of template, cannot be
null
-
getTemplateContext
public BslTemplateContext 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
public String 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
public void setName(String name)
Description copied from interface:ITemplateSets the name of the template to the given one
-
setDescription
public void setDescription(String description)
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
public void setTemplateContext(ITemplateContext context)
Description copied from interface:ITemplateSets the template context to given context- Specified by:
setTemplateContextin interfaceITemplate- Parameters:
context- The context to set, cannot benull
-
setPattern
public void setPattern(String pattern)
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
-
-