Search in sources :

Example 6 with AndroidXmlCodeStyleSettings

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

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

the class AndroidXmlFormatterTest method testPreferences2.

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

Example 8 with AndroidXmlCodeStyleSettings

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

the class AndroidXmlFormatterTest method testManifest5.

public void testManifest5() throws Exception {
    deleteManifest();
    final AndroidXmlCodeStyleSettings androidSettings = mySettings.getCustomSettings(AndroidXmlCodeStyleSettings.class);
    androidSettings.MANIFEST_SETTINGS.WRAP_ATTRIBUTES = CommonCodeStyleSettings.DO_NOT_WRAP;
    doTestManifest("manifest1.xml");
}
Also used : AndroidXmlCodeStyleSettings(org.jetbrains.android.formatter.AndroidXmlCodeStyleSettings)

Example 9 with AndroidXmlCodeStyleSettings

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

the class AndroidXmlFormatterTest method testManifest6.

public void testManifest6() throws Exception {
    deleteManifest();
    final AndroidXmlCodeStyleSettings androidSettings = mySettings.getCustomSettings(AndroidXmlCodeStyleSettings.class);
    androidSettings.MANIFEST_SETTINGS.GROUP_TAGS_WITH_SAME_NAME = false;
    doTestManifest("manifest1.xml");
}
Also used : AndroidXmlCodeStyleSettings(org.jetbrains.android.formatter.AndroidXmlCodeStyleSettings)

Example 10 with AndroidXmlCodeStyleSettings

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

the class AndroidXmlFormatterTest method testSelector3.

public void testSelector3() throws Exception {
    final AndroidXmlCodeStyleSettings androidSettings = mySettings.getCustomSettings(AndroidXmlCodeStyleSettings.class);
    androidSettings.VALUE_RESOURCE_FILE_SETTINGS.WRAP_ATTRIBUTES = CommonCodeStyleSettings.WRAP_ALWAYS;
    doTest("selector2.xml", "res/color/selector.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