Class BslTemplateContext
- java.lang.Object
-
- com.e1c.g5.v8.dt.bsl.ui.templates.impl.BslTemplateContext
-
- All Implemented Interfaces:
ITemplateContext
,Cloneable
public class BslTemplateContext extends Object implements ITemplateContext
This class contains information about where the template can be applied
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
BslTemplateContext.ModuleContexts
The enum of module contexts.static class
BslTemplateContext.ModuleEnvironments
The enum of module environments.
-
Constructor Summary
Constructors Constructor Description BslTemplateContext()
Creates new contexts with the default environments and contextsBslTemplateContext(BslTemplateContext other)
Copies the other context
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addModuleContext(BslTemplateContext.ModuleContexts context)
Adds module context to the list of applicable contexts for this contextvoid
addModuleEnvironment(BslTemplateContext.ModuleEnvironments moduleEnvironment)
Adds module environment to the list of applicable environments for this contextboolean
check(org.eclipse.xtext.ui.editor.contentassist.ContentAssistContext context)
Checks whether this template is applicable in the given contextCollection<BslTemplateContext.ModuleContexts>
getModuleContexts()
Returns all applicable module contextsCollection<BslTemplateContext.ModuleEnvironments>
getModuleEnvironments()
Returns the environments applicable for this contextvoid
removeModuleContext(BslTemplateContext.ModuleContexts context)
Removes module context from the list of applicable contextvoid
removeModuleEnvironment(BslTemplateContext.ModuleEnvironments moduleEnvironment)
Removes module environment from the list of applicable environments for this context
-
-
-
Constructor Detail
-
BslTemplateContext
public BslTemplateContext()
Creates new contexts with the default environments and contexts
-
BslTemplateContext
public BslTemplateContext(BslTemplateContext other)
Copies the other context- Parameters:
other
- The context to copy, cannot benull
-
-
Method Detail
-
getModuleEnvironments
public Collection<BslTemplateContext.ModuleEnvironments> getModuleEnvironments()
Returns the environments applicable for this context- Returns:
- The context's environments, cannot be
null
-
addModuleEnvironment
public void addModuleEnvironment(BslTemplateContext.ModuleEnvironments moduleEnvironment)
Adds module environment to the list of applicable environments for this context- Parameters:
moduleEnvironment
- The environment to add, cannot benull
-
removeModuleEnvironment
public void removeModuleEnvironment(BslTemplateContext.ModuleEnvironments moduleEnvironment)
Removes module environment from the list of applicable environments for this context- Parameters:
moduleEnvironment
- The environment to remove, cannot benull
-
getModuleContexts
public Collection<BslTemplateContext.ModuleContexts> getModuleContexts()
Returns all applicable module contexts- Returns:
- All applicable module contexts, cannot be
null
-
addModuleContext
public void addModuleContext(BslTemplateContext.ModuleContexts context)
Adds module context to the list of applicable contexts for this context- Parameters:
context
- The context to add, cannot benull
-
removeModuleContext
public void removeModuleContext(BslTemplateContext.ModuleContexts context)
Removes module context from the list of applicable context- Parameters:
context
- The context to remove, cannot benull
-
check
public boolean check(org.eclipse.xtext.ui.editor.contentassist.ContentAssistContext context)
Description copied from interface:ITemplateContext
Checks whether this template is applicable in the given context- Specified by:
check
in interfaceITemplateContext
- Parameters:
context
- The context where the check is occurred, cannot benull
- Returns:
- Whether this is applicable in the given context
-
-