|
Runtime | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.eclipse.core.commands.common.EventManager
org.eclipse.jface.action.AbstractAction
org.eclipse.jface.action.Action
org.eclipse.gmf.runtime.common.ui.action.AbstractActionHandler
org.eclipse.gmf.runtime.diagram.ui.actions.DiagramAction
An abstract implementation of a diagram action that follows the
request-command architecture.
Notice: 1) This action retargets to the active workbench part 2) This action
can either be contributed programatically or through the
ControbutionItemService.
| Nested Class Summary |
| Nested classes inherited from class org.eclipse.gmf.runtime.common.ui.action.IActionWithProgress |
IActionWithProgress.WorkIndicatorType |
| Field Summary |
| Fields inherited from interface org.eclipse.jface.action.IAction |
AS_CHECK_BOX, AS_DROP_DOWN_MENU, AS_PUSH_BUTTON, AS_RADIO_BUTTON, AS_UNSPECIFIED, CHECKED, DESCRIPTION, ENABLED, HANDLED, IMAGE, RESULT, TEXT, TOOL_TIP_TEXT |
| Constructor Summary | |
|
DiagramAction(IWorkbenchPage workbenchPage)
Constructs a new diagram action |
protected |
DiagramAction(IWorkbenchPart workbenchpart)
Constructs a new diagram action. |
| Method Summary | |
protected boolean |
calculateEnabled()
Calculates the enblement state of the action |
protected void |
clearTargetRequest()
Sets the target request to null. |
protected java.util.List |
createOperationSet()
Filters the selected objects and returns only editparts that understands the request |
protected abstract Request |
createTargetRequest()
Creates a new target request |
void |
dispose()
Default implementation of dispose. |
protected void |
doRun(IProgressMonitor progressMonitor)
Performs the actual work when this action handler is run. |
protected void |
execute(Command command,
IProgressMonitor progressMonitor)
Executes the given Command. |
protected java.util.List |
filterEditPartsMatching(java.util.List list,
EditPartViewer.Conditional condition)
Filters the given list of EditParts so that the list only contains the EditParts that matches the given condition. |
protected Command |
getCommand()
Gets the associated Command with this action based on the target request |
protected Command |
getCommand(Request request)
Gets a command to execute on the operation set based on a given request |
protected java.lang.String |
getCommandLabel()
Gets an optional label for the action's executed command |
protected DiagramCommandStack |
getDiagramCommandStack()
gives access to the diagram command stack |
protected IDiagramEditDomain |
getDiagramEditDomain()
A utility method to get the IDiagramEditDomain from the
current part if it adapts to it |
protected DiagramEditPart |
getDiagramEditPart()
A utility method to return the active DiagramEditPart if
the current part implements IDiagramWorkbenchPart |
protected IDiagramGraphicalViewer |
getDiagramGraphicalViewer()
A utility method to return the active DiagramEditPart if
the current part implements IDiagramWorkbenchPart |
protected IDiagramWorkbenchPart |
getDiagramWorkbenchPart()
A utility method to return the active part if it implements the IDiagramWorkbenchPart interface |
protected java.util.List |
getOperationSet()
Return the list of editparts considered the operation set after caching them |
protected PreferencesHint |
getPreferencesHint()
Gets the preferences hint that is to be used to find the appropriate preference store from which to retrieve diagram preference values. |
protected java.util.List |
getSelectedObjects()
A utility method to return a list of objects in the current structured selection |
protected java.util.List |
getTargetEditParts(EditPart editpart)
Given an editpart, returns a list of target editparts to the current request If no targets could be found, an empty list is returned |
protected Request |
getTargetRequest()
Gets a request to be addressed to the operation set |
protected abstract boolean |
isSelectionListener()
Does this action need to listen to selection change events? |
void |
refresh()
Refreshes various aspects of this action, such as its label and whether or not it is enabled. |
protected void |
setTargetRequest(Request targetRequest)
|
protected void |
updateTargetRequest()
updates the target request. |
| Methods inherited from class org.eclipse.gmf.runtime.common.ui.action.AbstractActionHandler |
contributedToPart, getActionManager, getLabel, getOperationHistory, getPartListener, getSelection, getStructuredSelection, getUndoContext, getWorkbenchPage, getWorkbenchPart, getWorkIndicatorType, handle, historyNotification, init, isDisposed, isOperationHistoryListener, isPropertyListener, isRunnable, isSetup, needsSetup, openErrorDialog, propertyChanged, run, run, runWithEvent, selectionChanged, setDisposed, setPartSelector, setSetup, setup, setWorkbenchPart |
| Methods inherited from class org.eclipse.jface.action.AbstractAction |
addPropertyChangeListener, firePropertyChange, firePropertyChange, removePropertyChangeListener |
| Methods inherited from class org.eclipse.core.commands.common.EventManager |
addListenerObject, clearListeners, getListeners, isListenerAttached, removeListenerObject |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface org.eclipse.jface.action.IAction |
addPropertyChangeListener, getAccelerator, getActionDefinitionId, getDescription, getDisabledImageDescriptor, getHelpListener, getHoverImageDescriptor, getId, getImageDescriptor, getMenuCreator, getStyle, getText, getToolTipText, isChecked, isEnabled, isHandled, removePropertyChangeListener, setAccelerator, setActionDefinitionId, setChecked, setDescription, setDisabledImageDescriptor, setEnabled, setHelpListener, setHoverImageDescriptor, setId, setImageDescriptor, setMenuCreator, setText, setToolTipText |
| Constructor Detail |
public DiagramAction(IWorkbenchPage workbenchPage)
workbenchPage - The workbench page associated with this actionprotected DiagramAction(IWorkbenchPart workbenchpart)
workbenchpart - The workbench part associated with this action| Method Detail |
public void dispose()
AbstractActionHandlersetDisposed(true) or calling
super.dispose().
dispose in interface Disposabledispose in class AbstractActionHandlerprotected void doRun(IProgressMonitor progressMonitor)
AbstractActionHandler
doRun in class AbstractActionHandlerprogressMonitor - the progress monitor for tracking the progress of this action
when it is run.public void refresh()
IActionWithProgress
refresh in interface IActionWithProgressprotected boolean calculateEnabled()
true if action should be enabled,
false otherwise
protected final void execute(Command command,
IProgressMonitor progressMonitor)
Command.
command - the command to executeprogressMonitor - the progress monitor to use during executionprotected DiagramCommandStack getDiagramCommandStack()
protected Command getCommand()
protected Command getCommand(Request request)
request - request to use to get the command
protected java.lang.String getCommandLabel()
protected Request getTargetRequest()
protected abstract Request createTargetRequest()
protected void updateTargetRequest()
protected void clearTargetRequest()
DiagramAction.getTargetRequest() call.
protected java.util.List getSelectedObjects()
protected final java.util.List getOperationSet()
protected java.util.List createOperationSet()
protected java.util.List getTargetEditParts(EditPart editpart)
editpart - The given editpart
protected IDiagramEditDomain getDiagramEditDomain()
IDiagramEditDomain from the
current part if it adapts to it
null
otherwiseprotected IDiagramWorkbenchPart getDiagramWorkbenchPart()
IDiagramWorkbenchPart interface
IDiagramWorkbenchPart; null
otherwiseprotected DiagramEditPart getDiagramEditPart()
DiagramEditPart if
the current part implements IDiagramWorkbenchPart
IDiagramWorkbenchPart; null
otherwiseprotected IDiagramGraphicalViewer getDiagramGraphicalViewer()
DiagramEditPart if
the current part implements IDiagramWorkbenchPart
IDiagramWorkbenchPart; null
otherwise
protected java.util.List filterEditPartsMatching(java.util.List list,
EditPartViewer.Conditional condition)
list - the list of edit parts to filtercondition - the condition
protected abstract boolean isSelectionListener()
Actions that are only contributed to the popup menu (and not toolbar or main menus) will not receive selection events at all. The refresh() method will be called when the context menu is about to show.
isSelectionListener in class AbstractActionHandlertrue if this action handler is interested;
false otherwise.protected void setTargetRequest(Request targetRequest)
targetRequest - The targetRequest to set.protected PreferencesHint getPreferencesHint()
|
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.