org.eclipse.gef.ui.actions
Class DirectEditAction
java.lang.Object
org.eclipse.gef.ui.actions.WorkbenchPartAction
org.eclipse.gef.ui.actions.SelectionAction
org.eclipse.gef.ui.actions.DirectEditAction
- public class DirectEditAction
- extends
SelectionAction
An action to perform direct editing on a selected part. The DirectEditAction provides
the function of sending a 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.
Field Summary
|
static java.lang.String
|
ID
Deprecated.
|
Methods inherited from class java.lang.Object
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
|
ID
public static final java.lang.String ID
-
Deprecated.
-
See Also:
-
Constant Field Values
DirectEditAction
public DirectEditAction(
IEditorPart editor)
- Same as
DirectEditAction(IWorkbenchPart)
.
-
Parameters:
-
editor
- the editor
DirectEditAction
public DirectEditAction(
IWorkbenchPart part)
- Constructs a DirectEditAction using the specified part.
-
Parameters:
-
part
- the workbench part
calculateEnabled
protected boolean calculateEnabled()
- returns
true
if there is exactly 1 EditPart selected that understand
a request of type:
RequestConstants.REQ_DIRECT_EDIT
.
-
-
Specified by:
-
calculateEnabled
in class
WorkbenchPartAction
-
-
Returns:
-
true
if enabled
getDirectEditRequest
protected
Request getDirectEditRequest()
- Returns the
Request
being used.
-
-
Returns:
- the request
run
public void run()
-
-
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:
WorkbenchPartAction
- Initializes this action.
-
-
Overrides:
-
init
in class
WorkbenchPartAction
-
-
See Also:
-
WorkbenchPartAction.init()
Copyright (c) IBM Corp. and others 2000, 2007. All Rights Reserved.