Package generic.theme

# Class GAttributes

java.lang.Object
javax.swing.text.SimpleAttributeSet
generic.theme.GAttributes

All Implemented Interfaces:
  `Serializable`, `Cloneable`, `AttributeSet`, `MutableAttributeSet`

public class GAttributes extends SimpleAttributeSet
A drop-in replacement for clients using `SimpleAttributeSet`s. This class will apply a default set of font attributes based on the given font and optional color.

See Also:
  - Serialized Form

- ## Nested Class Summary

  ## Nested classes/interfaces inherited from interface javax.swing.text.AttributeSet

  `AttributeSet.CharacterAttribute, AttributeSet.ColorAttribute, AttributeSet.FontAttribute, AttributeSet.ParagraphAttribute`

- ## Field Summary

  ### Fields inherited from class javax.swing.text.SimpleAttributeSet

  `EMPTY`

  ### Fields inherited from interface javax.swing.text.AttributeSet

  `NameAttribute, ResolveAttribute`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `GAttributes(Font f)`
  `GAttributes(Font f, Color c)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `String`
  `toStyledHtml(String content)`
  A convenience method to style the given text in HTML using the font and color attributes defined in this attribute set.

  ### Methods inherited from class javax.swing.text.SimpleAttributeSet

  `addAttribute, addAttributes, clone, containsAttribute, containsAttributes, copyAttributes, equals, getAttribute, getAttributeCount, getAttributeNames, getResolveParent, hashCode, isDefined, isEmpty, isEqual, removeAttribute, removeAttributes, removeAttributes, setResolveParent, toString`

  ### Methods inherited from class java.lang.Object

  `finalize, getClass, notify, notifyAll, wait, wait, wait`

- ## Constructor Details

  - ### GAttributes

    public GAttributes(Font f)

  - ### GAttributes

    public GAttributes(Font f, Color c)

- ## Method Details

  - ### toStyledHtml

    public String toStyledHtml(String content)
    A convenience method to style the given text in HTML using the font and color attributes defined in this attribute set. The text will be HTML escaped.
    Parameters:
      `content` - the content
    Returns:
      the styled content
    See Also:
      - `HTMLUtilities.styleText(SimpleAttributeSet, String)`