Class BslRefactoringUtil

java.lang.Object
com._1c.g5.v8.dt.internal.bsl.ui.refactoring.BslRefactoringUtil

public class BslRefactoringUtil extends Object
Util methods for Bsl refactoring
  • 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 be null
      newName - checks new name of the element, can't be null
      module - actual Bsl Module, can't be null
      scopeProvider - Bsl IScopeProvider, can't be null
      Returns:
      true if the name is valid, false otherwise
    • 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 be null
      newName - checks new name of the element, can't be null
      module - actual Bsl Module, can't be null
      scopeProvider - Bsl IScopeProvider, can't be null
      Returns:
      true if the name is valid, false otherwise
    • getFileName

      public static String getFileName(org.eclipse.emf.common.util.URI uri)
      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

      public static boolean isStartWithNumber(String newName)
      Checks that name doesn't start with digit
      Parameters:
      newName - checking name
      Returns:
      true if newName starts with digit, false otherwise and if newName is null or empty
    • isContainsNonLetterAndNumber

      public static boolean isContainsNonLetterAndNumber(String newName)
      Checks that name doesn't contain non letter characters
      Parameters:
      newName - checking name
      Returns:
      true if newName contain non letter characters, false otherwise and if newName is null or empty
    • trimSelection

      public static org.eclipse.jface.text.ITextSelection trimSelection(org.eclipse.jface.text.ITextSelection selection)
      Trim for ITextSelection. {@link ITextSelection.#getText()} must return valid content
      Parameters:
      selection - initial selection, can't be null
      Returns:
      trim selection, can't be null