1 package org.glom.web.client;
3 import com.google.gwt.user.cellview.client.CellTable;
4 import com.google.gwt.user.cellview.client.SimplePager;
5 import com.google.gwt.user.cellview.client.TextColumn;
6 import com.google.gwt.user.client.ui.Composite;
7 import com.google.gwt.user.client.ui.VerticalPanel;
9 public class LayoutList extends Composite {
11 private CellTable<String[]> table = null;
13 public LayoutList(String[] headers) {
14 table = new CellTable<String[]>();
15 LayoutListDataProvider dataProvider = new LayoutListDataProvider();
16 dataProvider.addDataDisplay(table);
18 // TODO wire up the pager
19 SimplePager pager = new SimplePager(SimplePager.TextLocation.CENTER);
20 pager.setDisplay(table);
22 // a panel to hold our widgets
23 VerticalPanel panel = new VerticalPanel();
27 for (int i = 0; i < headers.length; i++) {
28 // create a new column
29 final int j = new Integer(i);
30 TextColumn<String[]> column = new TextColumn<String[]>() {
32 public String getValue(String[] object) {
37 // add the column to the list
38 table.addColumn(column, headers[i]);
44 // take care of the necessary stuff required for composite widgets
46 setStyleName("glom-ListLayoutTable");