View Javadoc

1   /*
2    * Copyright 2006 Robert Hanson <iamroberthanson AT gmail.com>
3    * 
4    * Licensed under the Apache License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    * 
8    *    http://www.apache.org/licenses/LICENSE-2.0
9    * 
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   * See the License for the specific language governing permissions and
14   * limitations under the License.
15   */
16  
17  package org.gwtwidgets.client.ui.pagination;
18  
19  import com.google.gwt.user.client.rpc.AsyncCallback;
20  
21  /***
22   * Retrieves the next page. Pass the AsyncCallback provided to a RPC call or
23   * call it manually with a new List to update the table.
24   * 
25   * @author Joe Toth (joetoth@gmail.com)
26   * 
27   */
28  public interface DataProvider {
29  	/***
30  	 * 
31  	 * Since javascript is asynchronous, after the Results object is create the
32  	 * updateTableCallback needs to be executed. Usually you will retrieve
33  	 * results via a remote servlet, so you can call your service with the
34  	 * callback.
35  	 * 
36  	 * Ex. service.find(parameters, callback);
37  	 * 
38  	 * @param parameters
39  	 * @param callback
40  	 * @return
41  	 */
42  	public abstract void update(PaginationParameters parameters,
43  			AsyncCallback updateTableCallback);
44  }