Search in sources :

Example 41 with WLabel

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

the class WColumnRenderer_Test method testPaint.

@Test
public void testPaint() throws IOException, SAXException, XpathException {
    WRow row = new WRow();
    WColumn column = new WColumn(100);
    row.add(column);
    column.add(new WLabel("dummy"));
    assertSchemaMatch(row);
    assertXpathEvaluatesTo(column.getId(), "//ui:column/@id", row);
    assertXpathEvaluatesTo("100", "//ui:column/@width", row);
    assertXpathNotExists("//ui:column/@align", row);
    column.setAlignment(WColumn.Alignment.LEFT);
    assertSchemaMatch(row);
    assertXpathNotExists("//ui:column/@align", row);
    column.setAlignment(WColumn.Alignment.CENTER);
    assertSchemaMatch(row);
    assertXpathEvaluatesTo("center", "//ui:column/@align", row);
    column.setAlignment(WColumn.Alignment.RIGHT);
    assertSchemaMatch(row);
    assertXpathEvaluatesTo("right", "//ui:column/@align", row);
}
Also used : WRow(com.github.bordertech.wcomponents.WRow) WColumn(com.github.bordertech.wcomponents.WColumn) WLabel(com.github.bordertech.wcomponents.WLabel) Test(org.junit.Test)

Example 42 with WLabel

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

the class WLabelRenderer_Test method testWhatForGroup3.

@Test
public void testWhatForGroup3() throws IOException, SAXException, XpathException {
    WMultiTextField comp = new WMultiTextField();
    WLabel label = new WLabel("label", comp);
    assertSchemaMatch(label);
    assertXpathEvaluatesTo("group", "//ui:label/@what", label);
}
Also used : WMultiTextField(com.github.bordertech.wcomponents.WMultiTextField) WLabel(com.github.bordertech.wcomponents.WLabel) Test(org.junit.Test)

Example 43 with WLabel

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

the class WLabelRenderer_Test method testRendererCorrectlyConfigured.

/**
 * Test the Layout is correctly configured.
 */
@Test
public void testRendererCorrectlyConfigured() {
    WLabel label = new WLabel();
    Assert.assertTrue("Incorrect renderer supplied", getWebXmlRenderer(label) instanceof WLabelRenderer);
}
Also used : WLabel(com.github.bordertech.wcomponents.WLabel) Test(org.junit.Test)

Example 44 with WLabel

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

the class WLabelRenderer_Test method testHiddenBoth.

@Test
public void testHiddenBoth() throws IOException, SAXException, XpathException {
    MyInput comp = new MyInput();
    WLabel label = new WLabel("label", comp);
    label.setHidden(true);
    comp.setHidden(true);
    assertSchemaMatch(label);
    assertXpathEvaluatesTo("true", "//ui:label/@hidden", label);
    assertXpathEvaluatesTo("true", "//ui:label/@hiddencomponent", label);
}
Also used : WLabel(com.github.bordertech.wcomponents.WLabel) Test(org.junit.Test)

Example 45 with WLabel

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

the class WLabelRenderer_Test method testWhatForGroup5.

@Test
public void testWhatForGroup5() throws IOException, SAXException, XpathException {
    WRadioButtonSelect comp = new WRadioButtonSelect();
    WLabel label = new WLabel("label", comp);
    assertSchemaMatch(label);
    assertXpathEvaluatesTo("group", "//ui:label/@what", label);
}
Also used : WRadioButtonSelect(com.github.bordertech.wcomponents.WRadioButtonSelect) WLabel(com.github.bordertech.wcomponents.WLabel) Test(org.junit.Test)

Aggregations

WLabel (com.github.bordertech.wcomponents.WLabel)99 Test (org.junit.Test)57 WHeading (com.github.bordertech.wcomponents.WHeading)13 WTextField (com.github.bordertech.wcomponents.WTextField)10 WButton (com.github.bordertech.wcomponents.WButton)9 ExplanatoryText (com.github.bordertech.wcomponents.examples.common.ExplanatoryText)9 WComponent (com.github.bordertech.wcomponents.WComponent)8 WRadioButtonSelect (com.github.bordertech.wcomponents.WRadioButtonSelect)8 WPanel (com.github.bordertech.wcomponents.WPanel)7 UIContext (com.github.bordertech.wcomponents.UIContext)6 WCheckBoxSelect (com.github.bordertech.wcomponents.WCheckBoxSelect)6 SubordinateTarget (com.github.bordertech.wcomponents.SubordinateTarget)5 UIContextImpl (com.github.bordertech.wcomponents.UIContextImpl)5 WAjaxControl (com.github.bordertech.wcomponents.WAjaxControl)5 WComponentGroup (com.github.bordertech.wcomponents.WComponentGroup)5 WFieldLayout (com.github.bordertech.wcomponents.WFieldLayout)5 Action (com.github.bordertech.wcomponents.Action)4 ActionEvent (com.github.bordertech.wcomponents.ActionEvent)4 WApplication (com.github.bordertech.wcomponents.WApplication)4 WContainer (com.github.bordertech.wcomponents.WContainer)4