Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

org.eclipse.debug.internal.ui.actions
Class RetargetAction  view RetargetAction download RetargetAction.java

java.lang.Object
  extended byorg.eclipse.debug.internal.ui.actions.RetargetAction
All Implemented Interfaces:
org.eclipse.ui.IActionDelegate, org.eclipse.ui.IPartListener, org.eclipse.ui.texteditor.IUpdate, org.eclipse.ui.IWorkbenchWindowActionDelegate
Direct Known Subclasses:
RetargetBreakpointAction, RetargetRunToLineAction

public abstract class RetargetAction
extends java.lang.Object
implements org.eclipse.ui.IWorkbenchWindowActionDelegate, org.eclipse.ui.IPartListener, org.eclipse.ui.texteditor.IUpdate

Global retargettable debug action.

Since:
3.0

Nested Class Summary
(package private) static class RetargetAction.EmptySelection
           
 
Field Summary
private  org.eclipse.jface.action.IAction action
           
private  org.eclipse.ui.IWorkbenchPart activePart
           
private static org.eclipse.jface.viewers.ISelection EMPTY_SELECTION
           
private  java.lang.Object targetAdapter
           
protected  org.eclipse.ui.IWorkbenchWindow window
           
 
Constructor Summary
RetargetAction()
           
 
Method Summary
protected abstract  boolean canPerformAction(java.lang.Object target, org.eclipse.jface.viewers.ISelection selection, org.eclipse.ui.IWorkbenchPart part)
          Returns whether the specific operation is supported.
protected  void clearPart(org.eclipse.ui.IWorkbenchPart part)
          Clears reference to active part and adapter when a relevant part is closed or deactivated.
 void dispose()
          Disposes this action delegate.
protected  java.lang.Object getAdapter(org.eclipse.core.runtime.IAdaptable adaptable)
           
protected abstract  java.lang.Class getAdapterClass()
          Returns the type of adapter (target) this action works on.
private  org.eclipse.jface.viewers.ISelection getTargetSelection()
          Returns the current selection in the active part, possibly and empty selection, but never null.
 void init(org.eclipse.ui.IWorkbenchWindow window)
          Initializes this action delegate with the workbench window it will work in.
 void partActivated(org.eclipse.ui.IWorkbenchPart part)
          Notifies this listener that the given part has been activated.
 void partBroughtToTop(org.eclipse.ui.IWorkbenchPart part)
          Notifies this listener that the given part has been brought to the top.
 void partClosed(org.eclipse.ui.IWorkbenchPart part)
          Notifies this listener that the given part has been closed.
 void partDeactivated(org.eclipse.ui.IWorkbenchPart part)
          Notifies this listener that the given part has been deactivated.
 void partOpened(org.eclipse.ui.IWorkbenchPart part)
          Notifies this listener that the given part has been opened.
protected abstract  void performAction(java.lang.Object target, org.eclipse.jface.viewers.ISelection selection, org.eclipse.ui.IWorkbenchPart part)
          Performs the specific breakpoint toggling.
 void run(org.eclipse.jface.action.IAction action)
          Performs this action.
 void selectionChanged(org.eclipse.jface.action.IAction action, org.eclipse.jface.viewers.ISelection selection)
          Notifies this action delegate that the selection in the workbench has changed.
 void update()
          Requests that this object update itself.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

window

protected org.eclipse.ui.IWorkbenchWindow window

activePart

private org.eclipse.ui.IWorkbenchPart activePart

targetAdapter

private java.lang.Object targetAdapter

action

private org.eclipse.jface.action.IAction action

EMPTY_SELECTION

private static final org.eclipse.jface.viewers.ISelection EMPTY_SELECTION
Constructor Detail

RetargetAction

public RetargetAction()
Method Detail

getTargetSelection

private org.eclipse.jface.viewers.ISelection getTargetSelection()
Returns the current selection in the active part, possibly and empty selection, but never null.


dispose

public void dispose()
Description copied from interface: org.eclipse.ui.IWorkbenchWindowActionDelegate
Disposes this action delegate. The implementor should unhook any references to itself so that garbage collection can occur.

Specified by:
dispose in interface org.eclipse.ui.IWorkbenchWindowActionDelegate

init

public void init(org.eclipse.ui.IWorkbenchWindow window)
Description copied from interface: org.eclipse.ui.IWorkbenchWindowActionDelegate
Initializes this action delegate with the workbench window it will work in.

Specified by:
init in interface org.eclipse.ui.IWorkbenchWindowActionDelegate

run

public void run(org.eclipse.jface.action.IAction action)
Description copied from interface: org.eclipse.ui.IActionDelegate
Performs this action.

This method is called by the proxy action when the action has been triggered. Implement this method to do the actual work.

Note: If the action delegate also implements IActionDelegate2, then this method is not invoked but instead the runWithEvent(IAction, Event) method is called.

Specified by:
run in interface org.eclipse.ui.IActionDelegate

performAction

protected abstract void performAction(java.lang.Object target,
                                      org.eclipse.jface.viewers.ISelection selection,
                                      org.eclipse.ui.IWorkbenchPart part)
                               throws org.eclipse.core.runtime.CoreException
Performs the specific breakpoint toggling.


selectionChanged

public void selectionChanged(org.eclipse.jface.action.IAction action,
                             org.eclipse.jface.viewers.ISelection selection)
Description copied from interface: org.eclipse.ui.IActionDelegate
Notifies this action delegate that the selection in the workbench has changed.

Implementers can use this opportunity to change the availability of the action or to modify other presentation properties.

When the selection changes, the action enablement state is updated based on the criteria specified in the plugin.xml file. Then the delegate is notified of the selection change regardless of whether the enablement criteria in the plugin.xml file is met.

Specified by:
selectionChanged in interface org.eclipse.ui.IActionDelegate

partActivated

public void partActivated(org.eclipse.ui.IWorkbenchPart part)
Description copied from interface: org.eclipse.ui.IPartListener
Notifies this listener that the given part has been activated.

Specified by:
partActivated in interface org.eclipse.ui.IPartListener

getAdapter

protected java.lang.Object getAdapter(org.eclipse.core.runtime.IAdaptable adaptable)

getAdapterClass

protected abstract java.lang.Class getAdapterClass()
Returns the type of adapter (target) this action works on.


partBroughtToTop

public void partBroughtToTop(org.eclipse.ui.IWorkbenchPart part)
Description copied from interface: org.eclipse.ui.IPartListener
Notifies this listener that the given part has been brought to the top.

These events occur when an editor is brought to the top in the editor area, or when a view is brought to the top in a page book with multiple views. They are normally only sent when a part is brought to the top programmatically (via IPerspective.bringToTop). When a part is activated by the user clicking on it, only partActivated is sent.

Specified by:
partBroughtToTop in interface org.eclipse.ui.IPartListener

partClosed

public void partClosed(org.eclipse.ui.IWorkbenchPart part)
Description copied from interface: org.eclipse.ui.IPartListener
Notifies this listener that the given part has been closed.

Specified by:
partClosed in interface org.eclipse.ui.IPartListener

clearPart

protected void clearPart(org.eclipse.ui.IWorkbenchPart part)
Clears reference to active part and adapter when a relevant part is closed or deactivated.


partDeactivated

public void partDeactivated(org.eclipse.ui.IWorkbenchPart part)
Description copied from interface: org.eclipse.ui.IPartListener
Notifies this listener that the given part has been deactivated.

Specified by:
partDeactivated in interface org.eclipse.ui.IPartListener

partOpened

public void partOpened(org.eclipse.ui.IWorkbenchPart part)
Description copied from interface: org.eclipse.ui.IPartListener
Notifies this listener that the given part has been opened.

Specified by:
partOpened in interface org.eclipse.ui.IPartListener

update

public void update()
Description copied from interface: org.eclipse.ui.texteditor.IUpdate
Requests that this object update itself.

Specified by:
update in interface org.eclipse.ui.texteditor.IUpdate

canPerformAction

protected abstract boolean canPerformAction(java.lang.Object target,
                                            org.eclipse.jface.viewers.ISelection selection,
                                            org.eclipse.ui.IWorkbenchPart part)
Returns whether the specific operation is supported.