LaunchShortcutpublic class LaunchShortcut extends Object implements org.eclipse.debug.ui.ILaunchShortcutLaunch shortcut to launch debug/run configuration directly. |
Methods Summary |
---|
public void | launch(org.eclipse.jface.viewers.ISelection selection, java.lang.String mode)
if (selection instanceof IStructuredSelection) {
// get the object and the project from it
IStructuredSelection structSelect = (IStructuredSelection)selection;
Object o = structSelect.getFirstElement();
// get the first (and normally only) element
if (o instanceof IAdaptable) {
IResource r = (IResource)((IAdaptable)o).getAdapter(IResource.class);
// get the project from the resource
if (r != null) {
IProject project = r.getProject();
if (project != null) {
// and launch
launch(project, mode);
}
}
}
}
| public void | launch(org.eclipse.ui.IEditorPart editor, java.lang.String mode)
// since we force the shortcut to only work on selection in the
// package explorer, this will never be called.
| private void | launch(org.eclipse.core.resources.IProject project, java.lang.String mode)Launch a config for the specified project.
// get an existing or new launch configuration
ILaunchConfiguration config = AndroidLaunchController.getLaunchConfig(project);
if (config != null) {
// and launch!
DebugUITools.launch(config, mode);
}
|
|