开发者

RCP/RAP: Link in SWT/JFace-TableViewer-Cell

Does anyone know a possibility to place a link in a JFace-Tab开发者_StackOverflowleViewer-Cell? I just need something that fires an event, when it is clicked on. Something that looks like a hyperlink would be perfect. The (big) problem is, that it should work not only under RCP but also under RAP.


I don't know how to do this for RAP, but for RCP have a look at the answer for How to add Hyperlink in SWT Table`s column?.

Unfortunately, the graphical context is not supported with RAP (AFAIK...)...


It is very easy and can be done with something called Markup (https://www.eclipse.org/rap/developers-guide/devguide.php?topic=markup.html&version=3.23): in getText() of ColumnLabelProvider you could provide html part for example getText() result for link could look like this:

return "<a href='http://www.eclipse.org/rap' target='_blank'>RAP</a>";


Another way is to use TreeViewerColumn.setEditingSupport and override the ColumnViewer class. In that way, you could have your own custom control after you click on a cell (in edition mode).

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜