Bug 182216 - [Viewers] Unable to use DecoratingLabelProvider with TreeViewer with multi-column Tree
Summary: [Viewers] Unable to use DecoratingLabelProvider with TreeViewer with multi-co...
Status: NEW
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.2.1   Edit
Hardware: All Windows XP
: P3 enhancement with 2 votes (vote)
Target Milestone: ---   Edit
Assignee: Platform UI Triaged CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 79651 (view as bug list)
Depends on: 223392
Blocks: 181215
  Show dependency tree
 
Reported: 2007-04-12 15:54 EDT by Alex Bernstein CLA
Modified: 2019-09-06 15:32 EDT (History)
6 users (show)

See Also:


Attachments
Implemenation ontop of the new API (14.50 KB, text/plain)
2007-04-12 16:34 EDT, Thomas Schindl CLA
no flags Details
Updated to fixes from 181215 and support for CellLabelProvider methods (18.47 KB, patch)
2008-01-30 13:17 EST, Thomas Schindl CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Alex Bernstein CLA 2007-04-12 15:54:03 EDT
I would like to have a constructor in DecoratingLabelProvider that takes ITableLabelProvider as an argument and uses getColumnText and getColumnImage methods.
Right now there seems to be no way to do this.

Even though this sounds like a enhancement request, it is kind of critical to have .
Comment 1 Thomas Schindl CLA 2007-04-12 16:33:40 EDT
I think with the new Viewer-API this is easily possible but we needed to revert the DecoratingLabelProvider. See bug #171612, we will add this a provider in 3.4. Since then I think you can simply use the one before we reverted. I'll attach the code but because I've never worked myself with DecoratingLabelProvider it could be that I'm completely mistaken.
Comment 2 Thomas Schindl CLA 2007-04-12 16:34:38 EDT
Created attachment 63667 [details]
Implemenation ontop of the new API
Comment 3 Boris Bokowski CLA 2007-04-12 16:48:29 EDT
Why is this critical? You are asking for new API, and it is after the API freeze.

Is there no way you can implement the desired functionality yourself, until we can provide it in 3.4?
Comment 4 Alex Bernstein CLA 2007-04-12 17:52:47 EDT
Speaking of the new API, it is difficult to understand without whole picture, but [how] does it address the ITableLabelProvider?
Comment 5 Alex Bernstein CLA 2007-04-12 17:56:55 EDT
It is critical in a sense that the TableTree and its viewer is deprecated. Those classes were unable to display images in the first column, which was bad. So I decided I 'd move away from them to tree with columns. That class (and viewer) can display images in any column, but those images come up undecorated, because the DecoratingLabelprovider that I use in my application is not supported together with ITableLabelProvider (this one must be used with tree+columns). In short, I cannot provide required look-and-feel using current implementation. Being an owner of a huge UI component, I feel it is critical.
Comment 6 Boris Bokowski CLA 2007-04-12 23:57:20 EDT
Alex, can you try using the class attached by Tom? (You would have to move it to one of your packages.) It's definitely worth a try.

As for the new API, you can now do something like the following to set up column-specific label providers:

TreeViewerColumn column = new TreeViewer(treeViewer, SWT.NONE);
column.setLabelProvider(new SomeLabelProvider());
column.setEditingSupport(new EditingSupport() { ... });
column.getColumn().setWidth(200);
column.getColumn().setText("TableHeader");
Comment 7 Boris Bokowski CLA 2007-06-20 16:35:39 EDT
Tom, do you want to take this one?
Comment 8 Boris Bokowski CLA 2007-06-20 16:35:49 EDT
*** Bug 79651 has been marked as a duplicate of this bug. ***
Comment 9 Alex Bernstein CLA 2007-06-20 16:46:25 EDT
I'd love to try it, but I am still on 3.2, and it's a bit difficult to switch right now.
Comment 10 Thomas Schindl CLA 2007-06-21 03:56:20 EDT
taken :-)
Comment 11 charles Prevot CLA 2007-10-23 06:06:25 EDT
I used the same method (see Tom's attachment) to bypass this bug, but instead of extending CellLabelProvider, my class extends ColumnlabelProvider. this way i don't need to redefine the update(ViewerCell cell) method. 
The annoying thing in those workarounds is that I can't move my DecoratingColumnLabelProvider to another package, because of the visibility of ViewerLabel#setHasPendingDecorations()
Comment 12 Thomas Schindl CLA 2007-10-23 06:12:52 EDT
(In reply to comment #11)
> I used the same method (see Tom's attachment) to bypass this bug, but instead
> of extending CellLabelProvider, my class extends ColumnlabelProvider. this way
> i don't need to redefine the update(ViewerCell cell) method. 
> The annoying thing in those workarounds is that I can't move my
> DecoratingColumnLabelProvider to another package, because of the visibility of
> ViewerLabel#setHasPendingDecorations()
> 

What about using reflection? I think putting your class in the org.eclipse.jface-package will fail with signed bundles.
Comment 13 charles Prevot CLA 2007-10-23 10:04:49 EDT
I don't build signed bundles, only a standalone RCP application. It seems to work fine even with product exportation so I will stand this way
Comment 14 charles Prevot CLA 2007-10-29 09:41:29 EDT
There is another method to Override to enable tooltips in Tom's solution:

@Override
public String getToolTipText(Object element)
{
  if(provider instanceof CellLabelProvider) 
  {
    return ((CellLabelProvider) provider).getToolTipText(element);
  }
  return null;
}
Comment 15 Thomas Schindl CLA 2007-12-12 14:43:48 EST
missed the M4 cut
Comment 16 Thomas Schindl CLA 2008-01-30 12:49:57 EST
Has somebody of the ones attached to this bug a snippet for me to test the implementation else I'll have to write my own.
Comment 17 Thomas Schindl CLA 2008-01-30 13:17:26 EST
Created attachment 88319 [details]
Updated to fixes from 181215 and support for CellLabelProvider methods
Comment 18 Chris Aniszczyk CLA 2008-11-04 19:16:23 EST
any news on this becoming a possibility?
Comment 19 Thomas Schindl CLA 2009-05-05 12:17:33 EDT
Missed for 3.5 - but any one is free to test this and report back findings with the above implementation
Comment 20 Thomas Schindl CLA 2010-01-28 17:13:55 EST
multi change because of intenion of stepping back as platform-ui committer
Comment 21 Sebastien Dubois CLA 2010-11-04 13:21:27 EDT
Hi,

  What is the status on this bug?  What is the integration/release plan for this?

  I am working on the Mylyn reviews subproject & I would like this to be included as I want to use this functionality in our plugin to be able to display tooltips on a tree viewer.

Thanks,
Sebastien Dubois
Comment 22 Eclipse Webmaster CLA 2019-09-06 15:32:29 EDT
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.