public class ItemProviderAdapter.ResultAndAffectedObjectsWrappingCommand extends CommandWrapper
ResultAndAffectedObjectsWrappingCommand
wraps another command to substitute IWrapperItemProvider
s for their values in the command's result and affected objects. This is needed
as the values have been unwrapped for the command to operate on properly.
A list of wrappers from which to substitute is formed by calling getChildren
on the command's
owner(s). Additional wrappers to be considered for the result can by specified in the two-argument constructor.
The first wrapper whose value
matches a given value in the result or
affected objects is substituted for it.
AbstractCommand.NonDirtying
Modifier and Type | Field and Description |
---|---|
protected java.util.Collection<? extends IWrapperItemProvider> |
additionalWrappers |
protected java.util.List<java.lang.Object> |
owners |
command
description, isExecutable, isPrepared, label
Constructor and Description |
---|
ItemProviderAdapter.ResultAndAffectedObjectsWrappingCommand(Command command) |
ItemProviderAdapter.ResultAndAffectedObjectsWrappingCommand(Command command,
java.util.Collection<? extends IWrapperItemProvider> additionalResultWrappers) |
Modifier and Type | Method and Description |
---|---|
protected void |
addOwners(Command command)
Helper method that builds the list of owners, recursively for command wrappers and/or compound commands.
|
java.util.Collection<?> |
getAffectedObjects()
Delegates to the getAffectedObjects method of the command.
|
java.util.List<java.lang.Object> |
getOwners()
Returns any owners from the wrapped command.
|
java.util.Collection<?> |
getResult()
Delegates to the getResult method of the command.
|
protected java.util.Collection<? extends IWrapperItemProvider> |
wrapValues(java.util.Collection<?> unwrappedValues,
boolean useAdditionalWrappers) |
canUndo, createCommand, dispose, execute, getCommand, getDescription, getLabel, prepare, redo, toString, undo
canExecute, chain, setDescription, setLabel
protected java.util.List<java.lang.Object> owners
protected java.util.Collection<? extends IWrapperItemProvider> additionalWrappers
public ItemProviderAdapter.ResultAndAffectedObjectsWrappingCommand(Command command)
public ItemProviderAdapter.ResultAndAffectedObjectsWrappingCommand(Command command, java.util.Collection<? extends IWrapperItemProvider> additionalResultWrappers)
public java.util.Collection<?> getResult()
CommandWrapper
getResult
in interface Command
getResult
in class CommandWrapper
public java.util.Collection<?> getAffectedObjects()
CommandWrapper
getAffectedObjects
in interface Command
getAffectedObjects
in class CommandWrapper
protected java.util.Collection<? extends IWrapperItemProvider> wrapValues(java.util.Collection<?> unwrappedValues, boolean useAdditionalWrappers)
public java.util.List<java.lang.Object> getOwners()
protected void addOwners(Command command)