assertEquals(new Rectangle(0, 0, 500, 400), frame.getBounds());
}
}
public void test_withButton() throws Exception {
RootLayoutPanelInfo frame =
parseJavaInfo(
"public class Test implements EntryPoint {",
" public void onModuleLoad() {",
" RootLayoutPanel rootPanel = RootLayoutPanel.get();",
" {",
" Button button = new Button();",
" rootPanel.add(button);",
" rootPanel.setWidgetLeftRight(button, 10, Unit.PX, 20, Unit.PX);",
" rootPanel.setWidgetTopBottom(button, 30, Unit.PX, 40, Unit.PX);",
" }",
" }",
"}");
assertHierarchy(
"{RootLayoutPanel.get()} {local-unique: rootPanel} {/RootLayoutPanel.get()/ /rootPanel.add(button)/ /rootPanel.setWidgetLeftRight(button, 10, Unit.PX, 20, Unit.PX)/ /rootPanel.setWidgetTopBottom(button, 30, Unit.PX, 40, Unit.PX)/}",
" {new: com.google.gwt.user.client.ui.Button} {local-unique: button} {/new Button()/ /rootPanel.add(button)/ /rootPanel.setWidgetLeftRight(button, 10, Unit.PX, 20, Unit.PX)/ /rootPanel.setWidgetTopBottom(button, 30, Unit.PX, 40, Unit.PX)/}");
frame.refresh();
// bounds
WidgetInfo button = getJavaInfoByName("button");
{
Rectangle expected = new Rectangle(10, 30, 450 - 10 - 20, 300 - 30 - 40);
assertEquals(expected, button.getBounds());