Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDarin Wright2010-10-21 19:22:34 +0000
committerDarin Wright2010-10-21 19:22:34 +0000
commitab73cd0ab97104e7a32d5ef1706ce7d143380f31 (patch)
treed9bce916bbd3955bbb79443fe47b7516fd5322d0 /org.eclipse.debug.examples.core
parentb35e26213d302155b4a5809b32401af95ce9d257 (diff)
downloadeclipse.platform.debug-ab73cd0ab97104e7a32d5ef1706ce7d143380f31.tar.gz
eclipse.platform.debug-ab73cd0ab97104e7a32d5ef1706ce7d143380f31.tar.xz
eclipse.platform.debug-ab73cd0ab97104e7a32d5ef1706ce7d143380f31.zip
Bug 328295 - Launch button disabled after failed launch
Diffstat (limited to 'org.eclipse.debug.examples.core')
-rw-r--r--org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/midi/launcher/MidiLaunchDelegate.java22
1 files changed, 21 insertions, 1 deletions
diff --git a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/midi/launcher/MidiLaunchDelegate.java b/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/midi/launcher/MidiLaunchDelegate.java
index b5538a787..59e3131e8 100644
--- a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/midi/launcher/MidiLaunchDelegate.java
+++ b/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/midi/launcher/MidiLaunchDelegate.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2008 IBM Corporation and others.
+ * Copyright (c) 2008, 2010 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -52,10 +52,30 @@ public class MidiLaunchDelegate extends LaunchConfigurationDelegate {
*/
public static final String ATTR_MIDI_FILE = "midi.file";
+ /**
+ * Launch configuration attribute for the MIDI launcher. Specifies whether to throw
+ * an exception when present. Value is one of <code>HANDLED</code> or <code>UNHANDLED</code>.
+ */
+ public static final String ATTR_THROW_EXCEPTION = "throw.exception";
+
+ /**
+ * Possible values for the <code>ATTR_THROW_EXCEPTION</code>.
+ */
+ public static final String HANDLED = "HANDLED";
+ public static final String UNHANDLED = "UNHANDLED";
+
/* (non-Javadoc)
* @see org.eclipse.debug.core.model.ILaunchConfigurationDelegate#launch(org.eclipse.debug.core.ILaunchConfiguration, java.lang.String, org.eclipse.debug.core.ILaunch, org.eclipse.core.runtime.IProgressMonitor)
*/
public void launch(ILaunchConfiguration configuration, String mode, ILaunch launch, IProgressMonitor monitor) throws CoreException {
+ String excep = configuration.getAttribute(ATTR_THROW_EXCEPTION, (String)null);
+ if (excep != null) {
+ if (HANDLED.equals(excep)) {
+ throw new CoreException(new Status(IStatus.ERROR, DebugCorePlugin.PLUGIN_ID, 303, "Test handled exception during launch", null));
+ } else {
+ throw new CoreException(new Status(IStatus.ERROR, DebugCorePlugin.PLUGIN_ID, "Test unhandled exception during launch", new Error("Test unhandled exception during launch")));
+ }
+ }
String fileName = configuration.getAttribute(ATTR_MIDI_FILE, (String)null);
if (fileName == null) {
abort("MIDI file not specified.", null);

Back to the top