From 2334bb969d1124a62e9cd9f4f2a428ef3f5a95a9 Mon Sep 17 00:00:00 2001 From: Darin Wright Date: Sun, 1 Nov 2009 18:47:44 +0000 Subject: Support to disable status handlers via preference setting in support of bug 264338 --- org.eclipse.debug.core/META-INF/MANIFEST.MF | 2 +- .../core/org/eclipse/debug/core/DebugPlugin.java | 7 ++++++- .../debug/internal/core/DebugPreferenceInitializer.java | 3 ++- .../debug/internal/core/IInternalDebugCoreConstants.java | 16 +++++++++++++++- 4 files changed, 24 insertions(+), 4 deletions(-) diff --git a/org.eclipse.debug.core/META-INF/MANIFEST.MF b/org.eclipse.debug.core/META-INF/MANIFEST.MF index 072b5d5f0..b2c9d5d2f 100644 --- a/org.eclipse.debug.core/META-INF/MANIFEST.MF +++ b/org.eclipse.debug.core/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: %pluginName Bundle-SymbolicName: org.eclipse.debug.core; singleton:=true -Bundle-Version: 3.4.1.qualifier +Bundle-Version: 3.4.2.qualifier Bundle-ClassPath: . Bundle-Activator: org.eclipse.debug.core.DebugPlugin Bundle-Vendor: %providerName diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/core/DebugPlugin.java b/org.eclipse.debug.core/core/org/eclipse/debug/core/DebugPlugin.java index b04f51218..6ad33a342 100644 --- a/org.eclipse.debug.core/core/org/eclipse/debug/core/DebugPlugin.java +++ b/org.eclipse.debug.core/core/org/eclipse/debug/core/DebugPlugin.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2008 IBM Corporation and others. + * Copyright (c) 2000, 2009 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 @@ -59,6 +59,7 @@ import org.eclipse.debug.internal.core.DebugCoreMessages; import org.eclipse.debug.internal.core.DebugOptions; import org.eclipse.debug.internal.core.ExpressionManager; import org.eclipse.debug.internal.core.IConfigurationElementConstants; +import org.eclipse.debug.internal.core.IInternalDebugCoreConstants; import org.eclipse.debug.internal.core.LaunchManager; import org.eclipse.debug.internal.core.LogicalStructureManager; import org.eclipse.debug.internal.core.MemoryBlockManager; @@ -529,6 +530,10 @@ public class DebugPlugin extends Plugin { * @since 2.0 */ public IStatusHandler getStatusHandler(IStatus status) { + boolean enabled = getPluginPreferences().getBoolean(IInternalDebugCoreConstants.PREF_ENABLE_STATUS_HANDLERS); + if (!enabled) { + return null; + } StatusHandlerKey key = new StatusHandlerKey(status.getPlugin(), status.getCode()); if (fStatusHandlers == null) { initializeStatusHandlers(); 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 2ef4d7fef..269c74cb2 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, 2007 IBM Corporation and others. + * Copyright (c) 2006, 2009 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 { // Step filter preferences prefs.setDefault(StepFilterManager.PREF_USE_STEP_FILTERS, false); prefs.setDefault(LaunchManager.PREF_DELETE_CONFIGS_ON_PROJECT_DELETE, true); + prefs.setDefault(IInternalDebugCoreConstants.PREF_ENABLE_STATUS_HANDLERS, true); } } 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 ec6a7c2f2..cbcf068ab 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 IBM Corporation and others. + * Copyright (c) 2007, 2009 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 @@ -10,6 +10,9 @@ *******************************************************************************/ package org.eclipse.debug.internal.core; +import org.eclipse.core.runtime.IStatus; +import org.eclipse.debug.core.DebugPlugin; + /** * Contains constants to be used internally in all debug components * @@ -21,5 +24,16 @@ public interface IInternalDebugCoreConstants { * Represents the empty string */ public static final String EMPTY_STRING = ""; //$NON-NLS-1$ + + /** + * Boolean preference controlling whether status handler extensions + * are enabled. Default value is true. When disabled + * any call to {@link DebugPlugin#getStatusHandler(IStatus)} will return null. + * + * @since 3.4.2 + */ + public static final String PREF_ENABLE_STATUS_HANDLERS = DebugPlugin.getUniqueIdentifier() + ".PREF_ENABLE_STATUS_HANDLERS"; //$NON-NLS-1$ + + } -- cgit v1.2.3