我想创建类似GWT Stack Panel的东西,但是使用GXT。我找到了AccordionLayoutContainer。问题是使用AccordionLayoutContainer有可能折叠菜单中的所有面板(见图)。
我想像GWT Stack Panel一样打开一个面板。
以下是我的菜单代码:
public class MenuPanel extends ContentPanel implements LazyView, IsWidget {
ContentPanel detailsContentPanel;
ContentPanel actionsContentPanel;
ContentPanel logsContentPanel;
ContentPanel filesContentPanel;
ContentPanel assessmentContentPanel;
ContentPanel contactsContentPanel;
AccordionLayoutContainer menuContainer;
@Override
public void createView() {
setHeadingText("Menu");
setHeight("100%");
setWidth("100%");
menuContainer = new AccordionLayoutContainer();
menuContainer.setExpandMode(AccordionLayoutContainer.ExpandMode.SINGLE_FILL);
menuContainer.setHeight("100%");
add(menuContainer);
AccordionLayoutContainer.AccordionLayoutAppearance appearance = GWT.<AccordionLayoutContainer.AccordionLayoutAppearance>
create(AccordionLayoutContainer.AccordionLayoutAppearance.class);
detailsContentPanel = new ContentPanel(appearance);
detailsContentPanel.setAnimCollapse(false);
detailsContentPanel.setHeadingText("Details");
menuContainer.add(detailsContentPanel);
logsContentPanel = new ContentPanel(appearance);
logsContentPanel.setAnimCollapse(false);
logsContentPanel.setHeadingText("Logs");
menuContainer.add(logsContentPanel);
actionsContentPanel = new ContentPanel(appearance);
actionsContentPanel.setAnimCollapse(false);
actionsContentPanel.setHeadingText("Actions");
menuContainer.add(actionsContentPanel);
filesContentPanel = new ContentPanel(appearance);
filesContentPanel.setAnimCollapse(false);
filesContentPanel.setHeadingText("Files");
menuContainer.add(filesContentPanel);
assessmentContentPanel = new ContentPanel(appearance);
assessmentContentPanel.setAnimCollapse(false);
assessmentContentPanel.setHeadingText("Assessments");
menuContainer.add(assessmentContentPanel);
contactsContentPanel = new ContentPanel(appearance);
contactsContentPanel.setAnimCollapse(false);
contactsContentPanel.setHeadingText("Contacts");
menuContainer.add(contactsContentPanel);
}
}
你能帮我解决一下这个案子吗?提前谢谢。