|
Runtime | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.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.PromptForConnectionAndEndCommand
A command that pops up a menu which can allow the user to select the type of connection to be created and whether they want to create a new type or select an existing element for the other end of the connection.
The getRelationshipTypeAdapter() method returns an adaptable
to the relationship type result.
The getEndAdapter() method returns an adaptable to the end
type result.
| Nested Class Summary | |
protected class |
PromptForConnectionAndEndCommand.ConnectionAndEndLabelProvider
Label provider of the first and only popup for the type of the other end when there is only one connection type (e.g. a single relationship type palette tool is used). |
protected class |
PromptForConnectionAndEndCommand.ConnectionLabelProvider
Label provider of the first popup menu with the relationship types. |
protected class |
PromptForConnectionAndEndCommand.EndLabelProvider
Label provider of the second popup (submenus) for the type of the other end. |
| Field Summary |
| Fields inherited from class org.eclipse.gmf.runtime.diagram.ui.commands.PopupMenuCommand |
POPUP_DIALOG, POPUP_MENU |
| Constructor Summary | |
PromptForConnectionAndEndCommand(CreateConnectionRequest request,
IGraphicalEditPart containerEP)
Creates a new PromptForConnectionAndEndCommand. |
|
| Method Summary | |
boolean |
canExecute()
|
protected PopupMenu |
createPopupMenu()
Gets the content to be used in the popup menu from the Modeling Assistant Service and creates the popup menu. |
protected CommandResult |
doExecuteWithResult(IProgressMonitor progressMonitor,
IAdaptable info)
Pops up the dialog with the content provided. |
ObjectAdapter |
getConnectionAdapter()
Gets the connectionAdapter. |
protected ILabelProvider |
getConnectionAndEndLabelProvider(java.lang.Object connectionItem)
Gets the label provider that is to be used when there is only one option for the connection type so the popup menu consists of a single menu identifying the connection type to be created and options for the other end of which the user must choose |
protected ILabelProvider |
getConnectionLabelProvider()
Gets the label provider that is to be used in the first menu of the popup where the user is to choose the connection to be created. |
protected java.util.List |
getConnectionMenuContent()
Gets a list of all the connection items that will represent the connection choices and will appear in the first part of the popup menu. |
IAdaptable |
getEndAdapter()
Gets the endAdapter. |
protected ILabelProvider |
getEndLabelProvider()
Gets the label provider that is to be used in the second menu of the popup where the user is to choose the end (could be source or target) to be created. |
protected java.util.List |
getEndMenuContent(java.lang.Object connectionItem)
Gets a list of all the end items that will represent the other end choices and will appear in the submenu popup of the given connection item. |
protected boolean |
isDirectionReversed()
Returns true if the request is a reversed CreateUnspecifiedTypeConnectionRequest. |
| Methods inherited from class org.eclipse.gmf.runtime.diagram.ui.commands.PopupMenuCommand |
canRedo, canUndo, doRedoWithResult, doUndoWithResult, 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, 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, getContexts, getLabel, hasContext, removeContext |
| Constructor Detail |
public PromptForConnectionAndEndCommand(CreateConnectionRequest request,
IGraphicalEditPart containerEP)
PromptForConnectionAndEndCommand.
request - The request to create a connection. It may contain the
connection type or it may be a
CreateUnspecifiedTypeConnectionRequest.containerEP - The container edit part, where the view and element request to
create the other end is sent. This is used only for testing
that a type is valid for the other end.| Method Detail |
protected java.util.List getConnectionMenuContent()
If the objects in this are not IElementTypes or they
require a special label provider, then
PromptForConnectionAndEndCommand.getConnectionLabelProvider() should be overridden to provide
this.
When this command has executed, the connection adapter result (PromptForConnectionAndEndCommand.getConnectionAdapter())
will be populated with the connection item chosen.
protected java.util.List getEndMenuContent(java.lang.Object connectionItem)
If the objects in this are not IElementTypes or they
require a special label provider, then PromptForConnectionAndEndCommand.getEndLabelProvider()
should be overridden to provide this.
When this command has executed, the end adapter result (PromptForConnectionAndEndCommand.getEndAdapter())
will be populated with the end item chosen.
connectionItem - the connection item for which this will be a submenu
protected PopupMenu createPopupMenu()
public boolean canExecute()
protected CommandResult doExecuteWithResult(IProgressMonitor progressMonitor,
IAdaptable info)
throws ExecutionException
doExecuteWithResult in class PopupMenuCommandExecutionExceptionpublic ObjectAdapter getConnectionAdapter()
public IAdaptable getEndAdapter()
protected boolean isDirectionReversed()
CreateUnspecifiedTypeConnectionRequest.
CreateUnspecifiedTypeConnectionRequest; false
otherwiseprotected ILabelProvider getConnectionLabelProvider()
protected ILabelProvider getEndLabelProvider()
protected ILabelProvider getConnectionAndEndLabelProvider(java.lang.Object connectionItem)
connectionItem - the single known connection item
|
Runtime | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
Guidelines for using Eclipse APIs.
Copyright (c) IBM Corp., Borland Software Corp., and others 2005,2006. All rights reserved.