Runtime

## org.eclipse.gmf.runtime.emf.type.core.requests
Class MoveRequest

    java.lang.Object
      org.eclipse.gmf.runtime.emf.type.core.requests.AbstractEditCommandRequest
          org.eclipse.gmf.runtime.emf.type.core.requests.MoveRequest

All Implemented Interfaces:
  IEditCommandRequest

public class MoveRequest
extends AbstractEditCommandRequest

Request to move a collections of model elements from one location to another. The request can specify the target features that should be used to contain each of the elements being moved.

If the target feature is not specified for a given element being moved, then a default feature is found in the target according to the following rules:

- If the feature fomerly containing the moved element exists in the target element, it will be used.
- Otherwise, the first feature in the target that can contain the moved element will be used.

Field Summary

Fields inherited from interface org.eclipse.gmf.runtime.emf.type.core.requests.IEditCommandRequest
`REPLACE_DEFAULT_COMMAND`

Constructor Summary
`MoveRequest(EObject targetContainer, EObject elementToMove)` Constructs a new request to move a model element from one container to another.
`MoveRequest(EObject targetContainer, EReference targetFeature, EObject elementToMove)` Constructs a new request to move a model element from one container to another.
`MoveRequest(EObject targetContainer, java.util.List elementsToMove)` Constructs a new request to move a collection of model element into a new container.
`MoveRequest(EObject targetContainer, java.util.Map elementsToMove)` Constructs a new request to move a collection of model element into specific features of a new container.
`MoveRequest(org.eclipse.emf.transaction.TransactionalEditingDomain editingDomain, EObject targetContainer, EObject elementToMove)` Constructs a new request to move a model element from one container to another.
`MoveRequest(org.eclipse.emf.transaction.TransactionalEditingDomain editingDomain, EObject targetContainer, EReference targetFeature, EObject elementToMove)` Constructs a new request to move a model element from one container to another.
`MoveRequest(org.eclipse.emf.transaction.TransactionalEditingDomain editingDomain, EObject targetContainer, java.util.List elementsToMove)` Constructs a new request to move a collection of model element into a new container.
`MoveRequest(org.eclipse.emf.transaction.TransactionalEditingDomain editingDomain, EObject targetContainer, java.util.Map elementsToMove)` Constructs a new request to move a collection of model element into specific features of a new container.

Method Summary
`protected java.lang.String` `getDefaultLabel()` Gets the default edit command label.
`java.lang.Object` `getEditHelperContext()` Gets the edit helper context for this request.
`java.util.List` `getElementsToEdit()` Gets the elements that will be changed when the work is done for this request.
`java.util.Map` `getElementsToMove()` Gets the map of elements to be moved.
`EObject` `getTargetContainer()` Gets the container into which the element will be moved.
`EReference` `getTargetFeature(EObject element)` Gets the feature in the target element that should contain `element` after it is moved.
`void` `setTargetContainer(EObject targetContainer)` Sets the container into which the element will be moved.
`void` `setTargetFeature(EObject element, EReference targetFeature)` Sets the reference feature into which an element should be moved.

Methods inherited from class org.eclipse.gmf.runtime.emf.type.core.requests.AbstractEditCommandRequest
`addParameters, getClientContext, getEditingDomain, getLabel, getParameter, getParameters, setClientContext, setEditingDomain, setLabel, setParameter`

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

Constructor Detail

### MoveRequest

    public MoveRequest(org.eclipse.emf.transaction.TransactionalEditingDomain editingDomain,
                       EObject targetContainer,
                       EReference targetFeature,
                       EObject elementToMove)

  Constructs a new request to move a model element from one container to another.

Parameters:
  `editingDomain` - the editing domain in which I am requesting to make model
  `targetContainer` - the target container
  `targetFeature` - the target feature
  `elementToMove` - the element to be moved

### MoveRequest

    public MoveRequest(org.eclipse.emf.transaction.TransactionalEditingDomain editingDomain,
                       EObject targetContainer,
                       EObject elementToMove)

  Constructs a new request to move a model element from one container to another.

Parameters:
  `editingDomain` - the editing domain in which I am requesting to make model
  `targetContainer` - the target container
  `elementToMove` - the element to be moved.

### MoveRequest

    public MoveRequest(org.eclipse.emf.transaction.TransactionalEditingDomain editingDomain,
                       EObject targetContainer,
                       java.util.List elementsToMove)

  Constructs a new request to move a collection of model element into a new container. The features in the target used to contain the moved elements will be derived as follows:
  - If the feature fomerly containing the moved element exists in the target element, it will be used.
  - Otherwise, the first feature in the target that can contain the moved element will be used.

Parameters:
  `editingDomain` - the editing domain in which I am requesting to make model
  `targetContainer` - the target container
  `elementsToMove` - the list of `EObjects` to be moved.

### MoveRequest

    public MoveRequest(org.eclipse.emf.transaction.TransactionalEditingDomain editingDomain,
                       EObject targetContainer,
                       java.util.Map elementsToMove)

  Constructs a new request to move a collection of model element into specific features of a new container.

Parameters:
  `editingDomain` - the editing domain in which I am requesting to make model
  `targetContainer` - the target container
  `elementsToMove` - the map of `EObjects` to `EReference` features to be moved.

### MoveRequest

    public MoveRequest(EObject targetContainer,
                       EReference targetFeature,
                       EObject elementToMove)

  Constructs a new request to move a model element from one container to another. The editing domain is derived from the `targetContainer`.

Parameters:
  `targetContainer` - the target container
  `targetFeature` - the target feature
  `elementToMove` - the element to be moved

### MoveRequest

    public MoveRequest(EObject targetContainer,
                       EObject elementToMove)

  Constructs a new request to move a model element from one container to another. The editing domain is derived from the `targetContainer`.

Parameters:
  `targetContainer` - the target container
  `elementToMove` - the element to be moved.

### MoveRequest

    public MoveRequest(EObject targetContainer,
                       java.util.List elementsToMove)

  Constructs a new request to move a collection of model element into a new container. The features in the target used to contain the moved elements will be derived as follows:
  - If the feature fomerly containing the moved element exists in the target element, it will be used.
  - Otherwise, the first feature in the target that can contain the moved element will be used.

  The editing domain is derived from the `targetContainer`.

Parameters:
  `targetContainer` - the target container
  `elementsToMove` - the list of `EObjects` to be moved.

### MoveRequest

    public MoveRequest(EObject targetContainer,
                       java.util.Map elementsToMove)

  Constructs a new request to move a collection of model element into specific features of a new container. The editing domain is derived from the `targetContainer`.

Parameters:
  `targetContainer` - the target container
  `elementsToMove` - the map of `EObjects` to `EReference` features to be moved.

Method Detail

### getElementsToMove

    public java.util.Map getElementsToMove()

  Gets the map of elements to be moved. Each entry in the map consists of an `EObject` key, which is the element to be moved to the new target, and an `EReference` value, which is the feature in the new target that should contain the moved element.

  Returns:
    the map of elements to be moved

### setTargetContainer

    public void setTargetContainer(EObject targetContainer)

  Sets the container into which the element will be moved.

  Parameters:
    `targetContainer` - the target container

### getTargetContainer

    public EObject getTargetContainer()

  Gets the container into which the element will be moved.

  Returns:
    the container into which the element will be moved

### setTargetFeature

    public void setTargetFeature(EObject element,
                                 EReference targetFeature)

  Sets the reference feature into which an element should be moved.

  Parameters:
    `element` - the element to be moved
    `targetFeature` - the target feature

### getTargetFeature

    public EReference getTargetFeature(EObject element)

  Gets the feature in the target element that should contain `element` after it is moved.

  Parameters:
    `element` - the element to be moved
  Returns:
    the feature that will contain the element in the target

### getElementsToEdit

    public java.util.List getElementsToEdit()

  Description copied from interface: `IEditCommandRequest`
  Gets the elements that will be changed when the work is done for this request.

  Specified by:
    `getElementsToEdit` in interface `IEditCommandRequest`
  Overrides:
    `getElementsToEdit` in class `AbstractEditCommandRequest`

### getDefaultLabel

    protected java.lang.String getDefaultLabel()

  Description copied from class: `AbstractEditCommandRequest`
  Gets the default edit command label.

  Overrides:
    `getDefaultLabel` in class `AbstractEditCommandRequest`
  Returns:
    the default label

### getEditHelperContext

    public java.lang.Object getEditHelperContext()

  Description copied from interface: `IEditCommandRequest`
  Gets the edit helper context for this request. The context can be an `IElementType` or an `EObject`, or an `IEditHelperContext`. It determines which edit helper should be used to find a command to do the work in the request.

  Returns:
    the edit helper context for this request

Runtime

Guidelines for using Eclipse APIs.

Copyright (c) IBM Corp., Borland Software Corp., and others 2005,2006. All rights reserved.