Search in sources :

Example 11 with WList

use of com.github.bordertech.wcomponents.WList in project wcomponents by BorderTech.

the class WListRenderer_Test method testRenderedFormatWithBorder.

@Test
public void testRenderedFormatWithBorder() throws IOException, SAXException {
    // non-empty list, no border
    WList list = new WList(WList.Type.STRIPED);
    list.setRenderBorder(true);
    list.setRepeatedComponent(new WText());
    list.setData(Arrays.asList(new String[] { "row1", "row2", "row3" }));
    assertSchemaMatch(list);
}
Also used : WText(com.github.bordertech.wcomponents.WText) WList(com.github.bordertech.wcomponents.WList) Test(org.junit.Test)

Example 12 with WList

use of com.github.bordertech.wcomponents.WList in project wcomponents by BorderTech.

the class WListRenderer_Test method testRenderedFormatEmptyWithBorder.

@Test
public void testRenderedFormatEmptyWithBorder() throws IOException, SAXException, XpathException {
    // empty list, with border
    WList list = new WList(WList.Type.STRIPED);
    list.setRenderBorder(true);
    list.setRepeatedComponent(new WText());
    assertSchemaMatch(list);
    assertXpathEvaluatesTo("striped", "//ui:listlayout/@type", list);
    assertXpathEvaluatesTo("box", "//ui:panel/@type", list);
    assertXpathNotExists("//ui:listlayout/@separator", list);
}
Also used : WText(com.github.bordertech.wcomponents.WText) WList(com.github.bordertech.wcomponents.WList) Test(org.junit.Test)

Aggregations

WList (com.github.bordertech.wcomponents.WList)12 Test (org.junit.Test)8 WText (com.github.bordertech.wcomponents.WText)7 SimpleTableBean (com.github.bordertech.wcomponents.examples.common.SimpleTableBean)2 ArrayList (java.util.ArrayList)2 Margin (com.github.bordertech.wcomponents.Margin)1 Size (com.github.bordertech.wcomponents.Size)1 XmlStringBuilder (com.github.bordertech.wcomponents.XmlStringBuilder)1 SystemException (com.github.bordertech.wcomponents.util.SystemException)1 List (java.util.List)1