|
Lines 29-38
Link Here
|
| 29 |
import org.eclipse.core.expressions.IEvaluationContext; |
29 |
import org.eclipse.core.expressions.IEvaluationContext; |
| 30 |
import org.eclipse.core.runtime.CoreException; |
30 |
import org.eclipse.core.runtime.CoreException; |
| 31 |
import org.eclipse.core.runtime.IConfigurationElement; |
31 |
import org.eclipse.core.runtime.IConfigurationElement; |
|
|
32 |
import org.eclipse.debug.core.ILaunchConfiguration; |
| 32 |
import org.eclipse.debug.internal.ui.DebugUIPlugin; |
33 |
import org.eclipse.debug.internal.ui.DebugUIPlugin; |
| 33 |
import org.eclipse.debug.internal.ui.Pair; |
34 |
import org.eclipse.debug.internal.ui.Pair; |
| 34 |
import org.eclipse.debug.internal.ui.actions.LaunchShortcutAction; |
35 |
import org.eclipse.debug.internal.ui.actions.LaunchShortcutAction; |
| 35 |
import org.eclipse.debug.ui.ILaunchShortcut; |
36 |
import org.eclipse.debug.ui.ILaunchShortcut; |
|
|
37 |
import org.eclipse.debug.ui.ILaunchShortcut2; |
| 36 |
import org.eclipse.jface.resource.ImageDescriptor; |
38 |
import org.eclipse.jface.resource.ImageDescriptor; |
| 37 |
import org.eclipse.jface.viewers.ISelection; |
39 |
import org.eclipse.jface.viewers.ISelection; |
| 38 |
import org.eclipse.jface.viewers.StructuredSelection; |
40 |
import org.eclipse.jface.viewers.StructuredSelection; |
|
Lines 45-55
Link Here
|
| 45 |
/** |
47 |
/** |
| 46 |
* Proxy to a launch shortcut extension |
48 |
* Proxy to a launch shortcut extension |
| 47 |
*/ |
49 |
*/ |
| 48 |
public class LaunchShortcutExtension implements ILaunchShortcut, IPluginContribution { |
50 |
public class LaunchShortcutExtension implements ILaunchShortcut2, IPluginContribution { |
| 49 |
|
51 |
|
| 50 |
private ImageDescriptor fImageDescriptor = null; |
52 |
private ImageDescriptor fImageDescriptor = null; |
| 51 |
private List fPerspectives = null; |
53 |
private List fPerspectives = null; |
| 52 |
private ILaunchShortcut fDelegate = null; |
54 |
private ILaunchShortcut2 fDelegate = null; |
| 53 |
private Set fModes = null; |
55 |
private Set fModes = null; |
| 54 |
private IConfigurationElement fContextualLaunchConfigurationElement = null; |
56 |
private IConfigurationElement fContextualLaunchConfigurationElement = null; |
| 55 |
private Expression fContextualLaunchExpr = null; |
57 |
private Expression fContextualLaunchExpr = null; |
|
Lines 342-348
Link Here
|
| 342 |
protected ILaunchShortcut getDelegate() { |
344 |
protected ILaunchShortcut getDelegate() { |
| 343 |
if (fDelegate == null) { |
345 |
if (fDelegate == null) { |
| 344 |
try { |
346 |
try { |
| 345 |
fDelegate = (ILaunchShortcut)fConfig.createExecutableExtension("class"); //$NON-NLS-1$ |
347 |
fDelegate = (ILaunchShortcut2)fConfig.createExecutableExtension("class"); //$NON-NLS-1$ |
| 346 |
} catch (CoreException e) { |
348 |
} catch (CoreException e) { |
| 347 |
DebugUIPlugin.errorDialog(DebugUIPlugin.getShell(), LaunchConfigurationsMessages.LaunchShortcutExtension_Error_4, LaunchConfigurationsMessages.LaunchShortcutExtension_Unable_to_use_launch_shortcut_5, e.getStatus()); // |
349 |
DebugUIPlugin.errorDialog(DebugUIPlugin.getShell(), LaunchConfigurationsMessages.LaunchShortcutExtension_Error_4, LaunchConfigurationsMessages.LaunchShortcutExtension_Unable_to_use_launch_shortcut_5, e.getStatus()); // |
| 348 |
} |
350 |
} |
|
Lines 421-425
Link Here
|
| 421 |
public String getPluginId() { |
423 |
public String getPluginId() { |
| 422 |
return fConfig.getContributor().getName(); |
424 |
return fConfig.getContributor().getName(); |
| 423 |
} |
425 |
} |
|
|
426 |
|
| 427 |
/* (non-Javadoc) |
| 428 |
* @see org.eclipse.debug.ui.ILaunchShortcut#getAssociatedLaunchConfig(org.eclipse.jface.viewers.ISelection, java.lang.String) |
| 429 |
*/ |
| 430 |
public ILaunchConfiguration getAssociatedLaunchConfig(ISelection selection) { |
| 431 |
if(fDelegate == null) { |
| 432 |
getDelegate(); |
| 433 |
} |
| 434 |
if(fDelegate != null) { |
| 435 |
return fDelegate.getAssociatedLaunchConfig(selection); |
| 436 |
} |
| 437 |
return null; |
| 438 |
} |
| 439 |
|
| 440 |
/* (non-Javadoc) |
| 441 |
* @see org.eclipse.debug.ui.ILaunchShortcut#getAssociatedLaunchConfig(org.eclipse.ui.IEditorPart, java.lang.String) |
| 442 |
*/ |
| 443 |
public ILaunchConfiguration getAssociatedLaunchConfig(IEditorPart editor) { |
| 444 |
if(fDelegate == null) { |
| 445 |
getDelegate(); |
| 446 |
} |
| 447 |
if(fDelegate != null) { |
| 448 |
return fDelegate.getAssociatedLaunchConfig(editor); |
| 449 |
} |
| 450 |
return null; |
| 451 |
} |
| 424 |
} |
452 |
} |
| 425 |
|
453 |
|