Search in sources :

Example 16 with XmlCodeStyleSettings

use of com.intellij.psi.formatter.xml.XmlCodeStyleSettings in project intellij-plugins by JetBrains.

the class FlexOptimizeImportsTest method testNoBlankLines2.

@JSTestOptions({ JSTestOption.WithFlexFacet })
public void testNoBlankLines2() throws Throwable {
    JSTestUtils.addClassesToProject(myFixture, true, "com.Foo", "com.Bar", "com.Zzz");
    final CodeStyleSettings styleSettings = CodeStyleSettingsManager.getSettings(getProject());
    XmlCodeStyleSettings xmlSettings = styleSettings.getCustomSettings(XmlCodeStyleSettings.class);
    boolean b = xmlSettings.XML_KEEP_WHITE_SPACES_INSIDE_CDATA;
    try {
        xmlSettings.XML_KEEP_WHITE_SPACES_INSIDE_CDATA = true;
        runOptimizeAction(MXML_FILE_EXTENSION);
    } finally {
        xmlSettings.XML_KEEP_WHITE_SPACES_INSIDE_CDATA = b;
    }
}
Also used : JSCodeStyleSettings(com.intellij.lang.javascript.formatter.JSCodeStyleSettings) XmlCodeStyleSettings(com.intellij.psi.formatter.xml.XmlCodeStyleSettings) ECMA4CodeStyleSettings(com.intellij.lang.javascript.formatter.ECMA4CodeStyleSettings) CodeStyleSettings(com.intellij.psi.codeStyle.CodeStyleSettings) XmlCodeStyleSettings(com.intellij.psi.formatter.xml.XmlCodeStyleSettings) JSTestOptions(com.intellij.lang.javascript.JSTestOptions)

Example 17 with XmlCodeStyleSettings

use of com.intellij.psi.formatter.xml.XmlCodeStyleSettings in project intellij-plugins by JetBrains.

the class FlexEditorTest method testInsertCdataOnGt4.

@JSTestOptions({ JSTestOption.WithFlexFacet })
public void testInsertCdataOnGt4() throws Exception {
    final CodeStyleSettings codeSettings = CodeStyleSettingsManager.getSettings(getProject());
    final XmlCodeStyleSettings xmlSettings = codeSettings.getCustomSettings(XmlCodeStyleSettings.class);
    int currWsAroundCData = xmlSettings.XML_WHITE_SPACE_AROUND_CDATA;
    xmlSettings.XML_WHITE_SPACE_AROUND_CDATA = XmlCodeStyleSettings.WS_AROUND_CDATA_NEW_LINES;
    doGtTestWithJSSupportLoaderAndFlex();
    xmlSettings.XML_WHITE_SPACE_AROUND_CDATA = currWsAroundCData;
}
Also used : JSCodeStyleSettings(com.intellij.lang.javascript.formatter.JSCodeStyleSettings) XmlCodeStyleSettings(com.intellij.psi.formatter.xml.XmlCodeStyleSettings) ECMA4CodeStyleSettings(com.intellij.lang.javascript.formatter.ECMA4CodeStyleSettings) CodeStyleSettings(com.intellij.psi.codeStyle.CodeStyleSettings) XmlCodeStyleSettings(com.intellij.psi.formatter.xml.XmlCodeStyleSettings)

Example 18 with XmlCodeStyleSettings

use of com.intellij.psi.formatter.xml.XmlCodeStyleSettings in project intellij-plugins by JetBrains.

the class ActionScriptFormatterTest method testCDATAFormattingOptions2.

public void testCDATAFormattingOptions2() throws Exception {
    final CodeStyleSettings settings = CodeStyleSettingsManager.getInstance(getProject()).getCurrentSettings();
    final XmlCodeStyleSettings xmlSettings = settings.getCustomSettings(XmlCodeStyleSettings.class);
    int currCDATAWhitespace = xmlSettings.XML_WHITE_SPACE_AROUND_CDATA;
    xmlSettings.XML_WHITE_SPACE_AROUND_CDATA = XmlCodeStyleSettings.WS_AROUND_CDATA_NONE;
    doTestFromFile("mxml");
    xmlSettings.XML_WHITE_SPACE_AROUND_CDATA = currCDATAWhitespace;
}
Also used : JSCodeStyleSettings(com.intellij.lang.javascript.formatter.JSCodeStyleSettings) CommonCodeStyleSettings(com.intellij.psi.codeStyle.CommonCodeStyleSettings) XmlCodeStyleSettings(com.intellij.psi.formatter.xml.XmlCodeStyleSettings) ECMA4CodeStyleSettings(com.intellij.lang.javascript.formatter.ECMA4CodeStyleSettings) CodeStyleSettings(com.intellij.psi.codeStyle.CodeStyleSettings) XmlCodeStyleSettings(com.intellij.psi.formatter.xml.XmlCodeStyleSettings)

Example 19 with XmlCodeStyleSettings

use of com.intellij.psi.formatter.xml.XmlCodeStyleSettings in project android by JetBrains.

the class AndroidXmlFormatterTest method testLayout6.

public void testLayout6() throws Exception {
    final XmlCodeStyleSettings xmlSettings = mySettings.getCustomSettings(XmlCodeStyleSettings.class);
    xmlSettings.XML_ALIGN_ATTRIBUTES = false;
    final AndroidXmlCodeStyleSettings androidSettings = mySettings.getCustomSettings(AndroidXmlCodeStyleSettings.class);
    androidSettings.LAYOUT_SETTINGS.INSERT_LINE_BREAK_BEFORE_FIRST_ATTRIBUTE = false;
    androidSettings.LAYOUT_SETTINGS.INSERT_BLANK_LINE_BEFORE_TAG = false;
    doTestLayout("layout1.xml");
}
Also used : AndroidXmlCodeStyleSettings(org.jetbrains.android.formatter.AndroidXmlCodeStyleSettings) XmlCodeStyleSettings(com.intellij.psi.formatter.xml.XmlCodeStyleSettings) AndroidXmlCodeStyleSettings(org.jetbrains.android.formatter.AndroidXmlCodeStyleSettings)

Example 20 with XmlCodeStyleSettings

use of com.intellij.psi.formatter.xml.XmlCodeStyleSettings in project android by JetBrains.

the class AndroidXmlFormatterTest method testLayout3.

public void testLayout3() throws Exception {
    final XmlCodeStyleSettings xmlSettings = mySettings.getCustomSettings(XmlCodeStyleSettings.class);
    xmlSettings.XML_ATTRIBUTE_WRAP = CommonCodeStyleSettings.DO_NOT_WRAP;
    xmlSettings.XML_KEEP_BLANK_LINES = 0;
    doTestLayout("layout1.xml");
}
Also used : XmlCodeStyleSettings(com.intellij.psi.formatter.xml.XmlCodeStyleSettings) AndroidXmlCodeStyleSettings(org.jetbrains.android.formatter.AndroidXmlCodeStyleSettings)

Aggregations

XmlCodeStyleSettings (com.intellij.psi.formatter.xml.XmlCodeStyleSettings)23 AndroidXmlCodeStyleSettings (org.jetbrains.android.formatter.AndroidXmlCodeStyleSettings)10 CodeStyleSettings (com.intellij.psi.codeStyle.CodeStyleSettings)9 ECMA4CodeStyleSettings (com.intellij.lang.javascript.formatter.ECMA4CodeStyleSettings)6 JSCodeStyleSettings (com.intellij.lang.javascript.formatter.JSCodeStyleSettings)6 CommonCodeStyleSettings (com.intellij.psi.codeStyle.CommonCodeStyleSettings)5 JSTestOptions (com.intellij.lang.javascript.JSTestOptions)2 IntentionAction (com.intellij.codeInsight.intention.IntentionAction)1 VirtualFile (com.intellij.openapi.vfs.VirtualFile)1 ArrangementGroupingRule (com.intellij.psi.codeStyle.arrangement.group.ArrangementGroupingRule)1 StdArrangementMatchRule (com.intellij.psi.codeStyle.arrangement.match.StdArrangementMatchRule)1 ArrayList (java.util.ArrayList)1 ChooseFileIntentionAction (org.jetbrains.idea.maven.dom.intentions.ChooseFileIntentionAction)1 MavenDomDependency (org.jetbrains.idea.maven.dom.model.MavenDomDependency)1 MavenDomProjectModel (org.jetbrains.idea.maven.dom.model.MavenDomProjectModel)1