TableItem[] items = _tabLibraries.getItems();
for (TableItem item : items) {
if (item.getChecked()) {
itemsChecked = true;
// check dependencies
LibrarySet set = (LibrarySet) item.getData();
if (set.getDependencies() != null) {
for (String id : set.getDependencies()) {
for (TableItem dependentItem : items) {
LibrarySet dependentSet = (LibrarySet) dependentItem.getData();
if (dependentSet.getId().equals(id)) {
dependentItem.setChecked(true);
dependentItem.setForeground(Display.getDefault().getSystemColor(SWT.COLOR_GRAY));
}
}
}
}
} else {
// deselect dependencies
LibrarySet set = (LibrarySet) item.getData();
if (set.getDependencies() != null) {
for (String id : set.getDependencies()) {
for (TableItem dependentItem : items) {
LibrarySet dependentSet = (LibrarySet) dependentItem.getData();
if (dependentSet.getId().equals(id)) {
dependentItem.setForeground(Display.getDefault().getSystemColor(SWT.COLOR_WIDGET_FOREGROUND));
}
}
}
}