]> source.dussan.org Git - vaadin-framework.git/commitdiff
Rename SelectAllCheckBoxVisible enumeration. (#7981)
authorDenis <denis@vaadin.com>
Wed, 14 Dec 2016 11:21:52 +0000 (13:21 +0200)
committerGitHub <noreply@github.com>
Wed, 14 Dec 2016 11:21:52 +0000 (13:21 +0200)
Fixes vaadin/framework8-issues#540

server/src/main/java/com/vaadin/ui/components/grid/MultiSelectionModelImpl.java
server/src/test/java/com/vaadin/tests/components/grid/GridMultiSelectionModelTest.java
uitest/src/main/java/com/vaadin/tests/components/grid/GridMultiSelectionOnInit.java
uitest/src/main/java/com/vaadin/tests/components/grid/basics/GridBasics.java

index fa25ff677c11eaa46747beaacc45ed85a8f5cbcf..02f7a4d0de224a5f81ae115f287a1e1718702c67 100644 (file)
@@ -63,7 +63,7 @@ public class MultiSelectionModelImpl<T> extends AbstractSelectionModel<T>
      * only visible if an in-memory data provider is used
      * {@link DataSource#isInMemory()}.
      */
-    public enum SelectAllCheckBoxVisible {
+    public enum SelectAllCheckBoxVisibility {
         /**
          * Shows the select all checkbox, regardless of data provider used.
          * <p>
@@ -129,7 +129,7 @@ public class MultiSelectionModelImpl<T> extends AbstractSelectionModel<T>
 
     private Set<T> selection = new LinkedHashSet<>();
 
-    private SelectAllCheckBoxVisible selectAllCheckBoxVisible = SelectAllCheckBoxVisible.DEFAULT;
+    private SelectAllCheckBoxVisibility selectAllCheckBoxVisibility = SelectAllCheckBoxVisibility.DEFAULT;
 
     @Override
     protected void init() {
@@ -149,18 +149,18 @@ public class MultiSelectionModelImpl<T> extends AbstractSelectionModel<T>
     /**
      * Sets the select all checkbox visibility mode.
      * <p>
-     * The default value is {@link SelectAllCheckBoxVisible#DEFAULT}, which
+     * The default value is {@link SelectAllCheckBoxVisibility#DEFAULT}, which
      * means that the checkbox is only visible if the grid's data provider is
      * in- memory.
      *
-     * @param selectAllCheckBoxVisible
+     * @param selectAllCheckBoxVisibility
      *            the visiblity mode to use
-     * @see SelectAllCheckBoxVisible
+     * @see SelectAllCheckBoxVisibility
      */
-    public void setSelectAllCheckBoxVisible(
-            SelectAllCheckBoxVisible selectAllCheckBoxVisible) {
-        if (this.selectAllCheckBoxVisible != selectAllCheckBoxVisible) {
-            this.selectAllCheckBoxVisible = selectAllCheckBoxVisible;
+    public void setSelectAllCheckBoxVisibility(
+            SelectAllCheckBoxVisibility selectAllCheckBoxVisibility) {
+        if (this.selectAllCheckBoxVisibility != selectAllCheckBoxVisibility) {
+            this.selectAllCheckBoxVisibility = selectAllCheckBoxVisibility;
             markAsDirty();
         }
     }
@@ -169,22 +169,22 @@ public class MultiSelectionModelImpl<T> extends AbstractSelectionModel<T>
      * Gets the current mode for the select all checkbox visibility.
      *
      * @return the select all checkbox visibility mode
-     * @see SelectAllCheckBoxVisible
+     * @see SelectAllCheckBoxVisibility
      * @see #isSelectAllCheckBoxVisible()
      */
-    public SelectAllCheckBoxVisible getSelectAllCheckBoxVisible() {
-        return selectAllCheckBoxVisible;
+    public SelectAllCheckBoxVisibility getSelectAllCheckBoxVisibility() {
+        return selectAllCheckBoxVisibility;
     }
 
     /**
      * Returns whether the select all checkbox will be visible with the current
      * setting of
-     * {@link #setSelectAllCheckBoxVisible(SelectAllCheckBoxVisible)}.
+     * {@link #setSelectAllCheckBoxVisibility(SelectAllCheckBoxVisibility)}.
      *
      * @return {@code true} if the checkbox will be visible with the current
      *         settings
-     * @see SelectAllCheckBoxVisible
-     * @see #setSelectAllCheckBoxVisible(SelectAllCheckBoxVisible)
+     * @see SelectAllCheckBoxVisibility
+     * @see #setSelectAllCheckBoxVisibility(SelectAllCheckBoxVisibility)
      */
     public boolean isSelectAllCheckBoxVisible() {
         updateCanSelectAll();
@@ -224,10 +224,10 @@ public class MultiSelectionModelImpl<T> extends AbstractSelectionModel<T>
      * This is updated as a part of {@link #beforeClientResponse(boolean)},
      * since the data provider for grid can be changed on the fly.
      *
-     * @see SelectAllCheckBoxVisible
+     * @see SelectAllCheckBoxVisibility
      */
     protected void updateCanSelectAll() {
-        switch (selectAllCheckBoxVisible) {
+        switch (selectAllCheckBoxVisibility) {
         case VISIBLE:
             getState(false).selectAllCheckBoxVisible = true;
             break;
index c2896315f2271d0dcefb259b32d8346c41491351..733f00816dc1e82d23b962857474d68784488c0d 100644 (file)
@@ -35,7 +35,7 @@ import com.vaadin.ui.Grid.GridSelectionModel;
 import com.vaadin.ui.Grid.SelectionMode;
 import com.vaadin.ui.UI;
 import com.vaadin.ui.components.grid.MultiSelectionModelImpl;
-import com.vaadin.ui.components.grid.MultiSelectionModelImpl.SelectAllCheckBoxVisible;
+import com.vaadin.ui.components.grid.MultiSelectionModelImpl.SelectAllCheckBoxVisibility;
 
 import elemental.json.JsonObject;
 
@@ -622,28 +622,28 @@ public class GridMultiSelectionModelTest {
         ui.setContent(grid);
         // no items yet, default data provider is empty not in memory one
         Assert.assertFalse(model.isSelectAllCheckBoxVisible());
-        Assert.assertEquals(SelectAllCheckBoxVisible.DEFAULT,
-                model.getSelectAllCheckBoxVisible());
+        Assert.assertEquals(SelectAllCheckBoxVisibility.DEFAULT,
+                model.getSelectAllCheckBoxVisibility());
 
         grid.setItems("Foo", "Bar", "Baz");
 
         // in-memory container keeps default
         Assert.assertTrue(model.isSelectAllCheckBoxVisible());
-        Assert.assertEquals(SelectAllCheckBoxVisible.DEFAULT,
-                model.getSelectAllCheckBoxVisible());
+        Assert.assertEquals(SelectAllCheckBoxVisibility.DEFAULT,
+                model.getSelectAllCheckBoxVisibility());
 
         // change to explicit NO
-        model.setSelectAllCheckBoxVisible(SelectAllCheckBoxVisible.HIDDEN);
+        model.setSelectAllCheckBoxVisibility(SelectAllCheckBoxVisibility.HIDDEN);
 
-        Assert.assertEquals(SelectAllCheckBoxVisible.HIDDEN,
-                model.getSelectAllCheckBoxVisible());
+        Assert.assertEquals(SelectAllCheckBoxVisibility.HIDDEN,
+                model.getSelectAllCheckBoxVisibility());
         Assert.assertFalse(model.isSelectAllCheckBoxVisible());
 
         // change to explicit YES
-        model.setSelectAllCheckBoxVisible(SelectAllCheckBoxVisible.VISIBLE);
+        model.setSelectAllCheckBoxVisibility(SelectAllCheckBoxVisibility.VISIBLE);
 
-        Assert.assertEquals(SelectAllCheckBoxVisible.VISIBLE,
-                model.getSelectAllCheckBoxVisible());
+        Assert.assertEquals(SelectAllCheckBoxVisibility.VISIBLE,
+                model.getSelectAllCheckBoxVisibility());
         Assert.assertTrue(model.isSelectAllCheckBoxVisible());
     }
 
@@ -658,8 +658,8 @@ public class GridMultiSelectionModelTest {
 
         // no items yet, default data provider is empty not in memory one
         Assert.assertFalse(model.isSelectAllCheckBoxVisible());
-        Assert.assertEquals(SelectAllCheckBoxVisible.DEFAULT,
-                model.getSelectAllCheckBoxVisible());
+        Assert.assertEquals(SelectAllCheckBoxVisibility.DEFAULT,
+                model.getSelectAllCheckBoxVisibility());
 
         grid.setDataProvider(
                 new BackEndDataProvider<String, String>(
@@ -672,29 +672,29 @@ public class GridMultiSelectionModelTest {
 
         // not in-memory -> checkbox is hidden
         Assert.assertFalse(model.isSelectAllCheckBoxVisible());
-        Assert.assertEquals(SelectAllCheckBoxVisible.DEFAULT,
-                model.getSelectAllCheckBoxVisible());
+        Assert.assertEquals(SelectAllCheckBoxVisibility.DEFAULT,
+                model.getSelectAllCheckBoxVisibility());
 
         // change to explicit YES
-        model.setSelectAllCheckBoxVisible(SelectAllCheckBoxVisible.VISIBLE);
+        model.setSelectAllCheckBoxVisibility(SelectAllCheckBoxVisibility.VISIBLE);
 
-        Assert.assertEquals(SelectAllCheckBoxVisible.VISIBLE,
-                model.getSelectAllCheckBoxVisible());
+        Assert.assertEquals(SelectAllCheckBoxVisibility.VISIBLE,
+                model.getSelectAllCheckBoxVisibility());
         Assert.assertTrue(model.isSelectAllCheckBoxVisible());
 
         // change to explicit NO
-        model.setSelectAllCheckBoxVisible(SelectAllCheckBoxVisible.HIDDEN);
+        model.setSelectAllCheckBoxVisibility(SelectAllCheckBoxVisibility.HIDDEN);
 
-        Assert.assertEquals(SelectAllCheckBoxVisible.HIDDEN,
-                model.getSelectAllCheckBoxVisible());
+        Assert.assertEquals(SelectAllCheckBoxVisibility.HIDDEN,
+                model.getSelectAllCheckBoxVisibility());
         Assert.assertFalse(model.isSelectAllCheckBoxVisible());
 
         // change back to depends on data provider
-        model.setSelectAllCheckBoxVisible(SelectAllCheckBoxVisible.DEFAULT);
+        model.setSelectAllCheckBoxVisibility(SelectAllCheckBoxVisibility.DEFAULT);
 
         Assert.assertFalse(model.isSelectAllCheckBoxVisible());
-        Assert.assertEquals(SelectAllCheckBoxVisible.DEFAULT,
-                model.getSelectAllCheckBoxVisible());
+        Assert.assertEquals(SelectAllCheckBoxVisibility.DEFAULT,
+                model.getSelectAllCheckBoxVisibility());
 
     }
 }
index 6ef8337c212e8a91c948598cf7f9740f5135d538..77d2bd5a84b316475728f106aaf9982ba384d62d 100644 (file)
@@ -24,7 +24,7 @@ import com.vaadin.ui.Grid;
 import com.vaadin.ui.Grid.SelectionMode;
 import com.vaadin.ui.RadioButtonGroup;
 import com.vaadin.ui.components.grid.MultiSelectionModelImpl;
-import com.vaadin.ui.components.grid.MultiSelectionModelImpl.SelectAllCheckBoxVisible;
+import com.vaadin.ui.components.grid.MultiSelectionModelImpl.SelectAllCheckBoxVisibility;
 
 public class GridMultiSelectionOnInit extends AbstractTestUI {
 
@@ -44,14 +44,14 @@ public class GridMultiSelectionOnInit extends AbstractTestUI {
             grid.getSelectionModel().select("Foo 2");
         }
 
-        RadioButtonGroup<SelectAllCheckBoxVisible> rbg = new RadioButtonGroup<>(
+        RadioButtonGroup<SelectAllCheckBoxVisibility> rbg = new RadioButtonGroup<>(
                 "Select All Visible",
-                Arrays.asList(SelectAllCheckBoxVisible.VISIBLE,
-                        SelectAllCheckBoxVisible.HIDDEN,
-                        SelectAllCheckBoxVisible.DEFAULT));
-        rbg.setValue(selectionModel.getSelectAllCheckBoxVisible());
+                Arrays.asList(SelectAllCheckBoxVisibility.VISIBLE,
+                        SelectAllCheckBoxVisibility.HIDDEN,
+                        SelectAllCheckBoxVisibility.DEFAULT));
+        rbg.setValue(selectionModel.getSelectAllCheckBoxVisibility());
         rbg.addValueChangeListener(event -> selectionModel
-                .setSelectAllCheckBoxVisible(event.getValue()));
+                .setSelectAllCheckBoxVisibility(event.getValue()));
         addComponent(rbg);
     }
 }
index c9c5614205b665f0c06de57e37dc664d04db7799..a72a055e59b1da5c7fa8738ced068b7146e498c1 100644 (file)
@@ -44,7 +44,7 @@ import com.vaadin.ui.StyleGenerator;
 import com.vaadin.ui.TextField;
 import com.vaadin.ui.VerticalLayout;
 import com.vaadin.ui.components.grid.MultiSelectionModelImpl;
-import com.vaadin.ui.components.grid.MultiSelectionModelImpl.SelectAllCheckBoxVisible;
+import com.vaadin.ui.components.grid.MultiSelectionModelImpl.SelectAllCheckBoxVisibility;
 import com.vaadin.ui.components.grid.SingleSelectionModelImpl;
 import com.vaadin.ui.renderers.DateRenderer;
 import com.vaadin.ui.renderers.HtmlRenderer;
@@ -536,20 +536,20 @@ public class GridBasics extends AbstractTestUIWithLog {
         selectionModelItem.addItem("SelectAllCheckbox: Visible", menuItem -> {
             switchToMultiSelect();
             ((MultiSelectionModelImpl<DataObject>) grid.getSelectionModel())
-                    .setSelectAllCheckBoxVisible(
-                            SelectAllCheckBoxVisible.VISIBLE);
+                    .setSelectAllCheckBoxVisibility(
+                            SelectAllCheckBoxVisibility.VISIBLE);
         });
         selectionModelItem.addItem("SelectAllCheckbox: Hidden", menuItem -> {
             switchToMultiSelect();
             ((MultiSelectionModelImpl<DataObject>) grid.getSelectionModel())
-                    .setSelectAllCheckBoxVisible(
-                            SelectAllCheckBoxVisible.HIDDEN);
+                    .setSelectAllCheckBoxVisibility(
+                            SelectAllCheckBoxVisibility.HIDDEN);
         });
         selectionModelItem.addItem("SelectAllCheckbox: Default", menuItem -> {
             switchToMultiSelect();
             ((MultiSelectionModelImpl<DataObject>) grid.getSelectionModel())
-                    .setSelectAllCheckBoxVisible(
-                            SelectAllCheckBoxVisible.DEFAULT);
+                    .setSelectAllCheckBoxVisibility(
+                            SelectAllCheckBoxVisibility.DEFAULT);
         });
     }