public class Theme
extends java.lang.Object
org/fife/ui/rsyntaxtextarea/themes/theme.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 in the
org.fife.ui.rsyntaxtextarea.themes
package, and can be loaded
via getClass().getResourceAsStream(...)
.
All fields are public to facilitate programmatic manipulation, but typically
you won't need to reference any fields directly, rather using the
load()
, save()
, and apply()
methods
for various tasks.
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 |
---|---|
java.awt.Color |
activeLineRangeColor |
java.awt.Color |
armedFoldBG |
java.awt.Font |
baseFont |
java.awt.Color |
bgColor |
java.awt.Color |
caretColor |
java.awt.Color |
currentLineHighlight |
boolean |
fadeCurrentLineHighlight |
java.awt.Color |
foldBG |
java.awt.Color |
foldIndicatorFG |
java.awt.Color |
gutterBackgroundColor |
java.awt.Color |
gutterBorderColor |
java.awt.Color |
hyperlinkFG |
boolean |
iconRowHeaderInheritsGutterBG |
java.awt.Color |
lineNumberColor |
java.lang.String |
lineNumberFont |
int |
lineNumberFontSize |
java.awt.Color |
marginLineColor |
java.awt.Color |
markAllHighlightColor |
boolean |
markOccurrencesBorder |
java.awt.Color |
markOccurrencesColor |
boolean |
matchedBracketAnimate |
java.awt.Color |
matchedBracketBG |
java.awt.Color |
matchedBracketFG |
boolean |
matchedBracketHighlightBoth |
SyntaxScheme |
scheme |
java.awt.Color[] |
secondaryLanguages |
java.awt.Color |
selectionBG |
java.awt.Color |
selectionFG |
boolean |
selectionRoundedEdges |
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.
|
public java.awt.Font baseFont
public java.awt.Color bgColor
public java.awt.Color caretColor
public boolean useSelctionFG
public java.awt.Color selectionFG
public java.awt.Color selectionBG
public boolean selectionRoundedEdges
public java.awt.Color currentLineHighlight
public boolean fadeCurrentLineHighlight
public java.awt.Color marginLineColor
public java.awt.Color markAllHighlightColor
public java.awt.Color markOccurrencesColor
public boolean markOccurrencesBorder
public java.awt.Color matchedBracketFG
public java.awt.Color matchedBracketBG
public boolean matchedBracketHighlightBoth
public boolean matchedBracketAnimate
public java.awt.Color hyperlinkFG
public java.awt.Color[] secondaryLanguages
public SyntaxScheme scheme
public java.awt.Color gutterBackgroundColor
public java.awt.Color gutterBorderColor
public java.awt.Color activeLineRangeColor
public boolean iconRowHeaderInheritsGutterBG
public java.awt.Color lineNumberColor
public java.lang.String lineNumberFont
public int lineNumberFontSize
public java.awt.Color foldIndicatorFG
public java.awt.Color foldBG
public java.awt.Color armedFoldBG
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)