Class BslRefactoringUtil
java.lang.Object
com._1c.g5.v8.dt.internal.bsl.ui.refactoring.BslRefactoringUtil
Util methods for Bsl refactoring
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic StringgetFileName(org.eclipse.emf.common.util.URI uri) Gets Bsl file name by its URIstatic booleanisContainsNonLetterAndNumber(String newName) Checks that name doesn't contain non letter charactersstatic booleanisDuplicateNameForMethod(org.eclipse.emf.ecore.EObject targetElement, CaseInsensitiveString newName, Module module, org.eclipse.xtext.scoping.IScopeProvider scopeProvider) Checks methods for duplicate namestatic booleanisDuplicateNameForVariable(org.eclipse.emf.ecore.EObject targetElement, CaseInsensitiveString newName, Module module, org.eclipse.xtext.scoping.IScopeProvider scopeProvider) Checks variables for duplicate namestatic booleanisStartWithNumber(String newName) Checks that name doesn't start with digitstatic org.eclipse.jface.text.ITextSelectiontrimSelection(org.eclipse.jface.text.ITextSelection selection) Trim forITextSelection.
-
Constructor Details
-
BslRefactoringUtil
public BslRefactoringUtil()
-
-
Method Details
-
isDuplicateNameForMethod
public static boolean isDuplicateNameForMethod(org.eclipse.emf.ecore.EObject targetElement, CaseInsensitiveString newName, Module module, org.eclipse.xtext.scoping.IScopeProvider scopeProvider) Checks methods for duplicate name- Parameters:
targetElement- check element, can't benullnewName- checks new name of the element, can't benullmodule- actual BslModule, can't benullscopeProvider- BslIScopeProvider, can't benull- Returns:
trueif the name is valid,falseotherwise
-
isDuplicateNameForVariable
public static boolean isDuplicateNameForVariable(org.eclipse.emf.ecore.EObject targetElement, CaseInsensitiveString newName, Module module, org.eclipse.xtext.scoping.IScopeProvider scopeProvider) Checks variables for duplicate name- Parameters:
targetElement- check element, can't benullnewName- checks new name of the element, can't benullmodule- actual BslModule, can't benullscopeProvider- BslIScopeProvider, can't benull- Returns:
trueif the name is valid,falseotherwise
-
getFileName
Gets Bsl file name by its URI- Parameters:
uri- uri of the Bsl file, can't be <code<null- Returns:
- name of the file, can't be
null
-
isStartWithNumber
Checks that name doesn't start with digit- Parameters:
newName- checking name- Returns:
trueif newName starts with digit,falseotherwise and if newName isnullor empty
-
isContainsNonLetterAndNumber
Checks that name doesn't contain non letter characters- Parameters:
newName- checking name- Returns:
trueif newName contain non letter characters,falseotherwise and if newName isnullor empty
-
trimSelection
public static org.eclipse.jface.text.ITextSelection trimSelection(org.eclipse.jface.text.ITextSelection selection) Trim forITextSelection. {@link ITextSelection.#getText()} must return valid content- Parameters:
selection- initial selection, can't benull- Returns:
- trim selection, can't be
null
-