|
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.CreateOrSelectElementCommand
A command that pops up a menu which can allow the user to select whether they want to create a new type, select an existing element, or leave it unspecified.
The content can be customized, one or more of the above options are
permitted. The constants UNSPECIFIED and
SELECT_EXISTING can be used as the content of a menu item.
The displayed strings can be customized with a custom label provider.
The options are:
If a "Select Existing" menu item is chosen, an additional dialog appears allowing the user to choose an element.
The getResultAdapter() method returns an adaptable to the
result.
| Nested Class Summary | |
static class |
CreateOrSelectElementCommand.LabelProvider
The default label provider for the the menu items used in this command. |
| Field Summary | |
static java.lang.String |
CREATE_WITHOUT_BINDING
Add this to the content list of the popup menu to add a 'create without binding' option. |
static java.lang.String |
SELECT_EXISTING
Add this to the content list of the popup menu to add a 'select existing' option. |
static java.lang.String |
UNSPECIFIED
Add this to the content list of the popup menu to add an 'unspecified' option. |
| Fields inherited from class org.eclipse.gmf.runtime.diagram.ui.commands.PopupMenuCommand |
POPUP_DIALOG, POPUP_MENU |
| Constructor Summary | |
CreateOrSelectElementCommand(Shell parentShell,
java.util.List content)
Creates a new CreateOrSelectElementCommand that uses a
popup menu to prompt for the selection. |
|
CreateOrSelectElementCommand(Shell parentShell,
java.util.List content,
int style)
Creates a new CreateOrSelectElementCommand. |
|
CreateOrSelectElementCommand(Shell parentShell,
PopupMenu popupMenu)
Creates a new CreateOrSelectElementCommand. |
|
CreateOrSelectElementCommand(java.lang.String label,
Shell parentShell,
java.util.List content)
Creates a new CreateOrSelectElementCommand that uses a
popup menu to prompt for the selection. |
|
CreateOrSelectElementCommand(java.lang.String label,
Shell parentShell,
java.util.List content,
int style)
Creates a new CreateOrSelectElementCommand. |
|
| Method Summary | |
protected CommandResult |
doExecuteWithResult(IProgressMonitor progressMonitor,
IAdaptable info)
Pops up the dialog with the content provided. |
protected ILabelProvider |
getLabelProvider()
Gets the label provider that is to be used to display each item in the popup menu. |
ObjectAdapter |
getResultAdapter()
Gets the resultAdapter. |
protected AbstractSelectElementDialog |
getSelectElementDialog()
Gets the selectElementDialog. |
void |
setSelectElementDialog(AbstractSelectElementDialog dialog)
Sets the selectElementDialog. |
| 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, 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 |
| Field Detail |
public static final java.lang.String UNSPECIFIED
public static final java.lang.String SELECT_EXISTING
public static final java.lang.String CREATE_WITHOUT_BINDING
| Constructor Detail |
public CreateOrSelectElementCommand(Shell parentShell,
java.util.List content)
CreateOrSelectElementCommand that uses a
popup menu to prompt for the selection.
parentShell - the parent shellcontent - The list of items making up the content of the popup menu.
This can include element types (IElementType),
UNSPECIFIED, and SELECT_EXISTING.
public CreateOrSelectElementCommand(Shell parentShell,
java.util.List content,
int style)
CreateOrSelectElementCommand.
parentShell - the parent shellcontent - The list of items making up the content of the popup menu.
This can include element types (IElementType),
UNSPECIFIED, and SELECT_EXISTING.style - The kind of prompt to use for the selection. One of
PopupMenuCommand.POPUP_MENU
or
PopupMenuCommand.POPUP_DIALOG
public CreateOrSelectElementCommand(java.lang.String label,
Shell parentShell,
java.util.List content)
CreateOrSelectElementCommand that uses a
popup menu to prompt for the selection.
label - the command labelparentShell - the parent shellcontent - The list of items making up the content of the popup menu.
This can include element types (IElementType),
UNSPECIFIED, and SELECT_EXISTING.
public CreateOrSelectElementCommand(java.lang.String label,
Shell parentShell,
java.util.List content,
int style)
CreateOrSelectElementCommand.
label - the command labelparentShell - the parent shellcontent - The list of items making up the content of the popup menu.
This can include element types (IElementType),
UNSPECIFIED, and SELECT_EXISTING.style - The kind of prompt to use for the selection. One of
PopupMenuCommand.POPUP_MENU
or
PopupMenuCommand.POPUP_DIALOG
public CreateOrSelectElementCommand(Shell parentShell,
PopupMenu popupMenu)
CreateOrSelectElementCommand.
parentShell - the parent shellpopupMenu - the popup menu| Method Detail |
protected CommandResult doExecuteWithResult(IProgressMonitor progressMonitor,
IAdaptable info)
throws ExecutionException
doExecuteWithResult in class PopupMenuCommandExecutionExceptionorg.eclipse.gmf.runtime.common.core.sandbox.AbstractCommand2#doExecute(org.eclipse.core.runtime.IProgressMonitor)protected AbstractSelectElementDialog getSelectElementDialog()
public void setSelectElementDialog(AbstractSelectElementDialog dialog)
dialog - The dialog to set.public ObjectAdapter getResultAdapter()
protected ILabelProvider getLabelProvider()
|
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.