Search in sources :

Example 1 with JavaCodeStyleSettings

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

the class UnnecessaryFullyQualifiedNameFixTest method doTest.

private void doTest(@Language("JAVA") @NotNull @NonNls String before, @Language("JAVA") @NotNull @NonNls String after, @MagicConstant(intValues = { JavaCodeStyleSettings.FULLY_QUALIFY_NAMES_ALWAYS, JavaCodeStyleSettings.FULLY_QUALIFY_NAMES_IF_NOT_IMPORTED, JavaCodeStyleSettings.SHORTEN_NAMES_ALWAYS_AND_ADD_IMPORT }) int classNamesInJavadoc, String fileName) {
    final CodeStyleSettings settings = CodeStyleSettingsManager.getSettings(getProject());
    final JavaCodeStyleSettings javaSettings = settings.getCustomSettings(JavaCodeStyleSettings.class);
    final int oldClassNamesInJavadoc = javaSettings.CLASS_NAMES_IN_JAVADOC;
    try {
        javaSettings.CLASS_NAMES_IN_JAVADOC = classNamesInJavadoc;
        doTest(InspectionGadgetsBundle.message("unnecessary.fully.qualified.name.replace.quickfix"), before, after, fileName);
    } 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)

Example 2 with JavaCodeStyleSettings

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

the class CopyClassTest method testLibraryClass.

public void testLibraryClass() throws Exception {
    // IDEADEV-28791
    JavaCodeStyleSettings javaSettings = getCurrentCodeStyleSettings().getCustomSettings(JavaCodeStyleSettings.class);
    javaSettings.CLASS_NAMES_IN_JAVADOC = JavaCodeStyleSettings.FULLY_QUALIFY_NAMES_ALWAYS;
    doTest("java.util.ArrayList", "Bar");
}
Also used : JavaCodeStyleSettings(com.intellij.psi.codeStyle.JavaCodeStyleSettings)

Example 3 with JavaCodeStyleSettings

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

the class FullyQualifiedNamesInJavadocOptionProvider method reset.

public void reset(@NotNull CodeStyleSettings settings) {
    JavaCodeStyleSettings javaSettings = settings.getCustomSettings(JavaCodeStyleSettings.class);
    QualifyJavadocOptions option = QualifyJavadocOptions.fromIntValue(javaSettings.CLASS_NAMES_IN_JAVADOC);
    myComboBox.setSelectedItem(option);
}
Also used : JavaCodeStyleSettings(com.intellij.psi.codeStyle.JavaCodeStyleSettings)

Example 4 with JavaCodeStyleSettings

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

the class JavaReferenceAdjuster method process.

@Override
public ASTNode process(@NotNull ASTNode element, boolean addImports, boolean incompleteCode, Project project) {
    final CodeStyleSettings settings = CodeStyleSettingsManager.getSettings(project);
    JavaCodeStyleSettings javaSettings = settings.getCustomSettings(JavaCodeStyleSettings.class);
    return process(element, addImports, incompleteCode, javaSettings.useFqNamesInJavadocAlways(), settings.USE_FQ_CLASS_NAMES);
}
Also used : JavaCodeStyleSettings(com.intellij.psi.codeStyle.JavaCodeStyleSettings) CodeStyleSettings(com.intellij.psi.codeStyle.CodeStyleSettings) JavaCodeStyleSettings(com.intellij.psi.codeStyle.JavaCodeStyleSettings)

Example 5 with JavaCodeStyleSettings

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

the class JavaReferenceAdjuster method processRange.

@Override
public void processRange(@NotNull ASTNode element, int startOffset, int endOffset, Project project) {
    final CodeStyleSettings settings = CodeStyleSettingsManager.getSettings(project);
    JavaCodeStyleSettings javaSettings = settings.getCustomSettings(JavaCodeStyleSettings.class);
    processRange(element, startOffset, endOffset, javaSettings.useFqNamesInJavadocAlways(), settings.USE_FQ_CLASS_NAMES);
}
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