org.gjt.sp.util

## Class SyntaxUtilities

- java.lang.Object
- - org.gjt.sp.util.SyntaxUtilities

-     public class SyntaxUtilities
      extends java.lang.Object

  Syntax utilities that depends on JDK only and syntax package.
  Since:
    4.3pre13

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static IPropertyManager` | `propertyManager`

  - ### Method Summary

    All Methods Static Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static java.lang.String` | `getColorHexString(java.awt.Color c)` Converts a color object to its hex value.
    `static SyntaxStyle[]` | `loadStyles(java.lang.String family, int size)` Loads the syntax styles from the properties, giving them the specified base font family and size.
    `static SyntaxStyle[]` | `loadStyles(java.lang.String family, int size, boolean color)` Loads the syntax styles from the properties, giving them the specified base font family and size.
    `static java.awt.Color` | `parseColor(java.lang.String name, java.awt.Color defaultColor)`
    `static SyntaxStyle` | `parseStyle(java.lang.String str, java.lang.String family, int size, boolean color)` Converts a style string to a style object.
    `static SyntaxStyle` | `parseStyle(java.lang.String str, java.lang.String family, int size, boolean color, java.awt.Color defaultFgColor)` Converts a style string to a style object.

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

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### propertyManager

          public static IPropertyManager propertyManager

  - ### Method Detail

    - #### getColorHexString

          public static java.lang.String getColorHexString(java.awt.Color c)

      Converts a color object to its hex value. The hex value prefixed is with `#', for example `#ff0088'.
      Parameters:
        `c` - The color object
      Since:
        jEdit 4.3pre13

    - #### parseColor

          public static java.awt.Color parseColor(java.lang.String name,
                                                  java.awt.Color defaultColor)

      Since:
        jEdit 4.3pre13

    - #### parseStyle

          public static SyntaxStyle parseStyle(java.lang.String str,
                                               java.lang.String family,
                                               int size,
                                               boolean color,
                                               java.awt.Color defaultFgColor)
                                        throws java.lang.IllegalArgumentException

      Converts a style string to a style object.
      Parameters:
        `str` - The style string
        `family` - Style strings only specify font style, not font family
        `size` - Style strings only specify font style, not font family
        `color` - If false, the styles will be monochrome
        `defaultFgColor` - Default foreground color (if not specified in style string)
      Throws:
        `java.lang.IllegalArgumentException` - if the style is invalid
      Since:
        jEdit 4.3pre17

    - #### parseStyle

          public static SyntaxStyle parseStyle(java.lang.String str,
                                               java.lang.String family,
                                               int size,
                                               boolean color)
                                        throws java.lang.IllegalArgumentException

      Converts a style string to a style object.
      Parameters:
        `str` - The style string
        `family` - Style strings only specify font style, not font family
        `size` - Style strings only specify font style, not font family
        `color` - If false, the styles will be monochrome
      Throws:
        `java.lang.IllegalArgumentException` - if the style is invalid
      Since:
        jEdit 4.3pre13

    - #### loadStyles

          public static SyntaxStyle[] loadStyles(java.lang.String family,
                                                 int size)

      Loads the syntax styles from the properties, giving them the specified base font family and size.
      Parameters:
        `family` - The font family
        `size` - The font size
      Since:
        jEdit 4.3pre13

    - #### loadStyles

          public static SyntaxStyle[] loadStyles(java.lang.String family,
                                                 int size,
                                                 boolean color)

      Loads the syntax styles from the properties, giving them the specified base font family and size.
      Parameters:
        `family` - The font family
        `size` - The font size
        `color` - If false, the styles will be monochrome
      Since:
        jEdit 4.3pre13