Class SyntaxUtilities

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

public class SyntaxUtilities extends Object
Syntax utilities that depends on JDK only and syntax package.
Since:
4.3pre13
Version:
$Id: StandardUtilities.java 9871 2007-06-28 16:33:20Z Vampire0 $
Author:
Matthieu Casanova
  • Field Details

  • Method Details

    • getColorHexString

      public static String getColorHexString(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 Color parseColor(String name, Color defaultColor)
      Since:
      jEdit 4.3pre13
    • parseStyle

      public static SyntaxStyle parseStyle(String str, String family, int size, boolean color, Color defaultFgColor) throws 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:
      IllegalArgumentException - if the style is invalid
      Since:
      jEdit 4.3pre17
    • parseStyle

      public static SyntaxStyle parseStyle(String str, String family, int size, boolean color) throws 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:
      IllegalArgumentException - if the style is invalid
      Since:
      jEdit 4.3pre13
    • loadStyles

      public static SyntaxStyle[] loadStyles(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(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