From b61e9f2170ae4895bed34626d3d3428b3dc5621c Mon Sep 17 00:00:00 2001 From: Anton Leherbauer Date: Mon, 14 May 2007 10:36:16 +0000 Subject: [PATCH] Fix for 186115: Remove Link with Editor preference option --- .../ui/preferences/CPluginPreferencePage.java | 22 ++++++++----------- .../ui/preferences/PreferencesMessages.java | 2 +- .../PreferencesMessages.properties | 2 +- .../eclipse/cdt/ui/PreferenceConstants.java | 2 ++ 4 files changed, 13 insertions(+), 15 deletions(-) diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/CPluginPreferencePage.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/CPluginPreferencePage.java index 80c630372e2..584a5ab6e49 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/CPluginPreferencePage.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/CPluginPreferencePage.java @@ -32,12 +32,10 @@ import org.eclipse.cdt.internal.ui.ICHelpContextIds; import org.eclipse.cdt.internal.ui.util.PixelConverter; /** - * The page for setting c plugin preferences. + * The page for general C/C++ preferences. */ public class CPluginPreferencePage extends FieldEditorPreferencePage implements IWorkbenchPreferencePage { - - private static final String LINK_TO_EDITOR_LABEL= PreferencesMessages.CPluginPreferencePage_linkToEditor_label; private static final String USE_STRUCTURAL_PARSE_MODE_LABEL= PreferencesMessages.CPluginPreferencePage_structuralParseMode_label; public CPluginPreferencePage() { @@ -56,10 +54,12 @@ public class CPluginPreferencePage extends FieldEditorPreferencePage implements protected void createFieldEditors() { Composite parent= getFieldEditorParent(); - BooleanFieldEditor linkEditor= new BooleanFieldEditor(PreferenceConstants.PREF_LINK_TO_EDITOR, LINK_TO_EDITOR_LABEL, parent); - addField(linkEditor); + Label caption= new Label(parent, SWT.NULL); + caption.setText(PreferencesMessages.CPluginPreferencePage_caption); + GridData gd= new GridData(GridData.HORIZONTAL_ALIGN_FILL); + gd.horizontalSpan= 1; + caption.setLayoutData(gd); - // blank space addFiller(parent); BooleanFieldEditor useStructuralParseMode= new BooleanFieldEditor(PreferenceConstants.PREF_USE_STRUCTURAL_PARSE_MODE, USE_STRUCTURAL_PARSE_MODE_LABEL, parent); @@ -68,8 +68,8 @@ public class CPluginPreferencePage extends FieldEditorPreferencePage implements String noteTitle= PreferencesMessages.CPluginPreferencePage_note; String noteMessage= PreferencesMessages.CPluginPreferencePage_performanceHint; Composite noteControl= createNoteComposite(JFaceResources.getDialogFont(), parent, noteTitle, noteMessage); - GridData gd= new GridData(GridData.HORIZONTAL_ALIGN_FILL); - gd.horizontalSpan= 2; + gd= new GridData(GridData.HORIZONTAL_ALIGN_FILL); + gd.horizontalSpan= 1; noteControl.setLayoutData(gd); } @@ -77,7 +77,7 @@ public class CPluginPreferencePage extends FieldEditorPreferencePage implements PixelConverter pixelConverter= new PixelConverter(composite); Label filler= new Label(composite, SWT.LEFT ); GridData gd= new GridData(GridData.HORIZONTAL_ALIGN_FILL); - gd.horizontalSpan= 2; + gd.horizontalSpan= 1; gd.heightHint= pixelConverter.convertHeightInCharsToPixels(1) / 2; filler.setLayoutData(gd); } @@ -98,7 +98,6 @@ public class CPluginPreferencePage extends FieldEditorPreferencePage implements * @see IWorkbenchPreferencePage#init */ public void init(IWorkbench workbench) { - CUIPlugin.getDefault().getPreferenceStore().setValue(CCorePlugin.PREF_USE_STRUCTURAL_PARSE_MODE, CCorePlugin.getDefault().useStructuralParseMode()); } /** @@ -106,10 +105,7 @@ public class CPluginPreferencePage extends FieldEditorPreferencePage implements */ public static void initDefaults(IPreferenceStore prefs) { prefs.setDefault(PreferenceConstants.PREF_LINK_TO_EDITOR, false); - // The field is under Appearance page/preference - prefs.setDefault(PreferenceConstants.PREF_SHOW_CU_CHILDREN, true); prefs.setDefault(PreferenceConstants.PREF_USE_STRUCTURAL_PARSE_MODE, false); - prefs.setDefault(PreferenceConstants.EDITOR_SHOW_SEGMENTS, false); } /* (non-Javadoc) diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/PreferencesMessages.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/PreferencesMessages.java index db930b2f09e..b1aa53e5f4b 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/PreferencesMessages.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/PreferencesMessages.java @@ -221,7 +221,7 @@ public final class PreferencesMessages extends NLS { public static String FileLanguagesPropertyPage_configurationColumn; public static String FileLanguagesPropertyPage_defaultMapping; - public static String CPluginPreferencePage_linkToEditor_label; + public static String CPluginPreferencePage_caption; public static String CPluginPreferencePage_structuralParseMode_label; public static String CPluginPreferencePage_note; public static String CPluginPreferencePage_performanceHint; diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/PreferencesMessages.properties b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/PreferencesMessages.properties index 32dd9198141..9fa8e6b8e44 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/PreferencesMessages.properties +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/PreferencesMessages.properties @@ -259,7 +259,7 @@ FileLanguagesPropertyPage_defaultMapping = (Default) ProposalFilterPreferencesUtil_defaultFilterName= # C/C++ Preferences -CPluginPreferencePage_linkToEditor_label= Link view selection to active editor +CPluginPreferencePage_caption= General settings for C/C++ Development: CPluginPreferencePage_structuralParseMode_label= Follow unindexed header files when producing the outline view CPluginPreferencePage_note= Note: CPluginPreferencePage_performanceHint= Enabling this preference may have negative impact on performance. diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/PreferenceConstants.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/PreferenceConstants.java index 582e0017d98..5bc44f820d8 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/PreferenceConstants.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/PreferenceConstants.java @@ -923,6 +923,8 @@ public class PreferenceConstants { public static void initializeDefaultValues(IPreferenceStore store) { store.setDefault(PreferenceConstants.EDITOR_CORRECTION_INDICATION, false); + store.setDefault(PreferenceConstants.EDITOR_SHOW_SEGMENTS, false); + store.setDefault(PreferenceConstants.PREF_SHOW_CU_CHILDREN, true); // Turned off by default since there are too many false reports right now store.setDefault(PreferenceConstants.EDITOR_EVALUATE_TEMPORARY_PROBLEMS, false);