Runtime

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

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

All Implemented Interfaces:
  IEditCommandRequest

    public class CreateRelationshipRequest

extends CreateElementRequest

Request to create a new relationship element.

Field Summary
`static java.lang.String` `SOURCE` The parameter name for the relationship source.
`static java.lang.String` `TARGET` The parameter name for the relationship target.

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

Constructor Summary
`CreateRelationshipRequest(org.eclipse.emf.ecore.EObject container, org.eclipse.emf.ecore.EObject source, org.eclipse.emf.ecore.EObject target, IElementType elementType)` Constructs a new request to create a new relationship.
`CreateRelationshipRequest(org.eclipse.emf.ecore.EObject container, org.eclipse.emf.ecore.EObject source, org.eclipse.emf.ecore.EObject target, IElementType elementType, org.eclipse.emf.ecore.EReference containmentFeature)` Constructs a new request to create a new relationship.
`CreateRelationshipRequest(org.eclipse.emf.ecore.EObject source, org.eclipse.emf.ecore.EObject target, IElementType elementType)` Constructs a new request to create a new relationship.
`CreateRelationshipRequest(IElementType elementType)` Constructs a new request to create a new relationship.
`CreateRelationshipRequest(org.eclipse.emf.transaction.TransactionalEditingDomain editingDomain, org.eclipse.emf.ecore.EObject container, org.eclipse.emf.ecore.EObject source, org.eclipse.emf.ecore.EObject target, IElementType elementType)` Constructs a new request to create a new relationship.
`CreateRelationshipRequest(org.eclipse.emf.transaction.TransactionalEditingDomain editingDomain, org.eclipse.emf.ecore.EObject container, org.eclipse.emf.ecore.EObject source, org.eclipse.emf.ecore.EObject target, IElementType elementType, org.eclipse.emf.ecore.EReference containmentFeature)` Constructs a new request to create a new relationship.
`CreateRelationshipRequest(org.eclipse.emf.transaction.TransactionalEditingDomain editingDomain, org.eclipse.emf.ecore.EObject source, org.eclipse.emf.ecore.EObject target, IElementType elementType)` Constructs a new request to create a new relationship.
`CreateRelationshipRequest(org.eclipse.emf.transaction.TransactionalEditingDomain editingDomain, IElementType elementType)` Constructs a new request to create a new relationship.

Method Summary
`org.eclipse.emf.ecore.EObject` `getContainer()` Gets the container for the new element.
`org.eclipse.emf.ecore.EObject` `getSource()` Gets the source of the new relationship.
`org.eclipse.emf.ecore.EObject` `getTarget()` Gets the target of the new relationship.
`boolean` `isPrompt()` Gets the value of the prompt flag.
`void` `setPrompt(boolean prompt)` Sets the value of the prompt flag.
`void` `setSource(org.eclipse.emf.ecore.EObject source)` Sets the relationship source.
`void` `setTarget(org.eclipse.emf.ecore.EObject target)` Sets the relationship target.

Methods inherited from class org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest
`createContainer, getClientContext, getContainmentFeature, getDefaultLabel, getEditHelperContext, getEditingDomain, getElementsToEdit, getElementType, getNewElement, initializeContainmentFeature, invalidateContainmentFeature, invalidateEditHelperContext, setClientContext, setContainer, setContainmentFeature, setNewElement, setParameter`

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

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

Field Detail

### SOURCE

    public static final java.lang.String SOURCE

  The parameter name for the relationship source.

  See Also:
    Constant Field Values

### TARGET

    public static final java.lang.String TARGET

  The parameter name for the relationship target.

  See Also:
    Constant Field Values

Constructor Detail

### CreateRelationshipRequest

    public CreateRelationshipRequest(org.eclipse.emf.transaction.TransactionalEditingDomain editingDomain,
                                     org.eclipse.emf.ecore.EObject container,
                                     org.eclipse.emf.ecore.EObject source,
                                     org.eclipse.emf.ecore.EObject target,
                                     IElementType elementType,
                                     org.eclipse.emf.ecore.EReference containmentFeature)

  Constructs a new request to create a new relationship.

  Parameters:
    `editingDomain` - the editing domain in which I am requesting to make model
    `container` - the container for the new relationship
    `source` - the source of the new relationship
    `target` - the target of the new relationship
    `elementType` - the element type of the new relationship
    `containmentFeature` - the feature that will contain the new relationship

### CreateRelationshipRequest

    public CreateRelationshipRequest(org.eclipse.emf.transaction.TransactionalEditingDomain editingDomain,
                                     org.eclipse.emf.ecore.EObject container,
                                     org.eclipse.emf.ecore.EObject source,
                                     org.eclipse.emf.ecore.EObject target,
                                     IElementType elementType)

  Constructs a new request to create a new relationship.

  Parameters:
    `editingDomain` - the editing domain in which I am requesting to make model
    `container` - the container for the new relationship
    `source` - the source of the new relationship
    `target` - the target of the new relationship
    `elementType` - the element type of the new relationship

### CreateRelationshipRequest

    public CreateRelationshipRequest(org.eclipse.emf.transaction.TransactionalEditingDomain editingDomain,
                                     org.eclipse.emf.ecore.EObject source,
                                     org.eclipse.emf.ecore.EObject target,
                                     IElementType elementType)

  Constructs a new request to create a new relationship.

  Parameters:
    `editingDomain` - the editing domain in which I am requesting to make model
    `source` - the source of the new relationship
    `target` - the target of the new relationship
    `elementType` - the element type of the new relationship

### CreateRelationshipRequest

    public CreateRelationshipRequest(org.eclipse.emf.ecore.EObject source,
                                     org.eclipse.emf.ecore.EObject target,
                                     IElementType elementType)

  Constructs a new request to create a new relationship. The editing domain will be derived from the result of `getContainer()`.

  Parameters:
    `source` - the source of the new relationship
    `target` - the target of the new relationship
    `elementType` - the element type of the new relationship

### CreateRelationshipRequest

    public CreateRelationshipRequest(org.eclipse.emf.transaction.TransactionalEditingDomain editingDomain,
                                     IElementType elementType)

  Constructs a new request to create a new relationship.

  Parameters:
    `editingDomain` - the editing domain in which I am requesting to make model
    `elementType` - the element type of the new relationship

### CreateRelationshipRequest

    public CreateRelationshipRequest(IElementType elementType)

  Constructs a new request to create a new relationship. The editing domain will be derived from the result of `getContainer()`.

  Parameters:
    `elementType` - the element type of the new relationship

### CreateRelationshipRequest

    public CreateRelationshipRequest(org.eclipse.emf.ecore.EObject container,
                                     org.eclipse.emf.ecore.EObject source,
                                     org.eclipse.emf.ecore.EObject target,
                                     IElementType elementType,
                                     org.eclipse.emf.ecore.EReference containmentFeature)

  Constructs a new request to create a new relationship. The editing domain will be derived from `container`.

  Parameters:
    `container` - the container for the new relationship
    `source` - the source of the new relationship
    `target` - the target of the new relationship
    `elementType` - the element type of the new relationship
    `containmentFeature` - the feature that will contain the new relationship

### CreateRelationshipRequest

    public CreateRelationshipRequest(org.eclipse.emf.ecore.EObject container,
                                     org.eclipse.emf.ecore.EObject source,
                                     org.eclipse.emf.ecore.EObject target,
                                     IElementType elementType)

  Constructs a new request to create a new relationship. The editing domain will be derived from `container`.

  Parameters:
    `container` - the container for the new relationship
    `source` - the source of the new relationship
    `target` - the target of the new relationship
    `elementType` - the element type of the new relationship

Method Detail

### getSource

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

  Gets the source of the new relationship.

  Returns:
    the source of the new relationship

### setSource

    public void setSource(org.eclipse.emf.ecore.EObject source)

  Sets the relationship source.

  Does nothing of the source has not changed. Othewise, invalidates the edit helper context and containment feature.

  Parameters:
    `source` - the relationship source

### getTarget

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

  Gets the target of the new relationship.

  Returns:
    the target of the new relationship

### setTarget

    public void setTarget(org.eclipse.emf.ecore.EObject target)

  Sets the relationship target.

  Does nothing of the target has not changed. Otherwise, invalidates the edit helper context.

  Parameters:
    `target` - the relationship target

### getContainer

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

  Gets the container for the new element.

  Overrides:
    `getContainer` in class `CreateElementRequest`
  Returns:
    the container for the new element.

### isPrompt

    public boolean isPrompt()

  Gets the value of the prompt flag.

  Returns:
    `true` if the user should be prompted to create any parts necessary to the creation of the new relationship, `false` if defaults should be used.

### setPrompt

    public void setPrompt(boolean prompt)

  Sets the value of the prompt flag.

  Parameters:
    `prompt` - `true` if the user should be prompted to create any parts necessary to the creation of the new relationship, `false` if defaults should be used.

Runtime

Guidelines for using Eclipse APIs.

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