diff options
author | Henrik Paul <henrik@vaadin.com> | 2014-10-20 16:14:17 +0300 |
---|---|---|
committer | Vaadin Code Review <review@vaadin.com> | 2014-10-20 14:32:09 +0000 |
commit | c1de8966d4b9bc7fa50eb27d19cc5142205a167d (patch) | |
tree | 60dc93f5f29275327da0190e3fed8c84380c940a /client | |
parent | 1f2b8afede797f3f853b89f40d7eef04891cb008 (diff) | |
download | vaadin-framework-c1de8966d4b9bc7fa50eb27d19cc5142205a167d.tar.gz vaadin-framework-c1de8966d4b9bc7fa50eb27d19cc5142205a167d.zip |
Restructures Escalator method hierarchy (#13334)
Previously AbstractRowContainer.paintInsertRows was simply overridden by
BodyRowContainer, which was hard to follow. Now ARC.pIR is an abstract method
and the implementation has been put into another protected method.
Change-Id: Ia47a46216d2f9713b958785b5239d6850b1ede0d
Diffstat (limited to 'client')
-rw-r--r-- | client/src/com/vaadin/client/ui/grid/Escalator.java | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/client/src/com/vaadin/client/ui/grid/Escalator.java b/client/src/com/vaadin/client/ui/grid/Escalator.java index b3aebb1ec4..be831b5b61 100644 --- a/client/src/com/vaadin/client/ui/grid/Escalator.java +++ b/client/src/com/vaadin/client/ui/grid/Escalator.java @@ -16,7 +16,6 @@ package com.vaadin.client.ui.grid; import java.util.ArrayList; -import java.util.Collections; import java.util.HashMap; import java.util.LinkedList; import java.util.List; @@ -1285,8 +1284,11 @@ public class Escalator extends Widget implements RequiresResize, DeferredWorker * the number of rows to insert * @return a list of the added row elements */ - protected List<TableRowElement> paintInsertRows(final int visualIndex, - final int numberOfRows) { + protected abstract void paintInsertRows(final int visualIndex, + final int numberOfRows); + + protected List<TableRowElement> paintInsertStaticRows( + final int visualIndex, final int numberOfRows) { assert isAttached() : "Can't paint rows if Escalator is not attached"; final List<TableRowElement> addedRows = new ArrayList<TableRowElement>(); @@ -1981,6 +1983,11 @@ public class Escalator extends Widget implements RequiresResize, DeferredWorker Profiler.leave("Escalator.AbstractStaticRowContainer.refreshRows"); } + + @Override + protected void paintInsertRows(int visualIndex, int numberOfRows) { + paintInsertStaticRows(visualIndex, numberOfRows); + } } private class HeaderRowContainer extends AbstractStaticRowContainer { @@ -2306,10 +2313,9 @@ public class Escalator extends Widget implements RequiresResize, DeferredWorker } @Override - protected List<TableRowElement> paintInsertRows(final int index, - final int numberOfRows) { + protected void paintInsertRows(final int index, final int numberOfRows) { if (numberOfRows == 0) { - return Collections.emptyList(); + return; } /* @@ -2405,7 +2411,6 @@ public class Escalator extends Widget implements RequiresResize, DeferredWorker fireRowVisibilityChangeEvent(); sortDomElements(); } - return addedRows; } /** @@ -2585,7 +2590,7 @@ public class Escalator extends Widget implements RequiresResize, DeferredWorker if (escalatorRowsNeeded > 0) { - final List<TableRowElement> addedRows = super.paintInsertRows( + final List<TableRowElement> addedRows = paintInsertStaticRows( index, escalatorRowsNeeded); visualRowOrder.addAll(index, addedRows); |