Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/CodeStyleBlock.java')
-rw-r--r--core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/CodeStyleBlock.java73
1 files changed, 34 insertions, 39 deletions
diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/CodeStyleBlock.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/CodeStyleBlock.java
index b9c5b30b6f7..f747c5c6e7d 100644
--- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/CodeStyleBlock.java
+++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/CodeStyleBlock.java
@@ -31,60 +31,55 @@ import org.eclipse.cdt.internal.ui.dialogs.IStatusChangeListener;
* Configures elements of C/C++ code style affecting refactoring.
*/
class CodeStyleBlock extends OptionsConfigurationBlock {
- private static final Key CLASS_MEMBER_ASCENDING_VISIBILITY_ORDER =
- getCDTUIKey(PreferenceConstants.CLASS_MEMBER_ASCENDING_VISIBILITY_ORDER);
- private static final Key FUNCTION_OUTPUT_PARAMETERS_BEFORE_INPUT =
- getCDTUIKey(PreferenceConstants.FUNCTION_OUTPUT_PARAMETERS_BEFORE_INPUT);
- private static final Key FUNCTION_PASS_OUTPUT_PARAMETERS_BY_POINTER =
- getCDTUIKey(PreferenceConstants.FUNCTION_PASS_OUTPUT_PARAMETERS_BY_POINTER);
- private static final Key PLACE_CONST_RIGHT_OF_TYPE =
- getKey(CCorePlugin.PLUGIN_ID, CCorePreferenceConstants.PLACE_CONST_RIGHT_OF_TYPE);
+ private static final Key CLASS_MEMBER_ASCENDING_VISIBILITY_ORDER = getCDTUIKey(
+ PreferenceConstants.CLASS_MEMBER_ASCENDING_VISIBILITY_ORDER);
+ private static final Key FUNCTION_OUTPUT_PARAMETERS_BEFORE_INPUT = getCDTUIKey(
+ PreferenceConstants.FUNCTION_OUTPUT_PARAMETERS_BEFORE_INPUT);
+ private static final Key FUNCTION_PASS_OUTPUT_PARAMETERS_BY_POINTER = getCDTUIKey(
+ PreferenceConstants.FUNCTION_PASS_OUTPUT_PARAMETERS_BY_POINTER);
+ private static final Key PLACE_CONST_RIGHT_OF_TYPE = getKey(CCorePlugin.PLUGIN_ID,
+ CCorePreferenceConstants.PLACE_CONST_RIGHT_OF_TYPE);
private static Key[] getAllKeys() {
- return new Key[] {
- CLASS_MEMBER_ASCENDING_VISIBILITY_ORDER,
- FUNCTION_OUTPUT_PARAMETERS_BEFORE_INPUT,
- FUNCTION_PASS_OUTPUT_PARAMETERS_BY_POINTER,
- PLACE_CONST_RIGHT_OF_TYPE,
- };
+ return new Key[] { CLASS_MEMBER_ASCENDING_VISIBILITY_ORDER, FUNCTION_OUTPUT_PARAMETERS_BEFORE_INPUT,
+ FUNCTION_PASS_OUTPUT_PARAMETERS_BY_POINTER, PLACE_CONST_RIGHT_OF_TYPE, };
}
- public CodeStyleBlock(IStatusChangeListener context, IProject project,
- IWorkbenchPreferenceContainer container) {
+ public CodeStyleBlock(IStatusChangeListener context, IProject project, IWorkbenchPreferenceContainer container) {
super(context, project, getAllKeys(), container);
}
-
+
@Override
public Control createContents(Composite parent) {
- ScrolledPageContent scrolled= new ScrolledPageContent(parent, SWT.H_SCROLL | SWT.V_SCROLL);
+ ScrolledPageContent scrolled = new ScrolledPageContent(parent, SWT.H_SCROLL | SWT.V_SCROLL);
scrolled.setExpandHorizontal(true);
scrolled.setExpandVertical(true);
-
- Composite control= new Composite(scrolled, SWT.NONE);
- GridLayout layout= new GridLayout();
+
+ Composite control = new Composite(scrolled, SWT.NONE);
+ GridLayout layout = new GridLayout();
control.setLayout(layout);
- Composite composite = addSubsection(control, PreferencesMessages.CodeStyleBlock_class_member_order);
+ Composite composite = addSubsection(control, PreferencesMessages.CodeStyleBlock_class_member_order);
fillClassMemberOrderSection(composite);
-
- composite = addSubsection(control, PreferencesMessages.CodeStyleBlock_function_parameter_order);
+
+ composite = addSubsection(control, PreferencesMessages.CodeStyleBlock_function_parameter_order);
fillFunctionParameterOrderSection(composite);
- composite = addSubsection(control, PreferencesMessages.CodeStyleBlock_function_output_parameter_style);
+ composite = addSubsection(control, PreferencesMessages.CodeStyleBlock_function_output_parameter_style);
fillFunctionOutputParameterStyleSection(composite);
-
+
composite = addSubsection(control, PreferencesMessages.CodeStyleBlock_const_keyword_placement);
fillConstPlacementsSections(composite);
scrolled.setContent(control);
- final Point size= control.computeSize(SWT.DEFAULT, SWT.DEFAULT);
+ final Point size = control.computeSize(SWT.DEFAULT, SWT.DEFAULT);
scrolled.setMinSize(size.x, size.y);
return scrolled;
}
private void fillClassMemberOrderSection(Composite composite) {
- GridLayout layout= new GridLayout();
- layout.numColumns= 3;
+ GridLayout layout = new GridLayout();
+ layout.numColumns = 3;
composite.setLayout(layout);
addRadioButton(composite, PreferencesMessages.CodeStyleBlock_public_private,
@@ -94,8 +89,8 @@ class CodeStyleBlock extends OptionsConfigurationBlock {
}
private void fillFunctionParameterOrderSection(Composite composite) {
- GridLayout layout= new GridLayout();
- layout.numColumns= 3;
+ GridLayout layout = new GridLayout();
+ layout.numColumns = 3;
composite.setLayout(layout);
addRadioButton(composite, PreferencesMessages.CodeStyleBlock_input_output,
@@ -105,8 +100,8 @@ class CodeStyleBlock extends OptionsConfigurationBlock {
}
private void fillFunctionOutputParameterStyleSection(Composite composite) {
- GridLayout layout= new GridLayout();
- layout.numColumns= 3;
+ GridLayout layout = new GridLayout();
+ layout.numColumns = 3;
composite.setLayout(layout);
addRadioButton(composite, PreferencesMessages.CodeStyleBlock_pass_by_reference,
@@ -116,14 +111,14 @@ class CodeStyleBlock extends OptionsConfigurationBlock {
}
private void fillConstPlacementsSections(Composite composite) {
- GridLayout layout= new GridLayout();
- layout.numColumns= 3;
+ GridLayout layout = new GridLayout();
+ layout.numColumns = 3;
composite.setLayout(layout);
- addRadioButton(composite, PreferencesMessages.CodeStyleBlock_const_left,
- PLACE_CONST_RIGHT_OF_TYPE, FALSE_TRUE, 0);
- addRadioButton(composite, PreferencesMessages.CodeStyleBlock_const_right,
- PLACE_CONST_RIGHT_OF_TYPE, TRUE_FALSE, 0);
+ addRadioButton(composite, PreferencesMessages.CodeStyleBlock_const_left, PLACE_CONST_RIGHT_OF_TYPE, FALSE_TRUE,
+ 0);
+ addRadioButton(composite, PreferencesMessages.CodeStyleBlock_const_right, PLACE_CONST_RIGHT_OF_TYPE, TRUE_FALSE,
+ 0);
}
@Override

Back to the top