use of com.github.bordertech.wcomponents.WTable in project wcomponents by BorderTech.
the class WTableRenderer_Test method testDoPaintExpandModeClient.
@Test
public void testDoPaintExpandModeClient() throws IOException, SAXException, XpathException {
WTable component = new WTable();
component.addColumn(new WTableColumn(COL1_HEADING_TEST, WTextField.class));
component.addColumn(new WTableColumn(COL2_HEADING_TEST, WTextField.class));
component.addColumn(new WTableColumn(COL3_HEADING_TEST, WTextField.class));
TableModel tableModel = createTableModel();
component.setTableModel(tableModel);
component.setVisible(true);
component.setExpandMode(ExpandMode.CLIENT);
assertXpathEvaluatesTo("client", "//ui:table/ui:rowexpansion/@mode", component);
}
use of com.github.bordertech.wcomponents.WTable in project wcomponents by BorderTech.
the class WTableRenderer_Test method testDoPaintExpandModeLazy.
@Test
public void testDoPaintExpandModeLazy() throws IOException, SAXException, XpathException {
WTable component = new WTable();
component.addColumn(new WTableColumn(COL1_HEADING_TEST, WTextField.class));
component.addColumn(new WTableColumn(COL2_HEADING_TEST, WTextField.class));
component.addColumn(new WTableColumn(COL3_HEADING_TEST, WTextField.class));
TableModel tableModel = createTableModel();
component.setTableModel(tableModel);
component.setVisible(true);
component.setExpandMode(ExpandMode.LAZY);
assertXpathEvaluatesTo("lazy", "//ui:table/ui:rowexpansion/@mode", component);
}
use of com.github.bordertech.wcomponents.WTable in project wcomponents by BorderTech.
the class WTableRenderer_Test method testDoPaintMissingAttributes.
@Test
public void testDoPaintMissingAttributes() throws IOException, SAXException, XpathException {
WTable component = new WTable();
component.addColumn(new WTableColumn(COL1_HEADING_TEST, WTextField.class));
component.addColumn(new WTableColumn(COL2_HEADING_TEST, WTextField.class));
component.addColumn(new WTableColumn(COL3_HEADING_TEST, WTextField.class));
component.setTableModel(createTableModel());
component.setVisible(true);
component.setStripingType(WTable.StripingType.NONE);
component.setSeparatorType(WTable.SeparatorType.NONE);
assertXpathNotExists("//ui:table/@caption", component);
assertXpathEvaluatesTo("table", "//ui:table/@type", component);
assertXpathNotExists("//ui:table/@striping", component);
assertXpathNotExists("//ui:table/@separators", component);
}
use of com.github.bordertech.wcomponents.WTable in project wcomponents by BorderTech.
the class WTableRenderer_Test method testDoPaintWithColAlignment.
@Test
public void testDoPaintWithColAlignment() throws IOException, SAXException, XpathException {
WTable table = new WTable();
table.addColumn(new WTableColumn(COL1_HEADING_TEST, WTextField.class));
table.addColumn(new WTableColumn(COL2_HEADING_TEST, WTextField.class));
table.addColumn(new WTableColumn(COL3_HEADING_TEST, WTextField.class));
table.getColumn(0).setAlign(WTableColumn.Alignment.LEFT);
table.getColumn(1).setAlign(WTableColumn.Alignment.CENTER);
table.getColumn(2).setAlign(WTableColumn.Alignment.RIGHT);
TableModel tableModel = createTableModel();
table.setTableModel(tableModel);
assertXpathNotExists("//ui:table/ui:thead/ui:th[1]/@align", table);
assertXpathEvaluatesTo("center", "//ui:table/ui:thead/ui:th[2]/@align", table);
assertXpathEvaluatesTo("right", "//ui:table/ui:thead/ui:th[3]/@align", table);
}
use of com.github.bordertech.wcomponents.WTable in project wcomponents by BorderTech.
the class WTableRenderer_Test method testDoPaintOfRowHeaderWithNoRowHeaderColumn.
@Test
public void testDoPaintOfRowHeaderWithNoRowHeaderColumn() throws IOException, SAXException, XpathException {
WTable table = new WTable();
table.addColumn(new WTableColumn(COL1_HEADING_TEST, WTextField.class));
table.addColumn(new WTableColumn(COL2_HEADING_TEST, WTextField.class));
table.addColumn(new WTableColumn(COL3_HEADING_TEST, WTextField.class));
// no row headers set
TableModel tableModel = createTableModel();
table.setTableModel(tableModel);
assertXpathNotExists("//ui:table/ui:tbody/ui:tr/ui:th", table);
}
Aggregations