Package org.gjt.sp.util
Class SyntaxUtilities
java.lang.Object
org.gjt.sp.util.SyntaxUtilities
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 -
Method Summary
Modifier and TypeMethodDescriptionstatic String
Converts a color object to its hex value.static SyntaxStyle[]
loadStyles
(String family, int size) Loads the syntax styles from the properties, giving them the specified base font family and size.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.static Color
parseColor
(String name, Color defaultColor) static SyntaxStyle
parseStyle
(String str, String family, int size, boolean color) Converts a style string to a style object.static SyntaxStyle
parseStyle
(String str, String family, int size, boolean color, Color defaultFgColor) Converts a style string to a style object.
-
Field Details
-
propertyManager
-
-
Method Details
-
getColorHexString
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
- 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 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:
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 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:
IllegalArgumentException
- if the style is invalid- Since:
- jEdit 4.3pre13
-
loadStyles
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
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
-