Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| Eclipse Platform Release 3.0
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.eclipse.debug.ui
Interface ILaunchShortcut

public interface ILaunchShortcut

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).

Since:
  2.0

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

### launch

    public void launch(ISelection selection,
                       String mode)

  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 selection
    `mode` - one of the launch modes defined by the launch manager
  See Also:
    `ILaunchManager`

### launch

    public void launch(IEditorPart editor,
                       String mode)

  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 workbench
    `mode` - one of the launch modes defined by the launch manager
  See Also:
    `ILaunchManager`

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| Eclipse Platform Release 3.0
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, 2004. All rights reserved.