use of com.github.bordertech.wcomponents.WPanel in project wcomponents by BorderTech.
the class FlowLayoutRenderer_Test method testHVGapsWithContentAlign.
@Test
public void testHVGapsWithContentAlign() throws IOException, SAXException, XpathException {
WPanel panel = new WPanel();
String expected;
for (FlowLayout.Alignment a : FlowLayout.Alignment.values()) {
for (FlowLayout.ContentAlignment c : FlowLayout.ContentAlignment.values()) {
panel.setLayout(new FlowLayout(a, 3, 16, c));
assertSchemaMatch(panel);
expected = a == FlowLayout.VERTICAL ? BIG_GAP.toString() : GAP.toString();
assertXpathEvaluatesTo(expected, "//ui:panel/ui:flowlayout/@gap", panel);
}
}
}
use of com.github.bordertech.wcomponents.WPanel in project wcomponents by BorderTech.
the class ListLayoutRenderer_Test method testDoRender.
@Test
public void testDoRender() throws IOException, SAXException, XpathException {
final String text1 = "FlowRenderer_Test.testPaint.text1";
final String text2 = "FlowRenderer_Test.testPaint.text2";
WPanel panel = new WPanel();
panel.setLayout(new ListLayout(ListLayout.Type.STRIPED, ListLayout.Alignment.LEFT, ListLayout.Separator.DOT, true, GAP));
assertSchemaMatch(panel);
assertXpathNotExists("//ui:panel/ui:listlayout/ui:cell", panel);
panel.add(new WText(text1));
panel.add(new WText(text2));
assertXpathEvaluatesTo("2", "count(//ui:panel/ui:listlayout/ui:cell)", panel);
assertXpathEvaluatesTo(text1, "normalize-space(//ui:panel/ui:listlayout/ui:cell[1])", panel);
assertXpathEvaluatesTo(text2, "normalize-space(//ui:panel/ui:listlayout/ui:cell[2])", panel);
}
Aggregations