@Override public void intervalRemoved(ListDataEvent e) { if (isAllEntryConsidered()) { _allEntryIndex = findAllEntryIndex(); } }
@Override public void intervalAdded(ListDataEvent e) { if (isAllEntryConsidered()) { _allEntryIndex = findAllEntryIndex(); } }
@Override public void contentsChanged(ListDataEvent e) { if (isAllEntryConsidered()) { _allEntryIndex = findAllEntryIndex(); } }
public CheckBoxListSelectionModel(ListModel model) { _model = model; if (isAllEntryConsidered()) { _allEntryIndex = findAllEntryIndex(); _model.addListDataListener(this); } setSelectionMode(MULTIPLE_INTERVAL_SELECTION); }
public void setModel(ListModel model) { int oldLength = 0; int newLength = 0; if (_model != null) { oldLength = _model.getSize(); _model.removeListDataListener(this); } _model = model; if (_model != null) { newLength = _model.getSize(); _model.removeListDataListener(this); if (isAllEntryConsidered()) { _model.addListDataListener(this); _allEntryIndex = findAllEntryIndex(); } else if (!_allEntryIndexSet) { _allEntryIndex = -1; } } if (oldLength > newLength) { removeIndexInterval(newLength, oldLength); } }
/** * Sets the flag indicating if this CheckBoxListSelectionModel should consider the CheckBoxList.ALL item if there is one. * <p/> * By default, the flag is true. If you want to improve the performance and don't have "all" entry, or if you do have * an entry similar to "all" entry but want to treat it as a normal entry, please set it to false. * * @param allEntryConsidered the flag * @since 3.3.3 */ public void setAllEntryConsidered(boolean allEntryConsidered) { _allEntryConsidered = allEntryConsidered; if (_model != null) { _model.removeListDataListener(this); } if (isAllEntryConsidered()) { _allEntryIndex = findAllEntryIndex(); if (_model != null) { _model.addListDataListener(this); } } else { _allEntryIndex = -1; } }