如何在SWT表的列中添加超链接? [英] How to add Hyperlink in SWT Table`s column?
本文介绍了如何在SWT表的列中添加超链接?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何在SWT表列中添加超链接?
我使用org.eclipse.swt.widgets.Table类。
How to add Hyperlink in SWT Table column ? I`m using org.eclipse.swt.widgets.Table class.
有没有办法这样做,而不使用TableViewer,JFace?
Is there any way to do this without using TableViewer, JFace ?
我尝试过这种方式但不能正常工作(不显示超链接)。
I tried this way but not working correctly (not showing hyperlinks).
for(int i=2; i<4; i++){
Hyperlink link = new Hyperlink(table, SWT.WRAP);
link.setText(temp[i]);
link.setUnderlined(true);
TableEditor editor = new TableEditor(table);
editor.setEditor(link, tableItem[index-1], i); //set hyperlinks in column i
}
推荐答案
SWT.ItemPaint (也可能 SWT.ItemErase
和 SWT.ItemMeassure
)。
使用 TableView
更容易,但如果您使用正确的 LabelProvider
...
It is easier with TableView
though if you use the correct LabelProvider
...
这篇关于如何在SWT表的列中添加超链接?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文