Search in sources :

Example 31 with WTextField

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

the class ExpressionBuilder_Test method testAndOperatorPrecedenceRHS.

/**
 * Tests for correct operator precedence when there is an AND on the right-hand side of the OR: a || b
 * {@literal &}{@literal &} c.
 */
@Test
public void testAndOperatorPrecedenceRHS() {
    builder.equals(new WTextField(), "1").or().equals(new WTextArea(), "2").and().equals(new WDropdown(), "3");
    Assert.assertEquals("Incorrect condition", "(WTextField=\"1\" or (WTextArea=\"2\" and WDropdown=\"3\"))", builder.build().toString());
}
Also used : WTextArea(com.github.bordertech.wcomponents.WTextArea) WDropdown(com.github.bordertech.wcomponents.WDropdown) WTextField(com.github.bordertech.wcomponents.WTextField) Test(org.junit.Test)

Example 32 with WTextField

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

the class ExpressionBuilder_Test method testAndOperatorPrecedenceLHS.

/**
 * Tests for correct operator precedence when there is an AND on the left-hand side of the OR: a
 * {@literal &}{@literal &} b || c.
 */
@Test
public void testAndOperatorPrecedenceLHS() {
    builder.equals(new WTextField(), "1").and().equals(new WTextArea(), "2").or().equals(new WDropdown(), "3");
    Assert.assertEquals("Incorrect condition", "((WTextField=\"1\" and WTextArea=\"2\") or WDropdown=\"3\")", builder.build().toString());
}
Also used : WTextArea(com.github.bordertech.wcomponents.WTextArea) WDropdown(com.github.bordertech.wcomponents.WDropdown) WTextField(com.github.bordertech.wcomponents.WTextField) Test(org.junit.Test)

Example 33 with WTextField

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

the class ExpressionBuilder_Test method testBuildGreaterThanOrEquals.

@Test
public void testBuildGreaterThanOrEquals() {
    builder.greaterThanOrEquals(new WTextField(), "1");
    Assert.assertEquals("Incorrect condition", "WTextField>=\"1\"", builder.build().toString());
}
Also used : WTextField(com.github.bordertech.wcomponents.WTextField) Test(org.junit.Test)

Example 34 with WTextField

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

the class ExpressionBuilder_Test method testBuildLessThan.

@Test
public void testBuildLessThan() {
    builder.lessThan(new WTextField(), "1");
    Assert.assertEquals("Incorrect condition", "WTextField<\"1\"", builder.build().toString());
}
Also used : WTextField(com.github.bordertech.wcomponents.WTextField) Test(org.junit.Test)

Example 35 with WTextField

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

the class ExpressionBuilder_Test method testSimpleOneArgCondition.

@Test
public void testSimpleOneArgCondition() {
    builder.equals(new WTextField(), "1");
    Assert.assertEquals("Incorrect condition", "WTextField=\"1\"", builder.build().toString());
}
Also used : WTextField(com.github.bordertech.wcomponents.WTextField) Test(org.junit.Test)

Aggregations

WTextField (com.github.bordertech.wcomponents.WTextField)117 Test (org.junit.Test)90 SubordinateTarget (com.github.bordertech.wcomponents.SubordinateTarget)21 WCheckBox (com.github.bordertech.wcomponents.WCheckBox)21 WContainer (com.github.bordertech.wcomponents.WContainer)21 Equal (com.github.bordertech.wcomponents.subordinate.Equal)16 GreaterThanOrEqual (com.github.bordertech.wcomponents.subordinate.GreaterThanOrEqual)15 LessThanOrEqual (com.github.bordertech.wcomponents.subordinate.LessThanOrEqual)15 NotEqual (com.github.bordertech.wcomponents.subordinate.NotEqual)15 Rule (com.github.bordertech.wcomponents.subordinate.Rule)15 WSubordinateControl (com.github.bordertech.wcomponents.subordinate.WSubordinateControl)15 SubordinateTrigger (com.github.bordertech.wcomponents.SubordinateTrigger)14 WTextArea (com.github.bordertech.wcomponents.WTextArea)14 WComponentGroup (com.github.bordertech.wcomponents.WComponentGroup)12 WDropdown (com.github.bordertech.wcomponents.WDropdown)12 WButton (com.github.bordertech.wcomponents.WButton)11 WFieldLayout (com.github.bordertech.wcomponents.WFieldLayout)11 WHeading (com.github.bordertech.wcomponents.WHeading)10 WLabel (com.github.bordertech.wcomponents.WLabel)10 Hide (com.github.bordertech.wcomponents.subordinate.Hide)10