Class AbstractLaunchHistoryAction
- All Implemented Interfaces:
org.eclipse.debug.internal.ui.ILaunchHistoryChangedListener,IActionDelegate,IActionDelegate2,IWorkbenchWindowActionDelegate,IWorkbenchWindowPulldownDelegate,IWorkbenchWindowPulldownDelegate2
- Direct Known Subclasses:
AbstractLaunchToolbarAction
Clients may subclass this class.
- Since:
- 2.1
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected booleanIndicates whether the launch history has changed and the sub menu needs to be recreated. -
Constructor Summary
ConstructorsConstructorDescriptionAbstractLaunchHistoryAction(String launchGroupIdentifier) Constructs a launch history action. -
Method Summary
Modifier and TypeMethodDescriptionprotected voidaddSeparator(Menu menu) Adds a separator to the given menuprotected voidAdds the given action to the specified menu with an accelerator specified by the given number.voiddispose()Allows the action delegate to clean up.protected voidFills the drop-down menu with favorites and launch historyprotected IActionReturns the action used to render this delegate.protected ILaunchConfiguration[]Returns the launch favorites associated with this action's launch mode and group in user preference order.protected ILaunchConfiguration[]Returns the launch history associated with this action's launch mode and group in most recently launched order.protected ILaunchConfigurationReturn the last launch in this action's launch history.protected StringReturns the identifier of the launch group this action is associated with.protected org.eclipse.debug.internal.ui.launchConfigurations.LaunchHistoryDeprecated.this method returns a class that is not API and is not intended for clients of the debug platform.Returns the menu for this pull down action.Returns the menu for this pull down action.protected StringgetMode()Returns the mode (e.g., 'run' or 'debug') of this drop down.protected StringgetToolTip(ILaunchConfiguration configuration) Returns the tooltip specific to a configuration.voidAllows the action delegate to initialize itself after being created by the proxy action.voidinit(IWorkbenchWindow window) Initializes this action delegate with the workbench window it will work in.voidNotification that the launch history has changed.voidPerforms this action.protected voidrunInternal(IAction action, boolean isShift) voidrunWithEvent(IAction action, Event event) Performs this action, passing the SWT event which triggered it.voidselectionChanged(IAction action, ISelection selection) Notifies this action delegate that the selection in the workbench has changed.protected voidUpdates this action's tool-tip.
-
Field Details
-
fRecreateMenu
protected boolean fRecreateMenuIndicates whether the launch history has changed and the sub menu needs to be recreated.
-
-
Constructor Details
-
AbstractLaunchHistoryAction
Constructs a launch history action.- Parameters:
launchGroupIdentifier- unique identifier of the launch group extension that this action displays a launch history for.
-
-
Method Details
-
getAction
Returns the action used to render this delegate.- Returns:
- the action used to render this delegate
-
addToMenu
Adds the given action to the specified menu with an accelerator specified by the given number.- Parameters:
menu- the menu to add the action toaction- the action to addaccelerator- the number that should appear as an accelerator
-
updateTooltip
protected void updateTooltip()Updates this action's tool-tip. The tooltip is based on user preference settings for launching - either the previous launch, or based on the selection and which configuration will be launched.Subclasses may override as required.
-
getToolTip
Returns the tooltip specific to a configuration.- Parameters:
configuration- aILauncConfiguration- Returns:
- the string for the tool tip
-
launchHistoryChanged
public void launchHistoryChanged()Description copied from interface:org.eclipse.debug.internal.ui.ILaunchHistoryChangedListenerNotification that the launch history has changed. Any of the run history, debug history or last launched items could have changed. To examine the history items, retrieve them from theDebugUIPlugin.- Specified by:
launchHistoryChangedin interfaceorg.eclipse.debug.internal.ui.ILaunchHistoryChangedListener- See Also:
-
dispose
public void dispose()Description copied from interface:IActionDelegate2Allows the action delegate to clean up. This lifecycle method is called when the proxy action is done with this action delegate. This is the last method called.- Specified by:
disposein interfaceIActionDelegate2- Specified by:
disposein interfaceIWorkbenchWindowActionDelegate- See Also:
-
getLastLaunch
Return the last launch in this action's launch history.- Returns:
- the most recent configuration that was launched from this action's launch history that is not filtered from the menu
-
getMenu
Description copied from interface:IWorkbenchWindowPulldownDelegateReturns the menu for this pull down action. This method will only be called if the user opens the pull down menu for the action. Note that it is the responsibility of the implementor to properly dispose of any SWT menus created by this method.- Specified by:
getMenuin interfaceIWorkbenchWindowPulldownDelegate- Parameters:
parent- the control to set the menu on- Returns:
- the menu
- See Also:
-
getMenu
Description copied from interface:IWorkbenchWindowPulldownDelegate2Returns the menu for this pull down action. This method will only be called if the user opens the pull down menu for the action. Note that it is the responsibility of the implementor to properly dispose of any SWT menus created by this method.- Specified by:
getMenuin interfaceIWorkbenchWindowPulldownDelegate2- Parameters:
parent- the menu to work with- Returns:
- the menu
-
fillMenu
Fills the drop-down menu with favorites and launch history- Parameters:
menu- the menu to fill
-
addSeparator
Adds a separator to the given menu- Parameters:
menu- the menu to add the separator to
-
run
Description copied from interface:IActionDelegatePerforms 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 therunWithEvent(IAction, Event)method is called.- Specified by:
runin interfaceIActionDelegate- Parameters:
action- the action proxy that handles the presentation portion of the action- See Also:
-
runWithEvent
Description copied from interface:IActionDelegate2Performs this action, passing the SWT event which triggered it. This method is called by the proxy action when the action has been triggered. Implement this method to do the actual work.Note: This method is called instead of
run(IAction).- Specified by:
runWithEventin interfaceIActionDelegate2- Parameters:
action- the action proxy that handles the presentation portion of the actionevent- the SWT event which triggered this action being run- Since:
- 3.6
- See Also:
-
runInternal
- Since:
- 3.12
-
init
Description copied from interface:IActionDelegate2Allows the action delegate to initialize itself after being created by the proxy action. This lifecycle method is called after the action delegate has been created and before any other method of the action delegate is called.- Specified by:
initin interfaceIActionDelegate2- Parameters:
action- the proxy action that handles the presentation portion of the action.- Since:
- 3.6
- See Also:
-
selectionChanged
Description copied from interface:IActionDelegateNotifies 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:
selectionChangedin interfaceIActionDelegate- Parameters:
action- the action proxy that handles presentation portion of the actionselection- the current selection, ornullif there is no selection.- See Also:
-
init
Description copied from interface:IWorkbenchWindowActionDelegateInitializes this action delegate with the workbench window it will work in.- Specified by:
initin interfaceIWorkbenchWindowActionDelegate- Parameters:
window- the window that provides the context for this delegate- See Also:
-
getLaunchHistory
@Deprecated 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, usegetHistory(),getFavorites(), andgetLastLaunch().Returns the launch history associated with this action's launch group.- Returns:
- the launch history associated with this action's launch group
-
getHistory
Returns the launch history associated with this action's launch mode and group in most recently launched order. Configurations associated with disabled activities are not included in the list. As well, configurations are filtered based on workspace preference settings to filter configurations from closed projects, deleted projects, working sets and to filter specific launch configuration types.- Returns:
- launch history
- Since:
- 3.3
-
getFavorites
Returns the launch favorites associated with this action's launch mode and group in user preference order. Configurations associated with disabled activities are not included in the list. As well, configurations are filtered based on workspace preference settings to filter configurations from closed projects, deleted projects, working sets and to filter specific launch configuration types.- Returns:
- favorite launch configurations
- Since:
- 3.3
-
getMode
Returns the mode (e.g., 'run' or 'debug') of this drop down.- Returns:
- the mode of this action
-
getLaunchGroupIdentifier
Returns the identifier of the launch group this action is associated with.- Returns:
- the identifier of the launch group this action is associated with
-