Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMike Rennie2013-08-12 13:47:18 -0400
committerMike Rennie2013-08-12 13:47:18 -0400
commita33dbcd71101ea6cab467451e316a14bc84a93fc (patch)
treed6755b5c45486d1ba1edb4a136bc444f2a1e6b59 /org.eclipse.debug.examples.mixedmode/src
parent7076decdceeadf55f1dc9aa6a3bb65ecf5b64f83 (diff)
downloadeclipse.platform.debug-a33dbcd71101ea6cab467451e316a14bc84a93fc.tar.gz
eclipse.platform.debug-a33dbcd71101ea6cab467451e316a14bc84a93fc.tar.xz
eclipse.platform.debug-a33dbcd71101ea6cab467451e316a14bc84a93fc.zip
[nobug] spelling
Diffstat (limited to 'org.eclipse.debug.examples.mixedmode/src')
-rwxr-xr-xorg.eclipse.debug.examples.mixedmode/src/org/eclipse/debug/internal/examples/mixedmode/ClearAllDelegateInformationAction.java73
1 files changed, 73 insertions, 0 deletions
diff --git a/org.eclipse.debug.examples.mixedmode/src/org/eclipse/debug/internal/examples/mixedmode/ClearAllDelegateInformationAction.java b/org.eclipse.debug.examples.mixedmode/src/org/eclipse/debug/internal/examples/mixedmode/ClearAllDelegateInformationAction.java
new file mode 100755
index 000000000..6b909892d
--- /dev/null
+++ b/org.eclipse.debug.examples.mixedmode/src/org/eclipse/debug/internal/examples/mixedmode/ClearAllDelegateInformationAction.java
@@ -0,0 +1,73 @@
+package org.eclipse.debug.internal.examples.mixedmode;
+
+import java.util.Iterator;
+import java.util.Set;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.debug.core.DebugPlugin;
+import org.eclipse.debug.core.ILaunchConfigurationType;
+import org.eclipse.debug.core.ILaunchManager;
+import org.eclipse.debug.internal.ui.DebugUIPlugin;
+import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.ui.IWorkbenchWindow;
+import org.eclipse.ui.IWorkbenchWindowActionDelegate;
+
+/**
+ * Class defines an action used to clear all of the preferred launch delegate
+ * information from the launch configuration types and from the debug
+ * preferences
+ */
+public class ClearAllDelegateInformationAction implements IWorkbenchWindowActionDelegate {
+
+ /**
+ * @see org.eclipse.ui.IWorkbenchWindowActionDelegate#dispose()
+ */
+ @Override
+ public void dispose() {
+ }
+
+ /**
+ * @see org.eclipse.ui.IWorkbenchWindowActionDelegate#init(org.eclipse.ui.IWorkbenchWindow)
+ */
+ @Override
+ public void init(IWorkbenchWindow window) {
+ }
+
+ /**
+ * @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction)
+ */
+ @Override
+ public void run(IAction action) {
+ Runnable runner = new Runnable() {
+ @Override
+ public void run() {
+ try {
+ ILaunchManager lm = DebugPlugin.getDefault().getLaunchManager();
+ ILaunchConfigurationType[] types = lm.getLaunchConfigurationTypes();
+ Set<Set<String>> modes = null;
+ Set<String> mode = null;
+ for (int i = 0; i < types.length; i++) {
+ modes = types[i].getSupportedModeCombinations();
+ for (Iterator<Set<String>> iter = modes.iterator(); iter.hasNext();) {
+ mode = iter.next();
+ types[i].setPreferredDelegate(mode, null);
+ }
+ }
+ } catch (CoreException ce) {
+ DebugPlugin.log(ce);
+ }
+ }
+ };
+ DebugUIPlugin.getStandardDisplay().asyncExec(runner);
+ }
+
+ /**
+ * @see org.eclipse.ui.IActionDelegate#selectionChanged(org.eclipse.jface.action.IAction,
+ * org.eclipse.jface.viewers.ISelection)
+ */
+ @Override
+ public void selectionChanged(IAction action, ISelection selection) {
+ }
+
+}

Back to the top