Community
Participate
Working Groups
I would like to be able to disable the checkboxes of a CheckBoxTreeViewer, while leaving the possibility for people to expand the tree.
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
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 ?
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.
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.
Tom, I will follow your advice for now. I would recommend to leave this bug open for future investigation.
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.
We cannot do anything in JFace until and if SWT adds support for this at their level.
(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 ?
(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.
(In reply to comment #9) OK, thanks Boris.
Hitesh is now responsible for watching bugs in the [Viewers] component area.
Hello every one, I'm facing the same problem as Antoine. Is there any update on this issue? Regards, Arthur
I have the same issue. Is there any good solution?