2

I want to get Exactly eclipse editor kind highly customized tooltip like below-

enter image description here

I used eclipse provided snippets of customized Tooltips but none of them were so highly improvised performance and easy to use. How to reuse these Tooltips , any example would help.

Abhishek Choudhary
  • 8,255
  • 19
  • 69
  • 128

1 Answers1

3

you just need to extend org.eclipse.jface.window.ToolTip

and override

protected abstract Composite createToolTipContentArea(Event event,
            Composite parent);

you can add org.eclipse.swt.browser.Browser and set formatted content and add required controls.

sambi reddy
  • 3,065
  • 1
  • 13
  • 10
  • 2
    I guess, using a `Browser` is overkill (and will not work on every platform). A `StyledText` should be sufficient. – Mot May 30 '13 at 08:26
  • I think, as long as eclipse IDE is supported on the platform, browser should also work. – sambi reddy May 30 '13 at 14:32
  • 1
    For example, on common Linux systems there are problems with `Browser`. It can work, but often requires the user to install certain additional packages. Hence, you better should offer a fall-back without `Browser`. Otherwise users easily are frustrated. They will blame your application, not SWT or the packages. – Mot May 30 '13 at 14:48
  • 1
    I see there will issues with browser if you are invoking very complex web page...i think here he just needs to set few lines of formatted html text. if StyledText is used, you need to set Text Styles programmatically. – sambi reddy May 30 '13 at 15:00
  • 1
    I used API's of AbstractInformationControl and IInformationControlExtension2 like these to achieve the one.. Agreed that Browser is as well one easy solution. Linux do have some issue with SWT.BROWSER but eclipse does provide differen plugins of browser for Linux version, so that helped – Abhishek Choudhary Jun 01 '13 at 05:03
  • @AbhishekChoudhary: can you provide one example of protected abstract Composite createToolTipContentArea in SWT table cell? – S-IT Java Mar 23 '17 at 11:23