|
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.DeferredCreateConnectionViewAndElementCommand
a command to create the both of the View and Semantic of the connection, but the editparts of target and source to obtain the command has not been created yet, since we have the ViewAdapter to we can use it to get its editpart once it is created and hence on execution time we can get its editpart to get the command for our request and then execute it.
This command can handle both
CreateConnectionViewAndElementRequest and
CreateConnectionViewRequest.
| Constructor Summary | |
DeferredCreateConnectionViewAndElementCommand(CreateConnectionViewAndElementRequest request,
IAdaptable sourceViewAdapter,
IAdaptable targetViewAdapter,
EditPartViewer currentViewer)
Constructor for DeferredCreateConnectionViewAndElementCommand. |
|
DeferredCreateConnectionViewAndElementCommand(CreateRequest request,
IAdaptable typeInfoAdapter,
IAdaptable sourceViewAdapter,
IAdaptable targetViewAdapter,
EditPartViewer currentViewer)
Constructor for DeferredCreateConnectionViewAndElementCommand. |
|
DeferredCreateConnectionViewAndElementCommand(IElementType type,
IAdaptable sourceViewAdapter,
IAdaptable targetViewAdapter,
EditPartViewer currentViewer,
PreferencesHint preferencesHint)
Constructor for DeferredCreateConnectionViewAndElementCommand. |
|
| Method Summary | |
boolean |
canRedo()
|
boolean |
canUndo()
|
protected CommandResult |
doExecuteWithResult(IProgressMonitor progressMonitor,
IAdaptable info)
Finds the source and target editparts by extracting the views from the view adapaters and searching in the editpart viewer. |
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. |
java.util.List |
getAffectedFiles()
Returns the IFiles that may be modified when the operation is
executed, undone or redone. |
java.lang.String |
getLabel()
|
protected EditPart |
getSourceEditPart()
gives access to the connection source edit part, which is the edit part of the connection's source View |
protected EditPart |
getTargetEditPart()
gives access to the connection target edit part, which is the edit part of the connection's target View |
| Methods inherited from class org.eclipse.gmf.runtime.common.core.command.AbstractCommand |
compose, dispose, execute, getCommandResult, internalSetResult, redo, reduce, setResult, undo |
| Methods inherited from class org.eclipse.core.commands.operations.AbstractOperation |
addContext, canExecute, getContexts, 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, hasContext, removeContext |
| Constructor Detail |
public DeferredCreateConnectionViewAndElementCommand(CreateConnectionViewAndElementRequest request,
IAdaptable sourceViewAdapter,
IAdaptable targetViewAdapter,
EditPartViewer currentViewer)
request - the ceate connection requestsourceViewAdapter - will adapt to the source view at execution timetargetViewAdapter - will adapt to the target view at execution timecurrentViewer - used to find the editparts for the views
public DeferredCreateConnectionViewAndElementCommand(IElementType type,
IAdaptable sourceViewAdapter,
IAdaptable targetViewAdapter,
EditPartViewer currentViewer,
PreferencesHint preferencesHint)
type - the type to be used in a new
CreateConnectionViewAndElementRequestsourceViewAdapter - will adapt to the source view at execution timetargetViewAdapter - will adapt to the target view at execution timecurrentViewer - used to find the editparts for the views
public DeferredCreateConnectionViewAndElementCommand(CreateRequest request,
IAdaptable typeInfoAdapter,
IAdaptable sourceViewAdapter,
IAdaptable targetViewAdapter,
EditPartViewer currentViewer)
request - the ceate connection requesttypeInfoAdapter - extracts the type to be used in a new
CreateConnectionViewAndElementRequest at
execution timesourceViewAdapter - will adapt to the source view at execution timetargetViewAdapter - will adapt to the target view at execution timecurrentViewer - used to find the editparts for the views| Method Detail |
public java.util.List getAffectedFiles()
AbstractCommandIFiles that may be modified when the operation is
executed, undone or redone.
getAffectedFiles in interface ICommandgetAffectedFiles in class AbstractCommandpublic boolean canUndo()
public boolean canRedo()
protected EditPart getSourceEditPart()
View
protected EditPart getTargetEditPart()
View
protected CommandResult doExecuteWithResult(IProgressMonitor progressMonitor,
IAdaptable info)
throws ExecutionException
doExecuteWithResult in class AbstractCommandprogressMonitor - the progress monitor provided by the operation history. Must
never be null.info - the IAdaptable (or null) provided by the
caller in order to supply UI information for prompting the
user if necessary. When this parameter is not
null, it should minimally contain an adapter
for the org.eclipse.swt.widgets.Shell.class.
null
if the execution status is OK, but there is no meaningful result
to be returned.
ExecutionException - if, for some reason, I fail to complete the operationpublic java.lang.String getLabel()
IUndoableOperation.getLabel()
protected CommandResult doRedoWithResult(IProgressMonitor progressMonitor,
IAdaptable info)
throws ExecutionException
AbstractCommand
doRedoWithResult in class AbstractCommandprogressMonitor - the progress monitor provided by the operation history. Must
never be null.info - the IAdaptable (or null) provided by the
caller in order to supply UI information for prompting the
user if necessary. When this parameter is not
null, it should minimally contain an adapter
for the org.eclipse.swt.widgets.Shell.class.
null
if the execution status is OK, but there is no meaningful result
to be returned.
ExecutionException - on failure to redo
protected CommandResult doUndoWithResult(IProgressMonitor progressMonitor,
IAdaptable info)
throws ExecutionException
AbstractCommand
doUndoWithResult in class AbstractCommandprogressMonitor - the progress monitor provided by the operation history. Must
never be null.info - the IAdaptable (or null) provided by the
caller in order to supply UI information for prompting the
user if necessary. When this parameter is not
null, it should minimally contain an adapter
for the org.eclipse.swt.widgets.Shell.class.
null
if the execution status is OK, but there is no meaningful result
to be returned.
ExecutionException - on failure to undo
|
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.