diff options
author | Pekka Hyvönen <pekka@vaadin.com> | 2016-12-09 09:14:56 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-12-09 09:14:56 +0200 |
commit | 22063cfe1a027057e523ccd85937162af43edfd8 (patch) | |
tree | 21fae6cecb4c32de02787b4b1ee5cff284d5754b /uitest | |
parent | a95dadcde5a223aacc3005b298d66e00419454e8 (diff) | |
download | vaadin-framework-22063cfe1a027057e523ccd85937162af43edfd8.tar.gz vaadin-framework-22063cfe1a027057e523ccd85937162af43edfd8.zip |
Add a generic selection listener to Grid & SelectionModels (#105)
* Add a generic selection listener to Grid & SelectionModels
Fixes some inconsistent event naming and invalid javadocs.
Fixes vaadin/framework8-issues#541
Diffstat (limited to 'uitest')
3 files changed, 6 insertions, 6 deletions
diff --git a/uitest/src/main/java/com/vaadin/tests/components/abstractlisting/AbstractSingleSelectTestUI.java b/uitest/src/main/java/com/vaadin/tests/components/abstractlisting/AbstractSingleSelectTestUI.java index 544cc73dc7..f2dc3c20ad 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/abstractlisting/AbstractSingleSelectTestUI.java +++ b/uitest/src/main/java/com/vaadin/tests/components/abstractlisting/AbstractSingleSelectTestUI.java @@ -33,7 +33,7 @@ public abstract class AbstractSingleSelectTestUI<T extends AbstractSingleSelect< protected void createListenerMenu() { createListenerAction("Selection listener", "Listeners", - c -> c.addSelectionChangeListener( + c -> c.addSelectionListener( e -> log("Selected: " + e.getValue()))); } diff --git a/uitest/src/main/java/com/vaadin/tests/components/grid/basics/GridBasics.java b/uitest/src/main/java/com/vaadin/tests/components/grid/basics/GridBasics.java index 430692477d..4f9d733f44 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/grid/basics/GridBasics.java +++ b/uitest/src/main/java/com/vaadin/tests/components/grid/basics/GridBasics.java @@ -230,7 +230,7 @@ public class GridBasics extends AbstractTestUIWithLog { selectionListenerRegistration = ((SingleSelectionModelImpl<DataObject>) grid .getSelectionModel()) - .addSelectionListener(this::onSingleSelect); + .addSingleSelectionListener(this::onSingleSelect); layout.addComponent(createMenu()); layout.addComponent(grid); @@ -512,7 +512,7 @@ public class GridBasics extends AbstractTestUIWithLog { grid.setSelectionMode(SelectionMode.SINGLE); selectionListenerRegistration = ((SingleSelectionModelImpl<DataObject>) grid .getSelectionModel()) - .addSelectionListener(this::onSingleSelect); + .addSingleSelectionListener(this::onSingleSelect); grid.asSingleSelect().setReadOnly(isUserSelectionAllowed); }); selectionModelItem.addItem("multi", menuItem -> { @@ -558,10 +558,10 @@ public class GridBasics extends AbstractTestUIWithLog { selectionListenerRegistration.remove(); MultiSelectionModelImpl<DataObject> model = (MultiSelectionModelImpl<DataObject>) grid .setSelectionMode(SelectionMode.MULTI); - model.addSelectionListener(this::onMultiSelect); + model.addMultiSelectionListener(this::onMultiSelect); grid.asMultiSelect().setReadOnly(isUserSelectionAllowed); selectionListenerRegistration = model - .addSelectionListener(this::onMultiSelect); + .addMultiSelectionListener(this::onMultiSelect); } } diff --git a/uitest/src/main/java/com/vaadin/tests/components/radiobutton/RadioButtonGroupTestUI.java b/uitest/src/main/java/com/vaadin/tests/components/radiobutton/RadioButtonGroupTestUI.java index 07e5b2c4d0..672ab1a49f 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/radiobutton/RadioButtonGroupTestUI.java +++ b/uitest/src/main/java/com/vaadin/tests/components/radiobutton/RadioButtonGroupTestUI.java @@ -102,7 +102,7 @@ public class RadioButtonGroupTestUI protected void createListenerMenu() { createListenerAction("Selection listener", "Listeners", - c -> c.addSelectionChangeListener( + c -> c.addSelectionListener( e -> log("Selected: " + e.getSelectedItem()))); } |