- Google Web Toolkit 2 Application Development Cookbook
- Shamsuddin Ahammad
- 173字
- 2025-02-21 00:27:13
In this recipe, we are going to create a sidebar to be placed on the right-hand side. This sidebar will be used for some dynamic contents based on the main contents at the center.
- Define the method
getRightSidebar:
public ContentPanel getRightSideBar() { ContentPanel rightSidebarPanel = new ContentPanel(); rightSidebarPanel.setHeading("Right" Sidebar"); return rightSidebarPanel; }
- Call the add method of class
ContentPanel
in the constructor to add the sidebar in the content panel:add(getRightSideBar(), rightSidebarLayoutData);
The method getRightSideBar
creates a content panel instance, and sets a heading Right Sidebar. This heading will be modified later.
The right-hand sidebar created by this method is added in the east region of the main content panel by invoking add(getRightSideBar(), rightSidebarLayoutData)
in the constructor.