Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » Custom tooltip on table cell(Able to set the custom tooltip only for the first column)
icon5.gif  Custom tooltip on table cell [message #521291] Wed, 17 March 2010 07:34 Go to next message
Ana Mising name is currently offline Ana Mising nameFriend
Messages: 4
Registered: March 2010
Junior Member
I am trying to set a custom tooltip to all table cells.
But it works only for the first column.

My code looks like this:

Tree tableTree = new Tree(this, SWT.BORDER | SWT.V_SCROLL);
dependencyTreeViewer = new TreeViewer(tableTree);

TreeViewerColumn column1viewer = new TreeViewerColumn(dependencyTreeViewer, SWT.LEFT);
column1viewer.setLabelProvider(new DependencyColumnLabelProvider());

TreeViewerColumn column2viewer = new TreeViewerColumn(dependencyTreeViewer, SWT.LEFT);
column2viewer.setLabelProvider(new TypeColumnLabelProvider());

dependencyTreeViewer.setContentProvider(new DependencyTreeContentProvider());
ColumnViewerToolTipSupport.enableFor(dependencyTreeViewer,To olTip.NO_RECREATE);

DependencyColumnLabelProvider and TypeColumnLabelProvider inherit from ColumnLabelProvider
I override the getToolTipText(Object element) method in the same manner in both classes but I can see tooltip only for the first column.

Is it something to do with this being a tree table and not a simple table?

any help will be much appreciated.
Re: Custom tooltip on table cell [message #521299 is a reply to message #521291] Wed, 17 March 2010 08:22 Go to previous messageGo to next message
Thomas Schindl is currently offline Thomas SchindlFriend
Messages: 6501
Registered: July 2009
Senior Member
You need to create your tree with new Tree(this, SWT.BORDER |
SWT.V_SCROLL | SWT.FULL_SELECTION);

Tom

Am 17.03.10 08:34, schrieb Ana:
> I am trying to set a custom tooltip to all table cells.
> But it works only for the first column.
>
> My code looks like this:
>
> Tree tableTree = new Tree(this, SWT.BORDER | SWT.V_SCROLL);
> dependencyTreeViewer = new TreeViewer(tableTree);
>
> TreeViewerColumn column1viewer = new
> TreeViewerColumn(dependencyTreeViewer, SWT.LEFT);
> column1viewer.setLabelProvider(new DependencyColumnLabelProvider());
>
> TreeViewerColumn column2viewer = new
> TreeViewerColumn(dependencyTreeViewer, SWT.LEFT);
> column2viewer.setLabelProvider(new TypeColumnLabelProvider());
>
> dependencyTreeViewer.setContentProvider(new
> DependencyTreeContentProvider());
> ColumnViewerToolTipSupport.enableFor(dependencyTreeViewer,To
> olTip.NO_RECREATE);
>
> DependencyColumnLabelProvider and TypeColumnLabelProvider inherit from
> ColumnLabelProvider
> I override the getToolTipText(Object element) method in the same manner
> in both classes but I can see tooltip only for the first column.
>
> Is it something to do with this being a tree table and not a simple table?
>
> any help will be much appreciated.
Re: Custom tooltip on table cell [message #521309 is a reply to message #521299] Wed, 17 March 2010 08:47 Go to previous message
Ana Mising name is currently offline Ana Mising nameFriend
Messages: 4
Registered: March 2010
Junior Member

Thanks Tom it works now Razz
Previous Topic:adding actions on text editor
Next Topic:Re: Embed native app
Goto Forum:
  


Current Time: Sat Aug 24 11:01:53 GMT 2019

Powered by FUDForum. Page generated in 0.02263 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top