Tuesday, April 21, 2009

Code for selecting/de-selecting the checkbox in tree SWT

Below is a small snippet for code for selecting/de-selecting the child checkbox in tree

TreeItem[] itm = tree.getItems();
for(int i =0; i <>
//selecting parent items
itm[i].setChecked(true); //use false for de-selecting
//getting the child items for the parent items
TreeItem[] childItm = itm[i].getItems();
for(int j = 0; j <>
childItm[j].setChecked(true);
}
}

No comments:

Post a Comment