, FlowLayout, , , . , , .
, FitLayout contentPanel, 3 , FitLayout , .
:
1) RowLayout,
2) , , .
:
public void onModuleLoad() {
final Viewport viewport = new Viewport();
viewport.setLayout(new FitLayout());
final LayoutContainer topContainer = new LayoutContainer(
new FlowLayout());
final Button buttonOne = new Button("Top:One");
topContainer.add(buttonOne);
final LayoutContainer centerPanel = new LayoutContainer(new FitLayout());
centerPanel.add(new Button("Center"));
final LayoutContainer botPanel = new LayoutContainer(new FlowLayout());
botPanel.add(new Button("Bottom"));
final ContentPanel panel = new ContentPanel();
panel.setHeaderVisible(false);
panel.setLayout(new RowLayout(Orientation.VERTICAL));
panel.add(topContainer, new RowData(1, -1, new Margins(4)));
panel.add(centerPanel, new RowData(1, 1, new Margins(0, 4, 0, 4)));
panel.add(botPanel, new RowData(1, -1, new Margins(4)));
viewport.add(panel, new FlowData(10));
RootPanel.get().add(viewport);
Scheduler.get().scheduleDeferred(new ScheduledCommand() {
@Override
public void execute() {
final Button buttonTwo = new Button("Top:Two");
topContainer.add(buttonTwo);
panel.layout(true);
}
});
}