Package 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
- Version:
- $Id: StandardUtilities.java 9871 2007-06-28 16:33:20Z Vampire0 $
- Author:
- Matthieu Casanova
-
-
Field Summary
Fields Modifier and Type Field Description static IPropertyManager
propertyManager
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method 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.
-
-
-
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 stringfamily
- Style strings only specify font style, not font familysize
- Style strings only specify font style, not font familycolor
- If false, the styles will be monochromedefaultFgColor
- 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 stringfamily
- Style strings only specify font style, not font familysize
- Style strings only specify font style, not font familycolor
- 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 familysize
- 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 familysize
- The font sizecolor
- If false, the styles will be monochrome- Since:
- jEdit 4.3pre13
-
-