use of com.github.bordertech.wcomponents.WTableColumn in project wcomponents by BorderTech.
the class DataTableBeanExample method createTable.
/**
* Creates and configures the table to be used by the example.
*
* @return a new configured table.
*/
private WDataTable createTable() {
WDataTable tbl = new WDataTable();
tbl.addColumn(new WTableColumn("First name", new WTextField()));
tbl.addColumn(new WTableColumn("Last name", new WTextField()));
tbl.addColumn(new WTableColumn("DOB", new WDateField()));
return tbl;
}
use of com.github.bordertech.wcomponents.WTableColumn in project wcomponents by BorderTech.
the class DataTableOptionsExample method createBasicDataTable.
/**
* @return a basic table example.
*/
private WDataTable createBasicDataTable() {
WDataTable table = new WDataTable();
table.setType(WDataTable.Type.TABLE);
table.addColumn(new WTableColumn("Column1", WText.class));
table.addColumn(new WTableColumn("Column2", WText.class));
table.addColumn(new WTableColumn("Column3", WText.class));
table.setRowsPerPage(DEFAULT_ROWS_PER_PAGE);
table.setSummary("Basic table summary");
table.setCaption("Basic table caption");
ExampleDataModel data = new ExampleDataModel();
data.setData(createData());
table.setDataModel(data);
return table;
}
use of com.github.bordertech.wcomponents.WTableColumn in project wcomponents by BorderTech.
the class ScrollableDataTableModelExample method createTable.
/**
* Creates and configures the table to be used by the example. The table is configured with global rather than user
* data. Although this is not a realistic scenario, it will suffice for this example.
*
* @return a new configured table.
*/
private WDataTable createTable() {
WDataTable table = new WDataTable();
table.addColumn(new WTableColumn("First name", WText.class));
table.addColumn(new WTableColumn("Last name", WText.class));
table.addColumn(new WTableColumn("DOB", WText.class));
table.setPaginationMode(PaginationMode.DYNAMIC);
table.setRowsPerPage(1);
table.setDataModel(createTableModel());
return table;
}
use of com.github.bordertech.wcomponents.WTableColumn in project wcomponents by BorderTech.
the class TreeTableHierarchyExample method createTable.
/**
* Creates and configures the table to be used by the example. The table is configured with global rather than user
* data. Although this is not a realistic scenario, it will suffice for this example.
*
* @return a new configured table.
*/
private WDataTable createTable() {
WDataTable tbl = new WDataTable();
tbl.setType(WDataTable.Type.HIERARCHIC);
tbl.addColumn(new WTableColumn("First name", new WText()));
tbl.addColumn(new WTableColumn("Last name", new WText()));
tbl.addColumn(new WTableColumn("DOB", new WDateField()));
tbl.setExpandMode(ExpandMode.CLIENT);
tbl.setStripingType(WDataTable.StripingType.ROWS);
TableTreeNode root = createTree();
tbl.setDataModel(new ExampleTreeTableModel(root));
return tbl;
}
use of com.github.bordertech.wcomponents.WTableColumn in project wcomponents by BorderTech.
the class SelectableDataTableExample method createTable.
/**
* Creates and configures the table to be used by the example. The table is configured with global rather than user
* data. Although this is not a realistic scenario, it will suffice for this example.
*
* @return a new configured table.
*/
private WDataTable createTable() {
WDataTable table = new WDataTable();
table.addColumn(new WTableColumn("First name", new WText()));
table.addColumn(new WTableColumn("Last name", new WText()));
table.addColumn(new WTableColumn("DOB", new WText()));
String[][] data = new String[][] { new String[] { "Joe", "Bloggs", "01/02/1973" }, new String[] { "Jane", "Bloggs", "04/05/1976" }, new String[] { "Kid", "Bloggs", "31/12/1999" } };
table.setDataModel(new SimpleTableDataModel(data));
return table;
}
Aggregations