public class Theme
extends java.lang.Object
themes.dtd
. This provides applications and other consumers
with an easy way to style RSyntaxTextArea without having to use the API.
Sample themes are included in the source tree under the /themes
folder, but are not a part of the built RSyntaxTextArea jar. Hosting
applications are free to ship and use these themes as-is, modify them, or
create their own.
Note that to save a Theme
via save(OutputStream)
,
you must currently create a Theme
from a text area wrapped in
an RTextScrollPane
, so that the color information for the
gutter can be retrieved.
Modifier and Type | Field and Description |
---|---|
protected java.awt.Color |
activeLineRangeColor |
protected java.awt.Font |
baseFont |
protected java.awt.Color |
bgColor |
protected java.awt.Color |
caretColor |
protected java.awt.Color |
currentLineHighlight |
protected boolean |
fadeCurrentLineHighlight |
protected java.awt.Color |
foldBG |
protected java.awt.Color |
foldIndicatorFG |
protected java.awt.Color |
gutterBorderColor |
protected java.awt.Color |
hyperlinkFG |
protected boolean |
iconRowHeaderInheritsGutterBG |
protected java.awt.Color |
lineNumberColor |
protected java.lang.String |
lineNumberFont |
protected int |
lineNumberFontSize |
protected java.awt.Color |
marginLineColor |
protected java.awt.Color |
markAllHighlightColor |
protected boolean |
markOccurrencesBorder |
protected java.awt.Color |
markOccurrencesColor |
protected boolean |
matchedBracketAnimate |
protected java.awt.Color |
matchedBracketBG |
protected java.awt.Color |
matchedBracketFG |
protected boolean |
matchedBracketHighlightBoth |
protected SyntaxScheme |
scheme |
protected java.awt.Color[] |
secondaryLanguages |
protected java.awt.Color |
selectionBG |
protected java.awt.Color |
selectionFG |
protected boolean |
selectionRoundedEdges |
protected boolean |
useSelctionFG |
Constructor and Description |
---|
Theme(RSyntaxTextArea textArea)
Creates a theme from an RSyntaxTextArea.
|
Modifier and Type | Method and Description |
---|---|
void |
apply(RSyntaxTextArea textArea)
Applies this theme to a text area.
|
static Theme |
load(java.io.InputStream in)
Loads a theme.
|
static Theme |
load(java.io.InputStream in,
java.awt.Font baseFont)
Loads a theme.
|
void |
save(java.io.OutputStream out)
Saves this theme to an output stream.
|
protected java.awt.Font baseFont
protected java.awt.Color bgColor
protected java.awt.Color caretColor
protected boolean useSelctionFG
protected java.awt.Color selectionFG
protected java.awt.Color selectionBG
protected boolean selectionRoundedEdges
protected java.awt.Color currentLineHighlight
protected boolean fadeCurrentLineHighlight
protected java.awt.Color marginLineColor
protected java.awt.Color markAllHighlightColor
protected java.awt.Color markOccurrencesColor
protected boolean markOccurrencesBorder
protected java.awt.Color matchedBracketFG
protected java.awt.Color matchedBracketBG
protected boolean matchedBracketHighlightBoth
protected boolean matchedBracketAnimate
protected java.awt.Color hyperlinkFG
protected java.awt.Color[] secondaryLanguages
protected SyntaxScheme scheme
protected java.awt.Color gutterBorderColor
protected java.awt.Color activeLineRangeColor
protected boolean iconRowHeaderInheritsGutterBG
protected java.awt.Color lineNumberColor
protected java.lang.String lineNumberFont
protected int lineNumberFontSize
protected java.awt.Color foldIndicatorFG
protected java.awt.Color foldBG
public Theme(RSyntaxTextArea textArea)
RTextScrollPane
to get all gutter color information.textArea
- The text area.public void apply(RSyntaxTextArea textArea)
textArea
- The text area to apply this theme to.public static Theme load(java.io.InputStream in) throws java.io.IOException
in
- The input stream to read from. This will be closed when this
method returns.java.io.IOException
- If an IO error occurs.save(OutputStream)
public static Theme load(java.io.InputStream in, java.awt.Font baseFont) throws java.io.IOException
in
- The input stream to read from. This will be closed when this
method returns.baseFont
- The default font to use for any "base font" properties
not specified in the theme XML. If this is null
,
a default monospaced font will be used.java.io.IOException
- If an IO error occurs.save(OutputStream)
public void save(java.io.OutputStream out) throws java.io.IOException
out
- The output stream to write to.java.io.IOException
- If an IO error occurs.load(InputStream)