Use ArrayList instead of Array in GWT-RPC calls.
[online-glom:gwt-glom.git] / src / main / java / org / glom / web / client / LayoutListDataProvider.java
1 package org.glom.web.client;
2
3 import java.util.ArrayList;
4
5 import com.google.gwt.user.client.rpc.AsyncCallback;
6 import com.google.gwt.view.client.AsyncDataProvider;
7 import com.google.gwt.view.client.HasData;
8 import com.google.gwt.view.client.Range;
9
10 public class LayoutListDataProvider extends AsyncDataProvider<String[]> {
11
12         @Override
13         protected void onRangeChanged(HasData<String[]> display) {
14                 final Range range = display.getVisibleRange();
15
16                 final int start = range.getStart();
17                 final int length = range.getLength();
18
19                 AsyncCallback<ArrayList<String[]>> callback = new AsyncCallback<ArrayList<String[]>>() {
20                         public void onFailure(Throwable caught) {
21                                 // FIXME: need to deal with failure
22                                 System.out.println("AsyncCallback Failed: LibGlomService.getTableData()");
23                         }
24
25                         public void onSuccess(ArrayList<String[]> result) {
26                                 updateRowData(start, result);
27                         }
28                 };
29
30                 LibGlomServiceAsync.Util.getInstance().getTableData(start, length, OnlineGlom.getCurrentTableName(), callback);
31
32         }
33
34 }