Class AbstractBmObjectRefactoring

java.lang.Object
com._1c.g5.v8.dt.internal.refactoring.core.AbstractBmObjectRefactoring
All Implemented Interfaces:
IRefactoring
Direct Known Subclasses:
BmObjectDeleteRefactoring, BmObjectRenameRefactoring

public abstract class AbstractBmObjectRefactoring extends Object implements IRefactoring
The IRefactoring implementation for BM object refactoring.
It groups operations by BM model instance. For each BM model-wide operation it groups operations by top object for transaction splitting.
  • Constructor Details

    • AbstractBmObjectRefactoring

      protected AbstractBmObjectRefactoring(String title, RefactoringSettings settings)
      Initiates a refactoring instance.
      Parameters:
      title - the refactoring title, cannot be null.
      settings - the refactoring settings, cannot be null.
  • Method Details

    • addPreOperation

      public void addPreOperation(IRefactoringOperation operation)
      Adds the specified operation to pre-operations.
      Parameters:
      operation - the refactoring operation, cannot be null.
    • addPostOperation

      public void addPostOperation(IRefactoringOperation operation)
      Adds the specified operation to post-operations.
      Parameters:
      operation - the refactoring operation, cannot be null.
    • addOperation

      public void addOperation(IRefactoringOperation operation)
      Adds the specified operation.
      Parameters:
      operation - the refactoring operation, cannot be null.
    • addBmObjectOperation

      public void addBmObjectOperation(IBmModel bmModel, IBmObject bmObject, IRefactoringOperation operation)
      Adds the specified operation to BmObject refactoring instance.
      Parameters:
      bmModel - the BM model instance, cannot be null.
      bmObject - the BM object to change within operation instance, cannot be null.
      operation - the refactoring operation, cannot be null.
    • addMainOperation

      public void addMainOperation(IBmModel bmModel, IRefactoringOperation operation)
      Adds the specified 'main' operation to BmObject refactoring instance.
      Parameters:
      bmModel - the BM model instance, cannot be null.
      operation - the refactoring operation, cannot be null.
    • isEnabled

      public boolean isEnabled(IRefactoringOperation operation)
      Returns true if the operation is enabled, false - otherwise.
      Parameters:
      operation - the refactoring operation, cannot be null.
      Returns:
      true if the operation is enabled, false - otherwise.
    • associate

      public void associate(IRefactoringOperation operation, IRefactoringItem item)
      Associates the specified operation with the item.
      Parameters:
      operation - the refactoring operation, cannot be null.
      item - the refactoring item, cannot be null.
    • getStatus

      public RefactoringStatus getStatus()
      Description copied from interface: IRefactoring
      Returns the refactoring status.
      Specified by:
      getStatus in interface IRefactoring
      Returns:
      the refactoring status, never null.
    • getItems

      public Collection<IRefactoringItem> getItems()
      Description copied from interface: IRefactoring
      Returns refactoring items.
      Specified by:
      getItems in interface IRefactoring
      Returns:
      refactoring items, never null.
    • getTitle

      public String getTitle()
      Description copied from interface: IRefactoring
      Gets the refactoring title.
      Specified by:
      getTitle in interface IRefactoring
      Returns:
      the refactoring title, never null.
    • perform

      public void perform()
      Description copied from interface: IRefactoring
      Performs the refactoring.
      Specified by:
      perform in interface IRefactoring
    • perform

      protected abstract void perform(IBmModel bmModel, AbstractBmObjectRefactoring.BmModelRefactoringInfo bmModelInfo, Object batchSessionHandle)
      Performs the refactoring for the specified bmModel.
      Parameters:
      bmModel - the Bm
      bmModelInfo -
      batchSessionHandle -
    • executeBmModelOperations

      protected void executeBmModelOperations(IBmModel bmModel, Object batchSessionHandle, Collection<IRefactoringOperation> operations)
      Executes operations for the specified BmModel.
      Parameters:
      bmModel - the Bm model instance, cannot be null.
      batchSessionHandle - the batch session handle, cannot be null.
      operations - a coolection of operations, cannot be null.