Search in sources :

Example 11 with WLabel

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

the class Disable_Test method testToString.

@Test
public void testToString() {
    MyTarget target = new MyTarget();
    Disable action = new Disable(target);
    Assert.assertEquals("Incorrect toString for action", "disable MyTarget", action.toString());
    WLabel label = new WLabel("test label", target);
    Assert.assertEquals("Incorrect toString for action with a label", "disable " + label.getText(), action.toString());
}
Also used : WLabel(com.github.bordertech.wcomponents.WLabel) Test(org.junit.Test)

Example 12 with WLabel

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

the class EnableInGroup_Test method testToString.

@Test
public void testToString() {
    SubordinateTarget target1 = new MyTarget();
    SubordinateTarget target2 = new MyTarget();
    SubordinateTarget target3 = new MyTarget();
    WComponentGroup<SubordinateTarget> group = new WComponentGroup<>();
    group.addToGroup(target1);
    group.addToGroup(target2);
    group.addToGroup(target3);
    EnableInGroup action = new EnableInGroup(target2, group);
    Assert.assertEquals("Incorrect toString for action", "enable MyTarget in WComponentGroup([MyTarget, MyTarget, MyTarget])", action.toString());
    new WLabel("test label", target2);
    Assert.assertEquals("Incorrect toString for action with a label", "enable test label in WComponentGroup([MyTarget, MyTarget, MyTarget])", action.toString());
}
Also used : SubordinateTarget(com.github.bordertech.wcomponents.SubordinateTarget) WComponentGroup(com.github.bordertech.wcomponents.WComponentGroup) WLabel(com.github.bordertech.wcomponents.WLabel) Test(org.junit.Test)

Example 13 with WLabel

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

the class Enable_Test method testToString.

@Test
public void testToString() {
    MyTarget target = new MyTarget();
    Enable action = new Enable(target);
    Assert.assertEquals("Incorrect toString for action", "enable MyTarget", action.toString());
    WLabel label = new WLabel("test label", target);
    Assert.assertEquals("Incorrect toString for action with a label", "enable " + label.getText(), action.toString());
}
Also used : WLabel(com.github.bordertech.wcomponents.WLabel) Test(org.junit.Test)

Example 14 with WLabel

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

the class GreaterThanOrEqual_Test method testToString.

@Test
public void testToString() {
    MyTrigger trigger = new MyTrigger();
    GreaterThanOrEqual compare = new GreaterThanOrEqual(trigger, "1");
    Assert.assertEquals("Incorrect toString for compare", "MyTrigger>=\"1\"", compare.toString());
    WLabel label = new WLabel("test label", trigger);
    Assert.assertEquals("Incorrect toString for compare with a label", label.getText() + ">=\"1\"", compare.toString());
}
Also used : WLabel(com.github.bordertech.wcomponents.WLabel) Test(org.junit.Test)

Example 15 with WLabel

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

the class Hide_Test method testToString.

@Test
public void testToString() {
    MyTarget target = new MyTarget();
    Hide action = new Hide(target);
    Assert.assertEquals("Incorrect toString for action", "hide MyTarget", action.toString());
    WLabel label = new WLabel("test label", target);
    Assert.assertEquals("Incorrect toString for action with a label", "hide " + label.getText(), action.toString());
}
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