/** * Changes the styles used in the editor programmatically. */ private void changeStyleProgrammatically() { // Set the font for all token types. setFont(textArea, new Font("Comic Sans MS", Font.PLAIN, 16)); // Change a few things here and there. SyntaxScheme scheme = textArea.getSyntaxScheme(); scheme.getStyle(Token.RESERVED_WORD).background = Color.pink; scheme.getStyle(Token.DATA_TYPE).foreground = Color.blue; scheme.getStyle(Token.LITERAL_STRING_DOUBLE_QUOTE).underline = true; scheme.getStyle(Token.COMMENT_EOL).font = new Font("Georgia", Font.ITALIC, 12); textArea.revalidate(); }
boolean tabsToSpaces) { SyntaxScheme colorScheme = textArea.getSyntaxScheme(); Style scheme = colorScheme.getStyle(getType());
/** * Set the font for all token types. * * @param textArea The text area to modify. * @param font The font to use. */ public static void setFont(RSyntaxTextArea textArea, Font font) { if (font != null) { SyntaxScheme ss = textArea.getSyntaxScheme(); ss = (SyntaxScheme) ss.clone(); for (int i = 0; i < ss.getStyleCount(); i++) { if (ss.getStyle(i) != null) { ss.getStyle(i).font = font; } } textArea.setSyntaxScheme(ss); textArea.setFont(font); } }
SyntaxScheme scheme = rsta.getSyntaxScheme();
SyntaxScheme scheme = rsta.getSyntaxScheme();
SyntaxScheme scheme = getSyntaxScheme(); if (scheme!=null && old!=null) { scheme.changeBaseFont(old, font);
scheme = textArea.getSyntaxScheme();
textArea.getSyntaxScheme(); final Style scheme = colorScheme.styles[type];
textArea.getSyntaxScheme(); final Style scheme = colorScheme.styles[type];
gutter.setFoldBackground( new Color(Integer.parseInt(temaEditor.getString("background_editor"), 16))); SyntaxScheme scheme = textArea.getSyntaxScheme(); scheme.getStyle(Token.IDENTIFIER) .foreground = new Color(Integer.parseInt(temaEditor.getString("identificador"), 16)); scheme.getStyle(Token.RESERVED_WORD) .foreground = new Color(Integer.parseInt(temaEditor.getString("palavras_reservadas"), 16));
boolean tabsToSpaces) { SyntaxScheme colorScheme = textArea.getSyntaxScheme(); Style scheme = colorScheme.getStyle(getType());
public void actionPerformedImpl(ActionEvent e, RTextArea textArea) { SyntaxScheme scheme = rsta.getSyntaxScheme();
SyntaxScheme scheme = rsta.getSyntaxScheme();
SyntaxScheme scheme = rsta.getSyntaxScheme();
Assert.assertNotEquals(textArea1.getSyntaxScheme(), textArea2.getSyntaxScheme()); Assert.assertNotEquals(textArea1.getBackground(), textArea2.getBackground()); Assert.assertNotEquals(textArea1.getCaretColor(), textArea2.getCaretColor());
Assert.assertEquals(textArea1.getSyntaxScheme(), textArea1.getSyntaxScheme()); Assert.assertEquals(textArea1.getBackground(), textArea2.getBackground()); Assert.assertEquals(textArea1.getCaretColor(), textArea2.getCaretColor());
public static RSyntaxTextArea propertiesTextArea(Theme theme) { final RSyntaxTextArea editorPane = new RSyntaxTextArea(); editorPane.setSyntaxEditingStyle(SyntaxConstants.SYNTAX_STYLE_PROPERTIES_FILE); SyntaxScheme scheme = editorPane.getSyntaxScheme(); scheme.getStyle(Token.RESERVED_WORD).foreground = theme.getColor(ThemeKey.LOG_DETAILS_PROPERTY_KEY); scheme.getStyle(Token.OPERATOR).foreground = theme.getColor(ThemeKey.LOG_DETAILS_PROPERTY_KEY); scheme.getStyle(Token.VARIABLE).foreground = theme.getColor(ThemeKey.LOG_DETAILS_PROPERTY_VALUE); scheme.getStyle(Token.LITERAL_STRING_DOUBLE_QUOTE).foreground = theme.getColor(ThemeKey.LOG_DETAILS_PROPERTY_VALUE); scheme.getStyle(Token.COMMENT_EOL).foreground = theme.getColor(ThemeKey.LOG_DETAILS_STACKTRACE_COMMENT); editorPane.setBackground(new JTextArea().getBackground()); Color highlightColor; if (theme.themeType().equals(Theme.Type.Light)){ highlightColor = editorPane.getBackground().darker(); } else { highlightColor = editorPane.getBackground().brighter(); } editorPane.setCurrentLineHighlightColor(highlightColor); editorPane.revalidate(); return editorPane; } }
SyntaxScheme scheme = getSyntaxScheme(); if (scheme!=null && old!=null) { scheme.changeBaseFont(old, font);
SyntaxScheme scheme = getSyntaxScheme(); if (scheme!=null && old!=null) { scheme.changeBaseFont(old, font);
scheme = textArea.getSyntaxScheme();