Java SWT TreeViewer with one column that needs to be StyledText

╄→гoц情女王★ 提交于 2019-12-04 16:56:43
greg-449

Use a separate label provider for each column using TreeViewerColumn:

TreeViewer viewer = new TreeViewer(.....);

TreeViewerColumn col1 = new TreeViewerColumn(viewer, SWT.LEAD);

col1.setLabelProvider(col1 label provider);

... repeat for other columns

For columns that require styling use DelegatingStyledCellLabelProvider as the column label provider as described here

Note: Do not call viewer.setLabelProvider when using column label providers.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!