org.eclipse.debug.ui.actions
Class AbstractLaunchHistoryAction
java.lang.Object
org.eclipse.debug.ui.actions.AbstractLaunchHistoryAction
-
All Implemented Interfaces:
- org.eclipse.debug.internal.ui.ILaunchHistoryChangedListener,
IActionDelegate,
IWorkbenchWindowActionDelegate,
IWorkbenchWindowPulldownDelegate,
IWorkbenchWindowPulldownDelegate2
-
Direct Known Subclasses:
-
AbstractLaunchToolbarAction
-
public abstract class AbstractLaunchHistoryAction
- extends
Object
- implements
IWorkbenchWindowPulldownDelegate2, org.eclipse.debug.internal.ui.ILaunchHistoryChangedListener
Abstract implementation of an action that displays a drop-down launch
history for a specific launch group.
Clients may subclass this class.
-
Since:
- 2.1
-
See Also:
-
LaunchingResourceManager
,
ILaunchLabelChangedListener
Field Summary
|
protected boolean
|
fRecreateMenu
Indicates whether the launch history has changed and
the sub menu needs to be recreated. |
Method Summary
|
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
()
Disposes this action delegate. |
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
(
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
|
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. |
Methods inherited from class java.lang.
Object
|
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait
|
fRecreateMenu
protected boolean fRecreateMenu
- Indicates whether the launch history has changed and
the sub menu needs to be recreated.
AbstractLaunchHistoryAction
public AbstractLaunchHistoryAction(
String launchGroupIdentifier)
- Constructs a launch history action.
-
Parameters:
-
launchGroupIdentifier
- unique identifier of the launch group
extension that this action displays a launch history for.
getAction
protected
IAction getAction()
- Returns the action used to render this delegate.
-
-
-
Returns:
- the action used to render this delegate
addToMenu
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.
-
-
-
Parameters:
-
menu
- the menu to add the action to -
action
- the action to add -
accelerator
- 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
protected
String getToolTip(
ILaunchConfiguration configuration)
- Returns the tooltip specific to a configuration.
-
-
-
Parameters:
-
configuration
- a ILauncConfiguration
-
Returns:
- the string for the tool tip
launchHistoryChanged
public void launchHistoryChanged()
-
Description copied from interface:
org.eclipse.debug.internal.ui.ILaunchHistoryChangedListener
- Notification 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 the
DebugUIPlugin
.
-
-
Specified by:
-
launchHistoryChanged
in interface org.eclipse.debug.internal.ui.ILaunchHistoryChangedListener
-
-
See Also:
-
ILaunchHistoryChangedListener.launchHistoryChanged()
dispose
public void dispose()
-
Description copied from interface:
IWorkbenchWindowActionDelegate
- Disposes this action delegate. The implementor should unhook any references
to itself so that garbage collection can occur.
-
-
Specified by:
-
dispose
in interface
IWorkbenchWindowActionDelegate
-
-
See Also:
-
IWorkbenchWindowActionDelegate.dispose()
getLastLaunch
protected
ILaunchConfiguration 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
public
Menu getMenu(
Control parent)
-
Description copied from interface:
IWorkbenchWindowPulldownDelegate
- Returns 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:
-
getMenu
in interface
IWorkbenchWindowPulldownDelegate
-
-
Returns:
- the menu
-
See Also:
-
IWorkbenchWindowPulldownDelegate.getMenu(org.eclipse.swt.widgets.Control)
getMenu
public
Menu getMenu(
Menu parent)
-
Description copied from interface:
IWorkbenchWindowPulldownDelegate2
- Returns 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:
-
getMenu
in interface
IWorkbenchWindowPulldownDelegate2
-
-
Returns:
- the menu
-
See Also:
-
IMenuCreator.getMenu(org.eclipse.swt.widgets.Menu)
fillMenu
protected void fillMenu(
Menu menu)
- Fills the drop-down menu with favorites and launch history
-
-
-
Parameters:
-
menu
- the menu to fill
addSeparator
protected void addSeparator(
Menu menu)
- Adds a separator to the given menu
-
-
-
Parameters:
-
menu
-
run
public void run(
IAction action)
-
Description copied from interface:
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
IActionDelegate
-
-
Parameters:
-
action
- the action proxy that handles the presentation portion of the
action -
See Also:
-
IActionDelegate.run(org.eclipse.jface.action.IAction)
selectionChanged
public void selectionChanged(
IAction action,
ISelection selection)
-
Description copied from interface:
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
IActionDelegate
-
-
Parameters:
-
action
- the action proxy that handles presentation portion of
the action -
selection
- the current selection, or null
if there
is no selection. -
See Also:
-
IActionDelegate.selectionChanged(org.eclipse.jface.action.IAction, org.eclipse.jface.viewers.ISelection)
init
public void init(
IWorkbenchWindow window)
-
Description copied from interface:
IWorkbenchWindowActionDelegate
- Initializes this action delegate with the workbench window it will work in.
-
-
Specified by:
-
init
in interface
IWorkbenchWindowActionDelegate
-
-
Parameters:
-
window
- the window that provides the context for this delegate -
See Also:
-
IWorkbenchWindowActionDelegate.init(org.eclipse.ui.IWorkbenchWindow)
getLaunchHistory
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()
.
- Returns the launch history associated with this action's launch group.
-
-
-
Returns:
- the launch history associated with this action's launch group
getHistory
protected
ILaunchConfiguration[] 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
protected
ILaunchConfiguration[] 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
protected
String getMode()
- Returns the mode (e.g., 'run' or 'debug') of this drop down.
-
-
-
Returns:
- the mode of this action
getLaunchGroupIdentifier
protected
String 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
Guidelines for using Eclipse APIs.
Copyright (c) Eclipse contributors and others 2000, 2008. All rights reserved.