diff options
Diffstat (limited to 'uitest')
34 files changed, 129 insertions, 129 deletions
diff --git a/uitest/src/main/java/com/vaadin/tests/components/abstractlisting/AbstractListingTestUI.java b/uitest/src/main/java/com/vaadin/tests/components/abstractlisting/AbstractListingTestUI.java index 126eb4bf33..9d2ca4f6ea 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/abstractlisting/AbstractListingTestUI.java +++ b/uitest/src/main/java/com/vaadin/tests/components/abstractlisting/AbstractListingTestUI.java @@ -28,7 +28,7 @@ public abstract class AbstractListingTestUI<T extends AbstractListing<Object>> options.put("10000", 10000); options.put("100000", 100000); - createSelectAction("Items", "Data source", options, "20", + createSelectAction("Items", "Data provider", options, "20", (c, number, data) -> { c.setItems(createItems(number)); }); diff --git a/uitest/src/main/java/com/vaadin/tests/components/abstractlisting/AbstractMultiSelectTestUI.java b/uitest/src/main/java/com/vaadin/tests/components/abstractlisting/AbstractMultiSelectTestUI.java index 89f9f9e0ea..0037f0f2d1 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/abstractlisting/AbstractMultiSelectTestUI.java +++ b/uitest/src/main/java/com/vaadin/tests/components/abstractlisting/AbstractMultiSelectTestUI.java @@ -32,7 +32,7 @@ public abstract class AbstractMultiSelectTestUI<MULTISELECT extends AbstractMult "None", (abstractMultiSelect, captionGenerator, data) -> { abstractMultiSelect .setItemCaptionGenerator(captionGenerator); - abstractMultiSelect.getDataSource().refreshAll(); + abstractMultiSelect.getDataProvider().refreshAll(); }, true); } diff --git a/uitest/src/main/java/com/vaadin/tests/components/checkbox/CheckBoxGroupTestUI.java b/uitest/src/main/java/com/vaadin/tests/components/checkbox/CheckBoxGroupTestUI.java index 95d2c016b1..56d45995cb 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/checkbox/CheckBoxGroupTestUI.java +++ b/uitest/src/main/java/com/vaadin/tests/components/checkbox/CheckBoxGroupTestUI.java @@ -64,7 +64,7 @@ public class CheckBoxGroupTestUI } else { group.setItemIconGenerator(DEFAULT_ICON_GENERATOR); } - group.getDataSource().refreshAll(); + group.getDataProvider().refreshAll(); } private int getIndex(Object item) { diff --git a/uitest/src/main/java/com/vaadin/tests/components/combobox/ComboBoxClickIcon.java b/uitest/src/main/java/com/vaadin/tests/components/combobox/ComboBoxClickIcon.java index f6de3d22ba..d6d0c78ea6 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/combobox/ComboBoxClickIcon.java +++ b/uitest/src/main/java/com/vaadin/tests/components/combobox/ComboBoxClickIcon.java @@ -17,7 +17,7 @@ package com.vaadin.tests.components.combobox; import com.vaadin.server.FontAwesome; import com.vaadin.server.VaadinRequest; -import com.vaadin.server.data.DataSource; +import com.vaadin.server.data.DataProvider; import com.vaadin.tests.components.AbstractReindeerTestUI; import com.vaadin.ui.ComboBox; @@ -31,7 +31,7 @@ public class ComboBoxClickIcon extends AbstractReindeerTestUI { @Override protected void setup(VaadinRequest request) { final ComboBox<String> combo = new ComboBox<>(null, - DataSource.create("A", "B", "C")); + DataProvider.create("A", "B", "C")); combo.setItemIconGenerator(item -> FontAwesome.ALIGN_CENTER); combo.setTextInputAllowed(false); addComponent(combo); diff --git a/uitest/src/main/java/com/vaadin/tests/components/combobox/ComboBoxEmptyItemsKeyboardNavigation.java b/uitest/src/main/java/com/vaadin/tests/components/combobox/ComboBoxEmptyItemsKeyboardNavigation.java index 8d3936aecd..90d6ad74a1 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/combobox/ComboBoxEmptyItemsKeyboardNavigation.java +++ b/uitest/src/main/java/com/vaadin/tests/components/combobox/ComboBoxEmptyItemsKeyboardNavigation.java @@ -1,7 +1,7 @@ package com.vaadin.tests.components.combobox; import com.vaadin.server.VaadinRequest; -import com.vaadin.server.data.DataSource; +import com.vaadin.server.data.DataProvider; import com.vaadin.tests.components.AbstractReindeerTestUI; import com.vaadin.ui.ComboBox; @@ -9,7 +9,7 @@ public class ComboBoxEmptyItemsKeyboardNavigation extends AbstractReindeerTestUI @Override protected void setup(VaadinRequest request) { ComboBox<String> comboBox = new ComboBox<>(null, - DataSource.create("foo", "bar")); + DataProvider.create("foo", "bar")); addComponent(comboBox); } diff --git a/uitest/src/main/java/com/vaadin/tests/components/combobox/ComboBoxEnablesComboBox.java b/uitest/src/main/java/com/vaadin/tests/components/combobox/ComboBoxEnablesComboBox.java index 3917ad2ebd..c6ff7496af 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/combobox/ComboBoxEnablesComboBox.java +++ b/uitest/src/main/java/com/vaadin/tests/components/combobox/ComboBoxEnablesComboBox.java @@ -1,7 +1,7 @@ package com.vaadin.tests.components.combobox; import com.vaadin.tests.components.TestBase; -import com.vaadin.tests.util.ItemDataSource; +import com.vaadin.tests.util.ItemDataProvider; import com.vaadin.ui.ComboBox; public class ComboBoxEnablesComboBox extends TestBase { @@ -11,10 +11,10 @@ public class ComboBoxEnablesComboBox extends TestBase { @Override protected void setup() { ComboBox<String> cb = new ComboBox<>("Always enabled", - new ItemDataSource(10)); + new ItemDataProvider(10)); cb.addValueChangeListener(event -> cb2.setEnabled(true)); cb2 = new ComboBox<String>("Initially disabled", - new ItemDataSource(10)); + new ItemDataProvider(10)); cb2.setEnabled(false); addComponent(cb); diff --git a/uitest/src/main/java/com/vaadin/tests/components/combobox/ComboBoxInPopup.java b/uitest/src/main/java/com/vaadin/tests/components/combobox/ComboBoxInPopup.java index f34259e750..fdb97f3402 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/combobox/ComboBoxInPopup.java +++ b/uitest/src/main/java/com/vaadin/tests/components/combobox/ComboBoxInPopup.java @@ -1,7 +1,7 @@ package com.vaadin.tests.components.combobox; import com.vaadin.event.ShortcutAction.KeyCode; -import com.vaadin.server.data.DataSource; +import com.vaadin.server.data.DataProvider; import com.vaadin.tests.components.TestBase; import com.vaadin.ui.Button; import com.vaadin.ui.Button.ClickEvent; @@ -36,7 +36,7 @@ public class ComboBoxInPopup extends TestBase { private Component createComboBox() { return new ComboBox<String>("A combo box", - DataSource.create("Yes", "No", "Maybe")); + DataProvider.create("Yes", "No", "Maybe")); } @Override diff --git a/uitest/src/main/java/com/vaadin/tests/components/combobox/ComboBoxInvalidNullSelection.java b/uitest/src/main/java/com/vaadin/tests/components/combobox/ComboBoxInvalidNullSelection.java index a569801cbe..d01565e7c7 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/combobox/ComboBoxInvalidNullSelection.java +++ b/uitest/src/main/java/com/vaadin/tests/components/combobox/ComboBoxInvalidNullSelection.java @@ -1,6 +1,6 @@ package com.vaadin.tests.components.combobox; -import com.vaadin.server.data.DataSource; +import com.vaadin.server.data.DataProvider; import com.vaadin.tests.components.TestBase; import com.vaadin.tests.util.Log; import com.vaadin.ui.Button; @@ -9,28 +9,28 @@ import com.vaadin.ui.ComboBox; public class ComboBoxInvalidNullSelection extends TestBase { private static final Object CAPTION = "C"; - private DataSource<String> ds1; - private DataSource<String> ds2; + private DataProvider<String> ds1; + private DataProvider<String> ds2; private ComboBox<String> combo; private Log log = new Log(5); @Override protected void setup() { - createDataSources(); + createDataProviders(); - Button b = new Button("Swap data source"); + Button b = new Button("Swap data provider"); b.addClickListener(event -> { - if (combo.getDataSource() == ds1) { - combo.setDataSource(ds2); + if (combo.getDataProvider() == ds1) { + combo.setDataProvider(ds2); } else { - combo.setDataSource(ds1); + combo.setDataProvider(ds1); } combo.setValue("Item 3"); }); combo = new ComboBox<>(); - combo.setDataSource(ds1); + combo.setDataProvider(ds1); combo.addValueChangeListener( event -> log.log("Value is now: " + combo.getValue())); addComponent(log); @@ -39,16 +39,16 @@ public class ComboBoxInvalidNullSelection extends TestBase { addComponent(new Button("Dummy for TestBench")); } - private void createDataSources() { - ds1 = DataSource.create("Item 1", "Item 2", "Item 3", "Item 4"); + private void createDataProviders() { + ds1 = DataProvider.create("Item 1", "Item 2", "Item 3", "Item 4"); - ds2 = DataSource.create("Item 3"); + ds2 = DataProvider.create("Item 3"); } @Override protected String getDescription() { - return "Select \"Item 3\" in the ComboBox, change the data source, focus and blur the ComboBox. The value should temporarily change to null when changing data source but not when focusing and blurring the ComboBox"; + return "Select \"Item 3\" in the ComboBox, change the data provider, focus and blur the ComboBox. The value should temporarily change to null when changing data provider but not when focusing and blurring the ComboBox"; } @Override diff --git a/uitest/src/main/java/com/vaadin/tests/components/combobox/ComboBoxLargeIcons.java b/uitest/src/main/java/com/vaadin/tests/components/combobox/ComboBoxLargeIcons.java index c262b5f01a..1909a90c92 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/combobox/ComboBoxLargeIcons.java +++ b/uitest/src/main/java/com/vaadin/tests/components/combobox/ComboBoxLargeIcons.java @@ -3,7 +3,7 @@ package com.vaadin.tests.components.combobox; import java.util.Date; import com.vaadin.server.ThemeResource; -import com.vaadin.server.data.DataSource; +import com.vaadin.server.data.DataProvider; import com.vaadin.tests.components.TestBase; import com.vaadin.ui.ComboBox; @@ -22,7 +22,7 @@ public class ComboBoxLargeIcons extends TestBase { @Override protected void setup() { ComboBox<String> cb = new ComboBox<String>(null, - DataSource.create("folder-add", "folder-delete", "arrow-down", + DataProvider.create("folder-add", "folder-delete", "arrow-down", "arrow-left", "arrow-right", "arrow-up", "document-add", "document-delete", "document-doc", "document-edit", "document-image", "document-pdf", "document-ppt", diff --git a/uitest/src/main/java/com/vaadin/tests/components/combobox/ComboBoxMousewheel.java b/uitest/src/main/java/com/vaadin/tests/components/combobox/ComboBoxMousewheel.java index 8479733267..f77de3650c 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/combobox/ComboBoxMousewheel.java +++ b/uitest/src/main/java/com/vaadin/tests/components/combobox/ComboBoxMousewheel.java @@ -17,7 +17,7 @@ package com.vaadin.tests.components.combobox; import com.vaadin.server.VaadinRequest; import com.vaadin.tests.components.AbstractReindeerTestUI; -import com.vaadin.tests.util.ItemDataSource; +import com.vaadin.tests.util.ItemDataProvider; import com.vaadin.ui.ComboBox; /** @@ -37,7 +37,7 @@ public class ComboBoxMousewheel extends AbstractReindeerTestUI { } private ComboBox<String> createComboBox(String caption) { - ComboBox<String> cb = new ComboBox<>(caption, new ItemDataSource(100)); + ComboBox<String> cb = new ComboBox<>(caption, new ItemDataProvider(100)); cb.setId(caption); return cb; } diff --git a/uitest/src/main/java/com/vaadin/tests/components/combobox/ComboBoxNavigation.java b/uitest/src/main/java/com/vaadin/tests/components/combobox/ComboBoxNavigation.java index b4b12bcb5b..bc5144a7bf 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/combobox/ComboBoxNavigation.java +++ b/uitest/src/main/java/com/vaadin/tests/components/combobox/ComboBoxNavigation.java @@ -1,7 +1,7 @@ package com.vaadin.tests.components.combobox; import com.vaadin.tests.components.TestBase; -import com.vaadin.tests.util.ItemDataSource; +import com.vaadin.tests.util.ItemDataProvider; import com.vaadin.ui.ComboBox; public class ComboBoxNavigation extends TestBase { @@ -18,7 +18,7 @@ public class ComboBoxNavigation extends TestBase { @Override protected void setup() { - ComboBox<String> cb = new ComboBox<>(null, new ItemDataSource(100)); + ComboBox<String> cb = new ComboBox<>(null, new ItemDataProvider(100)); addComponent(cb); diff --git a/uitest/src/main/java/com/vaadin/tests/components/combobox/ComboBoxPopupWhenBodyScrolls.java b/uitest/src/main/java/com/vaadin/tests/components/combobox/ComboBoxPopupWhenBodyScrolls.java index b42e66e531..04636a3f4f 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/combobox/ComboBoxPopupWhenBodyScrolls.java +++ b/uitest/src/main/java/com/vaadin/tests/components/combobox/ComboBoxPopupWhenBodyScrolls.java @@ -17,7 +17,7 @@ package com.vaadin.tests.components.combobox; import com.vaadin.server.VaadinRequest; import com.vaadin.tests.components.AbstractReindeerTestUI; -import com.vaadin.tests.util.ItemDataSource; +import com.vaadin.tests.util.ItemDataProvider; import com.vaadin.ui.ComboBox; import com.vaadin.ui.Label; @@ -29,7 +29,7 @@ public class ComboBoxPopupWhenBodyScrolls extends AbstractReindeerTestUI { .add("body.v-generated-body { overflow: auto;height:auto;}"); getPage().getStyles().add( "body.v-generated-body .v-ui.v-scrollable{ overflow: visible;height:auto !important;}"); - ComboBox<String> cb = new ComboBox<>(null, new ItemDataSource(10)); + ComboBox<String> cb = new ComboBox<>(null, new ItemDataProvider(10)); Label spacer = new Label("foo"); spacer.setHeight("2000px"); diff --git a/uitest/src/main/java/com/vaadin/tests/components/combobox/ComboBoxSelectingWithNewItemsAllowed.java b/uitest/src/main/java/com/vaadin/tests/components/combobox/ComboBoxSelectingWithNewItemsAllowed.java index dc87ee59e5..a3e48f3509 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/combobox/ComboBoxSelectingWithNewItemsAllowed.java +++ b/uitest/src/main/java/com/vaadin/tests/components/combobox/ComboBoxSelectingWithNewItemsAllowed.java @@ -36,7 +36,7 @@ public class ComboBoxSelectingWithNewItemsAllowed extends ComboBoxSelecting { }); comboBox.addValueChangeListener(event -> label.setValue( - String.valueOf(comboBox.getDataSource().size(new Query())))); + String.valueOf(comboBox.getDataProvider().size(new Query())))); addComponent(label); } diff --git a/uitest/src/main/java/com/vaadin/tests/components/combobox/ComboBoxUndefinedWidthAndIcon.java b/uitest/src/main/java/com/vaadin/tests/components/combobox/ComboBoxUndefinedWidthAndIcon.java index d1f8c16562..10ec271745 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/combobox/ComboBoxUndefinedWidthAndIcon.java +++ b/uitest/src/main/java/com/vaadin/tests/components/combobox/ComboBoxUndefinedWidthAndIcon.java @@ -2,13 +2,13 @@ package com.vaadin.tests.components.combobox; import com.vaadin.server.ThemeResource; import com.vaadin.tests.components.TestBase; -import com.vaadin.tests.util.ItemDataSource; +import com.vaadin.tests.util.ItemDataProvider; import com.vaadin.ui.ComboBox; public class ComboBoxUndefinedWidthAndIcon extends TestBase { @Override protected void setup() { - ComboBox<String> cb = new ComboBox<>(null, new ItemDataSource(200)); + ComboBox<String> cb = new ComboBox<>(null, new ItemDataProvider(200)); cb.setItemIconGenerator( item -> new ThemeResource("../runo/icons/16/users.png")); diff --git a/uitest/src/main/java/com/vaadin/tests/components/combobox/ComboFocusBlurEvents.java b/uitest/src/main/java/com/vaadin/tests/components/combobox/ComboFocusBlurEvents.java index 5513c9eba9..9ab060e702 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/combobox/ComboFocusBlurEvents.java +++ b/uitest/src/main/java/com/vaadin/tests/components/combobox/ComboFocusBlurEvents.java @@ -1,7 +1,7 @@ package com.vaadin.tests.components.combobox; import com.vaadin.tests.components.TestBase; -import com.vaadin.tests.util.ItemDataSource; +import com.vaadin.tests.util.ItemDataProvider; import com.vaadin.ui.ComboBox; import com.vaadin.ui.TextField; import com.vaadin.v7.data.util.ObjectProperty; @@ -16,7 +16,7 @@ public class ComboFocusBlurEvents extends TestBase { protected void setup() { ComboBox<String> cb = new ComboBox<>("Combobox", - new ItemDataSource(100)); + new ItemDataProvider(100)); cb.setPlaceholder("Enter text"); cb.setDescription("Some Combobox"); addComponent(cb); diff --git a/uitest/src/main/java/com/vaadin/tests/components/combobox/ComboboxMenuBarAutoopen.java b/uitest/src/main/java/com/vaadin/tests/components/combobox/ComboboxMenuBarAutoopen.java index a0793aef47..3d5a2ad3c9 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/combobox/ComboboxMenuBarAutoopen.java +++ b/uitest/src/main/java/com/vaadin/tests/components/combobox/ComboboxMenuBarAutoopen.java @@ -17,7 +17,7 @@ package com.vaadin.tests.components.combobox; import com.vaadin.server.Page; import com.vaadin.server.VaadinRequest; -import com.vaadin.server.data.DataSource; +import com.vaadin.server.data.DataProvider; import com.vaadin.tests.components.AbstractReindeerTestUI; import com.vaadin.ui.ComboBox; import com.vaadin.ui.HorizontalLayout; @@ -38,7 +38,7 @@ public class ComboboxMenuBarAutoopen extends AbstractReindeerTestUI { HorizontalLayout layout = new HorizontalLayout(); layout.setSpacing(true); ComboBox<String> combo = new ComboBox<>(null, - DataSource.create("1", "2", "3")); + DataProvider.create("1", "2", "3")); layout.addComponent(combo); MenuBar menubar = getMenubar(); diff --git a/uitest/src/main/java/com/vaadin/tests/components/combobox/ComboboxPrimaryStyleNames.java b/uitest/src/main/java/com/vaadin/tests/components/combobox/ComboboxPrimaryStyleNames.java index 8072db9de4..7e78036d56 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/combobox/ComboboxPrimaryStyleNames.java +++ b/uitest/src/main/java/com/vaadin/tests/components/combobox/ComboboxPrimaryStyleNames.java @@ -1,6 +1,6 @@ package com.vaadin.tests.components.combobox; -import com.vaadin.server.data.DataSource; +import com.vaadin.server.data.DataProvider; import com.vaadin.tests.components.TestBase; import com.vaadin.ui.Button; import com.vaadin.ui.ComboBox; @@ -10,7 +10,7 @@ public class ComboboxPrimaryStyleNames extends TestBase { @Override protected void setup() { final ComboBox<String> box = new ComboBox(null, - DataSource.create("Value 1", "Value 2", "Value 3", "Value 4")); + DataProvider.create("Value 1", "Value 2", "Value 3", "Value 4")); box.setPrimaryStyleName("my-combobox"); addComponent(box); diff --git a/uitest/src/main/java/com/vaadin/tests/components/combobox/ComboboxStyleChangeWidth.java b/uitest/src/main/java/com/vaadin/tests/components/combobox/ComboboxStyleChangeWidth.java index 3faef53ed7..6d5f02be48 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/combobox/ComboboxStyleChangeWidth.java +++ b/uitest/src/main/java/com/vaadin/tests/components/combobox/ComboboxStyleChangeWidth.java @@ -16,7 +16,7 @@ package com.vaadin.tests.components.combobox; import com.vaadin.server.VaadinRequest; -import com.vaadin.server.data.DataSource; +import com.vaadin.server.data.DataProvider; import com.vaadin.tests.components.AbstractTestUIWithLog; import com.vaadin.ui.Button; import com.vaadin.ui.ComboBox; @@ -30,7 +30,7 @@ public class ComboboxStyleChangeWidth extends AbstractTestUIWithLog { @Override protected void setup(VaadinRequest request) { - final ComboBox<String> cbFoo = new ComboBox<>(null, DataSource.create( + final ComboBox<String> cbFoo = new ComboBox<>(null, DataProvider.create( "A really long string that causes an inline width to be set")); cbFoo.setSizeUndefined(); diff --git a/uitest/src/main/java/com/vaadin/tests/components/grid/GridApplyFilterWhenScrolledDown.java b/uitest/src/main/java/com/vaadin/tests/components/grid/GridApplyFilterWhenScrolledDown.java index b452965765..b1672fbbed 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/grid/GridApplyFilterWhenScrolledDown.java +++ b/uitest/src/main/java/com/vaadin/tests/components/grid/GridApplyFilterWhenScrolledDown.java @@ -5,7 +5,7 @@ import java.util.List; import com.vaadin.server.SerializableFunction; import com.vaadin.server.VaadinRequest; -import com.vaadin.server.data.DataSource; +import com.vaadin.server.data.DataProvider; import com.vaadin.tests.components.AbstractTestUI; import com.vaadin.ui.Button; import com.vaadin.ui.Grid; @@ -28,15 +28,15 @@ public class GridApplyFilterWhenScrolledDown extends AbstractTestUI { addComponent(grid); Button button = new Button("Filter Test item", - event -> filter(grid.getDataSource(), data)); + event -> filter(grid.getDataProvider(), data)); addComponent(button); } - private void filter(DataSource<String> dataSource, List<String> data) { + private void filter(DataProvider<String> dataProvider, List<String> data) { String last = data.get(data.size() - 1); data.clear(); data.add(last); - dataSource.refreshAll(); + dataProvider.refreshAll(); } -}
\ No newline at end of file +} diff --git a/uitest/src/main/java/com/vaadin/tests/components/grid/basics/RefreshDataSource.java b/uitest/src/main/java/com/vaadin/tests/components/grid/basics/RefreshDataProvider.java index fec3e4aee3..288bc190f3 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/grid/basics/RefreshDataSource.java +++ b/uitest/src/main/java/com/vaadin/tests/components/grid/basics/RefreshDataProvider.java @@ -18,8 +18,8 @@ package com.vaadin.tests.components.grid.basics; import java.util.List; import com.vaadin.server.VaadinRequest; -import com.vaadin.server.data.DataSource; -import com.vaadin.server.data.ListDataSource; +import com.vaadin.server.data.DataProvider; +import com.vaadin.server.data.ListDataProvider; import com.vaadin.tests.components.AbstractReindeerTestUI; import com.vaadin.ui.Button; import com.vaadin.ui.Grid; @@ -28,52 +28,52 @@ import com.vaadin.ui.Grid; * @author Vaadin Ltd * */ -public class RefreshDataSource extends AbstractReindeerTestUI { +public class RefreshDataProvider extends AbstractReindeerTestUI { @Override protected void setup(VaadinRequest request) { Grid<DataObject> grid = new Grid<>(); List<DataObject> data = DataObject.generateObjects(); - ListDataSource<DataObject> dataSource = DataSource.create(data); - grid.setDataSource(dataSource); + ListDataProvider<DataObject> dataProvider = DataProvider.create(data); + grid.setDataProvider(dataProvider); - grid.setDataSource(dataSource); + grid.setDataProvider(dataProvider); grid.addColumn("Coordinates", DataObject::getCoordinates); addComponent(grid); Button update = new Button("Update data", - event -> updateData(dataSource, data)); + event -> updateData(dataProvider, data)); update.setId("update"); addComponent(update); - Button add = new Button("Add data", event -> addData(dataSource, data)); + Button add = new Button("Add data", event -> addData(dataProvider, data)); add.setId("add"); addComponent(add); Button remove = new Button("Remove data", - event -> removeData(dataSource, data)); + event -> removeData(dataProvider, data)); remove.setId("remove"); addComponent(remove); } - private void updateData(DataSource<DataObject> dataSource, + private void updateData(DataProvider<DataObject> dataProvider, List<DataObject> data) { data.get(0).setCoordinates("Updated coordinates"); - dataSource.refreshAll(); + dataProvider.refreshAll(); } - private void addData(DataSource<DataObject> dataSource, + private void addData(DataProvider<DataObject> dataProvider, List<DataObject> data) { DataObject dataObject = new DataObject(); dataObject.setCoordinates("Added"); data.add(0, dataObject); - dataSource.refreshAll(); + dataProvider.refreshAll(); } - private void removeData(DataSource<DataObject> dataSource, + private void removeData(DataProvider<DataObject> dataProvider, List<DataObject> data) { data.remove(0); - dataSource.refreshAll(); + dataProvider.refreshAll(); } } diff --git a/uitest/src/main/java/com/vaadin/tests/components/listselect/ListSelectAddRemoveItems.java b/uitest/src/main/java/com/vaadin/tests/components/listselect/ListSelectAddRemoveItems.java index d78025bf4c..0ee679e891 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/listselect/ListSelectAddRemoveItems.java +++ b/uitest/src/main/java/com/vaadin/tests/components/listselect/ListSelectAddRemoveItems.java @@ -21,21 +21,21 @@ import java.util.List; import java.util.stream.Collectors; import com.vaadin.server.VaadinRequest; -import com.vaadin.server.data.ListDataSource; +import com.vaadin.server.data.ListDataProvider; import com.vaadin.tests.components.AbstractTestUIWithLog; import com.vaadin.ui.Button; import com.vaadin.ui.ListSelect; -// FIXME this test should be updated once the datasource supports CRUD operations #77 +// FIXME this test should be updated once the provider supports CRUD operations #77 public class ListSelectAddRemoveItems extends AbstractTestUIWithLog { - private ListDataSource<String> dataSource = new ListDataSource<>( + private ListDataProvider<String> dataProvider = new ListDataProvider<>( Collections.emptyList()); private ListSelect<String> listSelect; @Override protected void setup(VaadinRequest request) { - listSelect = new ListSelect<>("ListSelect", dataSource); + listSelect = new ListSelect<>("ListSelect", dataProvider); listSelect.setWidth("100px"); listSelect.setRows(10); @@ -50,69 +50,69 @@ public class ListSelectAddRemoveItems extends AbstractTestUIWithLog { })); addComponent(new Button("Add first", event -> { - List<String> list = dataSource.fetch(null) + List<String> list = dataProvider.fetch(null) .collect(Collectors.toList()); list.add(0, "first"); - dataSource = new ListDataSource<>(list); - listSelect.setDataSource(dataSource); + dataProvider = new ListDataProvider<>(list); + listSelect.setDataProvider(dataProvider); logContainer(); })); addComponent(new Button("Add middle", event -> { - List<String> list = dataSource.fetch(null) + List<String> list = dataProvider.fetch(null) .collect(Collectors.toList()); list.add(list.size() / 2, "middle"); - dataSource = new ListDataSource<>(list); - listSelect.setDataSource(dataSource); + dataProvider = new ListDataProvider<>(list); + listSelect.setDataProvider(dataProvider); logContainer(); })); addComponent(new Button("Add last", event -> { - List<String> list = dataSource.fetch(null) + List<String> list = dataProvider.fetch(null) .collect(Collectors.toList()); list.add("last"); - dataSource = new ListDataSource<>(list); - listSelect.setDataSource(dataSource); + dataProvider = new ListDataProvider<>(list); + listSelect.setDataProvider(dataProvider); logContainer(); })); addComponent(new Button("Swap", event -> { - List<String> list = dataSource.fetch(null) + List<String> list = dataProvider.fetch(null) .collect(Collectors.toList()); Collections.swap(list, 0, list.size() - 1); - dataSource = new ListDataSource<>(list); - listSelect.setDataSource(dataSource); + dataProvider = new ListDataProvider<>(list); + listSelect.setDataProvider(dataProvider); logContainer(); })); addComponent(new Button("Remove first", event -> { - List<String> list = dataSource.fetch(null) + List<String> list = dataProvider.fetch(null) .collect(Collectors.toList()); list.remove(0); - dataSource = new ListDataSource<>(list); - listSelect.setDataSource(dataSource); + dataProvider = new ListDataProvider<>(list); + listSelect.setDataProvider(dataProvider); logContainer(); })); addComponent(new Button("Remove middle", event -> { - List<String> list = dataSource.fetch(null) + List<String> list = dataProvider.fetch(null) .collect(Collectors.toList()); list.remove(list.size() / 2); - dataSource = new ListDataSource<>(list); - listSelect.setDataSource(dataSource); + dataProvider = new ListDataProvider<>(list); + listSelect.setDataProvider(dataProvider); logContainer(); })); addComponent(new Button("Remove last", event -> { - List<String> list = dataSource.fetch(null) + List<String> list = dataProvider.fetch(null) .collect(Collectors.toList()); list.remove(list.size() - 1); - dataSource = new ListDataSource<>(list); - listSelect.setDataSource(dataSource); + dataProvider = new ListDataProvider<>(list); + listSelect.setDataProvider(dataProvider); logContainer(); })); @@ -121,7 +121,7 @@ public class ListSelectAddRemoveItems extends AbstractTestUIWithLog { private void logContainer() { StringBuilder b = new StringBuilder(); - List<String> list = dataSource.fetch(null).collect(Collectors.toList()); + List<String> list = dataProvider.fetch(null).collect(Collectors.toList()); for (int i = 0; i < list.size(); i++) { Object id = list.get(i); if (i != 0) { @@ -134,8 +134,8 @@ public class ListSelectAddRemoveItems extends AbstractTestUIWithLog { } public void resetContainer() { - dataSource = new ListDataSource<>(Arrays.asList("a", "b", "c")); - listSelect.setDataSource(dataSource); + dataProvider = new ListDataProvider<>(Arrays.asList("a", "b", "c")); + listSelect.setDataProvider(dataProvider); } @Override 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 246441598b..07e5b2c4d0 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 @@ -75,7 +75,7 @@ public class RadioButtonGroupTestUI } else { group.setItemIconGenerator(item -> null); } - group.getDataSource().refreshAll(); + group.getDataProvider().refreshAll(); } private void createItemCaptionGeneratorMenu() { @@ -88,7 +88,7 @@ public class RadioButtonGroupTestUI createSelectAction("Item Caption Generator", "Item Caption Generator", options, "None", (radioButtonGroup, captionGenerator, data) -> { radioButtonGroup.setItemCaptionGenerator(captionGenerator); - radioButtonGroup.getDataSource().refreshAll(); + radioButtonGroup.getDataProvider().refreshAll(); }, true); } diff --git a/uitest/src/main/java/com/vaadin/tests/components/slider/SliderValueFromDataSource.java b/uitest/src/main/java/com/vaadin/tests/components/slider/SliderValueFromDataSource.java index 9d147eb3b5..6f9bd6b4ef 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/slider/SliderValueFromDataSource.java +++ b/uitest/src/main/java/com/vaadin/tests/components/slider/SliderValueFromDataSource.java @@ -47,7 +47,7 @@ public class SliderValueFromDataSource extends AbstractReindeerTestUI { @Override protected String getTestDescription() { - return "Slider and ProgressBar do not properly pass a value from data source to the client"; + return "Slider and ProgressBar do not properly pass a value from data provider to the client"; } @Override diff --git a/uitest/src/main/java/com/vaadin/tests/data/DummyData.java b/uitest/src/main/java/com/vaadin/tests/data/DummyData.java index cc1e60e7b0..fdf8a710d0 100644 --- a/uitest/src/main/java/com/vaadin/tests/data/DummyData.java +++ b/uitest/src/main/java/com/vaadin/tests/data/DummyData.java @@ -9,7 +9,7 @@ import java.util.stream.Stream; import com.vaadin.annotations.Widgetset; import com.vaadin.server.VaadinRequest; -import com.vaadin.server.data.ListDataSource; +import com.vaadin.server.data.ListDataProvider; import com.vaadin.server.data.Query; import com.vaadin.shared.data.DataCommunicatorConstants; import com.vaadin.tests.components.AbstractTestUIWithLog; @@ -22,12 +22,12 @@ import com.vaadin.ui.HorizontalLayout; public class DummyData extends AbstractTestUIWithLog { /** - * DataSource that keeps track on how often the data is requested. + * DataProvider that keeps track on how often the data is requested. */ - private class LoggingDataSource extends ListDataSource<String> { + private class LoggingDataProvider extends ListDataProvider<String> { private int count = 0; - private LoggingDataSource(Collection<String> collection) { + private LoggingDataProvider(Collection<String> collection) { super(collection); } @@ -80,7 +80,7 @@ public class DummyData extends AbstractTestUIWithLog { for (int i = 0; i < 300; ++i) { items.add("Foo " + i); } - dummy.setDataSource(new LoggingDataSource(items)); + dummy.setDataProvider(new LoggingDataProvider(items)); dummy.setValue("Foo 200"); HorizontalLayout controls = new HorizontalLayout(); @@ -88,11 +88,11 @@ public class DummyData extends AbstractTestUIWithLog { controls.addComponent(new Button("Select Foo 20", e -> { dummy.setValue("Foo " + 20); })); - controls.addComponent(new Button("Reset data source", e -> { - dummy.setDataSource(new LoggingDataSource(items)); + controls.addComponent(new Button("Reset data provider", e -> { + dummy.setDataProvider(new LoggingDataProvider(items)); })); controls.addComponent(new Button("Remove all data", e -> { - dummy.setDataSource(new LoggingDataSource(Collections.emptyList())); + dummy.setDataProvider(new LoggingDataProvider(Collections.emptyList())); })); addComponent(dummy); } diff --git a/uitest/src/main/java/com/vaadin/tests/layouts/MovingComponentsWhileOldParentInvisible.java b/uitest/src/main/java/com/vaadin/tests/layouts/MovingComponentsWhileOldParentInvisible.java index 910265696f..16e131da76 100644 --- a/uitest/src/main/java/com/vaadin/tests/layouts/MovingComponentsWhileOldParentInvisible.java +++ b/uitest/src/main/java/com/vaadin/tests/layouts/MovingComponentsWhileOldParentInvisible.java @@ -53,7 +53,7 @@ public class MovingComponentsWhileOldParentInvisible extends TestBase { }); componentContainerSelect.setValue(componentContainerSelect - .getDataSource().fetch(new Query()).iterator().next()); + .getDataProvider().fetch(new Query()).iterator().next()); Button but1 = new Button("Move in and out of component container", new Button.ClickListener() { diff --git a/uitest/src/main/java/com/vaadin/tests/performance/AbstractBeansMemoryTest.java b/uitest/src/main/java/com/vaadin/tests/performance/AbstractBeansMemoryTest.java index 526b758e22..8f352e23f3 100644 --- a/uitest/src/main/java/com/vaadin/tests/performance/AbstractBeansMemoryTest.java +++ b/uitest/src/main/java/com/vaadin/tests/performance/AbstractBeansMemoryTest.java @@ -175,7 +175,7 @@ public abstract class AbstractBeansMemoryTest<T extends AbstractComponent> private Component createMenu(T component) { MenuBar menu = new MenuBar(); createContainerSizeMenu(menu.addItem("Size", null), component); - createContainerMenu(menu.addItem("Data source", null), component); + createContainerMenu(menu.addItem("Data provider", null), component); menu.addItem("Create only data", item -> toggleDataOnly(item, component)).setCheckable(true); @@ -208,7 +208,7 @@ public abstract class AbstractBeansMemoryTest<T extends AbstractComponent> private MenuItem addContainerSizeMenu(int size, MenuItem menu, T component) { - MenuItem item = menu.addItem("Set data source size to " + size, + MenuItem item = menu.addItem("Set data provider size to " + size, itm -> setData(itm, size, component, isInMemory)); item.setCheckable(true); return item; diff --git a/uitest/src/main/java/com/vaadin/tests/util/ItemDataSource.java b/uitest/src/main/java/com/vaadin/tests/util/ItemDataProvider.java index e7a184f6da..5d207720d0 100644 --- a/uitest/src/main/java/com/vaadin/tests/util/ItemDataSource.java +++ b/uitest/src/main/java/com/vaadin/tests/util/ItemDataProvider.java @@ -2,16 +2,16 @@ package com.vaadin.tests.util; import java.util.stream.IntStream; -import com.vaadin.server.data.BackEndDataSource; +import com.vaadin.server.data.BackEndDataProvider; /** - * A data source for tests that creates "Item n" strings on the fly. + * A data provider for tests that creates "Item n" strings on the fly. * * @author Vaadin Ltd */ -public class ItemDataSource extends BackEndDataSource<String> { +public class ItemDataProvider extends BackEndDataProvider<String> { - public ItemDataSource(int size) { + public ItemDataProvider(int size) { super(q -> IntStream .range(q.getOffset(), Math.max(q.getOffset() + q.getLimit() + 1, size)) diff --git a/uitest/src/test/java/com/vaadin/tests/components/checkboxgroup/CheckBoxGroupTest.java b/uitest/src/test/java/com/vaadin/tests/components/checkboxgroup/CheckBoxGroupTest.java index b4e462a983..65c12e2687 100644 --- a/uitest/src/test/java/com/vaadin/tests/components/checkboxgroup/CheckBoxGroupTest.java +++ b/uitest/src/test/java/com/vaadin/tests/components/checkboxgroup/CheckBoxGroupTest.java @@ -55,13 +55,13 @@ public class CheckBoxGroupTest extends MultiBrowserTest { @Test public void initialItems_reduceItemCount_containsCorrectItems() { - selectMenuPath("Component", "Data source", "Items", "5"); + selectMenuPath("Component", "Data provider", "Items", "5"); assertItems(5); } @Test public void initialItems_increaseItemCount_containsCorrectItems() { - selectMenuPath("Component", "Data source", "Items", "100"); + selectMenuPath("Component", "Data provider", "Items", "100"); assertItems(100); } diff --git a/uitest/src/test/java/com/vaadin/tests/components/grid/basics/RefreshDataSourceTest.java b/uitest/src/test/java/com/vaadin/tests/components/grid/basics/RefreshDataProviderTest.java index e73bbd602c..7c60bb9572 100644 --- a/uitest/src/test/java/com/vaadin/tests/components/grid/basics/RefreshDataSourceTest.java +++ b/uitest/src/test/java/com/vaadin/tests/components/grid/basics/RefreshDataProviderTest.java @@ -26,7 +26,7 @@ import com.vaadin.tests.tb3.MultiBrowserTest; * @author Vaadin Ltd * */ -public class RefreshDataSourceTest extends MultiBrowserTest { +public class RefreshDataProviderTest extends MultiBrowserTest { @Test public void updateFirstRow() { @@ -61,4 +61,4 @@ public class RefreshDataSourceTest extends MultiBrowserTest { old, first.getText()); } -}
\ No newline at end of file +} diff --git a/uitest/src/test/java/com/vaadin/tests/components/listselect/ListSelectTest.java b/uitest/src/test/java/com/vaadin/tests/components/listselect/ListSelectTest.java index 68011d7813..d934fa448f 100644 --- a/uitest/src/test/java/com/vaadin/tests/components/listselect/ListSelectTest.java +++ b/uitest/src/test/java/com/vaadin/tests/components/listselect/ListSelectTest.java @@ -32,13 +32,13 @@ public class ListSelectTest extends SingleBrowserTestPhantomJS2 { @Test public void initialItems_reduceItemCount_containsCorrectItems() { - selectMenuPath("Component", "Data source", "Items", "5"); + selectMenuPath("Component", "Data provider", "Items", "5"); assertItems(5); } @Test public void initialItems_increaseItemCount_containsCorrectItems() { - selectMenuPath("Component", "Data source", "Items", "100"); + selectMenuPath("Component", "Data provider", "Items", "100"); assertItems(100); } diff --git a/uitest/src/test/java/com/vaadin/tests/components/nativeselect/NativeSelectTest.java b/uitest/src/test/java/com/vaadin/tests/components/nativeselect/NativeSelectTest.java index 364e53aa75..abb7acb428 100644 --- a/uitest/src/test/java/com/vaadin/tests/components/nativeselect/NativeSelectTest.java +++ b/uitest/src/test/java/com/vaadin/tests/components/nativeselect/NativeSelectTest.java @@ -39,13 +39,13 @@ public class NativeSelectTest extends MultiBrowserTest { @Test public void initialItems_reduceItemCount_containsCorrectItems() { - selectMenuPath("Component", "Data source", "Items", "5"); + selectMenuPath("Component", "Data provider", "Items", "5"); assertItems(5); } @Test public void initialItems_increaseItemCount_containsCorrectItems() { - selectMenuPath("Component", "Data source", "Items", "100"); + selectMenuPath("Component", "Data provider", "Items", "100"); assertItems(100); } diff --git a/uitest/src/test/java/com/vaadin/tests/components/radiobutton/RadioButtonGroupTest.java b/uitest/src/test/java/com/vaadin/tests/components/radiobutton/RadioButtonGroupTest.java index b2546347dd..bff6e85b98 100644 --- a/uitest/src/test/java/com/vaadin/tests/components/radiobutton/RadioButtonGroupTest.java +++ b/uitest/src/test/java/com/vaadin/tests/components/radiobutton/RadioButtonGroupTest.java @@ -50,13 +50,13 @@ public class RadioButtonGroupTest extends MultiBrowserTest { @Test public void initialItems_reduceItemCount_containsCorrectItems() { - selectMenuPath("Component", "Data source", "Items", "5"); + selectMenuPath("Component", "Data provider", "Items", "5"); assertItems(5); } @Test public void initialItems_increaseItemCount_containsCorrectItems() { - selectMenuPath("Component", "Data source", "Items", "100"); + selectMenuPath("Component", "Data provider", "Items", "100"); assertItems(100); } diff --git a/uitest/src/test/java/com/vaadin/tests/components/twincolselect/TwinColSelectTest.java b/uitest/src/test/java/com/vaadin/tests/components/twincolselect/TwinColSelectTest.java index ad2752112f..cc819a2744 100644 --- a/uitest/src/test/java/com/vaadin/tests/components/twincolselect/TwinColSelectTest.java +++ b/uitest/src/test/java/com/vaadin/tests/components/twincolselect/TwinColSelectTest.java @@ -32,19 +32,19 @@ public class TwinColSelectTest extends MultiBrowserTest { @Test public void initialItems_reduceItemCount_containsCorrectItems() { - selectMenuPath("Component", "Data source", "Items", "5"); + selectMenuPath("Component", "Data provider", "Items", "5"); assertItems(5); } @Test public void initialItems_increaseItemCount_containsCorrectItems() { - selectMenuPath("Component", "Data source", "Items", "100"); + selectMenuPath("Component", "Data provider", "Items", "100"); assertItems(100); } @Test public void itemsMovedFromLeftToRight() { - selectMenuPath("Component", "Data source", "Items", "5"); + selectMenuPath("Component", "Data provider", "Items", "5"); assertItems(5); selectItems("Item 1", "Item 2", "Item 4"); diff --git a/uitest/src/test/java/com/vaadin/tests/data/DummyDataTest.java b/uitest/src/test/java/com/vaadin/tests/data/DummyDataTest.java index 1e9f0f9ade..b05c64e713 100644 --- a/uitest/src/test/java/com/vaadin/tests/data/DummyDataTest.java +++ b/uitest/src/test/java/com/vaadin/tests/data/DummyDataTest.java @@ -57,10 +57,10 @@ public class DummyDataTest extends SingleBrowserTest { } @Test - public void testDataSourceChangeOnlyOneRequest() { - // Change to a new logging data source + public void testDataProviderChangeOnlyOneRequest() { + // Change to a new logging data provider $(ButtonElement.class).get(1).click(); - assertEquals("DataSource change should only cause 1 request", + assertEquals("DataProvider change should only cause 1 request", "3. Backend request #0", getLogRow(0)); } @@ -69,12 +69,12 @@ public class DummyDataTest extends SingleBrowserTest { assertEquals("Unexpected amount of content on init.", 300, $(DummyElement.class).first() .findElements(By.className("v-label")).size()); - // Change to an empty data source + // Change to an empty data provider $(ButtonElement.class).get(2).click(); - assertEquals("Empty data source did not work as expected.", 0, + assertEquals("Empty data provider did not work as expected.", 0, $(DummyElement.class).first() .findElements(By.className("v-label")).size()); - // Change back to logging data source + // Change back to logging data provider $(ButtonElement.class).get(1).click(); assertEquals("Data was not correctly restored.", 300, $(DummyElement.class).first() |