Runtime

## org.eclipse.gmf.runtime.diagram.ui.editpolicies
Class GraphicalNodeEditPolicy.PromptAndCreateConnectionCommand

    java.lang.Object
      org.eclipse.core.commands.operations.AbstractOperation
          org.eclipse.gmf.runtime.common.core.command.AbstractCommand
              org.eclipse.gmf.runtime.diagram.ui.commands.PopupMenuCommand
                  org.eclipse.gmf.runtime.diagram.ui.commands.CreateOrSelectElementCommand
                      org.eclipse.gmf.runtime.diagram.ui.editpolicies.GraphicalNodeEditPolicy.PromptAndCreateConnectionCommand

All Implemented Interfaces:
  ICommand, org.eclipse.gmf.runtime.common.core.internal.command.ICommandWithSettableResult, IUndoableOperation

Enclosing class:
  GraphicalNodeEditPolicy

protected class GraphicalNodeEditPolicy.PromptAndCreateConnectionCommand
extends CreateOrSelectElementCommand

Gets a command that pops up a menu which allows the user to select which type of connection to be created and then creates the connection. This command uses `#getCommandForMenuSelection(Object, CreateConnectionRequest)` on the connection chosen to get the creation command.

Nested Class Summary

Nested classes inherited from class org.eclipse.gmf.runtime.diagram.ui.commands.CreateOrSelectElementCommand
`CreateOrSelectElementCommand.LabelProvider`

Field Summary

Fields inherited from class org.eclipse.gmf.runtime.diagram.ui.commands.CreateOrSelectElementCommand
`CREATE_WITHOUT_BINDING, SELECT_EXISTING, UNSPECIFIED`

Fields inherited from class org.eclipse.gmf.runtime.diagram.ui.commands.PopupMenuCommand
`POPUP_DIALOG, POPUP_MENU`

Constructor Summary
`GraphicalNodeEditPolicy.PromptAndCreateConnectionCommand(java.util.List content, CreateConnectionRequest request)` Creates a new instance.

Method Summary
`protected CommandResult` `doExecuteWithResult(IProgressMonitor progressMonitor, IAdaptable info)` Pops up the dialog with the content provided, gets the command to be executed based on the user selection, and then executes the command.
`protected CommandResult` `doRedoWithResult(IProgressMonitor progressMonitor, IAdaptable info)` Performs the actual work of redoing this command.
`protected CommandResult` `doUndoWithResult(IProgressMonitor progressMonitor, IAdaptable info)` Performs the actual work of undoing this command.

Methods inherited from class org.eclipse.gmf.runtime.diagram.ui.commands.CreateOrSelectElementCommand
`getLabelProvider, getResultAdapter, getSelectElementDialog, setSelectElementDialog`

Methods inherited from class org.eclipse.gmf.runtime.diagram.ui.commands.PopupMenuCommand
`canRedo, canUndo, getParentShell, getPopupDialog, getPopupMenu, setParentShell, setPopupDialog, setPopupMenu`

Methods inherited from class org.eclipse.gmf.runtime.common.core.command.AbstractCommand
`compose, dispose, execute, getAffectedFiles, getCommandResult, internalSetResult, redo, reduce, setResult, undo`

Methods inherited from class org.eclipse.core.commands.operations.AbstractOperation
`addContext, canExecute, getContexts, getLabel, hasContext, removeContext, setLabel, toString`

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

Methods inherited from interface org.eclipse.core.commands.operations.IUndoableOperation
`addContext, canExecute, getContexts, getLabel, hasContext, removeContext`

Constructor Detail

### GraphicalNodeEditPolicy.PromptAndCreateConnectionCommand

    public GraphicalNodeEditPolicy.PromptAndCreateConnectionCommand(java.util.List content,
                                                                    CreateConnectionRequest request)

  Creates a new instance.

Parameters:
  `content` - The list of items making up the content of the popup menu.
  `request` - The relevant create connection request.

Method Detail

### doExecuteWithResult

    protected CommandResult doExecuteWithResult(IProgressMonitor progressMonitor,
                                                IAdaptable info)
                                         throws ExecutionException

  Pops up the dialog with the content provided, gets the command to be executed based on the user selection, and then executes the command.

  Overrides:
    `doExecuteWithResult` in class `CreateOrSelectElementCommand`
  Throws:
    `ExecutionException`
  See Also:
    `org.eclipse.gmf.runtime.common.core.sandbox.AbstractCommand2#doExecute(org.eclipse.core.runtime.IProgressMonitor)`

### doUndoWithResult

    protected CommandResult doUndoWithResult(IProgressMonitor progressMonitor,
                                             IAdaptable info)
                                      throws ExecutionException

  Description copied from class: `AbstractCommand`
  Performs the actual work of undoing this command. Subclasses must implement this method to perform the undo.

  Overrides:
    `doUndoWithResult` in class `PopupMenuCommand`
  Throws:
    `ExecutionException`

### doRedoWithResult

    protected CommandResult doRedoWithResult(IProgressMonitor progressMonitor,
                                             IAdaptable info)
                                      throws ExecutionException

  Description copied from class: `AbstractCommand`
  Performs the actual work of redoing this command. Subclasses must implement this method to perform the redo.

  Overrides:
    `doRedoWithResult` in class `PopupMenuCommand`
  Throws:
    `ExecutionException`

Runtime

Guidelines for using Eclipse APIs.

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