* Test for {@link StackPanelInfo#getWidgetHandles()}.
* <p>
* {@link WidgetHandle}'s should have some good bounds.
*/
public void test_WidgetHandle_getBounds() throws Exception {
StackLayoutPanelInfo panel =
parseJavaInfo(
"public class Test extends StackLayoutPanel {",
" public Test() {",
" super(Unit.EM);",
" {",
" Button button_1 = new Button();",
" add(button_1, new HTML('First widget'), 1.0);",
" }",
" {",
" Button button_2 = new Button();",
" add(button_2, new HTML('Second widget'), 1.0);",
" }",
" }",
"}");
panel.refresh();
WidgetInfo button_1 = getJavaInfoByName("button_1");
WidgetInfo button_2 = getJavaInfoByName("button_2");
//
List<WidgetHandle> handles = panel.getWidgetHandles();
assertThat(handles).hasSize(2);
{
WidgetHandle handle = handles.get(0);
assertSame(button_1, handle.getWidget());
Rectangle bounds = handle.getBounds();