diff options
author | Teemu Suo-Anttila <teemusa@vaadin.com> | 2014-07-23 15:15:28 +0300 |
---|---|---|
committer | Teemu Suo-Anttila <teemusa@vaadin.com> | 2014-07-31 11:05:07 +0000 |
commit | 6aeee90ccab579052452862e322b1c3ce0e0e51e (patch) | |
tree | 85a9d0229ef4f72700304fe3c158351d49f10ceb /server | |
parent | 5d0aa11b2c83e7f5abfa4c6d9ef71871b810a016 (diff) | |
download | vaadin-framework-6aeee90ccab579052452862e322b1c3ce0e0e51e.tar.gz vaadin-framework-6aeee90ccab579052452862e322b1c3ce0e0e51e.zip |
Refactor GridConnector to remove RowKeyHelper (#13334)
Change-Id: I4c2fec5b46b15eea456d4b0347b2a686943ad113
Diffstat (limited to 'server')
-rw-r--r-- | server/src/com/vaadin/ui/components/grid/Grid.java | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/server/src/com/vaadin/ui/components/grid/Grid.java b/server/src/com/vaadin/ui/components/grid/Grid.java index f5846c0148..514a0496e2 100644 --- a/server/src/com/vaadin/ui/components/grid/Grid.java +++ b/server/src/com/vaadin/ui/components/grid/Grid.java @@ -286,7 +286,7 @@ public class Grid extends AbstractComponent implements SelectionChangeNotifier { SetView<Object> removedItemIds = Sets.difference(oldSelection, newSelection); - if (!addedItemIds.isEmpty()) { + if (!removedItemIds.isEmpty()) { /* * Since these changes come from the client, we want to * modify the selection model and get that event fired to @@ -296,16 +296,16 @@ public class Grid extends AbstractComponent implements SelectionChangeNotifier { */ ignoreSelectionClientSync++; - if (addedItemIds.size() == 1) { - select(addedItemIds.iterator().next()); + if (removedItemIds.size() == 1) { + deselect(removedItemIds.iterator().next()); } else { - assert getSelectionModel() instanceof SelectionModel.Multi : "Got multiple selections, but the selection model is not a SelectionModel.Multi"; + assert getSelectionModel() instanceof SelectionModel.Multi : "Got multiple deselections, but the selection model is not a SelectionModel.Multi"; ((SelectionModel.Multi) getSelectionModel()) - .select(addedItemIds); + .deselect(removedItemIds); } } - if (!removedItemIds.isEmpty()) { + if (!addedItemIds.isEmpty()) { /* * Since these changes come from the client, we want to * modify the selection model and get that event fired to @@ -315,12 +315,12 @@ public class Grid extends AbstractComponent implements SelectionChangeNotifier { */ ignoreSelectionClientSync++; - if (removedItemIds.size() == 1) { - deselect(removedItemIds.iterator().next()); + if (addedItemIds.size() == 1) { + select(addedItemIds.iterator().next()); } else { - assert getSelectionModel() instanceof SelectionModel.Multi : "Got multiple deselections, but the selection model is not a SelectionModel.Multi"; + assert getSelectionModel() instanceof SelectionModel.Multi : "Got multiple selections, but the selection model is not a SelectionModel.Multi"; ((SelectionModel.Multi) getSelectionModel()) - .deselect(removedItemIds); + .select(addedItemIds); } } } |