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;
}
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 TableLoadPerformance method setupWTable.
/**
* Setup WTable.
*/
private void setupWTable() {
WTextField col1 = new WTextField();
col1.setIdName("my1");
col1.setReadOnly(true);
WTextField col2 = new WTextField();
col2.setIdName("my2");
col2.setReadOnly(true);
WDateField col3 = new WDateField();
col3.setIdName("my3");
col3.setReadOnly(true);
table.addColumn(new WTableColumn("COL1", col1));
table.addColumn(new WTableColumn("COL2", col2));
table.addColumn(new WTableColumn("COL3", col3));
table.setExpandMode(WTable.ExpandMode.CLIENT);
table.setIdName("wt");
LevelDetails level = new LevelDetails("documents", TravelDocPanel.class, true);
SimpleBeanBoundTableModel model = new SimpleBeanBoundTableModel(new String[] { "firstName", "lastName", "dateOfBirth" }, level);
table.setTableModel(model);
}
use of com.github.bordertech.wcomponents.WTableColumn in project wcomponents by BorderTech.
the class TableLoadPerformance method setupWDataTable.
/**
* Setup WTable.
*/
private void setupWDataTable() {
WTextField col1 = new WTextField();
col1.setIdName("my1");
col1.setReadOnly(true);
WTextField col2 = new WTextField();
col2.setIdName("my2");
col2.setReadOnly(true);
WDateField col3 = new WDateField();
col3.setIdName("my3");
col3.setReadOnly(true);
datatable.addColumn(new WTableColumn("COL1", col1));
datatable.addColumn(new WTableColumn("COL2", col2));
datatable.addColumn(new WTableColumn("COL3", col3));
datatable.setExpandMode(WDataTable.ExpandMode.CLIENT);
datatable.setIdName("wdt");
}
use of com.github.bordertech.wcomponents.WTableColumn in project wcomponents by BorderTech.
the class WTableOptionsExample method addColumns.
/**
* @param table the table to add columns
*/
private void addColumns(final WTable table) {
// Column - First name
WTextField textField = new WTextField();
textField.setToolTip("First name");
table.addColumn(new WTableColumn("First name", textField));
// Column - Last name
textField = new WTextField();
textField.setToolTip("Last name");
table.addColumn(new WTableColumn("Last name", textField));
// Column - Date field
WDateField dateField = new WDateField();
dateField.setToolTip("Date of birth");
table.addColumn(new WTableColumn("Date of birth", dateField));
}
Aggregations