I'm using the StandaloneTextArea (STA) component for an editor with syntax highlighting. I know how to define functions and keywords via xml-file, but I don't know how to customize font and color of the STA.
Here is what I have tried so far:
Mode mode = new Mode("asm");
mode.setProperty("file", assemblymodes[COMPILER_ACME]);
ModeProvider.instance.addMode(mode);
standaloneTextArea.getBuffer().setMode(mode);
I have tried something with painter
and setStyle
to set colors, with no success:
TextAreaPainter painter = standaloneTextArea.getPainter();
painter.setStyles(SyntaxUtilities.loadStyles(Font.MONOSPACED, 14));
I know there are color properties like view.style.comment1
, but how to assign these in order to apply custom color schemes to the syntax highlighting?