public void setSelected(Listgroup group, Checkbox check) { int i = 0; for (Iterator<Listitem> it = group.getItems().iterator(); it.hasNext(); ) { Checkbox c = ((Checkbox) ((Listcell) (it.next()).getFirstChild()).getFirstChild()); if (c.isChecked()) i++; } if (i == group.getItems().size()) { check.setChecked(true); habilitarButtons(false); } else if (i < group.getItems().size() && i != 0) { check.setChecked(false); habilitarButtons(false); } else if (i == 0) { check.setChecked(false); habilitarButtons(true); } if (idZBtnDuplicar != null) { if (i == 1) idZBtnDuplicar.setDisabled(false); else idZBtnDuplicar.setDisabled(true); } }
public void setMultiple(Listgroup group, boolean value) { for (Iterator<Listitem> it = group.getItems().iterator(); it.hasNext(); ) { Listitem item = it.next(); if (((Listcell) item.getFirstChild()).getFirstChild() != null) { item.setSelected(value); ((Checkbox) ((Listcell) item.getFirstChild()).getFirstChild()).setChecked(value); habilitarButtons(!value); } } if (idZBtnDuplicar != null) { if (((Checkbox) group.getFirstChild().getFirstChild()).isChecked()) idZBtnDuplicar.setDisabled(true); } }