use of com.github.bordertech.wcomponents.SubordinateTarget in project wcomponents by BorderTech.
the class DisableInGroup_Test method testActionType.
@Test
public void testActionType() {
SubordinateTarget target = new WTextField();
WComponentGroup<SubordinateTarget> group = new WComponentGroup<>();
group.addToGroup(target);
DisableInGroup action = new DisableInGroup(target, group);
Assert.assertEquals("Incorrect Action Type", action.getActionType(), AbstractAction.ActionType.DISABLEIN);
}
use of com.github.bordertech.wcomponents.SubordinateTarget in project wcomponents by BorderTech.
the class EnableInGroup_Test method testConstructor.
@Test
public void testConstructor() {
SubordinateTarget target = new MyTarget();
WComponentGroup<SubordinateTarget> group = new WComponentGroup<>();
EnableInGroup action = new EnableInGroup(target, group);
Assert.assertEquals("Value for EnableIn should be false", Boolean.FALSE, action.getValue());
Assert.assertEquals("Target for EnableIn should be the group", group, action.getTarget());
Assert.assertEquals("TargetInGroup for EnableIn should be the target", target, action.getTargetInGroup());
}
use of com.github.bordertech.wcomponents.SubordinateTarget 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());
}
use of com.github.bordertech.wcomponents.SubordinateTarget in project wcomponents by BorderTech.
the class Enable_Test method testConstructor.
@Test
public void testConstructor() {
SubordinateTarget target = new MyTarget();
Enable action = new Enable(target);
Assert.assertEquals("Value for Enable should be true", Boolean.TRUE, action.getValue());
Assert.assertEquals("Target for Enable should be the target", target, action.getTarget());
}
use of com.github.bordertech.wcomponents.SubordinateTarget in project wcomponents by BorderTech.
the class HideInGroup_Test method testConstructor.
@Test
public void testConstructor() {
SubordinateTarget target = new MyTarget();
WComponentGroup<SubordinateTarget> group = new WComponentGroup<>();
HideInGroup action = new HideInGroup(target, group);
Assert.assertEquals("Value for HideIn should be true", Boolean.TRUE, action.getValue());
Assert.assertEquals("Target for HideIn should be the group", group, action.getTarget());
Assert.assertEquals("TargetInGroup for HideIn should be the target", target, action.getTargetInGroup());
}
Aggregations