|
Bounce | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjavax.swing.text.StyleContext
org.bounce.text.xml.XMLContext
public class XMLContext
A list of styles used to render syntax-highlighted XML text.
Note: The XML Editor package is based on the JavaEditorKit example as described in the article 'Customizing a Text Editor' by Timothy Prinzing . See: http://java.sun.com/products/jfc/tsc/articles/text/editor_kit/
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class javax.swing.text.StyleContext |
|---|
StyleContext.NamedStyle, StyleContext.SmallAttributeSet |
| Field Summary |
|---|
| Fields inherited from class javax.swing.text.StyleContext |
|---|
DEFAULT_STYLE |
| Constructor Summary | |
|---|---|
XMLContext()
Constructs a set of style objects to represent XML lexical tokens and initialises these tokens with a font style and color. |
|
| Method Summary | |
|---|---|
int |
getFontStyle(Style style)
Fetch the font to use for a lexical token with the given scan value. |
Color |
getForeground(String token)
Gets the foreground color to use for a lexical token with the given value. |
Color |
getForeground(Style style)
Return the foreground color. |
Style |
getStyle(String token)
Return the style for the token. |
void |
setFontStyle(String token,
int style)
Sets the font to use for a lexical token with the given value. |
void |
setForeground(String token,
Color color)
Sets the foreground color to use for a lexical token with the given value. |
void |
setStyle(String token,
Color foreground,
int style)
Sets the styles, like foreground color and Font style. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public XMLContext()
| Method Detail |
|---|
public void setStyle(String token,
Color foreground,
int style)
token - the token to set the font for.foreground - the foreground color for the token.style - the font-style value for the token.
public void setFontStyle(String token,
int style)
token - the token to set the font for.style - the font-style value for the token.
public void setForeground(String token,
Color color)
token - the token to set the foreground for.color - the foreground color value for the token.public Color getForeground(String token)
token - the style value for the token.
public int getFontStyle(Style style)
style - the style.
public Color getForeground(Style style)
style - the style
public Style getStyle(String token)
getStyle in class StyleContexttoken - the style identifier.
|
Bounce | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||