Class AbstractCopyCommand
java.lang.Object
org.eclipse.emf.common.command.AbstractCommand
org.eclipse.emf.edit.command.ChangeCommand
org.eclipse.emf.compare.command.impl.AbstractCopyCommand
- All Implemented Interfaces:
Command,ICompareCopyCommand
- Direct Known Subclasses:
CopyCommand,MergeAllNonConflictingCommand,MergeCommand
This command can be used to copy a number of diffs (or a single one) in a given direction.
- Since:
- 3.0
-
Nested Class Summary
Nested classes/interfaces inherited from class org.eclipse.emf.common.command.AbstractCommand
AbstractCommand.NonDirtying -
Field Summary
FieldsModifier and TypeFieldDescriptionThe list of differences we are to merge.protected final booleanDirection of the merge operation.protected final IMerger.RegistryMerger registry.Fields inherited from class org.eclipse.emf.edit.command.ChangeCommand
changeDescription, changeRecorder, notifier, notifiersFields inherited from class org.eclipse.emf.common.command.AbstractCommand
description, isExecutable, isPrepared, label -
Constructor Summary
ConstructorsConstructorDescriptionAbstractCopyCommand(ChangeRecorder changeRecorder, Collection<Notifier> notifiers, List<? extends Diff> differences, boolean leftToRight, IMerger.Registry mergerRegistry) Constructs an instance of this command given the list of differences that it needs to merge. -
Method Summary
Modifier and TypeMethodDescriptionbooleanvoiddispose()Collection<?>com.google.common.collect.Multimap<DifferenceState,Diff> Returns the state changes to any diffs that this command produced.static com.google.common.collect.Multimap<DifferenceState,Diff> getChangedDiffs(ChangeDescription changeDescription, Collection<? extends Diff> relevantDiffs) Returns the state changes to any relevant diffs modified in the given change description.booleanReturns true if the command will be applied from left to right side, false otherwise.Methods inherited from class org.eclipse.emf.edit.command.ChangeCommand
createChangeRecorder, disposeChangeRecorder, doExecute, execute, getChangeDescription, getChangeRecorder, prepare, redo, setChangeDescription, undoMethods inherited from class org.eclipse.emf.common.command.AbstractCommand
canUndo, chain, getDescription, getLabel, getResult, setDescription, setLabel, toString
-
Field Details
-
differences
The list of differences we are to merge. -
leftToRight
protected final boolean leftToRightDirection of the merge operation. -
mergerRegistry
Merger registry.
-
-
Constructor Details
-
AbstractCopyCommand
public AbstractCopyCommand(ChangeRecorder changeRecorder, Collection<Notifier> notifiers, List<? extends Diff> differences, boolean leftToRight, IMerger.Registry mergerRegistry) Constructs an instance of this command given the list of differences that it needs to merge.- Parameters:
changeRecorder- The change recorder associated to this command.notifiers- The collection of notifiers that will be notified of this command's execution.differences- The list of differences that this command should merge.leftToRight- The direction in whichdifferencesshould be merged.mergerRegistry- The registry of mergers.
-
-
Method Details
-
isLeftToRight
public boolean isLeftToRight()Returns true if the command will be applied from left to right side, false otherwise.- Specified by:
isLeftToRightin interfaceICompareCopyCommand- Returns:
- true if the command will be applied from left to right side, false otherwise.
- See Also:
-
getAffectedObjects
- Specified by:
getAffectedObjectsin interfaceCommand- Overrides:
getAffectedObjectsin classAbstractCommand- See Also:
-
canExecute
public boolean canExecute()- Specified by:
canExecutein interfaceCommand- Overrides:
canExecutein classAbstractCommand- See Also:
-
getChangedDiffs
Returns the state changes to any diffs that this command produced.- Returns:
- the state changes to any diffs that this command produced.
-
getChangedDiffs
public static com.google.common.collect.Multimap<DifferenceState,Diff> getChangedDiffs(ChangeDescription changeDescription, Collection<? extends Diff> relevantDiffs) Returns the state changes to any relevant diffs modified in the given change description.- Parameters:
changeDescription- the change description to process.relevantDiffs- the diffs for which we can state changes in the map.- Returns:
- the state changes to any relevant diffs modified in the given change description.
-
dispose
public void dispose()- Specified by:
disposein interfaceCommand- Overrides:
disposein classChangeCommand
-