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.
构造器和说明 |
---|
Theme(RSyntaxTextArea textArea)
Creates a theme from an RSyntaxTextArea.
|
限定符和类型 | 方法和说明 |
---|---|
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 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)