org.fife.rtext.plugins.tidy
Class HtmlOptions

java.lang.Object
  extended by org.fife.ui.app.Prefs
      extended by org.fife.rtext.plugins.tidy.HtmlOptions

public class HtmlOptions
extends Prefs

Options for tidying HTML.

While all fields in this class are public, please use the getters and setters for accessing them for bounds checking, etc.

Version:
1.0
Author:
Robert Futrell

Field Summary
 boolean hideOptionalEndTags
           
 boolean htmlClean
           
 boolean htmlDropEmptyParas
           
 boolean htmlLogicalEmphasis
           
 int htmlSpaceCount
           
 boolean htmlUpperCaseAttrNames
           
 boolean htmlUpperCaseTagNames
           
 int htmlWrapLength
           
 
Constructor Summary
HtmlOptions()
           
 
Method Summary
 boolean getDropEmptyParas()
          Whether empty "p" elements should be dropped when tidying HTML.
 boolean getHideOptionalEndTags()
          Returns whether optional end tags are hidden in HTML.
 boolean getLogicalEmphasis()
          Returns whether to replace <i> and <b> with <em> and <strong>, respectively.
 boolean getMakeClean()
          Whether presentational tags should be replaced with style rules.
 int getSpaceCount()
          Returns the number of spaces to use for indentation when formatting HTML.
 boolean getUpperCaseAttrNames()
          Returns whether HTML attribute names should be made upper case.
 boolean getUpperCaseTagNames()
          Returns whether HTML tag names should be made upper case.
 int getWrapLength()
          Returns how long formatted lines can be before they are wrapped.
 void setDefaults()
          Sets all fields in this class to their default values.
 void setDropEmptyParas(boolean drop)
          Sets whether empty "p" elements should be dropped when tidying HTML.
 void setHideOptionalEndTags(boolean hide)
          Sets whether optional end tags are hidden in HTML.
 void setLogicalEmphasis(boolean emphasis)
          Sets whether to replace <i> and <b> with <em> and <strong>, respectively.
 void setMakeClean(boolean clean)
          Sets whether presentational tags should be replaced with style rules.
 void setSpaceCount(int count)
          Sets the number of spaces to use for indentation when formatting HTML.
 void setUpperCaseAttrNames(boolean upper)
          Sets whether HTML attribute names should be made upper-case.
 void setUpperCaseTagNames(boolean upper)
          Sets whether HTML tag names should be made upper-case.
 void setWrapLength(int length)
          Sets how long formatted lines can be before they are wrapped.
 
Methods inherited from class org.fife.ui.app.Prefs
load, load, load, save, save, save
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

htmlSpaceCount

public int htmlSpaceCount

htmlClean

public boolean htmlClean

htmlDropEmptyParas

public boolean htmlDropEmptyParas

htmlLogicalEmphasis

public boolean htmlLogicalEmphasis

hideOptionalEndTags

public boolean hideOptionalEndTags

htmlUpperCaseTagNames

public boolean htmlUpperCaseTagNames

htmlUpperCaseAttrNames

public boolean htmlUpperCaseAttrNames

htmlWrapLength

public int htmlWrapLength
Constructor Detail

HtmlOptions

public HtmlOptions()
Method Detail

getDropEmptyParas

public boolean getDropEmptyParas()
Whether empty "p" elements should be dropped when tidying HTML.

Returns:
Whether to drop empty "p" elements.
See Also:
setDropEmptyParas(boolean)

getHideOptionalEndTags

public boolean getHideOptionalEndTags()
Returns whether optional end tags are hidden in HTML.

Returns:
Whether optional end tags are hidden.
See Also:
setHideOptionalEndTags(boolean)

getLogicalEmphasis

public boolean getLogicalEmphasis()
Returns whether to replace <i> and <b> with <em> and <strong>, respectively.

Returns:
Whether to use logical emphasis tags.
See Also:
setLogicalEmphasis(boolean)

getMakeClean

public boolean getMakeClean()
Whether presentational tags should be replaced with style rules.

Returns:
Whether presentational tags should be replaced with style rules.
See Also:
setMakeClean(boolean)

getSpaceCount

public int getSpaceCount()
Returns the number of spaces to use for indentation when formatting HTML.

Returns:
The number of spaces to use.
See Also:
setSpaceCount(int)

getUpperCaseAttrNames

public boolean getUpperCaseAttrNames()
Returns whether HTML attribute names should be made upper case.

Returns:
Whether HTML attribute names should be made upper case.
See Also:
setUpperCaseAttrNames(boolean)

getUpperCaseTagNames

public boolean getUpperCaseTagNames()
Returns whether HTML tag names should be made upper case.

Returns:
Whether HTML tag names should be made upper case.
See Also:
setUpperCaseTagNames(boolean)

getWrapLength

public int getWrapLength()
Returns how long formatted lines can be before they are wrapped.

Returns:
The maximum length of a formatted line, or "0" for no limit.
See Also:
setWrapLength(int)

setDefaults

public void setDefaults()
Sets all fields in this class to their default values.

Specified by:
setDefaults in class Prefs

setDropEmptyParas

public void setDropEmptyParas(boolean drop)
Sets whether empty "p" elements should be dropped when tidying HTML.

Parameters:
drop - Whether to drop empty "p" elements.
See Also:
getDropEmptyParas()

setHideOptionalEndTags

public void setHideOptionalEndTags(boolean hide)
Sets whether optional end tags are hidden in HTML.

Parameters:
hide - Whether optional end tags are hidden.
See Also:
getHideOptionalEndTags()

setLogicalEmphasis

public void setLogicalEmphasis(boolean emphasis)
Sets whether to replace <i> and <b> with <em> and <strong>, respectively.

Parameters:
emphasis - Whether to use logical emphasis tags.
See Also:
getLogicalEmphasis()

setMakeClean

public void setMakeClean(boolean clean)
Sets whether presentational tags should be replaced with style rules.

Parameters:
clean - Whether presentational tags should be replaced with style rules.
See Also:
getMakeClean()

setSpaceCount

public void setSpaceCount(int count)
Sets the number of spaces to use for indentation when formatting HTML.

Parameters:
count - The number of spaces. This should be greater than or equal to -1 (which specifies to use tabs).
See Also:
getSpaceCount()

setUpperCaseAttrNames

public void setUpperCaseAttrNames(boolean upper)
Sets whether HTML attribute names should be made upper-case.

Parameters:
upper - Whether they should be made upper case.
See Also:
getUpperCaseAttrNames()

setUpperCaseTagNames

public void setUpperCaseTagNames(boolean upper)
Sets whether HTML tag names should be made upper-case.

Parameters:
upper - Whether they should be made upper case.
See Also:
getUpperCaseTagNames()

setWrapLength

public void setWrapLength(int length)
Sets how long formatted lines can be before they are wrapped.

Parameters:
length - The maximum length of a formatted line, or "0" for no limit.
See Also:
getWrapLength()