Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » Do not allow to check grayed checkboxes in CheckboxTableViewer
Do not allow to check grayed checkboxes in CheckboxTableViewer [message #465929] Fri, 23 December 2005 02:15
Vladimir Grishchenko is currently offline Vladimir GrishchenkoFriend
Messages: 7
Registered: July 2009
Junior Member

Not exactly a SWT question but I thought I'd ask it here. What is the best
way to prevent checking of grayed elements when using a CheckboxTableViewer?
My solution below which seem to work is to revert the state to unchecked for
grayed elements. Is there a more elegant way of doing it? I want to avoid
subclassing CheckboxTableViewer as "it is not intended to be subclassed
outside the viewer framework".

cbTableViewer.addCheckStateListener(new ICheckStateListener() {
public void checkStateChanged(CheckStateChangedEvent event) {
if (cbTableViewer.getGrayed(event.getElement()) && event.getChecked()) {
cbTableViewer.setChecked(event.getElement(), false);
//process check state change

Previous Topic:Get Color RGB under Cursor from Control ?
Next Topic:How to add request headers when open url in SWT Browser or WebBrowserEditor?
Goto Forum:

Current Time: Sun Sep 22 09:45:39 GMT 2019

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

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

Back to the top