|
Eclipse Platform 2.0 |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.eclipse.jface.action.Action | +--org.eclipse.ui.actions.PartEventAction
The abstract superclass for actions that listen to part activation and
open/close events. This implementation tracks the active part (see
getActivePart
) and provides a convenient place to monitor
part lifecycle events that could affect the availability of the action.
Subclasses must implement the following IAction
method:
run
- to do the action's work
Subclasses may extend any of the IPartListener
methods if the
action availablity needs to be recalculated:
partActivated
partDeactivated
partOpened
partClosed
partBroughtToTop
Field Summary |
Fields inherited from interface org.eclipse.jface.action.IAction |
AS_CHECK_BOX, AS_DROP_DOWN_MENU, AS_PUSH_BUTTON, CHECKED, DESCRIPTION, ENABLED, IMAGE, TEXT, TOOL_TIP_TEXT |
Constructor Summary | |
protected |
PartEventAction(String text)
Creates a new action with the given text. |
Method Summary | |
IWorkbenchPart |
getActivePart()
Returns the currently active part in the workbench. |
void |
partActivated(IWorkbenchPart part)
The PartEventAction implementation of this
IPartListener method records that the given part is active. |
void |
partBroughtToTop(IWorkbenchPart part)
The PartEventAction implementation of this
IPartListener method does nothing. |
void |
partClosed(IWorkbenchPart part)
The PartEventAction implementation of this
IPartListener method clears the active part if it just closed. |
void |
partDeactivated(IWorkbenchPart part)
The PartEventAction implementation of this
IPartListener method records that there is no active part. |
void |
partOpened(IWorkbenchPart part)
The PartEventAction implementation of this
IPartListener method does nothing. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
protected PartEventAction(String text)
text
- the string used as the text for the action,
or null
if these is no textMethod Detail |
public IWorkbenchPart getActivePart()
null
if nonepublic void partActivated(IWorkbenchPart part)
PartEventAction
implementation of this
IPartListener
method records that the given part is active.
Subclasses may extend this method if action availability has to be
recalculated.
partActivated
in interface IPartListener
part
- the part that was activatedIPerspective#activate
public void partBroughtToTop(IWorkbenchPart part)
PartEventAction
implementation of this
IPartListener
method does nothing. Subclasses should extend
this method if action availability has to be recalculated.
partBroughtToTop
in interface IPartListener
part
- the part that was surfacedIPerspective#bringToTop
public void partClosed(IWorkbenchPart part)
PartEventAction
implementation of this
IPartListener
method clears the active part if it just closed.
Subclasses may extend this method if action availability has to be
recalculated.
partClosed
in interface IPartListener
part
- the part that was closedIPerspective#close
public void partDeactivated(IWorkbenchPart part)
PartEventAction
implementation of this
IPartListener
method records that there is no active part.
Subclasses may extend this method if action availability has to be
recalculated.
partDeactivated
in interface IPartListener
part
- the part that was deactivatedIPerspective#activate
public void partOpened(IWorkbenchPart part)
PartEventAction
implementation of this
IPartListener
method does nothing. Subclasses should extend
this method if action availability has to be recalculated.
partOpened
in interface IPartListener
part
- the part that was opened
|
Eclipse Platform 2.0 |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |