// Arrows moves the selection and clears previous selections
if (selectMode > SELECT_MODE_NONE && !ctrlSelect && !shiftSelect) {
deselectAll();
- focusedRow.toggleSelection(!ctrlSelect);
+ focusedRow.toggleSelection();
selectionRangeStart = focusedRow;
}
for (String string : selectedKeys) {
VScrollTableRow row = getRenderedRowByKey(string);
if (row != null && !row.isSelected()) {
- row.toggleSelection(false);
+ row.toggleSelection();
}
}
}
}
}
if (uidl.hasAttribute("selected") && !isSelected()) {
- toggleSelection(true);
+ toggleSelection();
}
}
.getMetaKey())
&& selectMode == SELECT_MODE_MULTI
&& multiselectmode == MULTISELECT_MODE_DEFAULT) {
- toggleSelection(true);
+ toggleSelection();
setRowFocus(this);
// Ctrl click (Single selection)
deselectAll();
}
- toggleSelection(true);
+ toggleSelection();
setRowFocus(this);
}
}
selectionRangeStart = this;
- toggleSelection(multiselectmode == MULTISELECT_MODE_DEFAULT);
+ toggleSelection();
setRowFocus(this);
}
/**
* Toggle the selection of the row
*/
- public void toggleSelection(boolean ctrlSelect) {
+ public void toggleSelection() {
selected = !selected;
selectionChanged = true;
if (selected) {
if (selectMode == SELECT_MODE_SINGLE) {
// No previous selection found
deselectAll();
- toggleSelection(true);
+ toggleSelection();
return;
}
if (row == startRow || startSelection) {
startSelection = true;
if (!row.isSelected()) {
- row.toggleSelection(false);
+ row.toggleSelection();
}
selectedRowKeys.add(row.getKey());
}
for (int i = 0; i < keys.length; i++) {
final VScrollTableRow row = getRenderedRowByKey((String) keys[i]);
if (row != null && row.isSelected()) {
- row.toggleSelection(false);
+ row.toggleSelection();
removeKeyFromSelectedRange(Integer.parseInt(row.getKey()));
}
}
boolean wasSelected = focusedRow.isSelected();
deselectAll();
if (!wasSelected || !nullSelectionAllowed) {
- focusedRow.toggleSelection(true);
+ focusedRow.toggleSelection();
}
-
} else {
- focusedRow.toggleSelection(true);
+ focusedRow.toggleSelection();
}
sendSelectedRows();