How to add Hyperlink in SWT Table column ? I`m using org.eclipse.swt.widgets.Table class.
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
}
You need to set the size of the editor:
Yes, that is certainly possible. To do this you have to implement
SWT.ItemPaint
(and possibly alsoSWT.ItemErase
andSWT.ItemMeassure
).It is easier with
TableView
though if you use the correctLabelProvider
...Below is one way to draw the hyperlink using TableView with a LabelProvider, as mentioned in Tonny Madsen's answer.
The code below just paints the hyperlink.