//
// Manage active
//
////////////////////////////////////////////////////////////////////////////
public void test_manageActive() throws Exception {
LayoutContainerInfo container =
parseJavaInfo(
"public class Test extends LayoutContainer {",
" public Test() {",
" setLayout(new CardLayout());",
" {",
" Button button_1 = new Button();",
" add(button_1);",
" }",
" {",
" Button button_2 = new Button();",
" add(button_2);",
" }",
" {",
" Button button_3 = new Button();",
" add(button_3);",
" }",
" }",
"}");
container.refresh();
List<WidgetInfo> widgets = container.getWidgets();
// initially "button_1" is expanded
assertActiveIndex(container, 0);
// notify about "button_2"
{
boolean shouldRefresh = notifySelecting(widgets.get(1));
assertTrue(shouldRefresh);
container.refresh();
// now "button_2" is expanded
assertActiveIndex(container, 1);
}
// second notification about "button_2" does not cause refresh()
{