public abstract class AbstractLaunchHistoryAction extends Object implements IActionDelegate2, IWorkbenchWindowPulldownDelegate2, org.eclipse.debug.internal.ui.ILaunchHistoryChangedListener
Clients may subclass this class.
LaunchingResourceManager
,
ILaunchLabelChangedListener
Modifier and Type | Field and Description |
---|---|
protected boolean |
fRecreateMenu
Indicates whether the launch history has changed and
the sub menu needs to be recreated.
|
Constructor and Description |
---|
AbstractLaunchHistoryAction(String launchGroupIdentifier)
Constructs a launch history action.
|
Modifier and Type | Method and Description |
---|---|
protected void |
addSeparator(Menu menu)
Adds a separator to the given menu
|
protected void |
addToMenu(Menu menu,
IAction action,
int accelerator)
Adds the given action to the specified menu with an accelerator specified
by the given number.
|
void |
dispose()
Allows the action delegate to clean up.
|
protected void |
fillMenu(Menu menu)
Fills the drop-down menu with favorites and launch history
|
protected IAction |
getAction()
Returns the action used to render this delegate.
|
protected ILaunchConfiguration[] |
getFavorites()
Returns the launch favorites associated with this action's launch mode and group in user
preference order.
|
protected ILaunchConfiguration[] |
getHistory()
Returns the launch history associated with this action's launch mode and group in most
recently launched order.
|
protected ILaunchConfiguration |
getLastLaunch()
Return the last launch in this action's launch history.
|
protected String |
getLaunchGroupIdentifier()
Returns the identifier of the launch group this action is associated
with.
|
protected org.eclipse.debug.internal.ui.launchConfigurations.LaunchHistory |
getLaunchHistory()
Deprecated.
this method returns a class that is not API and is not intended
for clients of the debug platform. Instead, use
getHistory() ,
getFavorites() , and getLastLaunch() . |
Menu |
getMenu(Control parent)
Returns the menu for this pull down action.
|
Menu |
getMenu(Menu parent)
Returns the menu for this pull down action.
|
protected String |
getMode()
Returns the mode (e.g., 'run' or 'debug') of this drop down.
|
protected String |
getToolTip(ILaunchConfiguration configuration)
Returns the tooltip specific to a configuration.
|
void |
init(IAction action)
Allows the action delegate to initialize itself after being created by
the proxy action.
|
void |
init(IWorkbenchWindow window)
Initializes this action delegate with the workbench window it will work in.
|
void |
launchHistoryChanged()
Notification that the launch history has changed.
|
void |
run(IAction action)
Performs this action.
|
void |
runWithEvent(IAction action,
Event event)
Performs this action, passing the SWT event which triggered it.
|
void |
selectionChanged(IAction action,
ISelection selection)
Notifies this action delegate that the selection in the workbench has changed.
|
protected void |
updateTooltip()
Updates this action's tool-tip.
|
protected boolean fRecreateMenu
public AbstractLaunchHistoryAction(String launchGroupIdentifier)
launchGroupIdentifier
- unique identifier of the launch group
extension that this action displays a launch history for.protected IAction getAction()
protected void addToMenu(Menu menu, IAction action, int accelerator)
menu
- the menu to add the action toaction
- the action to addaccelerator
- the number that should appear as an acceleratorprotected void updateTooltip()
Subclasses may override as required.
protected String getToolTip(ILaunchConfiguration configuration)
configuration
- a ILauncConfiguration
public void launchHistoryChanged()
org.eclipse.debug.internal.ui.ILaunchHistoryChangedListener
DebugUIPlugin
.launchHistoryChanged
in interface org.eclipse.debug.internal.ui.ILaunchHistoryChangedListener
ILaunchHistoryChangedListener.launchHistoryChanged()
public void dispose()
IActionDelegate2
dispose
in interface IActionDelegate2
dispose
in interface IWorkbenchWindowActionDelegate
IWorkbenchWindowActionDelegate.dispose()
protected ILaunchConfiguration getLastLaunch()
public Menu getMenu(Control parent)
IWorkbenchWindowPulldownDelegate
getMenu
in interface IWorkbenchWindowPulldownDelegate
IWorkbenchWindowPulldownDelegate.getMenu(org.eclipse.swt.widgets.Control)
public Menu getMenu(Menu parent)
IWorkbenchWindowPulldownDelegate2
getMenu
in interface IWorkbenchWindowPulldownDelegate2
protected void fillMenu(Menu menu)
menu
- the menu to fillprotected void addSeparator(Menu menu)
menu
- the menu to add the separator topublic void run(IAction action)
IActionDelegate
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.
run
in interface IActionDelegate
action
- the action proxy that handles the presentation portion of the
actionIActionDelegate.run(org.eclipse.jface.action.IAction)
public void runWithEvent(IAction action, Event event)
IActionDelegate2
Note: This method is called instead of run(IAction)
.
runWithEvent
in interface IActionDelegate2
action
- the action proxy that handles the presentation portion of
the actionevent
- the SWT event which triggered this action being runIActionDelegate2.runWithEvent(org.eclipse.jface.action.IAction, org.eclipse.swt.widgets.Event)
public void init(IAction action)
IActionDelegate2
init
in interface IActionDelegate2
action
- the proxy action that handles the presentation portion of
the action.IActionDelegate2.init(org.eclipse.jface.action.IAction)
public void selectionChanged(IAction action, ISelection selection)
IActionDelegate
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.
selectionChanged
in interface IActionDelegate
action
- the action proxy that handles presentation portion of
the actionselection
- the current selection, or null
if there
is no selection.IActionDelegate.selectionChanged(org.eclipse.jface.action.IAction, org.eclipse.jface.viewers.ISelection)
public void init(IWorkbenchWindow window)
IWorkbenchWindowActionDelegate
init
in interface IWorkbenchWindowActionDelegate
window
- the window that provides the context for this delegateIWorkbenchWindowActionDelegate.init(org.eclipse.ui.IWorkbenchWindow)
@Deprecated protected org.eclipse.debug.internal.ui.launchConfigurations.LaunchHistory getLaunchHistory()
getHistory()
,
getFavorites()
, and getLastLaunch()
.protected ILaunchConfiguration[] getHistory()
protected ILaunchConfiguration[] getFavorites()
protected String getMode()
protected String getLaunchGroupIdentifier()
Copyright (c) 2000, 2015 Eclipse Contributors and others. All rights reserved.Guidelines for using Eclipse APIs.