## org.eclipse.emf.edit.provider
Class ItemProviderAdapter.ResultAndAffectedObjectsWrappingCommand

    java.lang.Object
      org.eclipse.emf.common.command.AbstractCommand
          org.eclipse.emf.common.command.CommandWrapper
              org.eclipse.emf.edit.provider.ItemProviderAdapter.ResultAndAffectedObjectsWrappingCommand

All Implemented Interfaces:
  Command

Direct Known Subclasses:
  ItemProviderAdapter.ResultAndAffectedObjectsWrappingCommandActionDelegate

Enclosing class:
  ItemProviderAdapter

    public class ItemProviderAdapter.ResultAndAffectedObjectsWrappingCommand

extends CommandWrapper

A `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.

Nested Class Summary

Nested classes/interfaces inherited from class org.eclipse.emf.common.command.AbstractCommand
`AbstractCommand.NonDirtying`

Field Summary
`protected java.util.Collection<? extends IWrapperItemProvider>` `additionalWrappers`
`protected java.util.List<java.lang.Object>` `owners`

Fields inherited from class org.eclipse.emf.common.command.CommandWrapper
`command`

Fields inherited from class org.eclipse.emf.common.command.AbstractCommand
`description, isExecutable, isPrepared, label`

Constructor Summary
`ItemProviderAdapter.ResultAndAffectedObjectsWrappingCommand(Command command)`
`ItemProviderAdapter.ResultAndAffectedObjectsWrappingCommand(Command command, java.util.Collection<? extends IWrapperItemProvider> additionalResultWrappers)`

Method Summary
`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)`

Methods inherited from class org.eclipse.emf.common.command.CommandWrapper
`canUndo, createCommand, dispose, execute, getCommand, getDescription, getLabel, prepare, redo, toString, undo`

Methods inherited from class org.eclipse.emf.common.command.AbstractCommand
`canExecute, chain, setDescription, setLabel`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

Field Detail

### owners

    protected java.util.List<java.lang.Object> owners

### additionalWrappers

    protected java.util.Collection<? extends IWrapperItemProvider> additionalWrappers

Constructor Detail

### ItemProviderAdapter.ResultAndAffectedObjectsWrappingCommand

    public ItemProviderAdapter.ResultAndAffectedObjectsWrappingCommand(Command command)

### ItemProviderAdapter.ResultAndAffectedObjectsWrappingCommand

    public ItemProviderAdapter.ResultAndAffectedObjectsWrappingCommand(Command command,
                                                                       java.util.Collection<? extends IWrapperItemProvider> additionalResultWrappers)

Method Detail

### getResult

    public java.util.Collection<?> getResult()

  Description copied from class: `CommandWrapper`
  Delegates to the getResult method of the command.

  Specified by:
    `getResult` in interface `Command`
  Overrides:
    `getResult` in class `CommandWrapper`
  Returns:
    the result.

### getAffectedObjects

    public java.util.Collection<?> getAffectedObjects()

  Description copied from class: `CommandWrapper`
  Delegates to the getAffectedObjects method of the command.

  Specified by:
    `getAffectedObjects` in interface `Command`
  Overrides:
    `getAffectedObjects` in class `CommandWrapper`
  Returns:
    the result.

### wrapValues

    protected java.util.Collection<? extends IWrapperItemProvider> wrapValues(java.util.Collection<?> unwrappedValues,
                                                                              boolean useAdditionalWrappers)

### getOwners

    public java.util.List<java.lang.Object> getOwners()

  Returns any owners from the wrapped command. If it is a compound command, or a wrapped compound command, it may have multiple owners. This returns and caches a list of them.

### addOwners

    protected void addOwners(Command command)

  Helper method that builds the list of owners, recursively for command wrappers and/or compound commands.

Copyright 2001-2006 IBM Corporation and others. All Rights Reserved.