123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736 |
- package com.vaadin.tests.widgetset.client.grid;
-
- import java.util.ArrayList;
- import java.util.HashMap;
- import java.util.List;
- import java.util.Map;
-
- import com.google.gwt.core.client.Duration;
- import com.google.gwt.core.client.Scheduler;
- import com.google.gwt.core.client.Scheduler.ScheduledCommand;
- import com.google.gwt.dom.client.TableCellElement;
- import com.google.gwt.user.client.DOM;
- import com.google.gwt.user.client.ui.Composite;
- import com.google.gwt.user.client.ui.HTML;
- import com.vaadin.client.widget.escalator.EscalatorUpdater;
- import com.vaadin.client.widget.escalator.FlyweightCell;
- import com.vaadin.client.widget.escalator.Row;
- import com.vaadin.client.widget.escalator.RowContainer;
- import com.vaadin.client.widget.escalator.RowContainer.BodyRowContainer;
- import com.vaadin.client.widget.escalator.Spacer;
- import com.vaadin.client.widget.escalator.SpacerUpdater;
- import com.vaadin.client.widget.escalator.events.SpacerIndexChangedEvent;
- import com.vaadin.client.widget.escalator.events.SpacerIndexChangedHandler;
- import com.vaadin.client.widgets.Escalator;
- import com.vaadin.shared.ui.grid.ScrollDestination;
- import com.vaadin.tests.widgetset.client.v7.grid.PureGWTTestApplication;
-
- public class EscalatorBasicClientFeaturesWidget
- extends PureGWTTestApplication<Escalator> {
-
- public static class LogWidget extends Composite {
-
- private static final int MAX_LOG = 9;
-
- private final HTML html = new HTML();
- private final List<String> logs = new ArrayList<>();
- private Escalator escalator;
-
- public LogWidget() {
- initWidget(html);
- getElement().setId("log");
- }
-
- public void setEscalator(Escalator escalator) {
- this.escalator = escalator;
- }
-
- public void updateDebugLabel() {
- int headers = escalator.getHeader().getRowCount();
- int bodys = escalator.getBody().getRowCount();
- int footers = escalator.getFooter().getRowCount();
- int columns = escalator.getColumnConfiguration().getColumnCount();
-
- while (logs.size() > MAX_LOG) {
- logs.remove(0);
- }
-
- String logString = "<hr>";
- for (String log : logs) {
- logString += log + "<br>";
- }
-
- html.setHTML("Columns: " + columns + "<br>" + //
- "Header rows: " + headers + "<br>" + //
- "Body rows: " + bodys + "<br>" + //
- "Footer rows: " + footers + "<br>" + //
- logString);
- }
-
- public void log(String string) {
- logs.add((Duration.currentTimeMillis() % 10000) + ": " + string);
- }
- }
-
- public static class UpdaterLifetimeWidget
- extends EscalatorBasicClientFeaturesWidget {
-
- private final EscalatorUpdater debugUpdater = new EscalatorUpdater() {
- @Override
- public void preAttach(Row row,
- Iterable<FlyweightCell> cellsToAttach) {
- log("preAttach", cellsToAttach);
- }
-
- @Override
- public void postAttach(Row row,
- Iterable<FlyweightCell> attachedCells) {
- log("postAttach", attachedCells);
- }
-
- @Override
- public void update(Row row, Iterable<FlyweightCell> cellsToUpdate) {
- log("update", cellsToUpdate);
- }
-
- @Override
- public void preDetach(Row row,
- Iterable<FlyweightCell> cellsToDetach) {
- log("preDetach", cellsToDetach);
- }
-
- @Override
- public void postDetach(Row row,
- Iterable<FlyweightCell> detachedCells) {
- log("postDetach", detachedCells);
- }
-
- private void log(String methodName, Iterable<FlyweightCell> cells) {
- if (!cells.iterator().hasNext()) {
- return;
- }
-
- TableCellElement cellElement = cells.iterator().next()
- .getElement();
- boolean isAttached = cellElement.getParentElement() != null
- && cellElement.getParentElement()
- .getParentElement() != null;
- logWidget.log(
- methodName + ": elementIsAttached == " + isAttached);
- }
- };
-
- public UpdaterLifetimeWidget() {
- super();
- escalator.getHeader().setEscalatorUpdater(debugUpdater);
- escalator.getBody().setEscalatorUpdater(debugUpdater);
- escalator.getFooter().setEscalatorUpdater(debugUpdater);
- }
- }
-
- private static final String COLUMNS_AND_ROWS_MENU = "Columns and Rows";
- private static final String GENERAL_MENU = "General";
- private static final String FEATURES_MENU = "Features";
-
- private static abstract class TestEscalatorUpdater
- implements EscalatorUpdater {
-
- @Override
- public void preAttach(Row row, Iterable<FlyweightCell> cellsToAttach) {
- // noop
- }
-
- @Override
- public void postAttach(Row row, Iterable<FlyweightCell> attachedCells) {
- // noop
- }
-
- @Override
- public void preDetach(Row row, Iterable<FlyweightCell> cellsToDetach) {
- // noop
- }
-
- @Override
- public void postDetach(Row row, Iterable<FlyweightCell> detachedCells) {
- // noop
- }
- }
-
- private class Data {
- private int columnCounter = 0;
- private int rowCounter = 0;
- private final List<Integer> columns = new ArrayList<>();
- private final List<Integer> rows = new ArrayList<>();
- private final Map<Integer, Integer> spacers = new HashMap<>();
-
- @SuppressWarnings("boxing")
- public void insertRows(final int offset, final int amount) {
- final List<Integer> newRows = new ArrayList<>();
- for (int i = 0; i < amount; i++) {
- newRows.add(rowCounter++);
- }
- rows.addAll(offset, newRows);
- }
-
- @SuppressWarnings("boxing")
- public void insertColumns(final int offset, final int amount) {
- final List<Integer> newColumns = new ArrayList<>();
- for (int i = 0; i < amount; i++) {
- newColumns.add(columnCounter++);
- }
- columns.addAll(offset, newColumns);
- }
-
- public EscalatorUpdater createHeaderUpdater() {
- return new TestEscalatorUpdater() {
- @Override
- public void update(final Row row,
- final Iterable<FlyweightCell> cellsToUpdate) {
- for (final FlyweightCell cell : cellsToUpdate) {
- final Integer columnName = columns
- .get(cell.getColumn());
- cell.getElement().setInnerText("Header " + columnName);
-
- if (colspan == Colspan.NORMAL) {
- if (cell.getColumn() % 2 == 0) {
- cell.setColSpan(2);
- }
- } else if (colspan == Colspan.CRAZY) {
- if (cell.getColumn() % 3 == 0) {
- cell.setColSpan(2);
- }
- }
- }
- }
- };
- }
-
- public EscalatorUpdater createFooterUpdater() {
- return new TestEscalatorUpdater() {
- @Override
- public void update(final Row row,
- final Iterable<FlyweightCell> cellsToUpdate) {
- for (final FlyweightCell cell : cellsToUpdate) {
- final Integer columnName = columns
- .get(cell.getColumn());
- cell.getElement().setInnerText("Footer " + columnName);
-
- if (colspan == Colspan.NORMAL) {
- if (cell.getColumn() % 2 == 0) {
- cell.setColSpan(2);
- }
- } else if (colspan == Colspan.CRAZY) {
- if (cell.getColumn() % 3 == 1) {
- cell.setColSpan(2);
- }
- }
- }
- }
- };
- }
-
- public EscalatorUpdater createBodyUpdater() {
- return new TestEscalatorUpdater() {
-
- public void renderCell(final FlyweightCell cell) {
- final Integer columnName = columns.get(cell.getColumn());
- final Integer rowName = rows.get(cell.getRow());
- String cellInfo = columnName + "," + rowName;
-
- if (cell.getColumn() > 0) {
- cell.getElement().setInnerText("Cell: " + cellInfo);
- } else {
- cell.getElement().setInnerText(
- "Row " + cell.getRow() + ": " + cellInfo);
- }
-
- if (colspan == Colspan.NORMAL) {
- if (cell.getColumn() % 2 == 0) {
- cell.setColSpan(2);
- }
- } else if (colspan == Colspan.CRAZY) {
- if (cell.getColumn() % 3 == cell.getRow() % 3) {
- cell.setColSpan(2);
- }
- }
- if (spacers.containsKey(cell.getRow()) && !escalator
- .getBody().spacerExists(cell.getRow())) {
- escalator.getBody().setSpacer(cell.getRow(),
- spacers.get(cell.getRow()));
- }
- }
-
- @Override
- public void update(final Row row,
- final Iterable<FlyweightCell> cellsToUpdate) {
- for (final FlyweightCell cell : cellsToUpdate) {
- renderCell(cell);
- }
- }
- };
- }
-
- public void removeRows(final int offset, final int amount) {
- for (int i = 0; i < amount; i++) {
- rows.remove(offset);
- if (spacers.containsKey(offset + i)) {
- spacers.remove(offset + i);
- }
- }
- // the following spacers get their indexes updated through
- // SpacerIndexChangedHandler
- }
-
- public void removeColumns(final int offset, final int amount) {
- for (int i = 0; i < amount; i++) {
- columns.remove(offset);
- }
- }
- }
-
- protected final Escalator escalator;
- private final Data data = new Data();
-
- private enum Colspan {
- NONE, NORMAL, CRAZY;
- }
-
- private Colspan colspan = Colspan.NONE;
- protected final LogWidget logWidget = new LogWidget();
-
- public EscalatorBasicClientFeaturesWidget() {
- super(new EscalatorProxy());
- escalator = getTestedWidget();
- logWidget.setEscalator(escalator);
-
- ((EscalatorProxy) escalator).setLogWidget(logWidget);
- addNorth(logWidget, 200);
-
- final RowContainer header = escalator.getHeader();
- header.setEscalatorUpdater(data.createHeaderUpdater());
-
- final RowContainer footer = escalator.getFooter();
- footer.setEscalatorUpdater(data.createFooterUpdater());
-
- escalator.getBody().setEscalatorUpdater(data.createBodyUpdater());
-
- setWidth("500px");
- setHeight("500px");
-
- escalator.getElement().getStyle().setZIndex(0);
- addNorth(escalator, 500);
-
- createGeneralMenu();
- createColumnMenu();
- createHeaderRowsMenu();
- createBodyRowsMenu();
- createFooterRowsMenu();
- createColumnsAndRowsMenu();
- createFrozenMenu();
- createColspanMenu();
- createSpacerMenu();
-
- escalator.addHandler(new SpacerIndexChangedHandler() {
- @Override
- public void onSpacerIndexChanged(SpacerIndexChangedEvent event) {
- // remove spacer from old index and move to new index
- Integer height = data.spacers.remove(event.getOldIndex());
- if (height != null) {
- data.spacers.put(event.getNewIndex(), height);
- } else {
- // no height, make sure the new index doesn't
- // point to anything else either
- data.spacers.remove(event.getNewIndex());
- }
- }
- }, SpacerIndexChangedEvent.TYPE);
- }
-
- private void createFrozenMenu() {
- String[] menupath = { FEATURES_MENU, "Frozen columns" };
- addMenuCommand("Freeze 1 column", () -> escalator
- .getColumnConfiguration().setFrozenColumnCount(1), menupath);
- addMenuCommand("Freeze 0 columns", () -> escalator
- .getColumnConfiguration().setFrozenColumnCount(0), menupath);
- }
-
- private void createColspanMenu() {
- String[] menupath = { FEATURES_MENU, "Column spanning" };
- addMenuCommand("Apply normal colspan", () -> {
- colspan = Colspan.NORMAL;
- refreshEscalator();
- }, menupath);
- addMenuCommand("Apply crazy colspan", () -> {
- colspan = Colspan.CRAZY;
- refreshEscalator();
- }, menupath);
- addMenuCommand("Apply no colspan", () -> {
- colspan = Colspan.NONE;
- refreshEscalator();
- }, menupath);
- }
-
- private void createColumnsAndRowsMenu() {
- String[] menupath = { COLUMNS_AND_ROWS_MENU };
- addMenuCommand("Add one of each row", () -> {
- insertRows(escalator.getHeader(), 0, 1);
- insertRows(escalator.getBody(), 0, 1);
- insertRows(escalator.getFooter(), 0, 1);
- }, menupath);
- addMenuCommand("Remove one of each row", () -> {
- removeRows(escalator.getHeader(), 0, 1);
- removeRows(escalator.getBody(), 0, 1);
- removeRows(escalator.getFooter(), 0, 1);
- }, menupath);
- }
-
- private void createGeneralMenu() {
- String[] menupath = { GENERAL_MENU };
-
- addMenuCommand("Detach Escalator", () -> escalator.removeFromParent(),
- menupath);
-
- addMenuCommand("Attach Escalator", () -> {
- if (!escalator.isAttached()) {
- addNorth(escalator, 500);
- }
- }, menupath);
-
- addMenuCommand("Clear (columns, then rows)", () -> resetColRow(),
- menupath);
- addMenuCommand("Clear (rows, then columns)", () -> resetRowCol()
-
- , menupath);
- addMenuCommand("Populate Escalator (columns, then rows)", () -> {
- resetColRow();
- insertColumns(0, 10);
- insertRows(escalator.getHeader(), 0, 1);
- insertRows(escalator.getBody(), 0, 100);
- insertRows(escalator.getFooter(), 0, 1);
- }, menupath);
- addMenuCommand("Populate Escalator (rows, then columns)", () -> {
- resetColRow();
- insertRows(escalator.getHeader(), 0, 1);
- insertRows(escalator.getBody(), 0, 100);
- insertRows(escalator.getFooter(), 0, 1);
- insertColumns(0, 10);
- }, menupath);
-
- createSizeMenu();
- }
-
- private void createSizeMenu() {
- String[] menupath = { "General", "Size" };
-
- addSizeMenuItem(null, "height", menupath);
- addSizeMenuItem("200px", "height", menupath);
- addSizeMenuItem("400px", "height", menupath);
- addSizeMenuItem(null, "width", menupath);
- addSizeMenuItem("200px", "width", menupath);
- addSizeMenuItem("400px", "width", menupath);
- }
-
- private void addSizeMenuItem(final String size, final String direction,
- String[] menupath) {
- final String title = (size != null ? size : "undefined");
- addMenuCommand(title + " " + direction, () -> {
- if (direction.equals("height")) {
- escalator.setHeight(size);
- } else {
- escalator.setWidth(size);
- }
- }, menupath);
- }
-
- private void createColumnMenu() {
- String[] menupath = { COLUMNS_AND_ROWS_MENU, "Columns" };
- addMenuCommand("Add one column to beginning", () -> insertColumns(0, 1),
- menupath);
- addMenuCommand("Add one column to end",
- () -> insertColumns(
- escalator.getColumnConfiguration().getColumnCount(), 1),
- menupath);
- addMenuCommand("Add ten columns", () -> insertColumns(0, 10), menupath);
- addMenuCommand("Remove one column from beginning",
- () -> removeColumns(0, 1), menupath);
- addMenuCommand("Remove one column from end",
- () -> removeColumns(
- escalator.getColumnConfiguration().getColumnCount() - 1,
- 1),
- menupath);
-
- addMenuCommand("Refresh first column",
- () -> escalator.getColumnConfiguration().refreshColumns(0, 1),
- menupath);
-
- addMenuCommand("Resize first column to max width",
- () -> escalator.getColumnConfiguration().setColumnWidth(0, -1),
- menupath);
-
- addMenuCommand("Resize first column to 100 px",
- () -> escalator.getColumnConfiguration().setColumnWidth(0, 100),
- menupath);
- }
-
- private void createHeaderRowsMenu() {
- String[] menupath = { COLUMNS_AND_ROWS_MENU, "Header Rows" };
- createRowsMenu(escalator.getHeader(), menupath);
- }
-
- private void createFooterRowsMenu() {
- String[] menupath = { COLUMNS_AND_ROWS_MENU, "Footer Rows" };
- createRowsMenu(escalator.getFooter(), menupath);
- }
-
- private void createBodyRowsMenu() {
- String[] menupath = { COLUMNS_AND_ROWS_MENU, "Body Rows" };
- createRowsMenu(escalator.getBody(), menupath);
-
- addMenuCommand("Add 5 rows to top",
- () -> insertRows(escalator.getBody(), 0, 5), menupath);
- addMenuCommand("Add 22 rows to top",
- () -> insertRows(escalator.getBody(), 0, 22), menupath);
- addMenuCommand("Add 50 rows to top",
- () -> insertRows(escalator.getBody(), 0, 50), menupath);
- addMenuCommand("Remove 5 rows from bottom",
- () -> removeRows(escalator.getBody(),
- escalator.getBody().getRowCount() - 5, 5),
- menupath);
- addMenuCommand("Remove 50 rows from bottom",
- () -> removeRows(escalator.getBody(),
- escalator.getBody().getRowCount() - 50, 50),
- menupath);
- addMenuCommand("Remove 15 rows from middle",
- () -> removeRows(escalator.getBody(), 3, 15), menupath);
- addMenuCommand("Remove 50 rows from almost bottom",
- () -> removeRows(escalator.getBody(),
- escalator.getBody().getRowCount() - 60, 50),
- menupath);
- addMenuCommand("Remove all, insert 30 and scroll 40px", () -> {
- removeRows(escalator.getBody(), 0,
- escalator.getBody().getRowCount());
- insertRows(escalator.getBody(), 0, 30);
- escalator.setScrollTop(40);
- }, menupath);
-
- String[] scrollToRowMenuPath = new String[menupath.length + 1];
- System.arraycopy(menupath, 0, scrollToRowMenuPath, 0, menupath.length);
- scrollToRowMenuPath[scrollToRowMenuPath.length - 1] = "Scroll to...";
- for (int i = 0; i < 100; i += 25) {
- final int rowIndex = i;
- addMenuCommand("Row " + i, () -> escalator.scrollToRow(rowIndex,
- ScrollDestination.ANY, 0), scrollToRowMenuPath);
- }
-
- addMenuCommand("Set 20px default height",
- () -> escalator.getBody().setDefaultRowHeight(20), menupath);
- }
-
- private void createRowsMenu(final RowContainer container,
- String[] menupath) {
- addMenuCommand("Add one row to beginning", () -> {
- int offset = 0;
- int number = 1;
- insertRows(container, offset, number);
- }, menupath);
- addMenuCommand("Add one row to end", () -> {
- int offset = container.getRowCount();
- int number = 1;
- insertRows(container, offset, number);
- }, menupath);
- addMenuCommand("Remove one row from beginning", () -> {
- int offset = 0;
- int number = 1;
- removeRows(container, offset, number);
- }, menupath);
- addMenuCommand("Remove one row from end", () -> {
- int offset = container.getRowCount() - 1;
- int number = 1;
- removeRows(container, offset, number);
- }, menupath);
- addMenuCommand("Remove all rows", () -> {
- if (container.getRowCount() > 0) {
- removeRows(container, 0, container.getRowCount());
- }
- }, menupath);
- }
-
- private void createSpacerMenu() {
- String[] menupath = { "Features", "Spacers" };
-
- addMenuCommand("Swap Spacer Updater", new ScheduledCommand() {
- private final SpacerUpdater CUSTOM = new SpacerUpdater() {
- @Override
- public void destroy(Spacer spacer) {
- spacer.getElement().setInnerText("");
- }
-
- @Override
- public void init(Spacer spacer) {
- spacer.getElement()
- .setInnerText("Spacer for row " + spacer.getRow());
- }
- };
-
- @Override
- public void execute() {
- BodyRowContainer body = escalator.getBody();
-
- if (SpacerUpdater.NULL.equals(body.getSpacerUpdater())) {
- body.setSpacerUpdater(CUSTOM);
- } else {
- body.setSpacerUpdater(SpacerUpdater.NULL);
- }
- }
- }, menupath);
-
- addMenuCommand("Focusable Updater",
- () -> escalator.getBody().setSpacerUpdater(new SpacerUpdater() {
- @Override
- public void init(Spacer spacer) {
- spacer.getElement().appendChild(DOM.createInputText());
- updateRowPositions(spacer);
- }
-
- @Override
- public void destroy(Spacer spacer) {
- spacer.getElement().removeAllChildren();
- updateRowPositions(spacer);
- }
-
- private void updateRowPositions(Spacer spacer) {
- if (spacer.getRow() < escalator.getBody()
- .getRowCount()) {
- Scheduler.get().scheduleFinally(() -> {
- escalator.getBody().updateRowPositions(
- spacer.getRow(),
- escalator.getBody().getRowCount());
- });
- }
- }
- }), menupath);
-
- createSpacersMenuForRow(-1, menupath);
- createSpacersMenuForRow(1, menupath);
- createSpacersMenuForRow(50, menupath);
- createSpacersMenuForRow(99, menupath);
- }
-
- private void createSpacersMenuForRow(final int rowIndex,
- String[] menupath) {
- menupath = new String[] { menupath[0], menupath[1], "Row " + rowIndex };
- addMenuCommand("Set 100px", () -> {
- escalator.getBody().setSpacer(rowIndex, 100);
- data.spacers.put(rowIndex, 100);
- }, menupath);
- addMenuCommand("Set 50px", () -> {
- escalator.getBody().setSpacer(rowIndex, 50);
- data.spacers.put(rowIndex, 50);
- }, menupath);
- addMenuCommand("Remove", () -> {
- escalator.getBody().setSpacer(rowIndex, -1);
- data.spacers.remove(rowIndex);
- }, menupath);
- addMenuCommand("Scroll here (ANY, 0)", () -> escalator
- .scrollToSpacer(rowIndex, ScrollDestination.ANY, 0), menupath);
- addMenuCommand("Scroll here row+spacer below (ANY, 0)", () -> escalator
- .scrollToRowAndSpacer(rowIndex, ScrollDestination.ANY, 0),
- menupath);
- }
-
- private void insertRows(final RowContainer container, int offset,
- int number) {
- if (container == escalator.getBody()) {
- data.insertRows(offset, number);
- escalator.getBody().insertRows(offset, number);
- } else {
- container.insertRows(offset, number);
- }
- if (container.getRowCount() > offset + number) {
- container.refreshRows(offset + number, container.getRowCount());
- }
- }
-
- private void removeRows(final RowContainer container, int offset,
- int number) {
- if (container == escalator.getBody()) {
- data.removeRows(offset, number);
- escalator.getBody().removeRows(offset, number);
- } else {
- container.removeRows(offset, number);
- }
- if (container.getRowCount() > offset) {
- container.refreshRows(offset, container.getRowCount());
- }
- }
-
- private void insertColumns(final int offset, final int number) {
- data.insertColumns(offset, number);
- escalator.getColumnConfiguration().insertColumns(offset, number);
- }
-
- private void removeColumns(final int offset, final int number) {
- data.removeColumns(offset, number);
- escalator.getColumnConfiguration().removeColumns(offset, number);
- }
-
- private void resetColRow() {
- if (escalator.getColumnConfiguration().getColumnCount() > 0) {
- removeColumns(0,
- escalator.getColumnConfiguration().getColumnCount());
- }
- if (escalator.getFooter().getRowCount() > 0) {
- removeRows(escalator.getFooter(), 0,
- escalator.getFooter().getRowCount());
- }
-
- if (escalator.getBody().getRowCount() > 0) {
- removeRows(escalator.getBody(), 0,
- escalator.getBody().getRowCount());
- }
-
- if (escalator.getHeader().getRowCount() > 0) {
- removeRows(escalator.getHeader(), 0,
- escalator.getHeader().getRowCount());
- }
- }
-
- private void resetRowCol() {
- if (escalator.getFooter().getRowCount() > 0) {
- removeRows(escalator.getFooter(), 0,
- escalator.getFooter().getRowCount());
- }
-
- if (escalator.getBody().getRowCount() > 0) {
- removeRows(escalator.getBody(), 0,
- escalator.getBody().getRowCount());
- }
-
- if (escalator.getHeader().getRowCount() > 0) {
- removeRows(escalator.getHeader(), 0,
- escalator.getHeader().getRowCount());
- }
-
- if (escalator.getColumnConfiguration().getColumnCount() > 0) {
- removeColumns(0,
- escalator.getColumnConfiguration().getColumnCount());
- }
- }
-
- private void refreshEscalator() {
- if (escalator.getHeader().getRowCount() > 0) {
- escalator.getHeader().refreshRows(0,
- escalator.getHeader().getRowCount());
- }
-
- if (escalator.getBody().getRowCount() > 0) {
- escalator.getBody().refreshRows(0,
- escalator.getBody().getRowCount());
- }
-
- if (escalator.getFooter().getRowCount() > 0) {
- escalator.getFooter().refreshRows(0,
- escalator.getFooter().getRowCount());
- }
- }
- }
|