Package org.eclipse.debug.ui
Interface ILaunchShortcut
- All Known Subinterfaces:
ILaunchShortcut2
public interface ILaunchShortcut
A launch shortcut is capable of launching a selection or active editor in the
workbench. The delegate is responsible for interpreting the selection or
active editor (if it applies), and launching an application. This may require
creating a new launch configuration with default values, or re-using an
existing launch configuration.
A launch shortcut is defined as an extension of type
org.eclipse.debug.ui.launchShortcuts. A shortcut specifies the
perspectives in which is should be available from the "Run/Debug" cascade
menus.
A launch shortcut extension is defined in plugin.xml. Following
is an example definition of a launch shortcut extension.
<extension point="org.eclipse.debug.ui.launchShortcuts">
<shortcut
class="org.eclipse.jdt.internal.debug.ui.launcher.JavaApplicationLaunchShortcut"
description="%JavaLaunchShortcut.description"
helpContextId="org.eclipse.jdt.debug.ui.shortcut_local_java_application"
icon="$nl$/icons/full/etool16/java_app.svg"
id="org.eclipse.jdt.debug.ui.localJavaShortcut"
label="%JavaApplicationShortcut.label"
modes="run, debug">
<contextualLaunch>
<enablement>
<with variable="selection">
<count value="1"/>
<iterate>
<and>
<adapt type="org.eclipse.jdt.core.IJavaElement">
<test property="org.eclipse.jdt.core.isInJavaProject"/>
</adapt>
<or>
<test property="org.eclipse.jdt.launching.hasMain"/>
<test property="org.eclipse.jdt.launching.isContainer"/>
<test property="org.eclipse.jdt.launching.isPackageFragment"/>
<test property="org.eclipse.jdt.launching.isPackageFragmentRoot"/>
</or>
</and>
</iterate>
</with>
</enablement>
</contextualLaunch>
<configurationType
id="org.eclipse.jdt.launching.localJavaApplication">
</configurationType>
<description
description="%RunJavaLaunchShortcut.description"
mode="run">
</description>
<description
description="%DebugJavaLaunchShortcut.description"
mode="debug">
</description>
</shortcut>
</extension>
The attributes are specified as follows:
idspecifies a unique identifier for this launch shortcut.modesspecifies a comma separated list of modes this shortcut supports.classspecifies a fully qualified name of a Java class that implementsILaunchShortcut.labelspecifies a label used to render this shortcut.iconspecifies a plug-in relative path to an icon used to render this shortcut.categoryspecifies the launch configuration type category this shortcut is applicable for. When unspecified, the category isnull(default).pathan optional menu path used to group launch shortcuts in menus. Launch shortcuts are grouped alphabetically based on thepathattribute, and then sorted alphabetically within groups based on thelabelattribute. When unspecified, a shortcut appears in the last group. This attribute was added in the 3.0.1 release.helpContextIdoptional attribute specifying the help context identifier to associate with the launch shortcut action in a menu.descriptionProvides a human readable description of what the shortcut does (or will do) if the user selects it. A Description provided in this field will apply as the default description for all of the modes listed in the modes attribute.perspectivehas been deprecated in the 3.1 release. The top level Run/Debug/Profile cascade menus now support contextual (selection sensitive) launching, and clients should provide acontextualLaunchelement instead.contextualLaunchholds all descriptions for adding shortcuts to the selection sensitive Run/Debug/Profile cascade menus. Only objects that provide anorg.eclipse.debug.ui.actions.ILaunchableadapter are considered for the cascade menus. Theorg.eclipse.debug.ui.actions.ILaunchableinterface is simply used to tag objects that support contextual launching.contextLabelzero or more context menu labels. For shortcuts that pass their filter tests, the specified label will appear in the "Run ->" context menu and be bound to a launch action of the specified mode (e.g. run,debug,profile).configurationTypeallows more that one associated launch configuration type to be specified for this launch shortcut. That way consumers of launch shortcut information can know what kinds of launch configurations your short is associated with/createsdescriptionallows a mode specific description(s) to be provided for this launch shortcut.
Clients contributing a launch shortcut are intended to implement this
interface.
- Since:
- 2.0
-
Method Summary
Modifier and TypeMethodDescriptionvoidlaunch(ISelection selection, String mode) Locates a launchable entity in the given selection and launches an application in the specified mode.voidlaunch(IEditorPart editor, String mode) Locates a launchable entity in the given active editor, and launches an application in the specified mode.
-
Method Details
-
launch
Locates a launchable entity in the given selection and launches an application in the specified mode. This launch configuration shortcut is responsible for progress reporting as well as error handling, in the event that a launchable entity cannot be found, or launching fails.- Parameters:
selection- workbench selectionmode- one of the launch modes defined by the launch manager- See Also:
-
launch
Locates a launchable entity in the given active editor, and launches an application in the specified mode. This launch configuration shortcut is responsible for progress reporting as well as error handling, in the event that a launchable entity cannot be found, or launching fails.- Parameters:
editor- the active editor in the workbenchmode- one of the launch modes defined by the launch manager- See Also:
-