Having played around with Gwt Designer for a couple of days I have a few more questions.
If I have a public (static) widget in another class and add it to the root panel the design view doesn't show it. The preview pane also doesn't show it, but hosted mode does as expected. Always having coded without visual tools I ask whether this is normal behavior?
Does Designer require all Gui initialization to be done in onModuleLoad? If I have another class (than the entry point class) as delegate for adding widgets to the rootpanel, the only way to show it (correct) in design view looks to be having this class implement EntryPoint (although it isn't really) and do the work in a onModuleLoad method. Is there anotherway of telling Designer where to look?
And (less important, but anyway ;-) the following:
- Code: Select all
public void onModuleLoad() {
RootPanel rootPanel = RootPanel.get();
Button button = getButton();
rootPanel.add(button, 10, 200);
}
public Button getButton() {
Button button = new Button("test");
button.setWidth("80%");
return button;
}
shows alright in design view, but
- Code: Select all
public void onModuleLoad() {
RootPanel rootPanel = RootPanel.get();
Button button = getButton();
button.setWidth("80%");
button.setText("failed");
rootPanel.add(button, 10, 200);
}
public Button getButton() {
Button button = new Button("test");
return button;
}
doesn't. Shows neither the width nor the new text.
What's going on here?
Art