Runtime

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

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

All Implemented Interfaces:
  IEditCommandRequest

    public class DestroyElementRequest

extends DestroyRequest

Request to destroy a model element.

Field Summary
`static java.lang.String` `DESTROY_DEPENDENTS_REQUEST_PARAMETER` Request parameter specifying the associated destroy-dependents request that is propagated recursively through the processing of destroy requests for an element, its contents, and its dependents.
`static java.lang.String` `INITIAL_ELEMENT_TO_DESTROY_PARAMETER` Request parameter specifying the initial element that was requested to be destroyed.

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

Constructor Summary
`DestroyElementRequest(boolean confirmationRequired)` Constructs a new request to destroy a model element.
`DestroyElementRequest(org.eclipse.emf.ecore.EObject elementToDestroy, boolean confirmationRequired)` Constructs a new request to destroy a model element.
`DestroyElementRequest(TransactionalEditingDomain editingDomain, boolean confirmationRequired)` Constructs a new request to destroy a model element.
`DestroyElementRequest(TransactionalEditingDomain editingDomain, org.eclipse.emf.ecore.EObject elementToDestroy, boolean confirmationRequired)` Constructs a new request to destroy a model element.

Method Summary
`DestroyElementCommand` `getBasicDestroyCommand()` Obtains a command to override the basic destroy command that would be created by default by the edit helper to perform the object destruction.
`org.eclipse.emf.ecore.EObject` `getContainer()` Gets the container of the element to be destroyed.
`java.lang.Object` `getEditHelperContext()` Extends the inherited method to return the default element type when destroying a root element of a resource.
`TransactionalEditingDomain` `getEditingDomain()` Derives the editing domain from the object to be destroyed, if it hasn't already been specified.
`org.eclipse.emf.ecore.EObject` `getElementToDestroy()` Gets the element to be destroyed.
`void` `setBasicDestroyCommand(DestroyElementCommand command)` Assigns a command to override the basic destroy command that would be created by default by the edit helper to perform the object destruction.
`void` `setElementToDestroy(org.eclipse.emf.ecore.EObject elementToDestroy)` Sets the element to be destroyed.

Methods inherited from class org.eclipse.gmf.runtime.emf.type.core.requests.DestroyRequest
`getDefaultLabel, getElementsToEdit, isConfirmationRequired, setConfirm`

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`

Field Detail

### DESTROY_DEPENDENTS_REQUEST_PARAMETER

    public static final java.lang.String DESTROY_DEPENDENTS_REQUEST_PARAMETER

  Request parameter specifying the associated destroy-dependents request that is propagated recursively through the processing of destroy requests for an element, its contents, and its dependents.

  The expected parameter value is an instance of type `DestroyDependentsRequest`.

  See Also:
    Constant Field Values

### INITIAL_ELEMENT_TO_DESTROY_PARAMETER

    public static final java.lang.String INITIAL_ELEMENT_TO_DESTROY_PARAMETER

  Request parameter specifying the initial element that was requested to be destroyed.

  The expected parameter value is an instance of type `EObject`, or `null`.

  See Also:
    Constant Field Values

Constructor Detail

### DestroyElementRequest

    public DestroyElementRequest(TransactionalEditingDomain editingDomain,
                                 boolean confirmationRequired)

  Constructs a new request to destroy a model element.

  Parameters:
    `editingDomain` - the editing domain in which I am requesting to make model
    `confirmationRequired` - `true` if the user should be prompted to confirm the element deletion, `false` otherwise.

### DestroyElementRequest

    public DestroyElementRequest(TransactionalEditingDomain editingDomain,
                                 org.eclipse.emf.ecore.EObject elementToDestroy,
                                 boolean confirmationRequired)

  Constructs a new request to destroy a model element.

  Parameters:
    `editingDomain` - the editing domain in which I am requesting to make model
    `elementToDestroy` - the element to be destroyed
    `confirmationRequired` - `true` if the user should be prompted to confirm the element deletion, `false` otherwise.

### DestroyElementRequest

    public DestroyElementRequest(boolean confirmationRequired)

  Constructs a new request to destroy a model element. The editing domain will be derived from the result of `getElementToDestroy()`.

  Parameters:
    `confirmationRequired` - `true` if the user should be prompted to confirm the element deletion, `false` otherwise.

### DestroyElementRequest

    public DestroyElementRequest(org.eclipse.emf.ecore.EObject elementToDestroy,
                                 boolean confirmationRequired)

  Constructs a new request to destroy a model element.

  Parameters:
    `elementToDestroy` - the element to be destroyed
    `confirmationRequired` - `true` if the user should be prompted to confirm the element deletion, `false` otherwise.

Method Detail

### getElementToDestroy

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

  Gets the element to be destroyed.

  Returns:
    the element to be destroyed

### setElementToDestroy

    public void setElementToDestroy(org.eclipse.emf.ecore.EObject elementToDestroy)

  Sets the element to be destroyed.

  Parameters:
    `elementToDestroy` - the element to be destroyed

### getContainer

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

  Description copied from class: `DestroyRequest`
  Gets the container of the element to be destroyed.

  Specified by:
    `getContainer` in class `DestroyRequest`
  Returns:
    the container of the element to be destroyed

### getEditHelperContext

    public java.lang.Object getEditHelperContext()

  Extends the inherited method to return the default element type when destroying a root element of a resource.

  Specified by:
    `getEditHelperContext` in interface `IEditCommandRequest`
  Overrides:
    `getEditHelperContext` in class `DestroyRequest`
  Returns:
    the edit helper context for this request

### getEditingDomain

    public TransactionalEditingDomain getEditingDomain()

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

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

### setBasicDestroyCommand

    public void setBasicDestroyCommand(DestroyElementCommand command)

  Assigns a command to override the basic destroy command that would be created by default by the edit helper to perform the object destruction. This can be used by before advice to replace the basic destruction behaviour.

  This is similar to the facility provided via the `IEditCommandRequest.REPLACE_DEFAULT_COMMAND` parameter for indicating that an advice has taken over the "instead" command, except that this is applies only to the basic single-object destruction, whereas the edit helper's command also performs recursion and destruction of dependents.

  Parameters:
    `command` - the basic destroy command to use for destruction of an element, or `null` to use the edit helper's default implementation
  See Also:
    `AbstractEditHelper#getBasicDestroyElementCommand(DestroyElementRequest)`

### getBasicDestroyCommand

    public DestroyElementCommand getBasicDestroyCommand()

  Obtains a command to override the basic destroy command that would be created by default by the edit helper to perform the object destruction.

  Returns:
    the basic destroy command to use for destruction of an element, or `null` to use the edit helper's default implementation
  See Also:
    `setBasicDestroyCommand(DestroyElementCommand)`, `AbstractEditHelper#getBasicDestroyElementCommand(DestroyElementRequest)`

Runtime

Guidelines for using Eclipse APIs.

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