public class DirectEditAction extends SelectionAction
Request
of the type
RequestConstants.REQ_DIRECT_EDIT
to a single EditPart. The request
will be sent to the editpart using
EditPart.performRequest(Request)
.
This action will be enabled whenever the current selection is one EditPart,
and that editpart returns true
for
EditPart.understandsRequest(Request)
, using the
getDirectEditRequest()
.
Clients can control the request that is sent by calling
setDirectEditRequest(Request)
. The
DirectEditRequest
class allows the client to
specify the feature that should be edited when invoked.
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
ID
Deprecated.
|
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 and Description |
---|
DirectEditAction(IEditorPart editor)
Same as
DirectEditAction(IWorkbenchPart) . |
DirectEditAction(IWorkbenchPart part)
Constructs a DirectEditAction using the specified part.
|
Modifier and Type | Method and Description |
---|---|
protected boolean |
calculateEnabled()
returns
true if there is exactly 1 EditPart selected that
understand a request of type: RequestConstants.REQ_DIRECT_EDIT . |
protected Request |
getDirectEditRequest()
Returns the
Request being used. |
protected void |
init()
Initializes this action.
|
void |
run() |
void |
setDirectEditRequest(Request req)
Clients may override the request that is used to perform the direct edit.
|
dispose, getSelectedObjects, getSelection, handleSelectionChanged, setSelection, setSelectionProvider, update
execute, getCommandStack, getWorkbenchPart, isEnabled, refresh, setLazyEnablementCalculation, setWorkbenchPart
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
addPropertyChangeListener, firePropertyChange, firePropertyChange, removePropertyChangeListener
addListenerObject, clearListeners, getListeners, isListenerAttached, removeListenerObject
public static final java.lang.String ID
public DirectEditAction(IEditorPart editor)
DirectEditAction(IWorkbenchPart)
.editor
- the editorpublic DirectEditAction(IWorkbenchPart part)
part
- the workbench partprotected boolean calculateEnabled()
true
if there is exactly 1 EditPart selected that
understand a request of type: RequestConstants.REQ_DIRECT_EDIT
.calculateEnabled
in class WorkbenchPartAction
true
if enabledprotected Request getDirectEditRequest()
Request
being used.public void run()
run
in interface IAction
run
in class Action
IAction.run()
public void setDirectEditRequest(Request req)
req
- the new request to be usedprotected void init()
WorkbenchPartAction
init
in class WorkbenchPartAction
WorkbenchPartAction.init()
Copyright (c) IBM Corp. and others 2000, 2011. All Rights Reserved.