diff --git a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/CCorePlugin.java b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/CCorePlugin.java index 423eeb5d3a5..19a01e3d60a 100644 --- a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/CCorePlugin.java +++ b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/CCorePlugin.java @@ -9,6 +9,7 @@ * IBM Corporation - initial API and implementation * Markus Schorn (Wind River Systems) * Andrew Ferguson (Symbian) + * Anton Leherbauer (Wind River Systems) *******************************************************************************/ package org.eclipse.cdt.core; @@ -91,7 +92,6 @@ public class CCorePlugin extends Plugin { public final static String DEFAULT_BINARY_PARSER_SIMPLE_ID = "ELF"; //$NON-NLS-1$ public final static String DEFAULT_BINARY_PARSER_UNIQ_ID = PLUGIN_ID + "." + DEFAULT_BINARY_PARSER_SIMPLE_ID; //$NON-NLS-1$ public final static String PREF_USE_STRUCTURAL_PARSE_MODE = "useStructualParseMode"; //$NON-NLS-1$ - public final static String PREF_USE_NEW_MODEL_BUILDER = "useNewModelBuilder"; //$NON-NLS-1$ public static final String INDEX_SIMPLE_ID = "CIndex"; //$NON-NLS-1$ public static final String INDEX_UNIQ_ID = PLUGIN_ID + "." + INDEX_SIMPLE_ID; //$NON-NLS-1$ @@ -361,8 +361,6 @@ public class CCorePlugin extends Plugin { // Set the default for using the structual parse mode to build the CModel getPluginPreferences().setDefault(PREF_USE_STRUCTURAL_PARSE_MODE, false); - // Set the default for using the new model builder to build the CModel - getPluginPreferences().setDefault(PREF_USE_NEW_MODEL_BUILDER, true); PositionTrackerManager.getInstance().install(); } diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/CPluginResources.properties b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/CPluginResources.properties index 92bea65ab41..ef1f7e06ee7 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/CPluginResources.properties +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/CPluginResources.properties @@ -9,6 +9,7 @@ # IBM Corporation - initial API and implementation # QNX Software System # Markus Schorn (Wind River Systems) +# Anton Leherbauer (Wind River Systems) ############################################################################### # ------- CView ----------------- @@ -28,16 +29,6 @@ ConsolePreferencePage.outputColor.label=Output text color ConsolePreferencePage.infoColor.label=Information message text color ConsolePreferencePage.errorColor.label=Error message text color -CBasePreferencePage.linkToEditor.label=Link view selection to active editor -CBasePreferencePage.CUChildren.label=Show file members in Project View -CBasePreferencePage.OutlineView.structuralParseMode.label=Follow #include's when parsing working copies. - -CBasePreferencePage.editorFont.label=C Editor font: - -CBasePreferencePage.bracketHighlightBox.label=Highlight matching brackets with box -CBasePreferencePage.bracketHighlightClr.label=Highlight matching brackets with color -CBasePreferencePage.bracketColour.label=Bracket highlighting color - # ------- Project/Prefernces/Wizards COnfiguration blocks ------- ErrorParserBlock.label=Error Parsers @@ -181,103 +172,6 @@ CElementProperties.elf_needed=needed CMergeViewer.title=C Compare Viewer CStructureCreator.name=C Compare -# ------- Editor ------------ - -Editor.Undo.label=Undo@Ctrl+Z -Editor.Undo.tooltip=Undo -Editor.Undo.image= -Editor.Undo.description=Undo - -Editor.Redo.label=Redo@Ctrl+Y -Editor.Redo.tooltip=Redo -Editor.Redo.image= -Editor.Redo.description=Redo - -Editor.Cut.label=Cut@Ctrl+X -Editor.Cut.tooltip=Cut -Editor.Cut.image= -Editor.Cut.description=Cut - -Editor.Copy.label=&Copy@Ctrl+C -Editor.Copy.tooltip=Copy -Editor.Copy.image= -Editor.Copy.description=Copy - -Editor.Paste.label=Paste@Ctrl+V -Editor.Paste.tooltip=Paste -Editor.Paste.image= -Editor.Paste.description=Paste - -Editor.Delete.label=Delete@Delete -Editor.Delete.tooltip=Delete -Editor.Delete.image= -Editor.Delete.description=Delete - -Editor.SelectAll.label=Select &All@Ctrl+A -Editor.SelectAll.tooltip=Select All -Editor.SelectAll.image= -Editor.SelectAll.description=Select All - -Editor.ShiftRight.label=Sh&ift Right@Ctrl+I -Editor.ShiftRight.tooltip=Shift Right -Editor.ShiftRight.image= -Editor.ShiftRight.description=Shift the selected text to the right - -Editor.ShiftLeft.label=S&hift Left@Ctrl+Shift+I -Editor.ShiftLeft.tooltip=Shift Left -Editor.ShiftLeft.image= -Editor.ShiftLeft.description=Shift the selected text to the left - -Editor.FindReplace.label=Find/Replace...@Ctrl+F -Editor.FindReplace.tooltip=Find/Replace -Editor.FindReplace.image= -Editor.FindReplace.description=Find/Replace - -Editor.AddBookmark.label=Boo&kmark... -Editor.AddBookmark.tooltip=Bookmark -Editor.AddBookmark.image= -Editor.AddBookmark.description=Add Bookmark -Editor.AddBookmark.dialog.title=Add Bookmark -Editor.AddBookmark.dialog.message=Enter Bookmark name - -Editor.AddTask.label=&Task... -Editor.AddTask.tooltip=Task -Editor.AddTask.image= -Editor.AddTask.description=Add Task - -Editor.Save.label=Save@Ctrl+S -Editor.Save.tooltip=Save -Editor.Save.image= -Editor.Save.description=Save - -Editor.Revert.label=Re&vert -Editor.Revert.tooltip=Revert -Editor.Revert.image= -Editor.Revert.description=Revert - -Editor.GotoLine.label=&Go to Line...@Ctrl+L -Editor.GotoLine.tooltip=Go to a Line -Editor.GotoLine.image= -Editor.GotoLine.description=Go to a line -Editor.GotoLine.dialog.title=Go to Line -Editor.GotoLine.dialog.message=Enter line number: -Editor.GotoLine.dialog.invalid_input=Invalid line number -Editor.GotoLine.dialog.invalid_range=Line number out of range - -Editor.NextError.label= Go To Next Error -Editor.PreviousError.label=Go To Previous Error -Editor.NextError.tooltip= Jump to next error marker -Editor.PreviousError.tooltip=Jump to previous error marker - - -Editor.error.no_provider=Text editor does not have a document provider -Editor.error.save.title=Save Problems -Editor.error.save.message=Internal error: -Editor.error.revert.title=Problems While Reverting to Saved State -Editor.error.revert.message=Internal error: -Editor.error.no_input=Unable to read text editor input -Editor.error.invalid_input=Invalid text editor input - # ------- OpenIncludeDeclarationAction------------ OpenIncludeAction.label=&Open 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 21e4dc5b452..80c630372e2 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 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000 2005 IBM Corporation and others. + * Copyright (c) 2000, 2007 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 @@ -8,29 +8,37 @@ * Contributors: * IBM Corporation - initial API and implementation * QNX Software System + * Anton Leherbauer (Wind River Systems) *******************************************************************************/ package org.eclipse.cdt.internal.ui.preferences; -import org.eclipse.cdt.core.CCorePlugin; -import org.eclipse.cdt.internal.ui.ICHelpContextIds; -import org.eclipse.cdt.ui.CUIPlugin; -import org.eclipse.cdt.ui.PreferenceConstants; import org.eclipse.jface.preference.BooleanFieldEditor; import org.eclipse.jface.preference.FieldEditorPreferencePage; import org.eclipse.jface.preference.IPreferenceStore; +import org.eclipse.jface.resource.JFaceResources; +import org.eclipse.swt.SWT; +import org.eclipse.swt.layout.GridData; 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.PlatformUI; +import org.eclipse.cdt.core.CCorePlugin; +import org.eclipse.cdt.ui.CUIPlugin; +import org.eclipse.cdt.ui.PreferenceConstants; + +import org.eclipse.cdt.internal.ui.ICHelpContextIds; +import org.eclipse.cdt.internal.ui.util.PixelConverter; + /** * The page for setting c plugin preferences. */ public class CPluginPreferencePage extends FieldEditorPreferencePage implements IWorkbenchPreferencePage { - private static final String LINK_TO_EDITOR_LABEL= "CBasePreferencePage.linkToEditor.label"; //$NON-NLS-1$ - private static final String USE_STRUCTURAL_PARSE_MODE_LABEL= "CBasePreferencePage.OutlineView.structuralParseMode.label"; //$NON-NLS-1$ + 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() { super(GRID); @@ -48,14 +56,31 @@ public class CPluginPreferencePage extends FieldEditorPreferencePage implements protected void createFieldEditors() { Composite parent= getFieldEditorParent(); - BooleanFieldEditor linkEditor= new BooleanFieldEditor(PreferenceConstants.PREF_LINK_TO_EDITOR, CUIPlugin.getResourceString(LINK_TO_EDITOR_LABEL), parent); + BooleanFieldEditor linkEditor= new BooleanFieldEditor(PreferenceConstants.PREF_LINK_TO_EDITOR, LINK_TO_EDITOR_LABEL, parent); addField(linkEditor); + // blank space + addFiller(parent); - BooleanFieldEditor useStructuralParseMode= new BooleanFieldEditor(PreferenceConstants.PREF_USE_STRUCTURAL_PARSE_MODE, CUIPlugin.getResourceString(USE_STRUCTURAL_PARSE_MODE_LABEL), parent); - addField(useStructuralParseMode); + BooleanFieldEditor useStructuralParseMode= new BooleanFieldEditor(PreferenceConstants.PREF_USE_STRUCTURAL_PARSE_MODE, USE_STRUCTURAL_PARSE_MODE_LABEL, parent); + addField(useStructuralParseMode); + + 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; + noteControl.setLayoutData(gd); } + protected void addFiller(Composite composite) { + PixelConverter pixelConverter= new PixelConverter(composite); + Label filler= new Label(composite, SWT.LEFT ); + GridData gd= new GridData(GridData.HORIZONTAL_ALIGN_FILL); + gd.horizontalSpan= 2; + gd.heightHint= pixelConverter.convertHeightInCharsToPixels(1) / 2; + filler.setLayoutData(gd); + } public static boolean isLinkToEditor() { return CUIPlugin.getDefault().getPreferenceStore().getBoolean(PreferenceConstants.PREF_LINK_TO_EDITOR); @@ -83,7 +108,7 @@ public class CPluginPreferencePage extends FieldEditorPreferencePage implements 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, CCorePlugin.getDefault().useStructuralParseMode()); + prefs.setDefault(PreferenceConstants.PREF_USE_STRUCTURAL_PARSE_MODE, false); prefs.setDefault(PreferenceConstants.EDITOR_SHOW_SEGMENTS, false); } 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 a85ffb1ab96..63d2c8b00df 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 @@ -214,6 +214,11 @@ public final class PreferencesMessages extends NLS { public static String FileLanguagesPropertyPage_inheritedFromProject; public static String FileLanguagesPropertyPage_inheritedFromWorkspace; public static String FileLanguagesPropertyPage_description; + + public static String CPluginPreferencePage_linkToEditor_label; + public static String CPluginPreferencePage_structuralParseMode_label; + public static String CPluginPreferencePage_note; + public static String CPluginPreferencePage_performanceHint; static { NLS.initializeMessages(BUNDLE_NAME, PreferencesMessages.class); 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 10c8a5246d1..a3b05897229 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 @@ -251,3 +251,9 @@ FileLanguagesPropertyPage_inheritedFromWorkspace = Inherited from the workspace # Others ProposalFilterPreferencesUtil_defaultFilterName= + +# C/C++ Preferences +CPluginPreferencePage_linkToEditor_label= Link view selection to active editor +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.