mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-02 22:55:26 +02:00
Moved save actions to a separate group. Enabled both save actions by default.
This commit is contained in:
parent
558f2d69fd
commit
60ec3f2f22
4 changed files with 28 additions and 13 deletions
|
@ -125,7 +125,7 @@ public class CEditorPreferencePage extends AbstractPreferencePage {
|
|||
}
|
||||
}
|
||||
|
||||
private Control createAppearancePage(Composite parent) {
|
||||
private Control createBehaviorBlock(Composite parent) {
|
||||
Composite behaviorComposite= ControlFactory.createGroup(parent, PreferencesMessages.CEditorPreferencePage_GeneralAppearanceGroupTitle, 1);
|
||||
|
||||
GridLayout layout = new GridLayout();
|
||||
|
@ -141,12 +141,6 @@ public class CEditorPreferencePage extends AbstractPreferencePage {
|
|||
label = PreferencesMessages.CEditorPreferencePage_behaviorPage_inactiveCode;
|
||||
addCheckBox(behaviorComposite, label, CEditor.INACTIVE_CODE_ENABLE, 0);
|
||||
|
||||
label = PreferencesMessages.CEditorPreferencePage_behaviorPage_ensureNewline;
|
||||
addCheckBox(behaviorComposite, label, PreferenceConstants.ENSURE_NEWLINE_AT_EOF, 0);
|
||||
|
||||
label = PreferencesMessages.CEditorPreferencePage_behaviorPage_removeTrailingWhitespace;
|
||||
addCheckBox(behaviorComposite, label, PreferenceConstants.REMOVE_TRAILING_WHITESPACE, 0);
|
||||
|
||||
Label l = new Label(behaviorComposite, SWT.LEFT);
|
||||
GridData gd = new GridData(GridData.HORIZONTAL_ALIGN_FILL);
|
||||
gd.horizontalSpan = 2;
|
||||
|
@ -234,6 +228,22 @@ public class CEditorPreferencePage extends AbstractPreferencePage {
|
|||
return behaviorComposite;
|
||||
}
|
||||
|
||||
private Control createSaveActionsBlock(Composite parent) {
|
||||
Composite saveActionsComposite= ControlFactory.createGroup(parent, PreferencesMessages.CEditorPreferencePage_SaveActionsTitle, 1);
|
||||
|
||||
GridLayout layout = new GridLayout();
|
||||
layout.numColumns = 2;
|
||||
saveActionsComposite.setLayout(layout);
|
||||
|
||||
String label = PreferencesMessages.CEditorPreferencePage_behaviorPage_removeTrailingWhitespace;
|
||||
addCheckBox(saveActionsComposite, label, PreferenceConstants.REMOVE_TRAILING_WHITESPACE, 0);
|
||||
|
||||
label = PreferencesMessages.CEditorPreferencePage_behaviorPage_ensureNewline;
|
||||
addCheckBox(saveActionsComposite, label, PreferenceConstants.ENSURE_NEWLINE_AT_EOF, 0);
|
||||
|
||||
return saveActionsComposite;
|
||||
}
|
||||
|
||||
private void handleAppearanceColorListSelection() {
|
||||
int i = fAppearanceColorList.getSelectionIndex();
|
||||
String key = fAppearanceColorListModel[i][1];
|
||||
|
@ -286,7 +296,10 @@ public class CEditorPreferencePage extends AbstractPreferencePage {
|
|||
createHeader(parent);
|
||||
|
||||
ControlFactory.createEmptySpace(parent, 2);
|
||||
createAppearancePage(parent);
|
||||
createBehaviorBlock(parent);
|
||||
|
||||
ControlFactory.createEmptySpace(parent, 2);
|
||||
createSaveActionsBlock(parent);
|
||||
|
||||
ControlFactory.createEmptySpace(parent, 2);
|
||||
|
||||
|
|
|
@ -178,6 +178,7 @@ public final class PreferencesMessages extends NLS {
|
|||
public static String CEditorPreferencePage_wrapStrings;
|
||||
public static String CEditorPreferencePage_escapeStrings;
|
||||
public static String CEditorPreferencePage_GeneralAppearanceGroupTitle;
|
||||
public static String CEditorPreferencePage_SaveActionsTitle;
|
||||
public static String CEditorPreferencePage_SelectDocToolDescription;
|
||||
public static String CEditorPreferencePage_smartPaste;
|
||||
|
||||
|
|
|
@ -85,8 +85,8 @@ CEditorColoringConfigurationBlock_underline=&Underline
|
|||
CEditorColoringConfigurationBlock_strikethrough=&Strikethrough
|
||||
|
||||
CEditorPreferencePage_colorPage_systemDefault=S&ystem Default
|
||||
CEditorPreferencePage_behaviorPage_ensureNewline=Ensure &newline at end of file when saving
|
||||
CEditorPreferencePage_behaviorPage_removeTrailingWhitespace=Remove trailing &whitespace when saving
|
||||
CEditorPreferencePage_behaviorPage_removeTrailingWhitespace=Remove trailing &whitespace
|
||||
CEditorPreferencePage_behaviorPage_ensureNewline=Ensure &newline at end of file
|
||||
CEditorPreferencePage_behaviorPage_matchingBrackets=Highlight &matching brackets
|
||||
CEditorPreferencePage_behaviorPage_subWordNavigation=Smart &caret positioning in identifiers
|
||||
CEditorPreferencePage_behaviorPage_inactiveCode=Highlight &inactive code
|
||||
|
@ -187,7 +187,8 @@ CEditorPreferencePage_closeAngularBrackets=<A&ngle> brackets
|
|||
CEditorPreferencePage_closeBraces={B&races}
|
||||
CEditorPreferencePage_wrapStrings=&Wrap automatically
|
||||
CEditorPreferencePage_escapeStrings=Escape text w&hen pasting into a string literal
|
||||
CEditorPreferencePage_GeneralAppearanceGroupTitle=General appearance
|
||||
CEditorPreferencePage_GeneralAppearanceGroupTitle=General behavior
|
||||
CEditorPreferencePage_SaveActionsTitle=Save actions
|
||||
CEditorPreferencePage_SelectDocToolDescription=Select the documentation tool to be used to determine editor behaviors when no project preference overrides exist
|
||||
CEditorPreferencePage_smartPaste=Adjust &indentation
|
||||
|
||||
|
|
|
@ -1497,8 +1497,8 @@ public class PreferenceConstants {
|
|||
store.setDefault(PreferenceConstants.EDITOR_ESCAPE_STRINGS, false);
|
||||
store.setDefault(PreferenceConstants.EDITOR_AUTO_INDENT, true);
|
||||
|
||||
store.setDefault(PreferenceConstants.ENSURE_NEWLINE_AT_EOF, false);
|
||||
store.setDefault(PreferenceConstants.REMOVE_TRAILING_WHITESPACE, false);
|
||||
store.setDefault(PreferenceConstants.REMOVE_TRAILING_WHITESPACE, true);
|
||||
store.setDefault(PreferenceConstants.ENSURE_NEWLINE_AT_EOF, true);
|
||||
|
||||
// formatter profile
|
||||
store.setDefault(PreferenceConstants.FORMATTER_PROFILE, FormatterProfileManager.DEFAULT_PROFILE);
|
||||
|
|
Loading…
Add table
Reference in a new issue