use of com.github.bordertech.wcomponents.WCollapsibleToggle in project wcomponents by BorderTech.
the class WCollapsibleToggleRenderer method doRender.
/**
* Paints the given WCollapsibleToggle.
*
* @param component the WCollapsibleToggle to paint.
* @param renderContext the RenderContext to paint to.
*/
@Override
public void doRender(final WComponent component, final WebXmlRenderContext renderContext) {
WCollapsibleToggle toggle = (WCollapsibleToggle) component;
XmlStringBuilder xml = renderContext.getWriter();
xml.appendTagOpen("ui:collapsibletoggle");
xml.appendAttribute("id", component.getId());
xml.appendOptionalAttribute("class", component.getHtmlClass());
xml.appendOptionalAttribute("track", component.isTracking(), "true");
xml.appendAttribute("groupName", toggle.getGroupName());
xml.appendEnd();
}
use of com.github.bordertech.wcomponents.WCollapsibleToggle in project wcomponents by BorderTech.
the class WCollapsibleToggleRenderer_Test method testRendererCorrectlyConfigured.
@Test
public void testRendererCorrectlyConfigured() {
WCollapsibleToggle component = new WCollapsibleToggle();
Assert.assertTrue("Incorrect renderer supplied", getWebXmlRenderer(component) instanceof WCollapsibleToggleRenderer);
}
use of com.github.bordertech.wcomponents.WCollapsibleToggle in project wcomponents by BorderTech.
the class WCollapsibleToggleRenderer_Test method testDoPaint.
@Test
public void testDoPaint() throws IOException, SAXException, XpathException {
// Client-side
WCollapsibleToggle toggle = new WCollapsibleToggle(true);
setActiveContext(createUIContext());
assertSchemaMatch(toggle);
assertXpathNotExists("//ui:collapsibletoggle/@roundTrip", toggle);
assertXpathEvaluatesTo(toggle.getGroupName(), "//ui:collapsibletoggle/@groupName", toggle);
// Server-side
toggle = new WCollapsibleToggle(false);
assertSchemaMatch(toggle);
assertXpathNotExists("//ui:collapsibletoggle/@roundTrip", toggle);
}
Aggregations