Class MethodExtractValidator
- java.lang.Object
-
- com._1c.g5.v8.dt.bsl.ui.refactoring.LocalVariableExtractValidator
-
- com._1c.g5.v8.dt.bsl.ui.refactoring.MethodExtractValidator
-
public class MethodExtractValidator extends LocalVariableExtractValidator
Validator for selected text in Bsl module before extracting method Instances ofMethodExtractValidator
are stateful and are not safe for use by multiple threads.
-
-
Field Summary
Fields Modifier and Type Field Description protected List<DeclareStatement>
allSelectedDeclareStatement
protected List<Statement>
allSelectedStatement
-
Fields inherited from class com._1c.g5.v8.dt.bsl.ui.refactoring.LocalVariableExtractValidator
module, moduleNode, selection, startLeafNode
-
-
Constructor Summary
Constructors Constructor Description MethodExtractValidator(Module module, org.eclipse.jface.text.ITextSelection selection)
Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected boolean
checkStatementForCoverage()
Checks that selectedDeclareStatement
andStatement
fully contained in select regionprotected boolean
collectAllSelectedStatement()
ExtractRefactoringStatementAnalyzer.ExtractingContentInformation
getExtractingContentInfomation()
GetsExtractRefactoringStatementAnalyzer.ExtractingContentInformation
for current selectionboolean
isFunction()
Checks that extract content must be functionprotected boolean
isLastNodePunctuation(boolean isLastNodePunctuation)
Checks that last node was punctuation nodeboolean
isLastNodeSemicolon()
Checks that last selected not hidden grammar node is semicolonprotected boolean
isNodeSemicolon(org.eclipse.xtext.nodemodel.INode node)
Checks that last selected not hidden grammar node is semicolonboolean
validate()
Validate selection text in bsl module for extracting method-
Methods inherited from class com._1c.g5.v8.dt.bsl.ui.refactoring.LocalVariableExtractValidator
getBorderUnitCompilation, getErrorMessage, getKeywordValue, getNextNode, getSelectedTreeNodes, isAllowedReplaceAllOccurrences, setErrorMessage, simpleValidate
-
-
-
-
Field Detail
-
allSelectedDeclareStatement
protected List<DeclareStatement> allSelectedDeclareStatement
-
-
Method Detail
-
validate
public boolean validate()
Validate selection text in bsl module for extracting method- Overrides:
validate
in classLocalVariableExtractValidator
- Returns:
true
if all are correct,false
otherwise
-
getExtractingContentInfomation
public ExtractRefactoringStatementAnalyzer.ExtractingContentInformation getExtractingContentInfomation()
GetsExtractRefactoringStatementAnalyzer.ExtractingContentInformation
for current selection- Returns:
- actual
ExtractRefactoringStatementAnalyzer.ExtractingContentInformation
for current selection, can benull
if selection is not valid
-
isFunction
public boolean isFunction()
Checks that extract content must be function- Returns:
true
if extract content must be function,false
otherwise
-
isLastNodeSemicolon
public boolean isLastNodeSemicolon()
Checks that last selected not hidden grammar node is semicolon- Returns:
true
if last node is semicolon,false
otherwise
-
isNodeSemicolon
protected boolean isNodeSemicolon(org.eclipse.xtext.nodemodel.INode node)
Checks that last selected not hidden grammar node is semicolon- Parameters:
node
- Parse-tree node (notnull
)- Returns:
true
if last node is semicolon,false
otherwise
-
isLastNodePunctuation
protected boolean isLastNodePunctuation(boolean isLastNodePunctuation)
Description copied from class:LocalVariableExtractValidator
Checks that last node was punctuation node- Overrides:
isLastNodePunctuation
in classLocalVariableExtractValidator
- Parameters:
isLastNodePunctuation
- flag says that inLocalVariableExtractValidator.getBorderUnitCompilation(org.eclipse.xtext.nodemodel.INode, int)
last node was punctuation- Returns:
true
if last node was punctuation,false
otherwise
-
collectAllSelectedStatement
protected boolean collectAllSelectedStatement()
- Returns:
true
if onlyDeclareStatement
andStatement
were found,false
otherwise
-
checkStatementForCoverage
protected boolean checkStatementForCoverage()
Checks that selectedDeclareStatement
andStatement
fully contained in select region- Returns:
true
if selectedDeclareStatement
andStatement
fully contained in select region,false
otherwise
-
-