Package org.eclipse.gef.ui.actions
Class DirectEditAction
- java.lang.Object
-
- All Implemented Interfaces:
Disposable,UpdateAction,IAction
public class DirectEditAction extends SelectionAction
An action to perform direct editing on a selected part. The DirectEditAction provides the function of sending aRequestof the typeRequestConstants.REQ_DIRECT_EDITto a single EditPart. The request will be sent to the editpart usingEditPart.performRequest(Request).This action will be enabled whenever the current selection is one EditPart, and that editpart returns
trueforEditPart.understandsRequest(Request), using thegetDirectEditRequest().Clients can control the request that is sent by calling
setDirectEditRequest(Request). TheDirectEditRequestclass allows the client to specify the feature that should be edited when invoked.
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringIDDeprecated.-
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
Constructors Constructor Description DirectEditAction(IEditorPart editor)Same asDirectEditAction(IWorkbenchPart).DirectEditAction(IWorkbenchPart part)Constructs a DirectEditAction using the specified part.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected booleancalculateEnabled()returnstrueif there is exactly 1 EditPart selected that understand a request of type:RequestConstants.REQ_DIRECT_EDIT.protected RequestgetDirectEditRequest()Returns theRequestbeing used.protected voidinit()Initializes this action.voidrun()voidsetDirectEditRequest(Request req)Clients may override the request that is used to perform the direct edit.-
Methods inherited from class org.eclipse.gef.ui.actions.SelectionAction
dispose, getSelectedObjects, getSelection, handleSelectionChanged, setSelection, setSelectionProvider, update
-
Methods inherited from class org.eclipse.gef.ui.actions.WorkbenchPartAction
execute, getCommandStack, getWorkbenchPart, isEnabled, refresh, setLazyEnablementCalculation, setWorkbenchPart
-
Methods inherited from class org.eclipse.jface.action.Action
convertAccelerator, convertAccelerator, findKeyCode, findKeyString, findModifier, findModifierString, getAccelerator, getActionDefinitionId, getDescription, getDisabledImageDescriptor, getHelpListener, getHoverImageDescriptor, getId, getImageDescriptor, getMenuCreator, getStyle, getText, getToolTipText, isChecked, isHandled, notifyResult, removeAcceleratorText, removeMnemonics, runWithEvent, setAccelerator, setActionDefinitionId, setChecked, setDescription, setDisabledImageDescriptor, setEnabled, setHelpListener, setHoverImageDescriptor, setId, setImageDescriptor, setMenuCreator, setText, setToolTipText
-
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
-
-
-
-
Field Detail
-
ID
public static final java.lang.String ID
Deprecated.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
DirectEditAction
public DirectEditAction(IEditorPart editor)
Same asDirectEditAction(IWorkbenchPart).- Parameters:
editor- the editor
-
DirectEditAction
public DirectEditAction(IWorkbenchPart part)
Constructs a DirectEditAction using the specified part.- Parameters:
part- the workbench part
-
-
Method Detail
-
calculateEnabled
protected boolean calculateEnabled()
returnstrueif there is exactly 1 EditPart selected that understand a request of type:RequestConstants.REQ_DIRECT_EDIT.- Specified by:
calculateEnabledin classWorkbenchPartAction- Returns:
trueif enabled
-
getDirectEditRequest
protected Request getDirectEditRequest()
Returns theRequestbeing used.- Returns:
- the request
-
run
public void run()
- Specified by:
runin interfaceIAction- Overrides:
runin classAction- See Also:
IAction.run()
-
setDirectEditRequest
public void setDirectEditRequest(Request req)
Clients may override the request that is used to perform the direct edit.- Parameters:
req- the new request to be used
-
init
protected void init()
Description copied from class:WorkbenchPartActionInitializes this action.- Overrides:
initin classWorkbenchPartAction- See Also:
WorkbenchPartAction.init()
-
-