Runtime

## org.eclipse.gmf.runtime.diagram.ui.requests
Class CreateConnectionViewRequest

    java.lang.Object
      org.eclipse.gef.Request
          org.eclipse.gef.requests.CreateRequest
              org.eclipse.gef.requests.CreateConnectionRequest
                  org.eclipse.gmf.runtime.diagram.ui.requests.CreateConnectionViewRequest

All Implemented Interfaces:
  DropRequest, TargetRequest

Direct Known Subclasses:
  CreateConnectionViewAndElementRequest

public class CreateConnectionViewRequest
extends CreateConnectionRequest

A request to create new `IView` (s) To instantiate this request, clients have to create a `ConnectionViewDescriptor` or a list of `ConnectionViewDescriptor` s filling it with view creation parameters. The `ConnectionViewDescriptor` is a inner class to this request The request object can be used to obtain a view creation command from a target `EditPart` Once such command is executed, the request cannot be reused again to create another view. A different instance of the reqyest has to be used instead

Nested Class Summary
`static class` `CreateConnectionViewRequest.ConnectionViewDescriptor` A specialized view descriptor for connection views

Constructor Summary
`CreateConnectionViewRequest(CreateConnectionViewRequest.ConnectionViewDescriptor ViewDescriptor)` Constructor.
`CreateConnectionViewRequest(EObject element, boolean persisted, PreferencesHint preferencesHint)` Constructor.
`CreateConnectionViewRequest(EObject element, PreferencesHint preferencesHint)` Constructor.

Method Summary
`CreateConnectionViewRequest.ConnectionViewDescriptor` `getConnectionViewDescriptor()` Gets the descriptor for the connection view to be created.
`static Command` `getCreateCommand(CreateConnectionViewRequest request, EditPart sourceEditPart, EditPart targetEditPart)` Method getCreateCommand Gets the command given a request, source and target edit parts.
`static Command` `getCreateCommand(CreateViewRequest.ViewDescriptor viewDescriptor, IAdaptable sourceViewAdapter, IAdaptable targetViewAdapter, DiagramEditPart diagramEditPart)` Method getCreateCommand.
`static Command` `getCreateCommand(EObject element, EditPart sourceEditPart, EditPart targetEditPart, PreferencesHint preferencesHint)` Method getCreateCommand.
`static Command` `getCreateCommand(IAdaptable elementAdapter, IAdaptable sourceViewAdapter, IAdaptable targetViewAdapter, DiagramEditPart diagramEditPart, PreferencesHint preferencesHint)` getCreateCommand.
`protected CreationFactory` `getFactory()` The factory mechanism is not used
`java.lang.Object` `getNewObject()` An `IAdaptable` object that adapts to `IView` .class
`java.lang.Object` `getNewObjectType()` The type is a `IAdaptable` object that adapters to `IView` .class
`void` `setFactory(CreationFactory factory)` The factory mechanism is not used

Methods inherited from class org.eclipse.gef.requests.CreateConnectionRequest
`getSourceEditPart, getStartCommand, getTargetEditPart, setSourceEditPart, setStartCommand, setTargetEditPart`

Methods inherited from class org.eclipse.gef.requests.CreateRequest
`getLocation, getSize, setLocation, setSize`

Methods inherited from class org.eclipse.gef.Request
`getExtendedData, getType, setExtendedData, setType`

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

Constructor Detail

### CreateConnectionViewRequest

    public CreateConnectionViewRequest(EObject element,
                                       PreferencesHint preferencesHint)

  Constructor.

Parameters:
  `element` - a semantic element

### CreateConnectionViewRequest

    public CreateConnectionViewRequest(EObject element,
                                       boolean persisted,
                                       PreferencesHint preferencesHint)

  Constructor.

Parameters:
  `element` - a semantic element

### CreateConnectionViewRequest

    public CreateConnectionViewRequest(CreateConnectionViewRequest.ConnectionViewDescriptor ViewDescriptor)

  Constructor.

Parameters:
  `ViewDescriptor` - a view descriptor

Method Detail

### getConnectionViewDescriptor

    public CreateConnectionViewRequest.ConnectionViewDescriptor getConnectionViewDescriptor()

  Gets the descriptor for the connection view to be created.

  Returns:
    the descriptor

### getNewObject

    public java.lang.Object getNewObject()

  An `IAdaptable` object that adapts to `IView` .class

  See Also:
    `CreateRequest.getNewObject()`

### getNewObjectType

    public java.lang.Object getNewObjectType()

  The type is a `IAdaptable` object that adapters to `IView` .class

  See Also:
    `CreateRequest.getNewObjectType()`

### getFactory

    protected CreationFactory getFactory()

  The factory mechanism is not used

  Throws:
    `java.lang.UnsupportedOperationException`

### setFactory

    public void setFactory(CreationFactory factory)

  The factory mechanism is not used

### getCreateCommand

    public static Command getCreateCommand(EObject element,
                                           EditPart sourceEditPart,
                                           EditPart targetEditPart,
                                           PreferencesHint preferencesHint)

  Method getCreateCommand.

  Parameters:
    `element` -
    `sourceEditPart` -
    `targetEditPart` -
  Returns:
    Command

### getCreateCommand

    public static Command getCreateCommand(CreateConnectionViewRequest request,
                                           EditPart sourceEditPart,
                                           EditPart targetEditPart)

  Method getCreateCommand Gets the command given a request, source and target edit parts. (No semantic element required.)

  Parameters:
    `request` -
    `sourceEditPart` -
    `targetEditPart` -
  Returns:
    `Command`

### getCreateCommand

    public static Command getCreateCommand(IAdaptable elementAdapter,
                                           IAdaptable sourceViewAdapter,
                                           IAdaptable targetViewAdapter,
                                           DiagramEditPart diagramEditPart,
                                           PreferencesHint preferencesHint)

  getCreateCommand.

  Parameters:
    `elementAdapter` -
    `sourceViewAdapter` -
    `targetViewAdapter` -
    `diagramEditPart` -
  Returns:
    Command

### getCreateCommand

    public static Command getCreateCommand(CreateViewRequest.ViewDescriptor viewDescriptor,
                                           IAdaptable sourceViewAdapter,
                                           IAdaptable targetViewAdapter,
                                           DiagramEditPart diagramEditPart)

  Method getCreateCommand.

  Parameters:
    `viewDescriptor` -
    `sourceViewAdapter` -
    `targetViewAdapter` -
    `diagramEditPart` -
  Returns:
    Command

Runtime

Guidelines for using Eclipse APIs.

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