Search in sources :

Example 6 with XmlCodeStyleSettings

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

the class AndroidXmlFormatterTest method testManifest3.

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

Example 7 with XmlCodeStyleSettings

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

the class AndroidXmlFormatterTest method testManifest2.

public void testManifest2() throws Exception {
    deleteManifest();
    final XmlCodeStyleSettings xmlSettings = mySettings.getCustomSettings(XmlCodeStyleSettings.class);
    xmlSettings.XML_ATTRIBUTE_WRAP = CommonCodeStyleSettings.DO_NOT_WRAP;
    xmlSettings.XML_ALIGN_ATTRIBUTES = true;
    xmlSettings.XML_SPACE_INSIDE_EMPTY_TAG = false;
    mySettings.getIndentOptions(XmlFileType.INSTANCE).CONTINUATION_INDENT_SIZE = 8;
    doTestManifest("manifest1.xml");
}
Also used : XmlCodeStyleSettings(com.intellij.psi.formatter.xml.XmlCodeStyleSettings) AndroidXmlCodeStyleSettings(org.jetbrains.android.formatter.AndroidXmlCodeStyleSettings)

Example 8 with XmlCodeStyleSettings

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

the class AndroidXmlFormatterTest method testLayout2.

public void testLayout2() throws Exception {
    final XmlCodeStyleSettings xmlSettings = mySettings.getCustomSettings(XmlCodeStyleSettings.class);
    xmlSettings.XML_ALIGN_ATTRIBUTES = true;
    xmlSettings.XML_SPACE_INSIDE_EMPTY_TAG = false;
    xmlSettings.XML_KEEP_LINE_BREAKS = true;
    mySettings.getIndentOptions(XmlFileType.INSTANCE).CONTINUATION_INDENT_SIZE = 8;
    doTestLayout("layout1.xml");
}
Also used : XmlCodeStyleSettings(com.intellij.psi.formatter.xml.XmlCodeStyleSettings) AndroidXmlCodeStyleSettings(org.jetbrains.android.formatter.AndroidXmlCodeStyleSettings)

Example 9 with XmlCodeStyleSettings

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

the class AndroidXmlFormatterTest method testManifest4.

public void testManifest4() throws Exception {
    deleteManifest();
    final XmlCodeStyleSettings xmlSettings = mySettings.getCustomSettings(XmlCodeStyleSettings.class);
    xmlSettings.XML_ALIGN_ATTRIBUTES = true;
    final AndroidXmlCodeStyleSettings androidSettings = mySettings.getCustomSettings(AndroidXmlCodeStyleSettings.class);
    androidSettings.MANIFEST_SETTINGS.INSERT_LINE_BREAK_BEFORE_FIRST_ATTRIBUTE = false;
    doTestManifest("manifest1.xml");
}
Also used : AndroidXmlCodeStyleSettings(org.jetbrains.android.formatter.AndroidXmlCodeStyleSettings) XmlCodeStyleSettings(com.intellij.psi.formatter.xml.XmlCodeStyleSettings) AndroidXmlCodeStyleSettings(org.jetbrains.android.formatter.AndroidXmlCodeStyleSettings)

Example 10 with XmlCodeStyleSettings

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

the class AndroidXmlFormatterTest method testLayout9.

public void testLayout9() throws Exception {
    // Regression test for https://code.google.com/p/android/issues/detail?id=177858
    final XmlCodeStyleSettings xmlSettings = mySettings.getCustomSettings(XmlCodeStyleSettings.class);
    xmlSettings.XML_ALIGN_ATTRIBUTES = true;
    final AndroidXmlCodeStyleSettings androidSettings = mySettings.getCustomSettings(AndroidXmlCodeStyleSettings.class);
    androidSettings.LAYOUT_SETTINGS.INSERT_LINE_BREAK_BEFORE_FIRST_ATTRIBUTE = true;
    androidSettings.LAYOUT_SETTINGS.INSERT_LINE_BREAK_BEFORE_NAMESPACE_DECLARATION = true;
    androidSettings.LAYOUT_SETTINGS.INSERT_LINE_BREAK_AFTER_LAST_ATTRIBUTE = true;
    doTestLayout("layout1.xml");
}
Also used : AndroidXmlCodeStyleSettings(org.jetbrains.android.formatter.AndroidXmlCodeStyleSettings) 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