Javafx InlineCssTextArea(RichTextFX)当前样式?

Javafx InlineCssTextArea(RichTextFX)当前样式?,javafx,richtextfx,Javafx,Richtextfx,我正在尝试使用RichTextFX库组件InlineCssTextArea在javafx中实现类似于富文本编辑器的功能 我希望API与此类似: InlineCssTextArea area = new InlineCssTextArea(); area.setStyle("-fx-font-weight: bold;"); //now user input is bold area.setStyle("text-decoration: underline;"); //now user input

我正在尝试使用RichTextFX库组件InlineCssTextArea在javafx中实现类似于富文本编辑器的功能

我希望API与此类似:

InlineCssTextArea area = new InlineCssTextArea();
area.setStyle("-fx-font-weight: bold;");
//now user input is bold
area.setStyle("text-decoration: underline;");
//now user input is bold and underlined
area.setStyle("-fx-font-weight: normal;");
//now user input is just underlined
但似乎所有的风格变化都必须适用于一系列角色。我错过什么了吗?这个用例似乎是最自然的

我是否必须跟踪当前的carret位置,并相应地应用更改?

请参见官方查看官方