Search in sources :

Example 1 with AndroidXmlCodeStyleSettings

use of org.jetbrains.android.formatter.AndroidXmlCodeStyleSettings in project android by JetBrains.

the class AndroidXmlFormatterTest method testValues2.

public void testValues2() throws Exception {
    final AndroidXmlCodeStyleSettings androidSettings = mySettings.getCustomSettings(AndroidXmlCodeStyleSettings.class);
    androidSettings.VALUE_RESOURCE_FILE_SETTINGS.INSERT_LINE_BREAK_BEFORE_FIRST_ATTRIBUTE = true;
    doTestValues("values1.xml");
}
Also used : AndroidXmlCodeStyleSettings(org.jetbrains.android.formatter.AndroidXmlCodeStyleSettings)

Example 2 with AndroidXmlCodeStyleSettings

use of org.jetbrains.android.formatter.AndroidXmlCodeStyleSettings 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 3 with AndroidXmlCodeStyleSettings

use of org.jetbrains.android.formatter.AndroidXmlCodeStyleSettings 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)

Example 4 with AndroidXmlCodeStyleSettings

use of org.jetbrains.android.formatter.AndroidXmlCodeStyleSettings in project android by JetBrains.

the class AndroidXmlFormatterTest method testShapeDrawable2.

public void testShapeDrawable2() throws Exception {
    final AndroidXmlCodeStyleSettings androidSettings = mySettings.getCustomSettings(AndroidXmlCodeStyleSettings.class);
    androidSettings.OTHER_SETTINGS.WRAP_ATTRIBUTES = CommonCodeStyleSettings.DO_NOT_WRAP;
    doTest("shapeDrawable1.xml", "res/drawable/drawable.xml");
}
Also used : AndroidXmlCodeStyleSettings(org.jetbrains.android.formatter.AndroidXmlCodeStyleSettings)

Example 5 with AndroidXmlCodeStyleSettings

use of org.jetbrains.android.formatter.AndroidXmlCodeStyleSettings in project android by JetBrains.

the class AndroidXmlFormatterTest method testValues3.

public void testValues3() throws Exception {
    final AndroidXmlCodeStyleSettings androidSettings = mySettings.getCustomSettings(AndroidXmlCodeStyleSettings.class);
    androidSettings.VALUE_RESOURCE_FILE_SETTINGS.WRAP_ATTRIBUTES = CommonCodeStyleSettings.WRAP_ALWAYS;
    doTestValues("values1.xml");
}
Also used : AndroidXmlCodeStyleSettings(org.jetbrains.android.formatter.AndroidXmlCodeStyleSettings)

Aggregations

AndroidXmlCodeStyleSettings (org.jetbrains.android.formatter.AndroidXmlCodeStyleSettings)14 XmlCodeStyleSettings (com.intellij.psi.formatter.xml.XmlCodeStyleSettings)5