|
Eclipse Platform Release 3.1 |
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
A launch shortcut is capable of launching a selection or active editor in the workbench. The delegate is responsible for interpretting 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"> <launchShortcut id="com.example.ExampleLaunchShortcut" class="com.example.ExampleLaunchShortcutClass" filterClass="com.example.ExampleLaunchShortcutFilterClass" label="Example Label" icon="\icons\exampleshortcut.gif" helpContextId="com.example.shortcut_context" modes="run, debug"> <perspective id="com.example.perspectiveId1"/> <perspective id="com.example.perspectiveId2"/> <filter name="NameMatches" value="*.java"/> <filter name="ContextualLaunchActionFilter" value="supportsContextualLaunch"/> <contextLabel mode="run" label="%RunJavaApplet.label"/> <contextLabel mode="debug" label="%DebugJavaApplet.label"/> ... </launchShortcut> </extension>The attributes are specified as follows:
id
specifies a unique identifier for this launch shortcut.class
specifies a fully qualified name of a Java class
that implements ILaunchShortcut
.filterClass
optionally specifies a fully qualified name of a Java class
that implements ILaunchFilter
for context menu filtering.label
specifies a label used to render this shortcut.icon
specifies a plug-in relative path to an icon used to
render this shortcut.helpContextId
optional attribute specifying the help context
identifier to associate with the launch shortcut action in a menu.modes
specifies a comma separated list of modes this shortcut
supports.perspective
one or more perspective entries enumerate the
perspectives that this shortcut is avilable in, from the run/debug cascade
menus.filter
zero or more filter entries specify the attribute
name
and attribute value
that will be supplied to
the testAttribute
method implemented by the filterClass
Java Class. If all filters in this list return true
when applied
to a selection target, the shortcut will be avilable in the run/debug context menu.
menu.contextLabel
zero 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).Clients contributing a lanuch shortcut are intended to implement this interface.
Method Summary | |
---|---|
void |
launch(IEditorPart editor,
String mode)
Locates a launchable entity in the given active editor, and launches an application in the specified mode. |
void |
launch(ISelection selection,
String mode)
Locates a launchable entity in the given selection and launches an application in the specified mode. |
Method Detail |
public void launch(ISelection selection, String mode)
selection
- workbench selectionmode
- one of the launch modes defined by the
launch managerILaunchManager
public void launch(IEditorPart editor, String mode)
editor
- the active editor in the workbenchmode
- one of the launch modes defined by the launch
managerILaunchManager
|
Eclipse Platform Release 3.1 |
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Guidelines for using Eclipse APIs.
Copyright (c) IBM Corp. and others 2000, 2005. All rights reserved.