我想在GWT中的RichTextArea中使用制表符。按下tab键的通常行为是将焦点切换到下一个元素。我试图在RichTextArea中键入文本时捕获TAB键(通过KeyDownHandler),并在当前光标位置插入制表符。遗憾的是,RichTextArea没有像TextArea那样的getCursorPos/setCursorPos。
有什么想法吗?
非常感谢!
Marcus
您可以尝试richTextArea.getFormatter().insertHTML("t")
,这应该在光标位置插入一个表格,或者用表格替换当前选择。