Search in sources :

Example 1 with WTabGroup

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

the class WTabGroupRenderer method doRender.

/**
 * Paints the given WTabGroup.
 *
 * @param component the WTabGroup to paint.
 * @param renderContext the RenderContext to paint to.
 */
@Override
public void doRender(final WComponent component, final WebXmlRenderContext renderContext) {
    WTabGroup group = (WTabGroup) component;
    paintChildren(group, renderContext);
}
Also used : WTabGroup(com.github.bordertech.wcomponents.WTabGroup)

Example 2 with WTabGroup

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

the class WTabGroupRenderer_Test method testDoPaint.

@Test
public void testDoPaint() throws IOException, SAXException, XpathException {
    String groupName = "WTabGroupRenderer_Test.testDoPaint.groupName";
    WTabGroup tabGroup = new WTabGroup(groupName);
    WComponent wrapped = wrapTabGroup(tabGroup);
    assertXpathNotExists("//ui:tab", wrapped);
    tabGroup.addTab(new WText("dummy"), "dummy", TabMode.CLIENT);
    assertXpathExists("//ui:tab", wrapped);
    assertSchemaMatch(wrapped);
}
Also used : WComponent(com.github.bordertech.wcomponents.WComponent) WText(com.github.bordertech.wcomponents.WText) WTabGroup(com.github.bordertech.wcomponents.WTabGroup) Test(org.junit.Test)

Example 3 with WTabGroup

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

the class WTabGroupRenderer_Test method testRendererCorrectlyConfigured.

@Test
public void testRendererCorrectlyConfigured() {
    WTabGroup tabGroup = new WTabGroup("");
    Assert.assertTrue("Incorrect renderer supplied", getWebXmlRenderer(tabGroup) instanceof WTabGroupRenderer);
}
Also used : WTabGroup(com.github.bordertech.wcomponents.WTabGroup) Test(org.junit.Test)

Example 4 with WTabGroup

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

the class WTabGroupRenderer_Test method testXssEscaping.

@Test
public void testXssEscaping() throws IOException, SAXException, XpathException {
    WTabGroup tabGroup = new WTabGroup(getMaliciousContent());
    tabGroup.addTab(new WText("dummy"), "dummy", TabMode.CLIENT);
    WComponent wrapped = wrapTabGroup(tabGroup);
    assertSafeContent(wrapped);
    tabGroup.setToolTip(getMaliciousAttribute("ui:tab"));
    assertSafeContent(wrapped);
    tabGroup.setAccessibleText(getMaliciousAttribute("ui:tab"));
    assertSafeContent(wrapped);
}
Also used : WComponent(com.github.bordertech.wcomponents.WComponent) WText(com.github.bordertech.wcomponents.WText) WTabGroup(com.github.bordertech.wcomponents.WTabGroup) Test(org.junit.Test)

Aggregations

WTabGroup (com.github.bordertech.wcomponents.WTabGroup)4 Test (org.junit.Test)3 WComponent (com.github.bordertech.wcomponents.WComponent)2 WText (com.github.bordertech.wcomponents.WText)2