use of org.fife.ui.rsyntaxtextarea.Theme in project knime-core by knime.
the class KnimeSyntaxTextArea method applySyntaxColors.
/**
* Loads the theme from the {@link JSnippetTextArea}'s class package's {@code eclipse.xml} file.
*
* @throws IOException Problem with loading.
*/
protected void applySyntaxColors() throws IOException {
InputStream in = JSnippetTextArea.class.getResourceAsStream("eclipse.xml");
Theme theme = Theme.load(in);
theme.apply(this);
}
use of org.fife.ui.rsyntaxtextarea.Theme in project zaproxy by zaproxy.
the class HttpPanelSyntaxHighlightTextArea method setLookAndFeel.
private void setLookAndFeel(boolean dark) {
try {
Theme theme = Theme.load(this.getClass().getResourceAsStream(dark ? RESOURCE_DARK : RESOURCE_LIGHT));
theme.apply(this);
setFont();
} catch (IOException e) {
// Ignore
}
}
use of org.fife.ui.rsyntaxtextarea.Theme in project jmeter by apache.
the class JSyntaxTextArea method applyTheme.
/**
* Apply XML Theme to syntax text area
* @param jSyntaxTextArea
*/
private static void applyTheme(JSyntaxTextArea jSyntaxTextArea) {
final boolean isDarklafTheme = LookAndFeelCommand.isDarklafTheme();
final Theme theme = isDarklafTheme ? new DarklafRSyntaxTheme(jSyntaxTextArea) : DEFAULT_THEME;
if (theme != null) {
theme.apply(jSyntaxTextArea);
Font font = jSyntaxTextArea.getFont();
float scale = JMeterUIDefaults.INSTANCE.getScale();
if (Math.abs(scale - 1.0f) > 0.01) {
font = font.deriveFont(font.getSize2D() * scale);
jSyntaxTextArea.setFont(font);
}
}
if (!isDarklafTheme) {
// Darklaf themes provide a custom background color for editors, so we don't overwrite it.
Color color = UIManager.getColor("TextArea.background");
if (color != null) {
// Pretend syntax textarea theme was designed for the current LaF
jSyntaxTextArea.setBackground(color);
}
}
}
use of org.fife.ui.rsyntaxtextarea.Theme in project knime-core by knime.
the class KnimeSyntaxTextArea method applySyntaxColors.
/**
* Loads the theme from this class' package {@code eclipse.xml} file.
*
* @throws IOException Problem with loading.
*/
protected void applySyntaxColors() throws IOException {
try (InputStream in = KnimeSyntaxTextArea.class.getResourceAsStream("eclipse.xml")) {
Theme theme = Theme.load(in);
theme.apply(this);
}
}
Aggregations