com.android.ide.common.xml
Class XmlFormatPreferences

java.lang.Object
  extended by com.android.ide.common.xml.XmlFormatPreferences

public class XmlFormatPreferences
extends java.lang.Object

Formatting preferences used by the Android XML formatter.


Field Summary
 boolean joinLines
          Join lines when reformatting text and comment blocks?
protected  java.lang.String mOneIndentUnit
          The string to insert for each indentation level
protected  int mTabWidth
          Tab width (number of spaces to display for a tab)
 boolean oneAttributeOnFirstLine
          Can attributes appear on the same line as the opening line if there is just one of them?
 boolean reflowText
          Reformat the text and comment blocks?
 boolean removeEmptyLines
          Remove empty lines in all cases?
 XmlAttributeSortOrder sortAttributes
          The sorting order to use when formatting
 boolean spaceBeforeClose
          Should there be a space before the closing > or /> ?
 boolean useEclipseIndent
          Use the Eclipse indent (tab/space, indent size) settings?
 
Constructor Summary
protected XmlFormatPreferences()
           
 
Method Summary
static XmlFormatPreferences defaults()
          Returns a new preferences object initialized with the defaults
 java.util.Comparator<org.w3c.dom.Attr> getAttributeComparator()
          Returns the comparator to use when formatting, or null for no sorting
 java.lang.String getOneIndentUnit()
           
 int getTabWidth()
          Returns the number of spaces used to display a single tab character
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

useEclipseIndent

public boolean useEclipseIndent
Use the Eclipse indent (tab/space, indent size) settings?


removeEmptyLines

public boolean removeEmptyLines
Remove empty lines in all cases?


reflowText

public boolean reflowText
Reformat the text and comment blocks?


joinLines

public boolean joinLines
Join lines when reformatting text and comment blocks?


oneAttributeOnFirstLine

public boolean oneAttributeOnFirstLine
Can attributes appear on the same line as the opening line if there is just one of them?


sortAttributes

public XmlAttributeSortOrder sortAttributes
The sorting order to use when formatting


spaceBeforeClose

public boolean spaceBeforeClose
Should there be a space before the closing > or /> ?


mOneIndentUnit

protected java.lang.String mOneIndentUnit
The string to insert for each indentation level


mTabWidth

protected int mTabWidth
Tab width (number of spaces to display for a tab)

Constructor Detail

XmlFormatPreferences

protected XmlFormatPreferences()
Method Detail

getAttributeComparator

@Nullable
public java.util.Comparator<org.w3c.dom.Attr> getAttributeComparator()
Returns the comparator to use when formatting, or null for no sorting


defaults

@NonNull
public static XmlFormatPreferences defaults()
Returns a new preferences object initialized with the defaults

Returns:
an XmlFormatPreferences object

getOneIndentUnit

public java.lang.String getOneIndentUnit()

getTabWidth

public int getTabWidth()
Returns the number of spaces used to display a single tab character

Returns:
the number of spaces used to display a single tab character