Class AbstractBmObjectRefactoring
java.lang.Object
com._1c.g5.v8.dt.internal.refactoring.core.AbstractBmObjectRefactoring
- All Implemented Interfaces:
IRefactoring
- Direct Known Subclasses:
BmObjectDeleteRefactoring
,BmObjectRenameRefactoring
The
It groups operations by BM model instance. For each BM model-wide operation it groups operations by top object for transaction splitting.
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.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static final class
Keeps the information about refatoring for one BmModel instance. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
AbstractBmObjectRefactoring
(String title, RefactoringSettings settings) Initiates a refactoring instance. -
Method Summary
Modifier and TypeMethodDescriptionvoid
addBmObjectOperation
(IBmModel bmModel, IBmObject bmObject, IRefactoringOperation operation) Adds the specifiedoperation
to BmObject refactoring instance.void
addMainOperation
(IBmModel bmModel, IRefactoringOperation operation) Adds the specified 'main'operation
to BmObject refactoring instance.void
addOperation
(IRefactoringOperation operation) Adds the specifiedoperation
.void
addPostOperation
(IRefactoringOperation operation) Adds the specifiedoperation
to post-operations.void
addPreOperation
(IRefactoringOperation operation) Adds the specifiedoperation
to pre-operations.void
associate
(IRefactoringOperation operation, IRefactoringItem item) Associates the specifiedoperation
with theitem
.protected void
executeBmModelOperations
(IBmModel bmModel, Object batchSessionHandle, Collection<IRefactoringOperation> operations) Executes operations for the specified BmModel.getItems()
Returns refactoring items.Returns the refactoring status.getTitle()
Gets the refactoring title.boolean
isEnabled
(IRefactoringOperation operation) Returnstrue
if the operation is enabled,false
- otherwise.void
perform()
Performs the refactoring.protected abstract void
perform
(IBmModel bmModel, AbstractBmObjectRefactoring.BmModelRefactoringInfo bmModelInfo, Object batchSessionHandle) Performs the refactoring for the specifiedbmModel
.
-
Constructor Details
-
AbstractBmObjectRefactoring
Initiates a refactoring instance.- Parameters:
title
- the refactoring title, cannot benull
.settings
- the refactoring settings, cannot benull
.
-
-
Method Details
-
addPreOperation
Adds the specifiedoperation
to pre-operations.- Parameters:
operation
- the refactoring operation, cannot benull
.
-
addPostOperation
Adds the specifiedoperation
to post-operations.- Parameters:
operation
- the refactoring operation, cannot benull
.
-
addOperation
Adds the specifiedoperation
.- Parameters:
operation
- the refactoring operation, cannot benull
.
-
addBmObjectOperation
public void addBmObjectOperation(IBmModel bmModel, IBmObject bmObject, IRefactoringOperation operation) Adds the specifiedoperation
to BmObject refactoring instance.- Parameters:
bmModel
- the BM model instance, cannot benull
.bmObject
- the BM object to change withinoperation
instance, cannot benull
.operation
- the refactoring operation, cannot benull
.
-
addMainOperation
Adds the specified 'main'operation
to BmObject refactoring instance.- Parameters:
bmModel
- the BM model instance, cannot benull
.operation
- the refactoring operation, cannot benull
.
-
isEnabled
Returnstrue
if the operation is enabled,false
- otherwise.- Parameters:
operation
- the refactoring operation, cannot benull
.- Returns:
true
if the operation is enabled,false
- otherwise.
-
associate
Associates the specifiedoperation
with theitem
.- Parameters:
operation
- the refactoring operation, cannot benull
.item
- the refactoring item, cannot benull
.
-
getStatus
Description copied from interface:IRefactoring
Returns the refactoring status.- Specified by:
getStatus
in interfaceIRefactoring
- Returns:
- the refactoring status, never
null
.
-
getItems
Description copied from interface:IRefactoring
Returns refactoring items.- Specified by:
getItems
in interfaceIRefactoring
- Returns:
- refactoring items, never
null
.
-
getTitle
Description copied from interface:IRefactoring
Gets the refactoring title.- Specified by:
getTitle
in interfaceIRefactoring
- Returns:
- the refactoring title, never
null
.
-
perform
public void perform()Description copied from interface:IRefactoring
Performs the refactoring.- Specified by:
perform
in interfaceIRefactoring
-
perform
protected abstract void perform(IBmModel bmModel, AbstractBmObjectRefactoring.BmModelRefactoringInfo bmModelInfo, Object batchSessionHandle) Performs the refactoring for the specifiedbmModel
.- Parameters:
bmModel
- the BmbmModelInfo
-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 benull
.batchSessionHandle
- the batch session handle, cannot benull
.operations
- a coolection of operations, cannot benull
.
-