use of com.intellij.psi.codeStyle.CodeStyleSettings in project intellij-community by JetBrains.
the class ReplaceIteratorForEachLoopWithIteratorForLoopFixTest method setUp.
@Override
protected void setUp() throws Exception {
super.setUp();
if (getTestName(false).startsWith("Final")) {
final CodeStyleSettings codeStyleSettings = CodeStyleSettingsManager.getSettings(getProject());
myFinalLocals = codeStyleSettings.GENERATE_FINAL_LOCALS;
codeStyleSettings.GENERATE_FINAL_LOCALS = true;
}
}
use of com.intellij.psi.codeStyle.CodeStyleSettings in project intellij-community by JetBrains.
the class IndentTest method testParenthesizedContinuation2.
public void testParenthesizedContinuation2() throws Exception {
defaultSettings();
CodeStyleSettings settings = CodeStyleSettingsManager.getSettings(getProject());
settings.ALIGN_MULTILINE_PARENTHESIZED_EXPRESSION = true;
doTest("ParenthesizedContinuation2.java", "ParenthesizedContinuation2_after.java");
}
use of com.intellij.psi.codeStyle.CodeStyleSettings in project intellij-community by JetBrains.
the class IndentTest method testParenthesizedContinuation.
public void testParenthesizedContinuation() throws Exception {
defaultSettings();
CodeStyleSettings settings = CodeStyleSettingsManager.getSettings(getProject());
settings.ALIGN_MULTILINE_PARENTHESIZED_EXPRESSION = true;
doTest("ParenthesizedContinuation.java", "ParenthesizedContinuation_after.java");
}
use of com.intellij.psi.codeStyle.CodeStyleSettings in project intellij-community by JetBrains.
the class JavaEnterActionTest method testEnter_AfterLastChainedCall.
public void testEnter_AfterLastChainedCall() throws IOException {
CodeStyleSettings settings = getCodeStyleSettings();
CommonCodeStyleSettings javaCommon = settings.getCommonSettings(JavaLanguage.INSTANCE);
javaCommon.ALIGN_MULTILINE_CHAINED_METHODS = true;
setCodeStyleSettings(settings);
doTextTest("java", "class T {\n" + " public void main() {\n" + " ActionBarPullToRefresh.from(getActivity())\n" + " .theseChildrenArePullable(eventsListView)\n" + " .listener(this)\n" + " .useViewDelegate(StickyListHeadersListView.class, new AbsListViewDelegate())<caret>\n" + " }\n" + "}", "class T {\n" + " public void main() {\n" + " ActionBarPullToRefresh.from(getActivity())\n" + " .theseChildrenArePullable(eventsListView)\n" + " .listener(this)\n" + " .useViewDelegate(StickyListHeadersListView.class, new AbsListViewDelegate())\n" + " <caret>\n" + " }\n" + "}");
}
use of com.intellij.psi.codeStyle.CodeStyleSettings in project intellij-community by JetBrains.
the class JavaFormatterTest method testWrapParamsOnEveryItem.
public void testWrapParamsOnEveryItem() throws Exception {
CodeStyleSettings codeStyleSettings = CodeStyleSettingsManager.getSettings(getProject());
int oldMargin = codeStyleSettings.getCommonSettings(JavaLanguage.INSTANCE).RIGHT_MARGIN;
boolean oldKeep = codeStyleSettings.KEEP_LINE_BREAKS;
int oldWrap = codeStyleSettings.METHOD_PARAMETERS_WRAP;
try {
codeStyleSettings.setRightMargin(JavaLanguage.INSTANCE, 80);
codeStyleSettings.KEEP_LINE_BREAKS = false;
codeStyleSettings.METHOD_PARAMETERS_WRAP = CommonCodeStyleSettings.WRAP_ON_EVERY_ITEM;
doClassTest("public void foo(String p1,\n" + " String p2,\n" + " String p3,\n" + " String p4,\n" + " String p5,\n" + " String p6,\n" + " String p7) {\n" + " //To change body of implemented methods use File | Settings | File Templates.\n" + "}", "public void foo(String p1,\n" + " String p2,\n" + " String p3,\n" + " String p4,\n" + " String p5,\n" + " String p6,\n" + " String p7) {\n" + " //To change body of implemented methods use File | Settings | File Templates.\n" + "}");
} finally {
codeStyleSettings.setRightMargin(JavaLanguage.INSTANCE, oldMargin);
codeStyleSettings.KEEP_LINE_BREAKS = oldKeep;
codeStyleSettings.METHOD_PARAMETERS_WRAP = oldWrap;
}
}
Aggregations