Bug 259092 - [Viewers] Allow disabling checkboxes in CheckBoxTreeViewer
Summary: [Viewers] Allow disabling checkboxes in CheckBoxTreeViewer
Status: NEW
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.4.1   Edit
Hardware: PC Mac OS X - Carbon (unsup.)
: P3 enhancement with 8 votes (vote)
Target Milestone: ---   Edit
Assignee: Platform UI Triaged CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on: 203943
Blocks: 280064
  Show dependency tree
 
Reported: 2008-12-17 08:16 EST by Antoine Toulmé CLA
Modified: 2017-07-31 09:54 EDT (History)
9 users (show)

See Also:


Attachments
Screenshot of a disabled checkbox (6.06 KB, image/png)
2008-12-17 10:37 EST, Antoine Toulmé CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Antoine Toulmé CLA 2008-12-17 08:16:31 EST
I would like to be able to disable the checkboxes of a CheckBoxTreeViewer, while leaving the possibility for people to expand the tree.
Comment 1 Thomas Schindl CLA 2008-12-17 08:30:13 EST
Did you see this blog entry? It looks there are multiple ways of doing this kind of thing already with custom code.

http://tom-eclipse-dev.blogspot.com/2008/10/disable-parts-swt-tabletree-with.html
Comment 2 Antoine Toulmé CLA 2008-12-17 08:49:47 EST
Tom, that would work, but as outlined in comment 1:

"Unfortunately, not allowing check/uncheck is only half of the problem. You have to still give the user some sense that they are looking at an unmodifiable item or they get frustrated trying to check/uncheck."

I could certainly use the trick you use. But it is imperative that my users understand the checkboxes are locked.

As the elements already have images, I can't substitute them to locks. I could add a decoration, but that's really quirky, plus some are decorated already.

I see you posted this too:
http://tom-eclipse-dev.blogspot.com/2007/01/tableviewers-and-nativelooking.html

So maybe I can use yet another image for the check box in case it is locked ?
Comment 3 Thomas Schindl CLA 2008-12-17 08:52:47 EST
No the image is not drawn above the Tree-Icon so it won't help you. I can't see what JFace can do for you here because SWT has no abstraction for a disabled looking checkbox. The only possibility is to gray out the text of the item to make it look disabled.
Comment 4 Antoine Toulmé CLA 2008-12-17 10:37:09 EST
Created attachment 120705 [details]
Screenshot of a disabled checkbox

Well it seems there is a support for a disabled look of checkboxes, see the screenshot of a disabled checkbox Button.

FWIW I found some people had been asking about this some time ago:
http://dev.eclipse.org/newslists/news.eclipse.platform.rcp/msg18483.html

I think this would be a popular enhancement to check box tree viewers.
Comment 5 Antoine Toulmé CLA 2008-12-22 09:31:58 EST
Tom, I will follow your advice for now.

I would recommend to leave this bug open for future investigation.
Comment 6 Eric Moffatt CLA 2008-12-22 12:43:31 EST
The new code for the customize perspective dialog has at least some implementation of this. If an action set is 'turned off' then the menu and toolbar visibility tabs will show the entries as 'disabled'. I'm pretty sure it requires a label provider capable of controlling the color.
Comment 7 Boris Bokowski CLA 2009-01-05 12:36:03 EST
We cannot do anything in JFace until and if SWT adds support for this at their level.
Comment 8 Antoine Toulmé CLA 2009-01-05 12:47:40 EST
(In reply to comment #7)
> We cannot do anything in JFace until and if SWT adds support for this at their
> level.
> 
Ah, so should I open a bug against SWT ? 
Comment 9 Boris Bokowski CLA 2009-01-05 15:13:40 EST
(In reply to comment #8)
> Ah, so should I open a bug against SWT ? 

You could comment on the SWT bug that already exists (bug 203943). I already marked this bug as dependent on the SWT bug.
Comment 10 Antoine Toulmé CLA 2009-01-05 15:50:48 EST
(In reply to comment #9)
OK, thanks Boris.
Comment 11 Boris Bokowski CLA 2009-11-26 09:52:31 EST
Hitesh is now responsible for watching bugs in the [Viewers] component area.
Comment 12 Arthur Daussy CLA 2014-07-04 02:53:42 EDT
Hello every one,

 I'm facing the same problem as Antoine. Is there any update on this issue?

Regards,

Arthur
Comment 13 Missing name CLA 2017-07-31 09:54:55 EDT
I have the same issue.
Is there any good solution?