mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-29 19:45:01 +02:00
Bug 228653: [scalability mode] additional options
This commit is contained in:
parent
f3ee65691f
commit
457ccce1be
8 changed files with 121 additions and 69 deletions
|
@ -763,9 +763,9 @@
|
||||||
id="org.eclipse.cdt.ui.preferences.MarkOccurrencesPreferencePage"/>
|
id="org.eclipse.cdt.ui.preferences.MarkOccurrencesPreferencePage"/>
|
||||||
<page
|
<page
|
||||||
name="%ScalabilityPreferencePage.name"
|
name="%ScalabilityPreferencePage.name"
|
||||||
category="org.eclipse.cdt.ui.preferences.CPluginPreferencePage"
|
category="org.eclipse.cdt.ui.preferences.CEditorPreferencePage"
|
||||||
class="org.eclipse.cdt.internal.ui.preferences.ScalabilityPreferencePage"
|
class="org.eclipse.cdt.internal.ui.preferences.ScalabilityPreferencePage"
|
||||||
id="org.eclipse.cdt.ui.preferneces.CScalabilityPreferernces"/>
|
id="org.eclipse.cdt.ui.preferences.CScalabilityPreferences"/>
|
||||||
<!--page
|
<!--page
|
||||||
name="%WorkInProgress.name"
|
name="%WorkInProgress.name"
|
||||||
category="org.eclipse.cdt.ui.preferences.CPluginPreferencePage"
|
category="org.eclipse.cdt.ui.preferences.CPluginPreferencePage"
|
||||||
|
|
|
@ -95,7 +95,6 @@ import org.eclipse.jface.text.source.IOverviewRuler;
|
||||||
import org.eclipse.jface.text.source.ISourceViewer;
|
import org.eclipse.jface.text.source.ISourceViewer;
|
||||||
import org.eclipse.jface.text.source.ISourceViewerExtension2;
|
import org.eclipse.jface.text.source.ISourceViewerExtension2;
|
||||||
import org.eclipse.jface.text.source.IVerticalRuler;
|
import org.eclipse.jface.text.source.IVerticalRuler;
|
||||||
import org.eclipse.jface.text.source.SourceViewer;
|
|
||||||
import org.eclipse.jface.text.source.SourceViewerConfiguration;
|
import org.eclipse.jface.text.source.SourceViewerConfiguration;
|
||||||
import org.eclipse.jface.text.source.projection.ProjectionAnnotationModel;
|
import org.eclipse.jface.text.source.projection.ProjectionAnnotationModel;
|
||||||
import org.eclipse.jface.text.source.projection.ProjectionSupport;
|
import org.eclipse.jface.text.source.projection.ProjectionSupport;
|
||||||
|
@ -1346,22 +1345,22 @@ public class CEditor extends TextEditor implements ISelectionChangedListener, IC
|
||||||
//Alert users that scalability mode should be turned on
|
//Alert users that scalability mode should be turned on
|
||||||
if (getPreferenceStore().getBoolean(PreferenceConstants.SCALABILITY_ALERT)) {
|
if (getPreferenceStore().getBoolean(PreferenceConstants.SCALABILITY_ALERT)) {
|
||||||
MessageDialogWithToggle dialog = new MessageDialogWithToggle(
|
MessageDialogWithToggle dialog = new MessageDialogWithToggle(
|
||||||
Display.getCurrent().getActiveShell(),
|
Display.getCurrent().getActiveShell(),
|
||||||
CEditorMessages.getString("Scalability.info"), //$NON-NLS-1$
|
CEditorMessages.getString("Scalability.info"), //$NON-NLS-1$
|
||||||
null,
|
null,
|
||||||
CEditorMessages.getString("Scalability.message"), //$NON-NLS-1$
|
CEditorMessages.getString("Scalability.message"), //$NON-NLS-1$
|
||||||
MessageDialog.INFORMATION,
|
MessageDialog.INFORMATION,
|
||||||
new String[] {IDialogConstants.OK_LABEL}, 0,
|
new String[] {IDialogConstants.OK_LABEL}, 0,
|
||||||
CEditorMessages.getString("Scalability.reappear"), //$NON-NLS-1$
|
CEditorMessages.getString("Scalability.reappear"), //$NON-NLS-1$
|
||||||
false) {
|
false) {
|
||||||
@Override
|
@Override
|
||||||
protected void buttonPressed(int buttonId) {
|
protected void buttonPressed(int buttonId) {
|
||||||
PreferenceConstants.getPreferenceStore().setValue(PreferenceConstants.SCALABILITY_ALERT, !getToggleState());
|
PreferenceConstants.getPreferenceStore().setValue(PreferenceConstants.SCALABILITY_ALERT, !getToggleState());
|
||||||
super.buttonPressed(buttonId);
|
super.buttonPressed(buttonId);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
dialog.setBlockOnOpen(false);
|
dialog.setBlockOnOpen(false);
|
||||||
dialog.open();
|
dialog.open();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1584,7 +1583,8 @@ public class CEditor extends TextEditor implements ISelectionChangedListener, IC
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (SemanticHighlightings.affectsEnablement(getPreferenceStore(), event)) {
|
if (SemanticHighlightings.affectsEnablement(getPreferenceStore(), event)
|
||||||
|
|| (isEnableScalablilityMode() && PreferenceConstants.SCALABILITY_SEMANTIC_HIGHLIGHT.equals(property))) {
|
||||||
if (isSemanticHighlightingEnabled()) {
|
if (isSemanticHighlightingEnabled()) {
|
||||||
installSemanticHighlighting();
|
installSemanticHighlighting();
|
||||||
fSemanticManager.refresh();
|
fSemanticManager.refresh();
|
||||||
|
@ -1593,22 +1593,20 @@ public class CEditor extends TextEditor implements ISelectionChangedListener, IC
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//For Scalability
|
||||||
|
if (isEnableScalablilityMode()) {
|
||||||
|
if (PreferenceConstants.SCALABILITY_RECONCILER.equals(property) ||
|
||||||
|
PreferenceConstants.SCALABILITY_SYNTAX_COLOR.equals(property)) {
|
||||||
|
asv.unconfigure();
|
||||||
|
asv.configure(getSourceViewerConfiguration());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
IContentAssistant c = asv.getContentAssistant();
|
IContentAssistant c = asv.getContentAssistant();
|
||||||
if (c instanceof ContentAssistant) {
|
if (c instanceof ContentAssistant) {
|
||||||
ContentAssistPreference.changeConfiguration((ContentAssistant) c, getPreferenceStore(), event);
|
ContentAssistPreference.changeConfiguration((ContentAssistant) c, getPreferenceStore(), event);
|
||||||
}
|
}
|
||||||
|
|
||||||
//For Scalability
|
|
||||||
if (PreferenceConstants.SCALABILITY_RECONCILER.equals(property)) {
|
|
||||||
((SourceViewer)getSourceViewer()).unconfigure();
|
|
||||||
getSourceViewer().configure(getSourceViewerConfiguration());
|
|
||||||
}
|
|
||||||
|
|
||||||
if (PreferenceConstants.SCALABILITY_SYNTAX_COLOR.equals(property)) {
|
|
||||||
((SourceViewer)getSourceViewer()).unconfigure();
|
|
||||||
getSourceViewer().configure(getSourceViewerConfiguration());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
} finally {
|
} finally {
|
||||||
super.handlePreferenceStoreChanged(event);
|
super.handlePreferenceStoreChanged(event);
|
||||||
|
@ -2819,7 +2817,7 @@ public class CEditor extends TextEditor implements ISelectionChangedListener, IC
|
||||||
protected String[] collectContextMenuPreferencePages() {
|
protected String[] collectContextMenuPreferencePages() {
|
||||||
// Add C/C++ Editor relevant pages
|
// Add C/C++ Editor relevant pages
|
||||||
String[] parentPrefPageIds = super.collectContextMenuPreferencePages();
|
String[] parentPrefPageIds = super.collectContextMenuPreferencePages();
|
||||||
String[] prefPageIds = new String[parentPrefPageIds.length + 10];
|
String[] prefPageIds = new String[parentPrefPageIds.length + 11];
|
||||||
int nIds = 0;
|
int nIds = 0;
|
||||||
prefPageIds[nIds++] = "org.eclipse.cdt.ui.preferences.CEditorPreferencePage"; //$NON-NLS-1$
|
prefPageIds[nIds++] = "org.eclipse.cdt.ui.preferences.CEditorPreferencePage"; //$NON-NLS-1$
|
||||||
prefPageIds[nIds++] = "org.eclipse.cdt.ui.preferences.CodeAssistPreferencePage"; //$NON-NLS-1$
|
prefPageIds[nIds++] = "org.eclipse.cdt.ui.preferences.CodeAssistPreferencePage"; //$NON-NLS-1$
|
||||||
|
@ -2831,6 +2829,7 @@ public class CEditor extends TextEditor implements ISelectionChangedListener, IC
|
||||||
prefPageIds[nIds++] = "org.eclipse.cdt.ui.preferences.TemplatePreferencePage"; //$NON-NLS-1$
|
prefPageIds[nIds++] = "org.eclipse.cdt.ui.preferences.TemplatePreferencePage"; //$NON-NLS-1$
|
||||||
prefPageIds[nIds++] = "org.eclipse.cdt.ui.preferences.SmartTypingPreferencePage"; //$NON-NLS-1$
|
prefPageIds[nIds++] = "org.eclipse.cdt.ui.preferences.SmartTypingPreferencePage"; //$NON-NLS-1$
|
||||||
prefPageIds[nIds++] = "org.eclipse.cdt.ui.preferences.CodeFormatterPreferencePage"; //$NON-NLS-1$
|
prefPageIds[nIds++] = "org.eclipse.cdt.ui.preferences.CodeFormatterPreferencePage"; //$NON-NLS-1$
|
||||||
|
prefPageIds[nIds++] = "org.eclipse.cdt.ui.preferences.CScalabilityPreferences"; //$NON-NLS-1$
|
||||||
System.arraycopy(parentPrefPageIds, 0, prefPageIds, nIds, parentPrefPageIds.length);
|
System.arraycopy(parentPrefPageIds, 0, prefPageIds, nIds, parentPrefPageIds.length);
|
||||||
return prefPageIds;
|
return prefPageIds;
|
||||||
}
|
}
|
||||||
|
@ -2898,7 +2897,7 @@ public class CEditor extends TextEditor implements ISelectionChangedListener, IC
|
||||||
* @since 4.0
|
* @since 4.0
|
||||||
*/
|
*/
|
||||||
private boolean isSemanticHighlightingEnabled() {
|
private boolean isSemanticHighlightingEnabled() {
|
||||||
return SemanticHighlightings.isEnabled(getPreferenceStore());
|
return SemanticHighlightings.isEnabled(getPreferenceStore()) && !(isEnableScalablilityMode() && getPreferenceStore().getBoolean(PreferenceConstants.SCALABILITY_SEMANTIC_HIGHLIGHT));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -3312,6 +3311,15 @@ public class CEditor extends TextEditor implements ISelectionChangedListener, IC
|
||||||
return getPreferenceStore().getBoolean(PreferenceConstants.SCALABILITY_PARSER_BASED_CONTENT_ASSIST);
|
return getPreferenceStore().getBoolean(PreferenceConstants.SCALABILITY_PARSER_BASED_CONTENT_ASSIST);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return <code>true</code> if Content Assist auto activation is disabled.
|
||||||
|
*
|
||||||
|
* @since 5.0
|
||||||
|
*/
|
||||||
|
public boolean isContentAssistAutoActivartionDisabled() {
|
||||||
|
return getPreferenceStore().getBoolean(PreferenceConstants.SCALABILITY_CONTENT_ASSIST_AUTO_ACTIVATION);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return <code>true</code> if the number of lines in the file exceed
|
* @return <code>true</code> if the number of lines in the file exceed
|
||||||
* the line number for scalability mode in the preference.
|
* the line number for scalability mode in the preference.
|
||||||
|
|
|
@ -20,7 +20,7 @@ AddIncludeOnSelection.label=Add Include
|
||||||
AddIncludeOnSelection.tooltip=Add Include Statement on Selection
|
AddIncludeOnSelection.tooltip=Add Include Statement on Selection
|
||||||
AddIncludesOperation.description=Adding include statement
|
AddIncludesOperation.description=Adding include statement
|
||||||
|
|
||||||
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++.
|
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.info=Editor Scalability
|
Scalability.info=Editor Scalability
|
||||||
Scalability.reappear=Do not show this message again.
|
Scalability.reappear=Do not show this message again.
|
||||||
ShowInCView.description=Show the current resource in the C/C++ Projects view
|
ShowInCView.description=Show the current resource in the C/C++ Projects view
|
||||||
|
|
|
@ -377,11 +377,12 @@ public final class PreferencesMessages extends NLS {
|
||||||
public static String ScalabilityPreferencePage_scalabilityMode_label;
|
public static String ScalabilityPreferencePage_scalabilityMode_label;
|
||||||
public static String ScalabilityPreferencePage_reconciler_label;
|
public static String ScalabilityPreferencePage_reconciler_label;
|
||||||
public static String ScalabilityPreferencePage_syntaxColor_label;
|
public static String ScalabilityPreferencePage_syntaxColor_label;
|
||||||
|
public static String ScalabilityPreferencePage_semanticHighlighting_label;
|
||||||
public static String ScalabilityPreferencePage_contentAssist_label;
|
public static String ScalabilityPreferencePage_contentAssist_label;
|
||||||
public static String ScalabilityPreferencePage_note;
|
public static String ScalabilityPreferencePage_note;
|
||||||
public static String ScalabilityPreferencePage_preferenceOnlyForNewViews;
|
public static String ScalabilityPreferencePage_preferenceOnlyForNewEditors;
|
||||||
|
public static String ScalabilityPreferencePage_contentAssist_autoActivation;
|
||||||
|
|
||||||
static {
|
static {
|
||||||
NLS.initializeMessages(BUNDLE_NAME, PreferencesMessages.class);
|
NLS.initializeMessages(BUNDLE_NAME, PreferencesMessages.class);
|
||||||
}
|
}
|
||||||
|
|
|
@ -433,10 +433,12 @@ ScalabilityPreferencePage_trigger_lines_label= Enable scalability mode options w
|
||||||
ScalabilityPreferencePage_error=Value must be an integer between {0} and {1}.
|
ScalabilityPreferencePage_error=Value must be an integer between {0} and {1}.
|
||||||
ScalabilityPreferencePage_scalabilityMode_group_label= Scalability mode settings
|
ScalabilityPreferencePage_scalabilityMode_group_label= Scalability mode settings
|
||||||
ScalabilityPreferencePage_scalabilityMode_label= Enable all scalability mode options
|
ScalabilityPreferencePage_scalabilityMode_label= Enable all scalability mode options
|
||||||
ScalabilityPreferencePage_reconciler_label= Disable editor reconciling (Outline view, semantic highlighting and editor folding will also be disabled)
|
ScalabilityPreferencePage_reconciler_label= Disable editor live parsing (Outline view, semantic highlighting and editor folding will also be disabled)
|
||||||
ScalabilityPreferencePage_syntaxColor_label= Disable syntax coloring in editor
|
ScalabilityPreferencePage_syntaxColor_label= Disable syntax coloring in editor
|
||||||
|
ScalabilityPreferencePage_semanticHighlighting_label= Disable semantic highlighting in editor
|
||||||
ScalabilityPreferencePage_contentAssist_label= Disable parsing-based content assist proposals
|
ScalabilityPreferencePage_contentAssist_label= Disable parsing-based content assist proposals
|
||||||
|
ScalabilityPreferencePage_contentAssist_autoActivation= Disable content assist auto-activation
|
||||||
ScalabilityPreferencePage_note=Note:
|
ScalabilityPreferencePage_note=Note:
|
||||||
ScalabilityPreferencePage_preferenceOnlyForNewViews=Some options do not affect opened views
|
ScalabilityPreferencePage_preferenceOnlyForNewEditors=Some options do not affect open editors
|
||||||
ScalabilityPreferencePage_error=Value must be an integer between {0} and {1}.
|
ScalabilityPreferencePage_error=Value must be an integer between {0} and {1}.
|
||||||
|
|
||||||
|
|
|
@ -59,8 +59,12 @@ public class ScalabilityPreferencePage extends PreferencePage implements
|
||||||
|
|
||||||
private Button fSyntaxColor;
|
private Button fSyntaxColor;
|
||||||
|
|
||||||
|
private Button fSemanticHighlighting;
|
||||||
|
|
||||||
private Button fContentAssist;
|
private Button fContentAssist;
|
||||||
|
|
||||||
|
private Button fContentAssistAutoActivation;
|
||||||
|
|
||||||
private Map<Object, String> fCheckBoxes= new HashMap<Object, String>();
|
private Map<Object, String> fCheckBoxes= new HashMap<Object, String>();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -72,7 +76,7 @@ public class ScalabilityPreferencePage extends PreferencePage implements
|
||||||
|
|
||||||
public ScalabilityPreferencePage() {
|
public ScalabilityPreferencePage() {
|
||||||
setPreferenceStore(PreferenceConstants.getPreferenceStore());
|
setPreferenceStore(PreferenceConstants.getPreferenceStore());
|
||||||
setDescription(PreferencesMessages.ScalabilityPreferencePage_description);
|
setDescription(PreferencesMessages.ScalabilityPreferencePage_description);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -104,7 +108,7 @@ public class ScalabilityPreferencePage extends PreferencePage implements
|
||||||
SelectionListener listener= (SelectionListener)iter.next();
|
SelectionListener listener= (SelectionListener)iter.next();
|
||||||
listener.widgetSelected(null);
|
listener.widgetSelected(null);
|
||||||
}
|
}
|
||||||
fLinesToTrigger.setStringValue(Integer.toString(prefs.getInt(PreferenceConstants.SCALABILITY_NUMBER_OF_LINES)));
|
fLinesToTrigger.setStringValue(Integer.toString(prefs.getInt(PreferenceConstants.SCALABILITY_NUMBER_OF_LINES)));
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -114,7 +118,7 @@ public class ScalabilityPreferencePage extends PreferencePage implements
|
||||||
public void createControl(Composite parent) {
|
public void createControl(Composite parent) {
|
||||||
super.createControl(parent);
|
super.createControl(parent);
|
||||||
PlatformUI.getWorkbench().getHelpSystem().setHelp(getControl(), ICHelpContextIds.SCALABILITY_PREFERENCE_PAGE);
|
PlatformUI.getWorkbench().getHelpSystem().setHelp(getControl(), ICHelpContextIds.SCALABILITY_PREFERENCE_PAGE);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* @see PreferencePage#createContents(Composite)
|
* @see PreferencePage#createContents(Composite)
|
||||||
|
@ -138,14 +142,14 @@ public class ScalabilityPreferencePage extends PreferencePage implements
|
||||||
|
|
||||||
createDetectionSettings(composite);
|
createDetectionSettings(composite);
|
||||||
|
|
||||||
new Separator().doFillIntoGrid(composite, nColumns);
|
new Separator().doFillIntoGrid(composite, nColumns);
|
||||||
|
|
||||||
createScalabilityModeSettings(composite);
|
createScalabilityModeSettings(composite);
|
||||||
|
|
||||||
new Separator().doFillIntoGrid(composite, nColumns);
|
new Separator().doFillIntoGrid(composite, nColumns);
|
||||||
|
|
||||||
String noteTitle= PreferencesMessages.ScalabilityPreferencePage_note;
|
String noteTitle= PreferencesMessages.ScalabilityPreferencePage_note;
|
||||||
String noteMessage= PreferencesMessages.ScalabilityPreferencePage_preferenceOnlyForNewViews;
|
String noteMessage= PreferencesMessages.ScalabilityPreferencePage_preferenceOnlyForNewEditors;
|
||||||
Composite noteControl= createNoteComposite(JFaceResources.getDialogFont(), composite, noteTitle, noteMessage);
|
Composite noteControl= createNoteComposite(JFaceResources.getDialogFont(), composite, noteTitle, noteMessage);
|
||||||
GridData gd= new GridData(GridData.HORIZONTAL_ALIGN_FILL);
|
GridData gd= new GridData(GridData.HORIZONTAL_ALIGN_FILL);
|
||||||
gd.horizontalSpan= 2;
|
gd.horizontalSpan= 2;
|
||||||
|
@ -178,15 +182,8 @@ public class ScalabilityPreferencePage extends PreferencePage implements
|
||||||
private void createDetectionSettings( Composite parent ) {
|
private void createDetectionSettings( Composite parent ) {
|
||||||
Composite group = createGroupComposite( parent, 1, PreferencesMessages.ScalabilityPreferencePage_detection_group_label );
|
Composite group = createGroupComposite( parent, 1, PreferencesMessages.ScalabilityPreferencePage_detection_group_label );
|
||||||
createCheckButton(group, PreferencesMessages.ScalabilityPreferencePage_detection_label,PreferenceConstants.SCALABILITY_ALERT);
|
createCheckButton(group, PreferencesMessages.ScalabilityPreferencePage_detection_label,PreferenceConstants.SCALABILITY_ALERT);
|
||||||
}
|
|
||||||
|
Composite comp= new Composite(group, SWT.NONE);
|
||||||
/**
|
|
||||||
* Create the view setting preferences composite widget
|
|
||||||
*/
|
|
||||||
private void createScalabilityModeSettings( Composite parent ) {
|
|
||||||
Composite group = createGroupComposite( parent, 1, PreferencesMessages.ScalabilityPreferencePage_scalabilityMode_group_label );
|
|
||||||
|
|
||||||
Composite comp = ControlFactory.createComposite( group, 2 );
|
|
||||||
fLinesToTrigger = new IntegerFieldEditor( PreferenceConstants.SCALABILITY_NUMBER_OF_LINES, PreferencesMessages.ScalabilityPreferencePage_trigger_lines_label, comp);
|
fLinesToTrigger = new IntegerFieldEditor( PreferenceConstants.SCALABILITY_NUMBER_OF_LINES, PreferencesMessages.ScalabilityPreferencePage_trigger_lines_label, comp);
|
||||||
GridData data = (GridData)fLinesToTrigger.getTextControl( comp ).getLayoutData();
|
GridData data = (GridData)fLinesToTrigger.getTextControl( comp ).getLayoutData();
|
||||||
data.horizontalAlignment = GridData.BEGINNING;
|
data.horizontalAlignment = GridData.BEGINNING;
|
||||||
|
@ -206,27 +203,42 @@ public class ScalabilityPreferencePage extends PreferencePage implements
|
||||||
}
|
}
|
||||||
} );
|
} );
|
||||||
|
|
||||||
new Separator().doFillIntoGrid(group, 1);
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Create the view setting preferences composite widget
|
||||||
|
*/
|
||||||
|
private void createScalabilityModeSettings( Composite parent ) {
|
||||||
|
Composite group = createGroupComposite( parent, 1, PreferencesMessages.ScalabilityPreferencePage_scalabilityMode_group_label );
|
||||||
|
|
||||||
fEnableAll = createCheckButton(group, PreferencesMessages.ScalabilityPreferencePage_scalabilityMode_label, PreferenceConstants.SCALABILITY_ENABLE_ALL);
|
fEnableAll = createCheckButton(group, PreferencesMessages.ScalabilityPreferencePage_scalabilityMode_label, PreferenceConstants.SCALABILITY_ENABLE_ALL);
|
||||||
fReconciler = createCheckButton(group, PreferencesMessages.ScalabilityPreferencePage_reconciler_label, PreferenceConstants.SCALABILITY_RECONCILER);
|
fReconciler = createCheckButton(group, PreferencesMessages.ScalabilityPreferencePage_reconciler_label, PreferenceConstants.SCALABILITY_RECONCILER);
|
||||||
createDependency(fEnableAll, PreferenceConstants.SCALABILITY_ENABLE_ALL, fReconciler);
|
createDependency(fEnableAll, PreferenceConstants.SCALABILITY_ENABLE_ALL, fReconciler, true);
|
||||||
|
|
||||||
fContentAssist = createCheckButton(group, PreferencesMessages.ScalabilityPreferencePage_contentAssist_label, PreferenceConstants.SCALABILITY_PARSER_BASED_CONTENT_ASSIST);
|
fSemanticHighlighting = createCheckButton(group, PreferencesMessages.ScalabilityPreferencePage_semanticHighlighting_label, PreferenceConstants.SCALABILITY_SEMANTIC_HIGHLIGHT);
|
||||||
createDependency(fEnableAll, PreferenceConstants.SCALABILITY_ENABLE_ALL, fContentAssist);
|
createDependency(fEnableAll, PreferenceConstants.SCALABILITY_ENABLE_ALL, fSemanticHighlighting, true);
|
||||||
|
|
||||||
fSyntaxColor = createCheckButton(group, PreferencesMessages.ScalabilityPreferencePage_syntaxColor_label, PreferenceConstants.SCALABILITY_SYNTAX_COLOR);
|
fSyntaxColor = createCheckButton(group, PreferencesMessages.ScalabilityPreferencePage_syntaxColor_label, PreferenceConstants.SCALABILITY_SYNTAX_COLOR);
|
||||||
createDependency(fEnableAll, PreferenceConstants.SCALABILITY_ENABLE_ALL, fSyntaxColor);
|
createDependency(fEnableAll, PreferenceConstants.SCALABILITY_ENABLE_ALL, fSyntaxColor, true);
|
||||||
|
|
||||||
|
fContentAssist = createCheckButton(group, PreferencesMessages.ScalabilityPreferencePage_contentAssist_label, PreferenceConstants.SCALABILITY_PARSER_BASED_CONTENT_ASSIST);
|
||||||
|
createDependency(fEnableAll, PreferenceConstants.SCALABILITY_ENABLE_ALL, fContentAssist, true);
|
||||||
|
|
||||||
|
fContentAssistAutoActivation = createCheckButton(group, PreferencesMessages.ScalabilityPreferencePage_contentAssist_autoActivation, PreferenceConstants.SCALABILITY_CONTENT_ASSIST_AUTO_ACTIVATION);
|
||||||
|
createDependency(fContentAssist, PreferenceConstants.SCALABILITY_PARSER_BASED_CONTENT_ASSIST, fContentAssistAutoActivation, true);
|
||||||
|
createDependency(fEnableAll, PreferenceConstants.SCALABILITY_ENABLE_ALL, fContentAssistAutoActivation, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void indent(Control control) {
|
private static void indent(Control control, GridData masterLayoutData) {
|
||||||
GridData gridData= new GridData();
|
GridData gridData= new GridData();
|
||||||
gridData.horizontalIndent= 20;
|
gridData.horizontalIndent= masterLayoutData.horizontalIndent + 20;
|
||||||
control.setLayoutData(gridData);
|
control.setLayoutData(gridData);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void createDependency(final Button master, String masterKey, final Control slave) {
|
private void createDependency(final Button master, String masterKey, final Control slave, boolean indent) {
|
||||||
indent(slave);
|
if (indent) {
|
||||||
|
indent(slave, (GridData)master.getLayoutData());
|
||||||
|
}
|
||||||
boolean masterState= getPreferenceStore().getBoolean(masterKey);
|
boolean masterState= getPreferenceStore().getBoolean(masterKey);
|
||||||
slave.setEnabled(!masterState);
|
slave.setEnabled(!masterState);
|
||||||
|
|
||||||
|
@ -269,7 +281,7 @@ public class ScalabilityPreferencePage extends PreferencePage implements
|
||||||
prefs.setValue(PreferenceConstants.SCALABILITY_NUMBER_OF_LINES, fLinesToTrigger.getIntValue());
|
prefs.setValue(PreferenceConstants.SCALABILITY_NUMBER_OF_LINES, fLinesToTrigger.getIntValue());
|
||||||
CUIPlugin.getDefault().savePluginPreferences();
|
CUIPlugin.getDefault().savePluginPreferences();
|
||||||
return super.performOk();
|
return super.performOk();
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* @see PreferencePage#performDefaults()
|
* @see PreferencePage#performDefaults()
|
||||||
|
@ -291,6 +303,6 @@ public class ScalabilityPreferencePage extends PreferencePage implements
|
||||||
SelectionListener listener= (SelectionListener)iter.next();
|
SelectionListener listener= (SelectionListener)iter.next();
|
||||||
listener.widgetSelected(null);
|
listener.widgetSelected(null);
|
||||||
}
|
}
|
||||||
fLinesToTrigger.setStringValue(Integer.toString(prefs.getDefaultInt(PreferenceConstants.SCALABILITY_NUMBER_OF_LINES)));
|
fLinesToTrigger.setStringValue(Integer.toString(prefs.getDefaultInt(PreferenceConstants.SCALABILITY_NUMBER_OF_LINES)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -116,8 +116,14 @@ public class CContentAssistInvocationContext extends ContentAssistInvocationCont
|
||||||
//for scalability
|
//for scalability
|
||||||
if (fEditor != null && fEditor instanceof CEditor) {
|
if (fEditor != null && fEditor instanceof CEditor) {
|
||||||
CEditor editor = (CEditor)fEditor;
|
CEditor editor = (CEditor)fEditor;
|
||||||
if (editor.isEnableScalablilityMode() && editor.isParserBasedContentAssistDisabled())
|
if (editor.isEnableScalablilityMode()) {
|
||||||
return null;
|
if (editor.isParserBasedContentAssistDisabled()) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
if (isAutoActivated() && editor.isContentAssistAutoActivartionDisabled()) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (fCNComputed) return fCN;
|
if (fCNComputed) return fCN;
|
||||||
|
|
|
@ -754,7 +754,7 @@ public class PreferenceConstants {
|
||||||
public static final String OUTLINE_LINK_TO_EDITOR = "org.eclipse.cdt.ui.outline.linktoeditor"; //$NON-NLS-1$
|
public static final String OUTLINE_LINK_TO_EDITOR = "org.eclipse.cdt.ui.outline.linktoeditor"; //$NON-NLS-1$
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A named preference that controls whether include directives should be grouped in the
|
* A named preference that controls whether include directives should be grouped in the
|
||||||
* C/C++ Projects view and the Project Explorer view.
|
* C/C++ Projects view and the Project Explorer view.
|
||||||
* <p>
|
* <p>
|
||||||
* Value is of type <code>Boolean</code>.
|
* Value is of type <code>Boolean</code>.
|
||||||
|
@ -763,7 +763,7 @@ public class PreferenceConstants {
|
||||||
public static final String CVIEW_GROUP_INCLUDES= "org.eclipse.cdt.ui.cview.groupincludes"; //$NON-NLS-1$
|
public static final String CVIEW_GROUP_INCLUDES= "org.eclipse.cdt.ui.cview.groupincludes"; //$NON-NLS-1$
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A named preference that controls whether header and source files should be separated in the
|
* A named preference that controls whether header and source files should be separated in the
|
||||||
* C/C++ Projects view and the Project Explorer view.
|
* C/C++ Projects view and the Project Explorer view.
|
||||||
* <p>
|
* <p>
|
||||||
* Value is of type <code>Boolean</code>.
|
* Value is of type <code>Boolean</code>.
|
||||||
|
@ -1308,7 +1308,7 @@ public class PreferenceConstants {
|
||||||
*
|
*
|
||||||
* @since 5.0
|
* @since 5.0
|
||||||
*/
|
*/
|
||||||
public static final String SCALABILITY_ENABLE_ALL = "enableScalabilityOptions"; //$NON-NLS-1$
|
public static final String SCALABILITY_ENABLE_ALL = "scalability.enableAll"; //$NON-NLS-1$
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A named preference that controls whether the editor's reconciler is disabled.
|
* A named preference that controls whether the editor's reconciler is disabled.
|
||||||
|
@ -1318,7 +1318,7 @@ public class PreferenceConstants {
|
||||||
*
|
*
|
||||||
* @since 5.0
|
* @since 5.0
|
||||||
*/
|
*/
|
||||||
public static final String SCALABILITY_RECONCILER = "reconciler"; //$NON-NLS-1$
|
public static final String SCALABILITY_RECONCILER = "scalability.reconciler"; //$NON-NLS-1$
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A named preference that controls whether syntax coloring is disabled.
|
* A named preference that controls whether syntax coloring is disabled.
|
||||||
|
@ -1328,7 +1328,7 @@ public class PreferenceConstants {
|
||||||
*
|
*
|
||||||
* @since 5.0
|
* @since 5.0
|
||||||
*/
|
*/
|
||||||
public static final String SCALABILITY_SYNTAX_COLOR = "syntaxColor"; //$NON-NLS-1$
|
public static final String SCALABILITY_SYNTAX_COLOR = "scalability.syntaxColor"; //$NON-NLS-1$
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A named preference that controls whether parser-based content assist proposals are disabled.
|
* A named preference that controls whether parser-based content assist proposals are disabled.
|
||||||
|
@ -1338,7 +1338,7 @@ public class PreferenceConstants {
|
||||||
*
|
*
|
||||||
* @since 5.0
|
* @since 5.0
|
||||||
*/
|
*/
|
||||||
public static final String SCALABILITY_PARSER_BASED_CONTENT_ASSIST = "cdtContentAssist"; //$NON-NLS-1$
|
public static final String SCALABILITY_PARSER_BASED_CONTENT_ASSIST = "scalability.parserBasedContentAssist"; //$NON-NLS-1$
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A named preference that controls whether users should be notified if scalability mode should be turned on.
|
* A named preference that controls whether users should be notified if scalability mode should be turned on.
|
||||||
|
@ -1348,7 +1348,7 @@ public class PreferenceConstants {
|
||||||
*
|
*
|
||||||
* @since 5.0
|
* @since 5.0
|
||||||
*/
|
*/
|
||||||
public static final String SCALABILITY_ALERT = "detectScalability"; //$NON-NLS-1$
|
public static final String SCALABILITY_ALERT = "scalability.detect"; //$NON-NLS-1$
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The size of the file that will trigger scalability mode
|
* The size of the file that will trigger scalability mode
|
||||||
|
@ -1358,8 +1358,29 @@ public class PreferenceConstants {
|
||||||
*
|
*
|
||||||
* @since 5.0
|
* @since 5.0
|
||||||
*/
|
*/
|
||||||
public static final String SCALABILITY_NUMBER_OF_LINES = "numberOfLines"; //$NON-NLS-1$
|
public static final String SCALABILITY_NUMBER_OF_LINES = "scalability.numberOfLines"; //$NON-NLS-1$
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A named preference that controls whether syntax coloring is disabled.
|
||||||
|
* <p>
|
||||||
|
* Value is of type <code>Boolean</code>.
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @since 5.0
|
||||||
|
*/
|
||||||
|
public static final String SCALABILITY_SEMANTIC_HIGHLIGHT = "scalability.semanticHighlight"; //$NON-NLS-1$
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A named preference that controls whether the content assist auto activation is disabled in scalability mode.
|
||||||
|
* <p>
|
||||||
|
* Value is of type <code>Boolean</code>.
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @since 5.0
|
||||||
|
*/
|
||||||
|
public static final String SCALABILITY_CONTENT_ASSIST_AUTO_ACTIVATION = "scalability.contentAssistAutoActivation"; //$NON-NLS-1$
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the CDT-UI preference store.
|
* Returns the CDT-UI preference store.
|
||||||
*
|
*
|
||||||
|
@ -1548,7 +1569,9 @@ public class PreferenceConstants {
|
||||||
store.setDefault(PreferenceConstants.SCALABILITY_ENABLE_ALL, false);
|
store.setDefault(PreferenceConstants.SCALABILITY_ENABLE_ALL, false);
|
||||||
store.setDefault(PreferenceConstants.SCALABILITY_RECONCILER, false);
|
store.setDefault(PreferenceConstants.SCALABILITY_RECONCILER, false);
|
||||||
store.setDefault(PreferenceConstants.SCALABILITY_SYNTAX_COLOR, false);
|
store.setDefault(PreferenceConstants.SCALABILITY_SYNTAX_COLOR, false);
|
||||||
|
store.setDefault(PreferenceConstants.SCALABILITY_SEMANTIC_HIGHLIGHT, false);
|
||||||
store.setDefault(PreferenceConstants.SCALABILITY_PARSER_BASED_CONTENT_ASSIST, false);
|
store.setDefault(PreferenceConstants.SCALABILITY_PARSER_BASED_CONTENT_ASSIST, false);
|
||||||
|
store.setDefault(PreferenceConstants.SCALABILITY_CONTENT_ASSIST_AUTO_ACTIVATION, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue