3

Does anyone know a possibility to place a link in a JFace-TableViewer-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.

Kai
  • 38,985
  • 14
  • 88
  • 103
bingo74
  • 31
  • 2

3 Answers3

1

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...)...

Community
  • 1
  • 1
Tonny Madsen
  • 12,628
  • 4
  • 31
  • 70
0

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>";
Damian
  • 1
  • 1
0

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).

Jeremy Caney
  • 7,102
  • 69
  • 48
  • 77
Damian
  • 1
  • 1
  • As it’s currently written, your answer is unclear. Please [edit] to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Jeremy Caney Feb 27 '23 at 00:23