private void encodeSelectionOutsideCurrentRange(FacesContext context, AbstractExtendedDataTable table, String selectionFlag) { // TODO
// Rename
// method
Object key = table.getRowKey();
table.captureOrigValue(context);
SequenceRange range = (SequenceRange) table.getComponentState().getRange();
SequenceRange newRange = null;
Map<String, Object> attributes = table.getAttributes();
Object rowKey = attributes.get("shiftRowKey");
if (rowKey == null) {
rowKey = attributes.get("activeRowKey");
attributes.put("shiftRowKey", rowKey);
}
table.setRowKey(rowKey);
int shiftIndex = table.getRowIndex();
if (ClientSelection.FLAG_ALL.equals(selectionFlag)) {
newRange = new SequenceRange(0, 0);
} else if (shiftIndex > 0) {
if (ClientSelection.FLAG_BEFORE_RANGE.equals(selectionFlag)) {
newRange = new SequenceRange(shiftIndex, range.getFirstRow() - shiftIndex);
} else {
int last = range.getFirstRow() + range.getRows();
newRange = new SequenceRange(last, shiftIndex - last + 1);
}
}
table.setRowKey(context, key);
table.restoreOrigValue(context);
if (newRange != null) {