//
// Children
//
////////////////////////////////////////////////////////////////////////////
public void test_activeWidget() throws Exception {
TabLayoutPanelInfo panel =
openJavaInfo(
"public class Test extends TabLayoutPanel {",
" public Test() {",
" super(1.5, Unit.EM);",
" {",
" Button button_1 = new Button();",
" add(button_1, 'AAAAAA', false);",
" }",
" {",
" Button button_2 = new Button();",
" add(button_2, 'BBBBBB', false);",
" }",
" }",
"}");
WidgetInfo button_1 = getJavaInfoByName("button_1");
WidgetInfo button_2 = getJavaInfoByName("button_2");
// "button_1" is active, so it should be selected on click
assertSame(button_1, panel.getActiveWidget());
canvas.click(panel, 100, 100);
canvas.assertPrimarySelected(button_1);
// select "button_2"
panel.getWidgetHandles().get(1).show();
canvas.deselectAll();
canvas.click(panel, 100, 100);
canvas.assertPrimarySelected(button_2);
}