Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » Checking & Greying tree items
Checking & Greying tree items [message #452417] Mon, 21 March 2005 08:45
Alex Chan is currently offline Alex ChanFriend
Messages: 16
Registered: July 2009
Junior Member
Hi all, Here's what I would like to achieve, but haven't been able to
solve at the moment. I have a main tree called tree1. Within my main tree
I have a treeItem called treeItemA. treeItemA consists of two child
treeItems namely treeItemB and treeItemC. What I would like to achieve are
the following conditions:
1. if treeItemB & treeItemC are checked, treeItemA is checked but not
2. if either one of treeItemB or threeItemC is checked (B checked & C not
OR C checked & B not), treeItemA is grayed.
3. if treeItemA is checked, both treeItemB & treeItemC are checked.

Here's my code for the time being:

tree1 = new Tree(composite2, SWT.CHECK);
FormData tree1LData = new FormData();
tree1.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent evt) {
//do something here to meet the above stated conditions
//do something here to meet the above stated conditions
//do something here to meet the above stated conditions
tree1LData.height = 213;
tree1LData.width = 474;
tree1LData.left = new FormAttachment(0, 1000, 2); = new FormAttachment(0, 1000, 3);
treeItemA = new TreeItem(tree1,SWT.NONE);
treeItemB = new TreeItem(treeItemA,SWT.NONE);
treeItemC = new TreeItem(treeItemA,SWT.NONE);

Anyone here mind helping me out on solving this problem?...So far, I can't
get the action sequence to fire properly...The conditions have to be met
abitrarily where the user has the flexibility of checking either one of
treeItemA or treeItemB or treeItemC first...Thanks in advance guys!!!

Previous Topic:Ugly image in TreeItem (vs. Label)
Next Topic:SWT Browser - Catching Get / Put
Goto Forum:

Current Time: Fri Mar 05 20:50:09 GMT 2021

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

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

Back to the top