From 4eb55adedadf0b1c18214a42484d591f0f3b5833 Mon Sep 17 00:00:00 2001 From: Mikhail Khodjaiants Date: Thu, 1 Apr 2004 00:18:58 +0000 Subject: [PATCH] Added default preferences to the C/C++ Debug preference page. Removed the preference page of the Shared Libraries views. --- debug/org.eclipse.cdt.debug.ui/ChangeLog | 9 ++ debug/org.eclipse.cdt.debug.ui/plugin.xml | 88 ++++++------ .../ui/preferences/CDebugPreferencePage.java | 11 +- .../SharedLibrariesViewPreferencePage.java | 125 ------------------ .../eclipse/cdt/debug/ui/CDebugUIPlugin.java | 2 - .../ui/CDebugUIPluginResources.properties | 5 +- 6 files changed, 62 insertions(+), 178 deletions(-) delete mode 100644 debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/preferences/SharedLibrariesViewPreferencePage.java diff --git a/debug/org.eclipse.cdt.debug.ui/ChangeLog b/debug/org.eclipse.cdt.debug.ui/ChangeLog index 3c091a83b6f..f5f449bf935 100644 --- a/debug/org.eclipse.cdt.debug.ui/ChangeLog +++ b/debug/org.eclipse.cdt.debug.ui/ChangeLog @@ -1,3 +1,12 @@ +2004-03-31 Mikhail Khodjaiants + Added default preferences to the C/C++ Debug preference page. + Removed the preference page of the Shared Libraries views. + * SharedLibrariesPreferencePage.java - removed + * CDebugPreferencePage.java + * CDebugUIPluginResources.properties + * CDebugUIPlugin.java + * plugin.xml + 2004-03-31 Mikhail Khodjaiants The Registers view has been contibuted and moved to the Eclipse platform. * org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/views/registers/* - removed diff --git a/debug/org.eclipse.cdt.debug.ui/plugin.xml b/debug/org.eclipse.cdt.debug.ui/plugin.xml index 5dcea3b02c6..155fd16e73b 100644 --- a/debug/org.eclipse.cdt.debug.ui/plugin.xml +++ b/debug/org.eclipse.cdt.debug.ui/plugin.xml @@ -69,24 +69,24 @@ targetID="org.eclipse.debug.ui.DebugPerspective"> + relationship="stack" + id="org.eclipse.cdt.debug.ui.MemoryView"> + relationship="stack" + id="org.eclipse.cdt.debug.ui.SharedLibrariesView"> + relationship="stack" + id="org.eclipse.cdt.debug.ui.SignalsView"> @@ -101,12 +101,6 @@ - - @@ -785,8 +779,8 @@ label="%SignalAction.label" icon="icons/full/clcl16/signal_co.gif" helpContextId="signal_action_context" - tooltip="%SignalAction.tooltip" class="org.eclipse.cdt.debug.internal.ui.actions.SignalActionDelegate" + tooltip="%SignalAction.tooltip" menubarPath="additions" enablesFor="1" id="org.eclipse.cdt.debug.internal.ui.actions.SignalActionDelegate"> @@ -823,8 +817,8 @@ @@ -839,8 +833,8 @@ label="%CastToTypeAction.label" icon="icons/full/clcl16/casttotype_co.gif" helpContextId="cast_to_type_action_context" - class="org.eclipse.cdt.debug.internal.ui.actions.CastToTypeActionDelegate" tooltip="%CastToTypeAction.tooltip" + class="org.eclipse.cdt.debug.internal.ui.actions.CastToTypeActionDelegate" menubarPath="additions" enablesFor="1" id="org.eclipse.cdt.debug.internal.ui.actions.CastToTypeActionDelegate"> @@ -855,8 +849,8 @@ label="%CastToArrayAction.label" icon="icons/full/clcl16/showasarray_co.gif" helpContextId="cast_to_array_action_context" - class="org.eclipse.cdt.debug.internal.ui.actions.CastToArrayActionDelegate" tooltip="%CastToArrayAction.tooltip" + class="org.eclipse.cdt.debug.internal.ui.actions.CastToArrayActionDelegate" menubarPath="additions" enablesFor="1" id="org.eclipse.cdt.debug.internal.ui.actions.CastToArrayActionDelegate"> @@ -875,8 +869,8 @@ label="%ManageFunctionBreakpointAction.label" icon="icons/full/obj16/funbrkp_obj.gif" helpContextId="manage_function_breakpoint_action_context" - class="org.eclipse.cdt.debug.internal.ui.actions.ManageFunctionBreakpointActionDelegate" tooltip="%ManageFunctionBreakpointAction.tooltip" + class="org.eclipse.cdt.debug.internal.ui.actions.ManageFunctionBreakpointActionDelegate" menubarPath="additions" enablesFor="1" id="org.eclipse.cdt.debug.internal.ui.actions.ManageFunctionBreakpointActionDelegate"> @@ -895,8 +889,8 @@ label="%DisableVariablesAction.label" icon="icons/full/clcl16/disabled_co.gif" helpContextId="disable_variables_action_context" - class="org.eclipse.cdt.debug.internal.ui.actions.DisableVariablesActionDelegate" tooltip="%DisableVariablesAction.tooltip" + class="org.eclipse.cdt.debug.internal.ui.actions.DisableVariablesActionDelegate" menubarPath="variableGroup" enablesFor="2+" id="org.eclipse.cdt.debug.internal.ui.actions.DisableVariablesActionDelegate"> @@ -908,8 +902,8 @@ label="%EnableVariablesAction.label" icon="icons/full/clcl16/enabled_co.gif" helpContextId="enable_variables_action_context" - class="org.eclipse.cdt.debug.internal.ui.actions.EnableVariablesActionDelegate" tooltip="%EnableVariablesAction.tooltip" + class="org.eclipse.cdt.debug.internal.ui.actions.EnableVariablesActionDelegate" menubarPath="variableGroup" enablesFor="2+" id="org.eclipse.cdt.debug.internal.ui.actions.EnableVariablesActionDelegate"> @@ -932,8 +926,8 @@ disabledIcon="icons/full/dlcl16/restart.gif" enablesFor="1" icon="icons/full/elcl16/restart.gif" - label="%RestartAction.label" helpContextId="restart_action_context" + label="%RestartAction.label" tooltip="%RestartAction.tooltip"> @@ -1221,16 +1215,16 @@ point="org.eclipse.ui.editors"> @@ -1252,8 +1246,8 @@ + parentId="org.eclipse.debug.ui.debugging" + id="org.eclipse.cdt.debug.ui.debugging"> + contextId="org.eclipse.cdt.debug.ui.debugging" + autoClose="false"> + contextId="org.eclipse.cdt.debug.ui.debugging" + autoClose="false"> + contextId="org.eclipse.cdt.debug.ui.debugging" + autoClose="false"> + contextId="org.eclipse.cdt.debug.ui.debugging" + autoClose="false"> 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 ebfe9f88b07..ed9e1f38fba 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 @@ -52,6 +52,8 @@ public class CDebugPreferencePage extends PreferencePage implements IWorkbenchPr { // View setting widgets private Button fPathsButton; + private Button fRefreshRegistersButton; + private Button fRefreshSolibsButton; private Combo fVariableFormatCombo; private Combo fExpressionFormatCombo; private Combo fRegisterFormatCombo; @@ -150,8 +152,9 @@ public class CDebugPreferencePage extends PreferencePage implements IWorkbenchPr private void setValues() { IPreferenceStore store = getPreferenceStore(); - fPathsButton.setSelection( store.getBoolean( ICDebugPreferenceConstants.PREF_SHOW_FULL_PATHS ) ); + fRefreshRegistersButton.setSelection( CDebugCorePlugin.getDefault().getPluginPreferences().getBoolean( ICDebugConstants.PREF_REGISTERS_AUTO_REFRESH ) ); + fRefreshSolibsButton.setSelection( CDebugCorePlugin.getDefault().getPluginPreferences().getBoolean( ICDebugConstants.PREF_SHARED_LIBRARIES_AUTO_REFRESH ) ); fAutoDisassemblyButton.setSelection( CDebugCorePlugin.getDefault().getPluginPreferences().getBoolean( ICDebugConstants.PREF_AUTO_DISASSEMBLY ) ); getMaxNumberOfInstructionsText().setStringValue( new Integer( CDebugCorePlugin.getDefault().getPluginPreferences().getInt( ICDebugConstants.PREF_MAX_NUMBER_OF_INSTRUCTIONS ) ).toString() ); fVariableFormatCombo.select( getFormatIndex( CDebugCorePlugin.getDefault().getPluginPreferences().getInt( ICDebugConstants.PREF_DEFAULT_VARIABLE_FORMAT ) ) ); @@ -205,6 +208,8 @@ public class CDebugPreferencePage extends PreferencePage implements IWorkbenchPr { Composite comp = createGroupComposite( parent, 1, CDebugUIPlugin.getResourceString("internal.ui.preferences.CDebugPreferencePage.Opened_view_default_settings") ); //$NON-NLS-1$ fPathsButton = createCheckButton( comp, CDebugUIPlugin.getResourceString("internal.ui.preferences.CDebugPreferencePage.pathsButton") ); //$NON-NLS-1$ + fRefreshRegistersButton = createCheckButton( comp, CDebugUIPlugin.getResourceString( "internal.ui.preferences.CDebugPreferencePage.autoRefreshRegistersButton" ) ); //$NON-NLS-1$ + fRefreshSolibsButton = createCheckButton( comp, CDebugUIPlugin.getResourceString( "internal.ui.preferences.CDebugPreferencePage.autoRefreshSolibsButton" ) ); //$NON-NLS-1$ Composite formatComposite = ControlFactory.createCompositeEx( comp, 2, 0 ); ((GridLayout)formatComposite.getLayout()).makeColumnsEqualWidth = true; fVariableFormatCombo = createComboBox( formatComposite, CDebugUIPlugin.getResourceString("internal.ui.preferences.CDebugPreferencePage.variableFormatCombo"), fFormatLabels, fFormatLabels[0] ); //$NON-NLS-1$ @@ -355,6 +360,8 @@ public class CDebugPreferencePage extends PreferencePage implements IWorkbenchPr { IPreferenceStore store = getPreferenceStore(); store.setValue( ICDebugPreferenceConstants.PREF_SHOW_FULL_PATHS, fPathsButton.getSelection() ); + CDebugCorePlugin.getDefault().getPluginPreferences().setValue( ICDebugConstants.PREF_REGISTERS_AUTO_REFRESH, fRefreshRegistersButton.getSelection() ); + CDebugCorePlugin.getDefault().getPluginPreferences().setValue( ICDebugConstants.PREF_SHARED_LIBRARIES_AUTO_REFRESH, fRefreshSolibsButton.getSelection() ); CDebugCorePlugin.getDefault().getPluginPreferences().setValue( ICDebugConstants.PREF_AUTO_DISASSEMBLY, fAutoDisassemblyButton.getSelection() ); CDebugCorePlugin.getDefault().getPluginPreferences().setValue( ICDebugConstants.PREF_MAX_NUMBER_OF_INSTRUCTIONS, getMaxNumberOfInstructionsText().getIntValue() ); CDebugCorePlugin.getDefault().getPluginPreferences().setValue( ICDebugConstants.PREF_DEFAULT_VARIABLE_FORMAT, getFormatId( fVariableFormatCombo.getSelectionIndex() ) ); @@ -376,6 +383,8 @@ public class CDebugPreferencePage extends PreferencePage implements IWorkbenchPr { IPreferenceStore store = getPreferenceStore(); fPathsButton.setSelection( store.getDefaultBoolean( ICDebugPreferenceConstants.PREF_SHOW_FULL_PATHS ) ); + fRefreshRegistersButton.setSelection( CDebugCorePlugin.getDefault().getPluginPreferences().getDefaultBoolean( ICDebugConstants.PREF_REGISTERS_AUTO_REFRESH ) ); + fRefreshSolibsButton.setSelection( CDebugCorePlugin.getDefault().getPluginPreferences().getDefaultBoolean( ICDebugConstants.PREF_SHARED_LIBRARIES_AUTO_REFRESH ) ); fAutoDisassemblyButton.setSelection( CDebugCorePlugin.getDefault().getPluginPreferences().getDefaultBoolean( ICDebugConstants.PREF_AUTO_DISASSEMBLY ) ); getMaxNumberOfInstructionsText().setStringValue( new Integer( CDebugCorePlugin.getDefault().getPluginPreferences().getDefaultInt( ICDebugConstants.PREF_MAX_NUMBER_OF_INSTRUCTIONS ) ).toString() ); fVariableFormatCombo.select( getFormatIndex( CDebugCorePlugin.getDefault().getPluginPreferences().getDefaultInt( ICDebugConstants.PREF_DEFAULT_VARIABLE_FORMAT ) ) ); diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/preferences/SharedLibrariesViewPreferencePage.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/preferences/SharedLibrariesViewPreferencePage.java deleted file mode 100644 index 798ba2a9fc8..00000000000 --- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/preferences/SharedLibrariesViewPreferencePage.java +++ /dev/null @@ -1,125 +0,0 @@ -/* - *(c) Copyright QNX Software Systems Ltd. 2002. - * All Rights Reserved. - * - */ -package org.eclipse.cdt.debug.internal.ui.preferences; - -import org.eclipse.cdt.debug.core.CDebugCorePlugin; -import org.eclipse.cdt.debug.core.ICDebugConstants; -import org.eclipse.cdt.debug.internal.ui.ICDebugHelpContextIds; -import org.eclipse.cdt.debug.ui.CDebugUIPlugin; -import org.eclipse.cdt.utils.ui.controls.ControlFactory; -import org.eclipse.jface.preference.FieldEditorPreferencePage; -import org.eclipse.jface.preference.IPreferenceStore; -import org.eclipse.swt.SWT; -import org.eclipse.swt.layout.GridData; -import org.eclipse.swt.layout.GridLayout; -import org.eclipse.swt.widgets.Button; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Label; -import org.eclipse.ui.IWorkbench; -import org.eclipse.ui.IWorkbenchPreferencePage; -import org.eclipse.ui.help.WorkbenchHelp; - -/** - * Enter type comment. - * - * @since: Feb 7, 2003 - */ -public class SharedLibrariesViewPreferencePage extends FieldEditorPreferencePage - implements IWorkbenchPreferencePage -{ - private Button fAutoRefreshField = null; - - /** - * Constructor for SharedLibrariesViewPreferencePage. - * @param style - */ - public SharedLibrariesViewPreferencePage() - { - super( GRID ); - setDescription( CDebugUIPlugin.getResourceString("internal.ui.preferences.SharedLibrariesViewPreferencePage.Shared_Libraries_View_Settings") ); //$NON-NLS-1$ - setPreferenceStore( CDebugUIPlugin.getDefault().getPreferenceStore() ); - } - - /* (non-Javadoc) - * @see org.eclipse.jface.preference.FieldEditorPreferencePage#createFieldEditors() - */ - protected void createFieldEditors() - { - fAutoRefreshField = ControlFactory.createCheckBox( getFieldEditorParent(), CDebugUIPlugin.getResourceString("internal.ui.preferences.SharedLibrariesViewPreferencePage.Auto-Refresh_by_default") ); //$NON-NLS-1$ - fAutoRefreshField.setSelection( CDebugCorePlugin.getDefault().getPluginPreferences().getBoolean( ICDebugConstants.PREF_SHARED_LIBRARIES_AUTO_REFRESH ) ); - } - - /* (non-Javadoc) - * @see org.eclipse.ui.IWorkbenchPreferencePage#init(org.eclipse.ui.IWorkbench) - */ - public void init( IWorkbench workbench ) - { - } - - /* (non-Javadoc) - * @see org.eclipse.jface.dialogs.IDialogPage#createControl(org.eclipse.swt.widgets.Composite) - */ - public void createControl(Composite parent) - { - super.createControl( parent ); - WorkbenchHelp.setHelp( parent, ICDebugHelpContextIds.SHARED_LIBRARIES_PREFERENCE_PAGE ); - } - - public static void initDefaults( IPreferenceStore store ) - { - CDebugCorePlugin.getDefault().getPluginPreferences().setDefault( ICDebugConstants.PREF_SHARED_LIBRARIES_AUTO_REFRESH, false ); - } - - protected void createSpacer( Composite composite, int columnSpan ) - { - Label label = new Label( composite, SWT.NONE ); - GridData gd = new GridData(); - gd.horizontalSpan = columnSpan; - label.setLayoutData( gd ); - } - - /* (non-Javadoc) - * @see org.eclipse.jface.preference.IPreferencePage#performOk() - */ - public boolean performOk() - { - boolean ok = super.performOk(); - storeValues(); - CDebugUIPlugin.getDefault().savePluginPreferences(); - CDebugCorePlugin.getDefault().savePluginPreferences(); - return ok; - } - - /* (non-Javadoc) - * @see org.eclipse.jface.preference.PreferencePage#performDefaults() - */ - protected void performDefaults() - { - setDefaultValues(); - super.performDefaults(); - } - - private void setDefaultValues() - { - fAutoRefreshField.setSelection( CDebugCorePlugin.getDefault().getPluginPreferences().getDefaultBoolean( ICDebugConstants.PREF_SHARED_LIBRARIES_AUTO_REFRESH ) ); - } - - private void storeValues() - { - CDebugCorePlugin.getDefault().getPluginPreferences().setValue( ICDebugConstants.PREF_SHARED_LIBRARIES_AUTO_REFRESH, fAutoRefreshField.getSelection() ); - } - - /* (non-Javadoc) - * @see org.eclipse.jface.preference.FieldEditorPreferencePage#adjustGridLayout() - */ - protected void adjustGridLayout() - { - super.adjustGridLayout(); - // If there are no editor fields on this page set the number of columns to prevent stack overflow - if ( ((GridLayout)getFieldEditorParent().getLayout()).numColumns == 0 ) - ((GridLayout)getFieldEditorParent().getLayout()).numColumns = 2; - } -} diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/ui/CDebugUIPlugin.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/ui/CDebugUIPlugin.java index 70aaa4a53cd..eb1437fd747 100644 --- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/ui/CDebugUIPlugin.java +++ b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/ui/CDebugUIPlugin.java @@ -18,7 +18,6 @@ import org.eclipse.cdt.debug.internal.ui.editors.DisassemblyDocumentProvider; import org.eclipse.cdt.debug.internal.ui.editors.DisassemblyEditorInput; import org.eclipse.cdt.debug.internal.ui.preferences.CDebugPreferencePage; import org.eclipse.cdt.debug.internal.ui.preferences.MemoryViewPreferencePage; -import org.eclipse.cdt.debug.internal.ui.preferences.SharedLibrariesViewPreferencePage; import org.eclipse.cdt.debug.ui.sourcelookup.DefaultSourceLocator; import org.eclipse.core.resources.IStorage; import org.eclipse.core.resources.IWorkspace; @@ -177,7 +176,6 @@ public class CDebugUIPlugin extends AbstractUIPlugin protected void initializeDefaultPreferences( IPreferenceStore pstore ) { MemoryViewPreferencePage.initDefaults( pstore ); - SharedLibrariesViewPreferencePage.initDefaults( pstore ); CDebugPreferencePage.initDefaults( pstore ); } diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/ui/CDebugUIPluginResources.properties b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/ui/CDebugUIPluginResources.properties index 77971d0cf33..1846b046a9f 100644 --- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/ui/CDebugUIPluginResources.properties +++ b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/ui/CDebugUIPluginResources.properties @@ -118,9 +118,6 @@ internal.ui.editors.DisassemblyEditorInput.Disassembly=Disassembly internal.ui.preferences.SharedLibrariesViewPreferencePage.Shared_Libraries_View_Settings=Shared Libraries View Settings. internal.ui.preferences.SharedLibrariesViewPreferencePage.Auto-Refresh_by_default=Auto-Refresh by default -internal.ui.preferences.RegistersViewPreferencePage.Registers_View_Settings=Registers View Settings. -internal.ui.preferences.RegistersViewPreferencePage.Changed_register_value_color=&Changed register value color: -internal.ui.preferences.RegistersViewPreferencePage.Auto-Refresh_by_default=Auto-Refresh by default internal.ui.preferences.CDebugPreferencePage.Natural=Natural internal.ui.preferences.CDebugPreferencePage.Hexadecimal=Hexadecimal @@ -138,6 +135,8 @@ internal.ui.preferences.CDebugPreferencePage.ErrorMaxNumberOfInstructionsRange=T internal.ui.preferences.SourcePreferencePage.Description=Common source lookup settings. internal.ui.preferences.SourcePreferencePage.Source_locations=Source Locations internal.ui.preferences.SourcePreferencePage.Search_for_duplicate_source_files=Search for duplicate source files +internal.ui.preferences.CDebugPreferencePage.autoRefreshRegistersButton=Automatically refresh registers +internal.ui.preferences.CDebugPreferencePage.autoRefreshSolibsButton=Automatically refresh shared libraries internal.ui.preferences.MemoryViewPreferencePage.Description=Memory View Settings. internal.ui.preferences.MemoryViewPreferencePage.Text_Color=Text Color: internal.ui.preferences.MemoryViewPreferencePage.Background_Color=Background Color: