From c39daa9ca9c9a3652eefb6cb861a6e0ae3756ce9 Mon Sep 17 00:00:00 2001 From: John Cortell Date: Thu, 17 Jun 2010 18:30:47 +0000 Subject: [PATCH] Bug 316987: Show full paths preference under C/C++->Debug is not really necessary --- debug/org.eclipse.cdt.debug.core/META-INF/MANIFEST.MF | 2 +- .../debug/internal/core/ICDebugInternalConstants.java | 8 ++++++++ .../debug/internal/ui/actions/ShowFullPathsAction.java | 5 ++--- .../internal/ui/preferences/CDebugPreferencePage.java | 1 - .../ui/preferences/PreferenceMessages.properties | 1 - .../eclipse/cdt/dsf/debug/ui/IDsfDebugUIConstants.java | 4 ++-- .../src/org/eclipse/cdt/dsf/debug/model/DsfLaunch.java | 10 ++-------- 7 files changed, 15 insertions(+), 16 deletions(-) diff --git a/debug/org.eclipse.cdt.debug.core/META-INF/MANIFEST.MF b/debug/org.eclipse.cdt.debug.core/META-INF/MANIFEST.MF index 0a7b35e0735..098589df549 100644 --- a/debug/org.eclipse.cdt.debug.core/META-INF/MANIFEST.MF +++ b/debug/org.eclipse.cdt.debug.core/META-INF/MANIFEST.MF @@ -18,7 +18,7 @@ Export-Package: org.eclipse.cdt.debug.core, org.eclipse.cdt.debug.core.model, org.eclipse.cdt.debug.core.model.provisional;x-friends:="org.eclipse.cdt.dsf,org.eclipse.cdt.debug.ui.memory.memorybrowser,org.eclipse.cdt.dsf.gdb", org.eclipse.cdt.debug.core.sourcelookup, - org.eclipse.cdt.debug.internal.core;x-friends:="org.eclipse.cdt.dsf.gdb.ui", + org.eclipse.cdt.debug.internal.core;x-friends:="org.eclipse.cdt.dsf.gdb.ui,org.eclipse.cdt.dsf,org.eclipse.cdt.dsf.ui", org.eclipse.cdt.debug.internal.core.breakpoints;x-friends:="org.eclipse.cdt.debug.edc,org.eclipse.cdt.dsf.gdb", org.eclipse.cdt.debug.internal.core.executables;x-internal:=true, org.eclipse.cdt.debug.internal.core.model;x-internal:=true, diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/ICDebugInternalConstants.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/ICDebugInternalConstants.java index 1b8cb974f9d..6e8c8e1f6e3 100644 --- a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/ICDebugInternalConstants.java +++ b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/ICDebugInternalConstants.java @@ -28,4 +28,12 @@ public class ICDebugInternalConstants { * String preference for the common source containers. */ public static final String PREF_COMMON_SOURCE_CONTAINERS = CDebugCorePlugin.getUniqueIdentifier() + ".cDebug.common_source_containers"; //$NON-NLS-1$ + + /** + * Boolean preference indicating the on/off state of the Show Full Paths + * toggle action. Actually, as the action appears in multiple views, and the + * state is preserved for each view, the full preference key is the view ID + * plus this key + */ + public static final String SHOW_FULL_PATHS_PREF_KEY = "org.eclipse.cdt.debug.ui.cDebug.show_full_paths"; //$NON-NLS-1$ } diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/ShowFullPathsAction.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/ShowFullPathsAction.java index 8a88876af5b..642ad191b6a 100644 --- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/ShowFullPathsAction.java +++ b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/ShowFullPathsAction.java @@ -12,6 +12,7 @@ package org.eclipse.cdt.debug.internal.ui.actions; import org.eclipse.cdt.debug.core.CDIDebugModel; +import org.eclipse.cdt.debug.internal.core.ICDebugInternalConstants; import org.eclipse.cdt.debug.internal.ui.CDebugModelPresentation; import org.eclipse.cdt.debug.ui.CDebugUIPlugin; import org.eclipse.debug.core.DebugPlugin; @@ -34,13 +35,11 @@ import org.eclipse.swt.custom.BusyIndicator; */ public class ShowFullPathsAction extends ViewFilterAction { - public static final String PREF_KEY = "org.eclipse.cdt.debug.ui.cDebug.show_full_paths"; //$NON-NLS-1$ - /* (non-Javadoc) * @see org.eclipse.cdt.debug.internal.ui.actions.ViewFilterAction#getPreferenceKey() */ protected String getPreferenceKey() { - return PREF_KEY; + return ICDebugInternalConstants.SHOW_FULL_PATHS_PREF_KEY; } /* (non-Javadoc) diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/preferences/CDebugPreferencePage.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/preferences/CDebugPreferencePage.java index ab9da34e6e0..621fbae580a 100644 --- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/preferences/CDebugPreferencePage.java +++ b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/preferences/CDebugPreferencePage.java @@ -175,7 +175,6 @@ public class CDebugPreferencePage extends PreferencePage implements IWorkbenchPr */ public static void initDefaults( IPreferenceStore store ) { store.setDefault( ICDebugPreferenceConstants.PREF_SHOW_HEX_VALUES, false ); -// store.setDefault( ICDebugPreferenceConstants.PREF_SHOW_FULL_PATHS, true ); PreferenceConverter.setDefault( store, IInternalCDebugUIConstants.DISASSEMBLY_SOURCE_LINE_COLOR, IInternalCDebugUIConstants.DEFAULT_DISASSEMBLY_SOURCE_LINE_RGB ); } diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/preferences/PreferenceMessages.properties b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/preferences/PreferenceMessages.properties index 86745c68980..369e4b42227 100644 --- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/preferences/PreferenceMessages.properties +++ b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/preferences/PreferenceMessages.properties @@ -16,7 +16,6 @@ CDebugPreferencePage.1=Hexadecimal CDebugPreferencePage.2=Decimal CDebugPreferencePage.3=General settings for C/C++ Debugging. CDebugPreferencePage.4=Opened view default settings -CDebugPreferencePage.5=Show full &paths CDebugPreferencePage.8=Default variable format: CDebugPreferencePage.9=Default expression format: CDebugPreferencePage.10=Default register format: diff --git a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/IDsfDebugUIConstants.java b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/IDsfDebugUIConstants.java index a584751f1c1..5df843145a1 100644 --- a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/IDsfDebugUIConstants.java +++ b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/IDsfDebugUIConstants.java @@ -10,7 +10,7 @@ *******************************************************************************/ package org.eclipse.cdt.dsf.debug.ui; -import org.eclipse.cdt.debug.internal.ui.actions.ShowFullPathsAction; +import org.eclipse.cdt.debug.internal.core.ICDebugInternalConstants; import org.eclipse.cdt.dsf.internal.ui.DsfUIPlugin; import org.eclipse.debug.ui.IDebugUIConstants; @@ -94,5 +94,5 @@ public interface IDsfDebugUIConstants { * The value of this id must match what is being used as a full key in ShowFullPathsAction.run() * * @since 2.1 */ - public static final String DEBUG_VIEW_SHOW_FULL_PATH_PROPERTY = IDebugUIConstants.ID_DEBUG_VIEW + "." + ShowFullPathsAction.PREF_KEY; //$NON-NLS-1$ + public static final String DEBUG_VIEW_SHOW_FULL_PATH_PROPERTY = IDebugUIConstants.ID_DEBUG_VIEW + "." + ICDebugInternalConstants.SHOW_FULL_PATHS_PREF_KEY; //$NON-NLS-1$ } diff --git a/dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/debug/model/DsfLaunch.java b/dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/debug/model/DsfLaunch.java index 896a0e7bddf..e0d81ea81cc 100644 --- a/dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/debug/model/DsfLaunch.java +++ b/dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/debug/model/DsfLaunch.java @@ -10,6 +10,7 @@ *******************************************************************************/ package org.eclipse.cdt.dsf.debug.model; +import org.eclipse.cdt.debug.internal.core.ICDebugInternalConstants; import org.eclipse.debug.core.DebugPlugin; import org.eclipse.debug.core.ILaunchConfiguration; import org.eclipse.debug.core.Launch; @@ -24,20 +25,13 @@ import org.eclipse.debug.core.model.ISourceLocator; */ public class DsfLaunch extends Launch { - /* - * Used to indicate that this launch supports the "Show Full Path" action in the debug view. - * This constant must have the same value as ICDebugPreferenceConstants.PREF_SHOW_FULL_PATHS - * We have our own copy to avoid a dependency. - */ - private static final String PREF_SHOW_FULL_PATHS = "org.eclipse.cdt.debug.ui.cDebug.show_full_paths"; //$NON-NLS-1$ - public DsfLaunch(ILaunchConfiguration launchConfiguration, String mode, ISourceLocator locator) { super(launchConfiguration, mode, locator); // Just set this attribute to any value. It's presence indicates that the // "Show Full Path" action is supported in the debug view. // see org.eclipse.cdt.debug.internal.ui.actions.ShowFullPathsAction - setAttribute(PREF_SHOW_FULL_PATHS, ""); //$NON-NLS-1$ + setAttribute(ICDebugInternalConstants.SHOW_FULL_PATHS_PREF_KEY, ""); //$NON-NLS-1$ } @Override