Search in sources :

Example 81 with WLabel

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

the class WLabelRenderer_Test method testReadOnlyWithInput.

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

Example 82 with WLabel

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

the class WLabelRenderer_Test method testXssEscaping.

@Test
public void testXssEscaping() throws IOException, SAXException, XpathException {
    WLabel label = new WLabel(getMaliciousContent());
    assertSafeContent(label);
    label.setHint(getMaliciousAttribute("ui:label"));
    assertSafeContent(label);
    label.setToolTip(getMaliciousAttribute("ui:label"));
    assertSafeContent(label);
    label.setAccessibleText(getMaliciousAttribute("ui:label"));
    assertSafeContent(label);
}
Also used : WLabel(com.github.bordertech.wcomponents.WLabel) Test(org.junit.Test)

Example 83 with WLabel

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

the class WLabelRenderer_Test method testHidden.

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

Example 84 with WLabel

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

the class WLabelRenderer_Test method testWhatForNotAnInput.

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

Example 85 with WLabel

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

the class WLabelRenderer_Test method testMandatoryWithInput.

@Test
public void testMandatoryWithInput() throws IOException, SAXException, XpathException {
    MyInput comp = new MyInput();
    WLabel label = new WLabel("label", comp);
    comp.setMandatory(true);
    assertSchemaMatch(label);
    assertXpathEvaluatesTo("true", "//ui:label/@required", label);
}
Also used : 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