如果文本包含回车符,则TreeItem文本将换行

时间:2022-03-14 22:45:39

If text contains any carriage return (say "Hello\r\n Hi"), on setting this text to TreeItem as node item, displays only the text which is before carriage return (ex. "Hello"). I am not sure if there are any limitation with Tree Data Binding if text contains any special characters.

如果文本包含任何回车符(例如“Hello \ r \ n Hi”),则在将此文本设置为TreeItem作为节点项时,仅显示回车前的文本(例如“Hello”)。如果文本包含任何特殊字符,我不确定Tree Data Binding是否有任何限制。

Is this the predefined behavior for TreeItem to truncate text after carriage return character ?

这是TreeItem在回车符后截断文本的预定义行为吗?

Thanks

1 个解决方案

#1


0  

Have a look at this SWT Snippet: Table example snippet: draw multiple lines of text in a table item. Although it is for tables, the same holds true for trees.

看一下这个SWT Snippet:Table示例片段:在表项中绘制多行文本。虽然它适用于表格,但树木也是如此。

#1


0  

Have a look at this SWT Snippet: Table example snippet: draw multiple lines of text in a table item. Although it is for tables, the same holds true for trees.

看一下这个SWT Snippet:Table示例片段:在表项中绘制多行文本。虽然它适用于表格,但树木也是如此。