Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » Disable CheckboxTableViewer
Disable CheckboxTableViewer [message #484750] Wed, 09 September 2009 06:43 Go to next message
Rahul Yadav is currently offline Rahul YadavFriend
Messages: 65
Registered: July 2009
Member
Hi,
is there a way to disable i.e setEnable(false) for CheckboxTableViewer?
as a workaround i am setting each element to gray in CheckboxTableViewer
and restricting check mark on element with some event handling...

diagramTypeGroupCtv.addCheckStateListener(new ICheckStateListener() {
public void checkStateChanged(CheckStateChangedEvent event) {
if (event.getChecked() && !diagramExt.getSelection()) {
diagramTypeGroupCtv.setChecked(event.getElement(), false); }
if (!event.getChecked() && !diagramExt.getSelection()) {
diagramTypeGroupCtv.setChecked(event.getElement(), true);
}
if (event.getChecked() && diagramExt.getSelection()) {
DiagramType diaType = (DiagramType) event.getElement();
if (diaType.getName()).equalsIgnoreCase("Select All"))
{ diagramTypeGroupCtv.setAllChecked(true);
}
}
if (!event.getChecked() && diagramExt.getSelection()) {
DiagramType diaType = (DiagramType) event.getElement();
if ((diaType.getName()).equalsIgnoreCase("Select All"))
{ diagramTypeGroupCtv.setAllChecked(false);
}
}
}
});
Re: Disable CheckboxTableViewer [message #484766 is a reply to message #484750] Wed, 09 September 2009 08:01 Go to previous message
Daniel Krügler is currently offline Daniel KrüglerFriend
Messages: 853
Registered: July 2009
Senior Member
Rahul Yadav wrote:
> Hi,
> is there a way to disable i.e setEnable(false) for CheckboxTableViewer?
> as a workaround i am setting each element to gray in CheckboxTableViewer
> and restricting check mark on element with some event handling...
>
> diagramTypeGroupCtv.addCheckStateListener(new ICheckStateListener() {
> public void checkStateChanged(CheckStateChangedEvent event) {
> if (event.getChecked() && !diagramExt.getSelection())
> { diagramTypeGroupCtv.setChecked(event.getElement(),
> false); }
> if (!event.getChecked() && !diagramExt.getSelection()) {
> diagramTypeGroupCtv.setChecked(event.getElement(), true);
> }
> if (event.getChecked() && diagramExt.getSelection()) {
> DiagramType diaType = (DiagramType) event.getElement();
> if (diaType.getName()).equalsIgnoreCase("Select All"))
> { diagramTypeGroupCtv.setAllChecked(true);
> }
> }
> if (!event.getChecked() && diagramExt.getSelection()) {
> DiagramType diaType = (DiagramType) event.getElement();
> if ((diaType.getName()).equalsIgnoreCase("Select All"))
> { diagramTypeGroupCtv.setAllChecked(false);
> }
> }
> }
> });

It seems that you are looking for something like this:

http://tom-eclipse-dev.blogspot.com/2008/10/disable-parts-sw t-tabletree-with.html

HTH & Greetings from Bremen,

Daniel Krügler
Previous Topic:SWT on snow leopard osx 10.6 with older programs
Next Topic:COMPOSITE WITH EMBEDDED STYLE
Goto Forum:
  


Current Time: Sat Aug 24 11:15:58 GMT 2019

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

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

Back to the top