- Google Web Toolkit 2 Application Development Cookbook
- Shamsuddin Ahammad
- 167字
- 2025-02-21 00:27:14
In this recipe, we are going to create the main content panel, to be placed at the center. All forms and reports will be shown in this panel.
- Define the method
getMainContents:
public ContentPanel getMainContents() { ContentPanel mainContentsPanel = new ContentPanel(); mainContentsPanel.setHeading("Main Contents"); return mainContentsPanel; }
- Call the
add
method of theContentPanel
class in the constructor to add the sidebar in the content panel:add(getMainContents(), mainContentsLayoutData);
The method getMainContents
creates a ContentPanel
instance and sets a heading Main Contents. This heading will be modified later.
The content panel created by this method is added at the center of the home page content panel by invoking add(getMainContents(), mainContentsLayoutData)
in the constructor.