TPTP 4.2.0 Platform Project
Internal API Specification

org.eclipse.hyades.trace.ui.internal.actions
Class AbstractProfileActionDelegate

java.lang.Object
  extended byorg.eclipse.hyades.trace.ui.internal.actions.AbstractProfileActionDelegate
All Implemented Interfaces:
org.eclipse.ui.IActionDelegate, org.eclipse.ui.ISelectionListener, org.eclipse.ui.IViewActionDelegate, org.eclipse.ui.IWorkbenchWindowActionDelegate
Direct Known Subclasses:
AbstractListenerActionDelegate

public abstract class AbstractProfileActionDelegate
extends java.lang.Object
implements org.eclipse.ui.IWorkbenchWindowActionDelegate, org.eclipse.ui.IViewActionDelegate, org.eclipse.ui.ISelectionListener


Constructor Summary
AbstractProfileActionDelegate()
          It's crucial that delegate actions have a zero-arg constructor so that they can be reflected into existence when referenced in an action set in the plugin's plugin.xml file.
 
Method Summary
 void dispose()
           
protected abstract  void doAction(java.lang.Object element)
          Does the specific action of this action to the process.
protected  boolean enableForMultiSelection()
          Returns whether this action should be enabled if there is multi selection.
protected  org.eclipse.jface.action.IAction getAction()
           
protected  boolean getEnableStateForSelection(org.eclipse.jface.viewers.IStructuredSelection selection)
          Return whether the action should be enabled or not based on the given selection.
protected  org.eclipse.jface.viewers.IStructuredSelection getSelection()
          Returns the most recent selection
protected  org.eclipse.ui.IViewPart getView()
          Returns this action's view part, or null if not installed in a view.
 void init(org.eclipse.ui.IViewPart view)
           
 void init(org.eclipse.ui.IWorkbenchWindow window)
           
protected  boolean initialize(org.eclipse.jface.action.IAction action, org.eclipse.jface.viewers.ISelection selection)
          Initialize this delegate, updating this delegate's presentation.
protected abstract  boolean isEnabledFor(java.lang.Object element)
          Returns whether this action will work for the given element
protected  boolean isInitialized()
           
 void run(org.eclipse.jface.action.IAction action)
           
 void selectionChanged(org.eclipse.jface.action.IAction action, org.eclipse.jface.viewers.ISelection s)
          Set the icons for this action on the first selection changed event.
 void selectionChanged(org.eclipse.ui.IWorkbenchPart part, org.eclipse.jface.viewers.ISelection selection)
           
protected  void setAction(org.eclipse.jface.action.IAction action)
           
protected  void setInitialized(boolean initialized)
           
protected  void setView(org.eclipse.ui.IViewPart viewPart)
           
protected  void update(org.eclipse.jface.action.IAction action, org.eclipse.jface.viewers.ISelection s)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractProfileActionDelegate

public AbstractProfileActionDelegate()
It's crucial that delegate actions have a zero-arg constructor so that they can be reflected into existence when referenced in an action set in the plugin's plugin.xml file.

Method Detail

dispose

public void dispose()
Specified by:
dispose in interface org.eclipse.ui.IWorkbenchWindowActionDelegate
See Also:
IWorkbenchWindowActionDelegate.dispose()

init

public void init(org.eclipse.ui.IWorkbenchWindow window)
Specified by:
init in interface org.eclipse.ui.IWorkbenchWindowActionDelegate
See Also:
IWorkbenchWindowActionDelegate.init(IWorkbenchWindow)

run

public void run(org.eclipse.jface.action.IAction action)
Specified by:
run in interface org.eclipse.ui.IActionDelegate
See Also:
IActionDelegate#run(IAction)

selectionChanged

public void selectionChanged(org.eclipse.jface.action.IAction action,
                             org.eclipse.jface.viewers.ISelection s)
Set the icons for this action on the first selection changed event. This is necessary because the XML currently only supports setting the enabled icon.

AbstractProfileActionDelegates come in 2 flavors: IViewActionDelegate, IWorkbenchWindowActionDelegate delegates.

Only want to call update(action, selection) for IViewActionDelegates. An initialize call to update(action, selection) is made for all flavors to set the initial enabled state of the underlying action. IWorkbenchWindowActionDelegate's listen to selection changes in the debug view only.

Specified by:
selectionChanged in interface org.eclipse.ui.IActionDelegate
See Also:
IActionDelegate#selectionChanged(IAction, ISelection)

update

protected void update(org.eclipse.jface.action.IAction action,
                      org.eclipse.jface.viewers.ISelection s)

getEnableStateForSelection

protected boolean getEnableStateForSelection(org.eclipse.jface.viewers.IStructuredSelection selection)
Return whether the action should be enabled or not based on the given selection.


enableForMultiSelection

protected boolean enableForMultiSelection()
Returns whether this action should be enabled if there is multi selection.


doAction

protected abstract void doAction(java.lang.Object element)
                          throws java.lang.Exception
Does the specific action of this action to the process.

Throws:
java.lang.Exception

isEnabledFor

protected abstract boolean isEnabledFor(java.lang.Object element)
Returns whether this action will work for the given element


init

public void init(org.eclipse.ui.IViewPart view)
Specified by:
init in interface org.eclipse.ui.IViewActionDelegate
See Also:
IViewActionDelegate.init(IViewPart)

getView

protected org.eclipse.ui.IViewPart getView()
Returns this action's view part, or null if not installed in a view.

Returns:
view part or null

initialize

protected boolean initialize(org.eclipse.jface.action.IAction action,
                             org.eclipse.jface.viewers.ISelection selection)
Initialize this delegate, updating this delegate's presentation. As well, all of the flavors of AbstractDebugActionDelegates need to have the initial enabled state set with a call to update(IAction, ISelection).

Parameters:
action - the presentation for this action
Returns:
whether the action was initialized

getSelection

protected org.eclipse.jface.viewers.IStructuredSelection getSelection()
Returns the most recent selection

Returns:
structured selection

selectionChanged

public void selectionChanged(org.eclipse.ui.IWorkbenchPart part,
                             org.eclipse.jface.viewers.ISelection selection)
Specified by:
selectionChanged in interface org.eclipse.ui.ISelectionListener
See Also:
ISelectionListener.selectionChanged(IWorkbenchPart, ISelection)

setView

protected void setView(org.eclipse.ui.IViewPart viewPart)

isInitialized

protected boolean isInitialized()

setInitialized

protected void setInitialized(boolean initialized)

setAction

protected void setAction(org.eclipse.jface.action.IAction action)

getAction

protected org.eclipse.jface.action.IAction getAction()

TPTP 4.2.0 Platform Project
Internal API Specification