Runtime

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

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

All Implemented Interfaces:
  IEditCommandRequest

    public class DuplicateElementsRequest

extends AbstractEditCommandRequest

Request to duplicate a model element.

Field Summary

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

Constructor Summary
`DuplicateElementsRequest()` Constructs a new request to duplicate a model element.
`DuplicateElementsRequest(java.util.List elementsToDuplicate)` Constructs a new request to duplicate a model element.
`DuplicateElementsRequest(TransactionalEditingDomain editingDomain)` Constructs a new request to duplicate a model element.
`DuplicateElementsRequest(TransactionalEditingDomain editingDomain, java.util.List elementsToDuplicate)` Constructs a new request to duplicate a model element.

Method Summary
`java.util.Map` `getAllDuplicatedElementsMap()` Returns a map of all duplicated elements.
`protected java.lang.String` `getDefaultLabel()` Gets the default edit command label.
`org.eclipse.emf.ecore.EObject` `getDuplicate()` Gets the duplicate.
`java.lang.Object` `getEditHelperContext()` Gets the edit helper context for this request.
`TransactionalEditingDomain` `getEditingDomain()` Derives the editing domain from the elements to be duplicated, if it hasn't already been specified.
`java.util.List` `getElementsToBeDuplicated()` Returns the primary elements to be duplicated.
`java.util.List` `getElementsToEdit()` Gets the elements that will be changed when the work is done for this request.
`void` `setAllDuplicatedElementsMap(java.util.Map duplicatedElementsMap)` Sets the duplicate.
`void` `setElementsToBeDuplicated(java.util.List elements)` Sets the primary elements to be duplicated.

Methods inherited from class org.eclipse.gmf.runtime.emf.type.core.requests.AbstractEditCommandRequest
`addParameters, getClientContext, 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

### DuplicateElementsRequest

    public DuplicateElementsRequest(TransactionalEditingDomain editingDomain)

  Constructs a new request to duplicate a model element.

  Parameters:
    `editingDomain` - the editing domain in which I am requesting to make model

### DuplicateElementsRequest

    public DuplicateElementsRequest(TransactionalEditingDomain editingDomain,
                                    java.util.List elementsToDuplicate)

  Constructs a new request to duplicate a model element.

  Parameters:
    `editingDomain` - the editing domain in which I am requesting to make model
    `elementToDuplicate` - the element to be duplicated

### DuplicateElementsRequest

    public DuplicateElementsRequest()

  Constructs a new request to duplicate a model element. The editing domain will be derived from the elements in `getElementsToBeDuplicated()`.

### DuplicateElementsRequest

    public DuplicateElementsRequest(java.util.List elementsToDuplicate)

  Constructs a new request to duplicate a model element. The editing domain will be derived from the elements in `getElementsToBeDuplicated()`.

  Parameters:
    `elementToDuplicate` - the element to be duplicated

Method Detail

### getAllDuplicatedElementsMap

    public java.util.Map getAllDuplicatedElementsMap()

  Returns a map of all duplicated elements. This will be populated with all the elements that are duplicated after the command executes. The key is the original element and the value is the new duplicated element. There may be more elements duplicated than the original list of elements passed in (e.g. contained elements) -- these will appear in this map.

  Returns:
    Returns the allDuplicatedElementsMap.

### getElementsToBeDuplicated

    public java.util.List getElementsToBeDuplicated()

  Returns the primary elements to be duplicated.

  Returns:
    Returns the elements to be duplicated.

### getDuplicate

    public org.eclipse.emf.ecore.EObject getDuplicate()

  Gets the duplicate. Will return `null` until the request has been answered.

  Returns:
    the duplicate

### setAllDuplicatedElementsMap

    public void setAllDuplicatedElementsMap(java.util.Map duplicatedElementsMap)

  Sets the duplicate.

  Parameters:
    `duplicate` - the duplicate

### setElementsToBeDuplicated

    public void setElementsToBeDuplicated(java.util.List elements)

  Sets the primary elements to be duplicated.

  Parameters:
    `elements` - The elements to be duplicated.

### 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`
  Returns:
    the elements that will be edited

### 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

### getEditingDomain

    public TransactionalEditingDomain getEditingDomain()

  Derives the editing domain from the elements to be duplicated, if it hasn't already been specified.

  Specified by:
    `getEditingDomain` in interface `IEditCommandRequest`
  Overrides:
    `getEditingDomain` in class `AbstractEditCommandRequest`
  Returns:
    the editing domain

Runtime

Guidelines for using Eclipse APIs.

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