From efdb2353220a61202f628b31f657030eacf97cac Mon Sep 17 00:00:00 2001 From: Anton Leherbauer Date: Tue, 27 Jan 2009 08:06:12 +0000 Subject: [PATCH] Bug 258407 - [scalability] Disable the reconciler in scalability mode by default --- .../ui/editor/CContentOutlinePage.java | 18 ++++++++++++++---- .../internal/ui/editor/CEditorMessages.java | 1 + .../ui/editor/CEditorMessages.properties | 6 ++++-- .../eclipse/cdt/ui/PreferenceConstants.java | 2 +- 4 files changed, 20 insertions(+), 7 deletions(-) diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/CContentOutlinePage.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/CContentOutlinePage.java index 3f1cd591d95..ecc80efd546 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/CContentOutlinePage.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/CContentOutlinePage.java @@ -15,11 +15,14 @@ package org.eclipse.cdt.internal.ui.editor; import org.eclipse.swt.SWT; import org.eclipse.swt.custom.StackLayout; +import org.eclipse.swt.events.SelectionAdapter; +import org.eclipse.swt.events.SelectionEvent; import org.eclipse.swt.layout.FillLayout; import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.Control; -import org.eclipse.swt.widgets.Label; +import org.eclipse.swt.widgets.Link; import org.eclipse.ui.actions.ActionGroup; +import org.eclipse.ui.dialogs.PreferencesUtil; import org.eclipse.cdt.core.model.ITranslationUnit; import org.eclipse.cdt.ui.PreferenceConstants; @@ -72,9 +75,16 @@ public class CContentOutlinePage extends AbstractCModelOutlinePage { } private Control createStatusPage(Composite parent) { - Label label = new Label(parent, SWT.NONE); - label.setText(CEditorMessages.Scalability_outlineDisabled); - return label; + final Link link= new Link(parent, SWT.NONE); + link.setText(CEditorMessages.Scalability_outlineDisabled); + link.setToolTipText(CEditorMessages.Scalability_linkToolTip); + link.addSelectionListener(new SelectionAdapter() { + @Override + public void widgetSelected(SelectionEvent e) { + PreferencesUtil.createPreferenceDialogOn(link.getShell(), "org.eclipse.cdt.ui.preferences.CScalabilityPreferences", null, null).open(); //$NON-NLS-1$ + } + }); + return link; } @Override diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/CEditorMessages.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/CEditorMessages.java index 7ac0a907116..19fbfdbc248 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/CEditorMessages.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/CEditorMessages.java @@ -48,6 +48,7 @@ public final class CEditorMessages extends NLS { public static String GotoMatchingBracket_error_bracketOutsideSelectedElement; public static String Scalability_message; public static String Scalability_info; + public static String Scalability_linkToolTip; public static String Scalability_reappear; public static String Scalability_outlineDisabled; public static String ToggleComment_error_title; diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/CEditorMessages.properties b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/CEditorMessages.properties index bdb94914d8b..ae7ff2ae56a 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/CEditorMessages.properties +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/CEditorMessages.properties @@ -45,10 +45,12 @@ GotoMatchingBracket_error_invalidSelection=No bracket selected GotoMatchingBracket_error_noMatchingBracket=No matching bracket found GotoMatchingBracket_error_bracketOutsideSelectedElement=Bracket is outside selected element -Scalability_message=You are opening a large file. Turning on scalability mode might help improve editor's performance. Please see the Scalability preference page under Preferences > C/C++ > Editor. +Scalability_message=You are opening a large file. Scalability mode has been turned on for this editor to help improve performance. Please see the Scalability preference page under Preferences > C/C++ > Editor. Scalability_info=Editor Scalability +Scalability_linkToolTip=Open the Scalability preference page Scalability_reappear=Do not show this message again. -Scalability_outlineDisabled=Outline is disabled due to scalability mode. +# do not translate the href argument (org.eclipse.cdt.ui.preferences.CScalabilityPreferences) +Scalability_outlineDisabled=Outline is disabled due to scalability mode (options). ToggleComment_error_title=Comment/Uncomment ToggleComment_error_message=An error occurred while commenting/uncommenting. 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 df3c6758699..f913c500c3f 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 @@ -1597,7 +1597,7 @@ public class PreferenceConstants { store.setDefault(PreferenceConstants.SCALABILITY_ALERT, true); store.setDefault(PreferenceConstants.SCALABILITY_NUMBER_OF_LINES, 5000); store.setDefault(PreferenceConstants.SCALABILITY_ENABLE_ALL, false); - store.setDefault(PreferenceConstants.SCALABILITY_RECONCILER, false); + store.setDefault(PreferenceConstants.SCALABILITY_RECONCILER, true); store.setDefault(PreferenceConstants.SCALABILITY_SYNTAX_COLOR, false); store.setDefault(PreferenceConstants.SCALABILITY_SEMANTIC_HIGHLIGHT, false); store.setDefault(PreferenceConstants.SCALABILITY_PARSER_BASED_CONTENT_ASSIST, false);