mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
IDEA-57897 blank lines after class header changed between idea 9.0 and 10.0
Added dedicated option that controls number of blank lines after anonymous class header
This commit is contained in:
@@ -214,7 +214,7 @@ public class JavaSpacePropertyProcessor extends JavaElementVisitor {
|
||||
mySettings.KEEP_LINE_BREAKS, mySettings.KEEP_BLANK_LINES_IN_DECLARATIONS);
|
||||
}
|
||||
else {
|
||||
myResult = Spacing.createSpacing(0, 0, mySettings.BLANK_LINES_AFTER_CLASS_HEADER + 1,
|
||||
myResult = Spacing.createSpacing(0, 0, mySettings.BLANK_LINES_AFTER_ANONYMOUS_CLASS_HEADER + 1,
|
||||
mySettings.KEEP_LINE_BREAKS, mySettings.KEEP_BLANK_LINES_IN_DECLARATIONS);
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -307,6 +307,7 @@ public class JavaFormatterBlankLinesTest extends AbstractJavaFormatterTest {
|
||||
public void testAroundClassHeader() {
|
||||
// Inspired by IDEA-54746
|
||||
getSettings().BLANK_LINES_AFTER_CLASS_HEADER = 2;
|
||||
getSettings().BLANK_LINES_AFTER_ANONYMOUS_CLASS_HEADER = 1;
|
||||
doTextTest(
|
||||
"public class FormattingTest {\n" +
|
||||
" public void foo() {\n" +
|
||||
@@ -322,7 +323,6 @@ public class JavaFormatterBlankLinesTest extends AbstractJavaFormatterTest {
|
||||
" public void foo() {\n" +
|
||||
" Object buzz = new Object() {\n" +
|
||||
"\n" +
|
||||
"\n" +
|
||||
" Object test = new Object();\n" +
|
||||
" };\n" +
|
||||
" }\n" +
|
||||
|
||||
@@ -471,6 +471,7 @@ public class CodeStyleSettings implements Cloneable, JDOMExternalizable {
|
||||
|
||||
|
||||
public int BLANK_LINES_AFTER_CLASS_HEADER = 0;
|
||||
public int BLANK_LINES_AFTER_ANONYMOUS_CLASS_HEADER = 0;
|
||||
//public int BLANK_LINES_BETWEEN_CASE_BLOCKS;
|
||||
|
||||
//----------------- SPACES --------------------
|
||||
@@ -812,6 +813,7 @@ public class CodeStyleSettings implements Cloneable, JDOMExternalizable {
|
||||
|
||||
//----------------- WRAPPING ---------------------------
|
||||
public int RIGHT_MARGIN = 120;
|
||||
public boolean WRAP_WHEN_TYPING_REACHES_RIGHT_MAGIN = false;
|
||||
|
||||
public static final int DO_NOT_WRAP = 0x00;
|
||||
public static final int WRAP_AS_NEEDED = 0x01;
|
||||
|
||||
+3
-2
@@ -78,12 +78,13 @@ public class CodeStyleBlankLinesPanel extends MultilanguageCodeStyleAbstractPane
|
||||
createOption(optionGroup, ApplicationBundle.message("editbox.blanklines.before.imports"), "BLANK_LINES_BEFORE_IMPORTS");
|
||||
createOption(optionGroup, ApplicationBundle.message("editbox.blanklines.after.imports"), "BLANK_LINES_AFTER_IMPORTS");
|
||||
createOption(optionGroup, ApplicationBundle.message("editbox.blanklines.around.class"), "BLANK_LINES_AROUND_CLASS");
|
||||
createOption(optionGroup, ApplicationBundle.message("editbox.blanklines.after.class.header"), "BLANK_LINES_AFTER_CLASS_HEADER");
|
||||
createOption(optionGroup, ApplicationBundle.message("editbox.blanklines.around.field"), "BLANK_LINES_AROUND_FIELD");
|
||||
createOption(optionGroup, ApplicationBundle.message("editbox.blanklines.around.method"), "BLANK_LINES_AROUND_METHOD");
|
||||
createOption(optionGroup, ApplicationBundle.message("editbox.blanklines.before.method.body"), "BLANK_LINES_BEFORE_METHOD_BODY");
|
||||
createOption(optionGroup, "Around field in interface:", "BLANK_LINES_AROUND_FIELD_IN_INTERFACE");
|
||||
createOption(optionGroup, "Around method in interface:", "BLANK_LINES_AROUND_METHOD_IN_INTERFACE");
|
||||
createOption(optionGroup, ApplicationBundle.message("editbox.blanklines.after.class.header"), "BLANK_LINES_AFTER_CLASS_HEADER");
|
||||
createOption(optionGroup, ApplicationBundle.message("editbox.blanklines.after.anonymous.class.header"), "BLANK_LINES_AFTER_ANONYMOUS_CLASS_HEADER");
|
||||
|
||||
return optionGroup.createPanel();
|
||||
}
|
||||
@@ -223,5 +224,5 @@ public class CodeStyleBlankLinesPanel extends MultilanguageCodeStyleAbstractPane
|
||||
myTextField.setText(String.valueOf(fieldValue));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -49,6 +49,7 @@ editbox.blanklines.around.field=Around field:
|
||||
editbox.blanklines.around.method=Around method:
|
||||
editbox.blanklines.before.method.body=Before method body:
|
||||
editbox.blanklines.after.class.header=After class header:
|
||||
editbox.blanklines.after.anonymous.class.header=After anonymous class header:
|
||||
title.keep.blank.lines=Keep Blank Lines
|
||||
editbox.keep.blanklines.in.declarations=In declarations:
|
||||
editbox.keep.blanklines.in.code=In code:
|
||||
@@ -402,6 +403,7 @@ checkbox.indent.use.same.settings.for.all.file.types=Use same settings for all f
|
||||
tab.indent.other=Other
|
||||
combobox.line.separator.for.new.files=Line separator (for new files):
|
||||
editbox.right.margin.columns=Right margin (columns):
|
||||
checkbox.wrap.typing.on.right.margin=Wrap when typing reaches right margin
|
||||
group.javadoc.other=Other
|
||||
group.javadoc.invalid.tags=Invalid tags
|
||||
group.javadoc.blank.lines=Blank lines
|
||||
|
||||
Reference in New Issue
Block a user