Search in sources :

Example 11 with JavaCodeStyleSettings

use of com.intellij.psi.codeStyle.JavaCodeStyleSettings in project intellij-community by JetBrains.

the class JavaEnterActionTest method testEnterInsideAnnotationParameters.

public void testEnterInsideAnnotationParameters() throws IOException {
    CodeStyleSettings settings = getCodeStyleSettings();
    JavaCodeStyleSettings javaSettings = settings.getCustomSettings(JavaCodeStyleSettings.class);
    javaSettings.ALIGN_MULTILINE_ANNOTATION_PARAMETERS = true;
    setCodeStyleSettings(settings);
    doTextTest("java", "public class T {\n" + "\n" + "  @Configurable(order = 25, \n" + "                validator = BigDecimalPercentValidator.class, <caret>)\n" + "  public void run() {\n" + "  }\n" + "  \n" + "  \n" + "}", "public class T {\n" + "\n" + "  @Configurable(order = 25, \n" + "                validator = BigDecimalPercentValidator.class, \n" + "                <caret>)\n" + "  public void run() {\n" + "  }\n" + "  \n" + "  \n" + "}");
    doTextTest("java", "public class T {\n" + "\n" + "  @Configurable(order = 25, \n" + "                validator = BigDecimalPercentValidator.class, <caret>\n" + "  )\n" + "  public void run() {\n" + "  }\n" + "  \n" + "  \n" + "}", "public class T {\n" + "\n" + "  @Configurable(order = 25, \n" + "                validator = BigDecimalPercentValidator.class, \n" + "                <caret>\n" + "  )\n" + "  public void run() {\n" + "  }\n" + "  \n" + "  \n" + "}");
}
Also used : JavaCodeStyleSettings(com.intellij.psi.codeStyle.JavaCodeStyleSettings) CommonCodeStyleSettings(com.intellij.psi.codeStyle.CommonCodeStyleSettings) CodeStyleSettings(com.intellij.psi.codeStyle.CodeStyleSettings) JavaCodeStyleSettings(com.intellij.psi.codeStyle.JavaCodeStyleSettings)

Example 12 with JavaCodeStyleSettings

use of com.intellij.psi.codeStyle.JavaCodeStyleSettings in project intellij-community by JetBrains.

the class JavaEnterActionTest method testEnterInsideAnnotationParameters_AfterNameValuePairBeforeLparenth.

public void testEnterInsideAnnotationParameters_AfterNameValuePairBeforeLparenth() throws IOException {
    CodeStyleSettings settings = getCodeStyleSettings();
    JavaCodeStyleSettings javaSettings = settings.getCustomSettings(JavaCodeStyleSettings.class);
    javaSettings.ALIGN_MULTILINE_ANNOTATION_PARAMETERS = true;
    setCodeStyleSettings(settings);
    doTextTest("java", "public class T {\n" + "\n" + "  @Configurable(order = 25, \n" + "                validator = BigDecimalPercentValidator.class<caret>)\n" + "  public void run() {\n" + "  }\n" + "  \n" + "  \n" + "}", "public class T {\n" + "\n" + "  @Configurable(order = 25, \n" + "                validator = BigDecimalPercentValidator.class\n" + "  <caret>)\n" + "  public void run() {\n" + "  }\n" + "  \n" + "  \n" + "}");
}
Also used : JavaCodeStyleSettings(com.intellij.psi.codeStyle.JavaCodeStyleSettings) CommonCodeStyleSettings(com.intellij.psi.codeStyle.CommonCodeStyleSettings) CodeStyleSettings(com.intellij.psi.codeStyle.CodeStyleSettings) JavaCodeStyleSettings(com.intellij.psi.codeStyle.JavaCodeStyleSettings)

Example 13 with JavaCodeStyleSettings

use of com.intellij.psi.codeStyle.JavaCodeStyleSettings in project intellij-community by JetBrains.

the class UnnecessaryFullyQualifiedNameInspectionTest method doTestWithFqnInJavadocSetting.

private void doTestWithFqnInJavadocSetting(String dirPath, int classNamesInJavadoc) {
    final CodeStyleSettings settings = CodeStyleSettingsManager.getSettings(getProject());
    JavaCodeStyleSettings javaSettings = settings.getCustomSettings(JavaCodeStyleSettings.class);
    int oldClassNamesInJavadoc = javaSettings.CLASS_NAMES_IN_JAVADOC;
    try {
        javaSettings.CLASS_NAMES_IN_JAVADOC = classNamesInJavadoc;
        doTest(dirPath, new UnnecessaryFullyQualifiedNameInspection());
    } finally {
        javaSettings.CLASS_NAMES_IN_JAVADOC = oldClassNamesInJavadoc;
    }
}
Also used : JavaCodeStyleSettings(com.intellij.psi.codeStyle.JavaCodeStyleSettings) CodeStyleSettings(com.intellij.psi.codeStyle.CodeStyleSettings) JavaCodeStyleSettings(com.intellij.psi.codeStyle.JavaCodeStyleSettings)

Aggregations

JavaCodeStyleSettings (com.intellij.psi.codeStyle.JavaCodeStyleSettings)13 CodeStyleSettings (com.intellij.psi.codeStyle.CodeStyleSettings)7 CommonCodeStyleSettings (com.intellij.psi.codeStyle.CommonCodeStyleSettings)4 Block (com.intellij.formatting.Block)1 FormattingDocumentModelImpl (com.intellij.psi.formatter.FormattingDocumentModelImpl)1 AbstractJavaBlock (com.intellij.psi.formatter.java.AbstractJavaBlock)1 PsiBasedFormatterModelWithShiftIndentInside (com.intellij.psi.impl.source.codeStyle.PsiBasedFormatterModelWithShiftIndentInside)1 FileElement (com.intellij.psi.impl.source.tree.FileElement)1 NotNull (org.jetbrains.annotations.NotNull)1