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
Variable that creates invocation of the method and the method itself
-
Constructor Summary
ConstructorsConstructorDescriptionCreateMethodAndInvocationVariable(org.eclipse.jface.text.IRegion region, String name, boolean isProcedure, List<String> params) Creates new instance of this with given parameters -
Method Summary
Modifier and TypeMethodDescriptionapplyGlobal(org.eclipse.xtext.ui.editor.model.XtextDocument document, org.eclipse.jface.text.IRegion variablePosition, IPlacementContext placementContext) Performs apply at any region of the documentprotected StringcreateMethod(Collection<LinkedGroup> groupsToLink, int replaceOffset, List<org.eclipse.text.edits.RangeMarker> nameGroup, String[] pragmas, boolean asynAllowed, ScriptVariant scriptVariant) Creates method textprotected StringReturns text of the variable for the given regionpreApplyGlobal(org.eclipse.xtext.ui.editor.model.XtextDocument document, int offset) Computes additional data for computingApplyResultin method#applyGlobal(XtextDocument, IRegion)before content of thedocumentwill 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 textMethods inherited from class com.e1c.g5.v8.dt.lcore.ui.templates.contentassist.variable.AbstractVariable
apply, getDialogProvider, getProposalProvider, getRegionMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.e1c.g5.v8.dt.lcore.ui.templates.contentassist.variable.IVariable
apply, getDialogProvider, getProposalProvider, getRegion
-
Constructor Details
-
Method Details
-
preApplyGlobal
public IPlacementContext preApplyGlobal(org.eclipse.xtext.ui.editor.model.XtextDocument document, int offset) Description copied from interface:IGlobalVariableComputes additional data for computingApplyResultin method#applyGlobal(XtextDocument, IRegion)before content of thedocumentwill be changed by template pattern- Specified by:
preApplyGlobalin interfaceIGlobalVariable- Parameters:
document- actual document for applyingITemplateoffset- offset of applying wholeITemplate- Returns:
- additional data for computing
ApplyResultin method#applyGlobal(XtextDocument, IRegion)before content of thedocumentwill be changed by template pattern, can benullif
-
applyGlobal
public ApplyResult applyGlobal(org.eclipse.xtext.ui.editor.model.XtextDocument document, org.eclipse.jface.text.IRegion variablePosition, IPlacementContext placementContext) Description copied from interface:IGlobalVariablePerforms apply at any region of the document- Specified by:
applyGlobalin interfaceIGlobalVariable- Parameters:
document- The document to perform apply on, cannot benullvariablePosition- The position of the variable after applying template and usualIVariable.apply(String), cannot benullplacementContext- additional information for creatingApplyResult, computed in {@link #preApplyGlobal(XtextDocument, int), can benullif there is no additional information- Returns:
- The result of global apply, cannot be
null
-
getVariableText
Description copied from class:AbstractVariableReturns text of the variable for the given region- Specified by:
getVariableTextin 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 benullvariablePosition- The position of the variable, cannot benullnameGroup- The list to add link group of the name to, cannot benull- Returns:
- created
LinkedGroupby 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 benullreplaceOffset- 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
-