/**
* There was problem that sequence: reparent, move does not moves add() association.
*/
public void test_ADD_associationProblem() throws Exception {
RootPanelInfo frame =
parseJavaInfo(
"public class Test implements EntryPoint {",
" public void onModuleLoad() {",
" RootPanel rootPanel = RootPanel.get();",
" {",
" AbsolutePanel panel = new AbsolutePanel();",
" rootPanel.add(panel);",
" {",
" Button button = new Button();",
" panel.add(button);",
" }",
" }",
" }",
"}");
refresh();
WidgetInfo button = getJavaInfoByName("button");
AbsolutePanelInfo panel = getJavaInfoByName("panel");
// do ADD
frame.command_MOVE2(button, null);
assertEditor(
"public class Test implements EntryPoint {",
" public void onModuleLoad() {",
" RootPanel rootPanel = RootPanel.get();",
" {",
" AbsolutePanel panel = new AbsolutePanel();",
" rootPanel.add(panel);",
" }",
" {",
" Button button = new Button();",
" rootPanel.add(button);",
" }",
" }",
"}");
assertHierarchy(
"{RootPanel.get()} {local-unique: rootPanel} {/RootPanel.get()/ /rootPanel.add(panel)/ /rootPanel.add(button)/}",
" {new: com.google.gwt.user.client.ui.AbsolutePanel} {local-unique: panel} {/new AbsolutePanel()/ /rootPanel.add(panel)/}",
" {new: com.google.gwt.user.client.ui.Button} {local-unique: button} {/new Button()/ /rootPanel.add(button)/}");
// set location
frame.command_BOUNDS(button, new Point(50, 100), null);
assertEditor(
"public class Test implements EntryPoint {",
" public void onModuleLoad() {",
" RootPanel rootPanel = RootPanel.get();",
" {",
" AbsolutePanel panel = new AbsolutePanel();",
" rootPanel.add(panel);",
" }",
" {",
" Button button = new Button();",
" rootPanel.add(button, 50, 100);",
" }",
" }",
"}");
assertHierarchy(
"{RootPanel.get()} {local-unique: rootPanel} {/RootPanel.get()/ /rootPanel.add(panel)/ /rootPanel.add(button, 50, 100)/}",
" {new: com.google.gwt.user.client.ui.AbsolutePanel} {local-unique: panel} {/new AbsolutePanel()/ /rootPanel.add(panel)/}",
" {new: com.google.gwt.user.client.ui.Button} {local-unique: button} {/new Button()/ /rootPanel.add(button, 50, 100)/}");
// move "button" before "panel"
frame.command_MOVE2(button, panel);
assertEditor(
"public class Test implements EntryPoint {",
" public void onModuleLoad() {",
" RootPanel rootPanel = RootPanel.get();",
" {",