diff options
author | Darin Wright | 2010-01-22 22:32:56 +0000 |
---|---|---|
committer | Darin Wright | 2010-01-22 22:32:56 +0000 |
commit | f6e4682a41e9a547250809ea38499154040a83be (patch) | |
tree | c3b5fc315da30cc98f83ce2b294a9986ecaa6fad | |
parent | 89f976a9835332d1d1cd1f99844f39f4111673ae (diff) | |
download | eclipse.platform.debug-f6e4682a41e9a547250809ea38499154040a83be.tar.gz eclipse.platform.debug-f6e4682a41e9a547250809ea38499154040a83be.tar.xz eclipse.platform.debug-f6e4682a41e9a547250809ea38499154040a83be.zip |
Bug 298935 - Skip All Breakpoints action does not work any more from keyboard
5 files changed, 43 insertions, 22 deletions
diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/BreakpointManager.java b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/BreakpointManager.java index 84156ab22..a369fad3e 100644 --- a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/BreakpointManager.java +++ b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/BreakpointManager.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2009 IBM Corporation and others. + * Copyright (c) 2000, 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 @@ -142,11 +142,6 @@ public class BreakpointManager implements IBreakpointManager, IResourceChangeLis private static BreakpointManagerVisitor fgVisitor; /** - * Whether or not this breakpoint manager is enabled. - */ - private boolean fEnabled= true; - - /** * Collection of breakpoint manager listeners which are * notified when this manager's state changes. */ @@ -1023,15 +1018,15 @@ public class BreakpointManager implements IBreakpointManager, IResourceChangeLis * @see org.eclipse.debug.core.IBreakpointManager#isEnabled() */ public boolean isEnabled() { - return fEnabled; + return Platform.getPreferencesService().getBoolean(DebugPlugin.getUniqueIdentifier(), IInternalDebugCoreConstants.PREF_BREAKPOINT_MANAGER_ENABLED_STATE, true, null); } /* (non-Javadoc) * @see org.eclipse.debug.core.IBreakpointManager#setEnabled(boolean) */ public void setEnabled(final boolean enabled) { - if (fEnabled != enabled) { - fEnabled= enabled; + if (isEnabled() != enabled) { + Preferences.setBoolean(DebugPlugin.getUniqueIdentifier(), IInternalDebugCoreConstants.PREF_BREAKPOINT_MANAGER_ENABLED_STATE, enabled, null); IWorkspaceRunnable runnable = new IWorkspaceRunnable() { public void run(IProgressMonitor monitor) throws CoreException { IBreakpoint[] breakpoints = getBreakpoints(); diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/DebugPreferenceInitializer.java b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/DebugPreferenceInitializer.java index fc3a13214..9e2896927 100644 --- a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/DebugPreferenceInitializer.java +++ b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/DebugPreferenceInitializer.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2006, 2009 IBM Corporation and others. + * Copyright (c) 2006, 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 @@ -29,6 +29,7 @@ public class DebugPreferenceInitializer extends AbstractPreferenceInitializer { //launch configurations preferences Preferences.setDefaultBoolean(DebugPlugin.getUniqueIdentifier(), LaunchManager.PREF_DELETE_CONFIGS_ON_PROJECT_DELETE, true); Preferences.setDefaultBoolean(DebugPlugin.getUniqueIdentifier(), IInternalDebugCoreConstants.PREF_ENABLE_STATUS_HANDLERS, true); + Preferences.setDefaultBoolean(DebugPlugin.getUniqueIdentifier(), IInternalDebugCoreConstants.PREF_BREAKPOINT_MANAGER_ENABLED_STATE, true); Preferences.savePreferences(DebugPlugin.getUniqueIdentifier()); } diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/IInternalDebugCoreConstants.java b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/IInternalDebugCoreConstants.java index cbcf068ab..8fc33db5e 100644 --- a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/IInternalDebugCoreConstants.java +++ b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/IInternalDebugCoreConstants.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2007, 2009 IBM Corporation and others. + * Copyright (c) 2007, 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 @@ -34,6 +34,11 @@ public interface IInternalDebugCoreConstants { */ public static final String PREF_ENABLE_STATUS_HANDLERS = DebugPlugin.getUniqueIdentifier() + ".PREF_ENABLE_STATUS_HANDLERS"; //$NON-NLS-1$ - + /** + * Persistence of breakpoint manager enabled state. + * + * @since 3.6 + */ + public static final String PREF_BREAKPOINT_MANAGER_ENABLED_STATE = DebugPlugin.getUniqueIdentifier() + ".PREF_BREAKPOINT_MANAGER_ENABLED_STATE"; //$NON-NLS-1$ } diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpoints/SkipAllBreakpointsAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpoints/SkipAllBreakpointsAction.java index 3548e9c73..96cb539f1 100644 --- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpoints/SkipAllBreakpointsAction.java +++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpoints/SkipAllBreakpointsAction.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2009 IBM Corporation and others. + * Copyright (c) 2000, 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 @@ -26,6 +26,8 @@ import org.eclipse.jface.action.Action; import org.eclipse.jface.action.IAction; import org.eclipse.jface.preference.IPreferenceStore; import org.eclipse.jface.viewers.ISelection; +import org.eclipse.swt.widgets.Event; +import org.eclipse.ui.IActionDelegate2; import org.eclipse.ui.IWorkbenchPart; import org.eclipse.ui.IWorkbenchWindow; import org.eclipse.ui.IWorkbenchWindowActionDelegate; @@ -40,7 +42,7 @@ import org.eclipse.ui.progress.IWorkbenchSiteProgressService; * This class also implements the window action delegate for the action presented as * part of the "Breakpoints" group for the "Run" menu. */ -public class SkipAllBreakpointsAction extends Action implements IWorkbenchWindowActionDelegate, IBreakpointManagerListener { +public class SkipAllBreakpointsAction extends Action implements IWorkbenchWindowActionDelegate, IActionDelegate2, IBreakpointManagerListener { public static final String ACTION_ID = "org.eclipse.debug.ui.actions.SkipAllBreakpoints"; //$NON-NLS-1$ @@ -69,6 +71,7 @@ public class SkipAllBreakpointsAction extends Action implements IWorkbenchWindow this(); fPart = part; setId(ACTION_ID); // set action ID when created programmatically. + updateActionCheckedState(); } /* (non-Javadoc) @@ -80,7 +83,7 @@ public class SkipAllBreakpointsAction extends Action implements IWorkbenchWindow progressService = (IWorkbenchSiteProgressService)fPart.getSite(). getAdapter(IWorkbenchSiteProgressService.class); } - final boolean enabled = !isChecked(); + final boolean enabled = !getBreakpointManager().isEnabled(); Job job = new Job(getText()) { protected IStatus run(IProgressMonitor monitor) { if (!monitor.isCanceled()) { @@ -160,4 +163,19 @@ public class SkipAllBreakpointsAction extends Action implements IWorkbenchWindow fAction.setChecked(!enabled); } } + + /* (non-Javadoc) + * @see org.eclipse.ui.IActionDelegate2#init(org.eclipse.jface.action.IAction) + */ + public void init(IAction action) { + fAction = action; + updateActionCheckedState(); + } + + /* (non-Javadoc) + * @see org.eclipse.ui.IActionDelegate2#runWithEvent(org.eclipse.jface.action.IAction, org.eclipse.swt.widgets.Event) + */ + public void runWithEvent(IAction action, Event event) { + run(action); + } } diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/AbstractDebugView.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/AbstractDebugView.java index a0eb8f5b5..ab8e727f5 100644 --- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/AbstractDebugView.java +++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/AbstractDebugView.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2009 IBM Corporation and others. + * Copyright (c) 2000, 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 @@ -22,6 +22,7 @@ import java.util.Set; import org.eclipse.debug.internal.ui.DebugUIPlugin; import org.eclipse.debug.internal.ui.DelegatingModelPresentation; import org.eclipse.debug.internal.ui.LazyModelPresentation; +import org.eclipse.debug.internal.ui.actions.breakpoints.SkipAllBreakpointsAction; import org.eclipse.jface.action.ActionContributionItem; import org.eclipse.jface.action.IAction; import org.eclipse.jface.action.IContributionItem; @@ -604,13 +605,14 @@ public abstract class AbstractDebugView extends PageBookView implements IDebugVi for (int i = 0; i < items.length; i++) { if (items[i] instanceof ActionContributionItem) { IAction action = ((ActionContributionItem)items[i]).getAction(); - if (action.getStyle() == IAction.AS_CHECK_BOX) { - initActionState(action); - if (action.isChecked()) { - action.run(); + if (!SkipAllBreakpointsAction.ACTION_ID.equals(action.getId())) { + if (action.getStyle() == IAction.AS_CHECK_BOX) { + initActionState(action); + if (action.isChecked()) { + action.run(); + } } - } - } + }} } setMemento(null); } |