Class CreateMethodAndInvocationVariable
- java.lang.Object
-
- com.e1c.g5.v8.dt.lcore.ui.templates.contentassist.variable.AbstractVariable
-
- com.e1c.g5.v8.dt.bsl.ui.templates.variables.CreateMethodAndInvocationVariable
-
- All Implemented Interfaces:
IGlobalVariable
,IVariable
- Direct Known Subclasses:
CreateMethodVariable
public class CreateMethodAndInvocationVariable extends AbstractVariable implements IGlobalVariable
Variable that creates invocation of the method and the method itself
-
-
Constructor Summary
Constructors Constructor Description CreateMethodAndInvocationVariable(org.eclipse.jface.text.IRegion region, String name, boolean isProcedure, List<String> params)
Creates new instance of this with given parameters
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ApplyResult
applyGlobal(org.eclipse.xtext.ui.editor.model.XtextDocument document, org.eclipse.jface.text.IRegion variablePosition, IPlacementContext placementContext)
Performs apply at any region of the documentprotected String
createMethod(Collection<LinkedGroup> groupsToLink, int replaceOffset, List<org.eclipse.text.edits.RangeMarker> nameGroup, String[] pragmas, boolean asynAllowed, ScriptVariant scriptVariant)
Creates method textprotected String
getVariableText()
Returns text of the variable for the given regionIPlacementContext
preApplyGlobal(org.eclipse.xtext.ui.editor.model.XtextDocument document, int offset)
Computes additional data for computingApplyResult
in method#applyGlobal(XtextDocument, IRegion)
before content of thedocument
will be changed by template patternprotected Collection<LinkedGroup>
setupVariableLinks(org.eclipse.xtext.ui.editor.model.XtextDocument document, org.eclipse.jface.text.IRegion variablePosition, List<org.eclipse.text.edits.RangeMarker> nameGroup)
Setups link groups for the variable text-
Methods inherited from class com.e1c.g5.v8.dt.lcore.ui.templates.contentassist.variable.AbstractVariable
apply, getDialogProvider, getProposalProvider, getRegion
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.e1c.g5.v8.dt.lcore.ui.templates.contentassist.variable.IVariable
apply, getDialogProvider, getProposalProvider, getRegion
-
-
-
-
Method Detail
-
preApplyGlobal
public IPlacementContext preApplyGlobal(org.eclipse.xtext.ui.editor.model.XtextDocument document, int offset)
Description copied from interface:IGlobalVariable
Computes additional data for computingApplyResult
in method#applyGlobal(XtextDocument, IRegion)
before content of thedocument
will be changed by template pattern- Specified by:
preApplyGlobal
in interfaceIGlobalVariable
- Parameters:
document
- actual document for applyingITemplate
offset
- offset of applying wholeITemplate
- Returns:
- additional data for computing
ApplyResult
in method#applyGlobal(XtextDocument, IRegion)
before content of thedocument
will be changed by template pattern, can benull
if
-
applyGlobal
public ApplyResult applyGlobal(org.eclipse.xtext.ui.editor.model.XtextDocument document, org.eclipse.jface.text.IRegion variablePosition, IPlacementContext placementContext)
Description copied from interface:IGlobalVariable
Performs apply at any region of the document- Specified by:
applyGlobal
in interfaceIGlobalVariable
- Parameters:
document
- The document to perform apply on, cannot benull
variablePosition
- The position of the variable after applying template and usualIVariable.apply(String)
, cannot benull
placementContext
- additional information for creatingApplyResult
, computed in {@link #preApplyGlobal(XtextDocument, int), can benull
if there is no additional information- Returns:
- The result of global apply, cannot be
null
-
getVariableText
protected String getVariableText()
Description copied from class:AbstractVariable
Returns text of the variable for the given region- Specified by:
getVariableText
in classAbstractVariable
- Returns:
- The text of the variable for the given region, can be
null
-
setupVariableLinks
protected Collection<LinkedGroup> setupVariableLinks(org.eclipse.xtext.ui.editor.model.XtextDocument document, org.eclipse.jface.text.IRegion variablePosition, List<org.eclipse.text.edits.RangeMarker> nameGroup)
Setups link groups for the variable text- Parameters:
document
- The document to work on, cannot benull
variablePosition
- The position of the variable, cannot benull
nameGroup
- The list to add link group of the name to, cannot benull
- Returns:
- created
LinkedGroup
by template variableRangeMarker
, nevernull
-
createMethod
protected String createMethod(Collection<LinkedGroup> groupsToLink, int replaceOffset, List<org.eclipse.text.edits.RangeMarker> nameGroup, String[] pragmas, boolean asynAllowed, ScriptVariant scriptVariant)
Creates method text- Parameters:
groupsToLink
- The groups to link to add needed linked groups, cannot benull
replaceOffset
- The replace offset for this procedurenameGroup
- The name group to add created procedure name into, cannot benull
- Returns:
- The string representing the procedure text, cannot be
null
-
-