diff options
author | Teemu Suo-Anttila <teemusa@vaadin.com> | 2015-09-29 19:13:36 +0300 |
---|---|---|
committer | Teemu Suo-Anttila <teemusa@vaadin.com> | 2015-10-12 07:18:12 +0000 |
commit | 8a66300779e9dcc949d68ab1a66d445921e0d40b (patch) | |
tree | f08f6b36213e289bcc11595b7ba602cd5b462f5c /uitest | |
parent | e5634deaa77cdcebc577a1f04d146b960b3b54d1 (diff) | |
download | vaadin-framework-8a66300779e9dcc949d68ab1a66d445921e0d40b.tar.gz vaadin-framework-8a66300779e9dcc949d68ab1a66d445921e0d40b.zip |
Refactor DetailComponentManager to be a static nested class of Grid
While refactoring any special cases are removed. This needs Grid
extensions to have a way for adding and removing components from Grid.
Removing any and all parts of RpcDataProvider work towards having it
separate from Grid and maybe usable for other components as well.
Change-Id: Ia4e25d5f0acaf2085478346b0ff6e23c8334e1b9
Diffstat (limited to 'uitest')
3 files changed, 5 insertions, 10 deletions
diff --git a/uitest/src/com/vaadin/tests/components/grid/GridDetailsDetach.java b/uitest/src/com/vaadin/tests/components/grid/GridDetailsDetach.java index 3d7f6da587..f18c0f9bdb 100644 --- a/uitest/src/com/vaadin/tests/components/grid/GridDetailsDetach.java +++ b/uitest/src/com/vaadin/tests/components/grid/GridDetailsDetach.java @@ -26,6 +26,7 @@ import com.vaadin.ui.Component; import com.vaadin.ui.Grid; import com.vaadin.ui.Grid.DetailsGenerator; import com.vaadin.ui.Grid.RowReference; +import com.vaadin.ui.Grid.SelectionMode; import com.vaadin.ui.Label; import com.vaadin.ui.VerticalLayout; @@ -79,6 +80,7 @@ public class GridDetailsDetach extends AbstractTestUI { final Grid grid = new Grid(container); grid.setColumnOrder("name", "amount", "count"); grid.setSizeFull(); + grid.setSelectionMode(SelectionMode.NONE); grid.setDetailsGenerator(new DetailsGenerator() { @Override diff --git a/uitest/src/com/vaadin/tests/components/grid/basicfeatures/GridBasicFeatures.java b/uitest/src/com/vaadin/tests/components/grid/basicfeatures/GridBasicFeatures.java index a3160ba2c6..2e4869cab0 100644 --- a/uitest/src/com/vaadin/tests/components/grid/basicfeatures/GridBasicFeatures.java +++ b/uitest/src/com/vaadin/tests/components/grid/basicfeatures/GridBasicFeatures.java @@ -231,10 +231,12 @@ public class GridBasicFeatures extends AbstractComponentTest<Grid> { private Map<Object, Panel> detailsMap = new HashMap<Object, Panel>(); private final DetailsGenerator persistingDetailsGenerator = new DetailsGenerator() { + @Override public Component getDetails(RowReference rowReference) { Object itemId = rowReference.getItemId(); if (!detailsMap.containsKey(itemId)) { + Panel panel = new Panel(); panel.setContent(new Label("One")); detailsMap.put(itemId, panel); diff --git a/uitest/src/com/vaadin/tests/components/grid/basicfeatures/server/GridDetailsServerTest.java b/uitest/src/com/vaadin/tests/components/grid/basicfeatures/server/GridDetailsServerTest.java index f13ea9c073..dda9c03f94 100644 --- a/uitest/src/com/vaadin/tests/components/grid/basicfeatures/server/GridDetailsServerTest.java +++ b/uitest/src/com/vaadin/tests/components/grid/basicfeatures/server/GridDetailsServerTest.java @@ -59,7 +59,7 @@ public class GridDetailsServerTest extends GridBasicFeaturesTest { } @Test(expected = NoSuchElementException.class) - public void openVisibleDetails() { + public void openWithNoGenerator() { try { getGridElement().getDetails(0); fail("Expected NoSuchElementException"); @@ -70,14 +70,6 @@ public class GridDetailsServerTest extends GridBasicFeaturesTest { getGridElement().getDetails(0); } - @Test(expected = NoSuchElementException.class) - public void closeVisibleDetails() { - selectMenuPath(OPEN_FIRST_ITEM_DETAILS); - selectMenuPath(OPEN_FIRST_ITEM_DETAILS); - - getGridElement().getDetails(0); - } - @Test public void openVisiblePopulatedDetails() { selectMenuPath(DETAILS_GENERATOR_WATCHING); @@ -220,7 +212,6 @@ public class GridDetailsServerTest extends GridBasicFeaturesTest { selectMenuPath(OPEN_FIRST_ITEM_DETAILS); assertEquals("Two", getGridElement().getDetails(0).getText()); - } @Test |