0

我想用 GXT 创建类似 GWT Stack Panel 的东西。我找到了 AccordionLayoutContainer。问题是使用 AccordionLayoutContainer 有可能折叠菜单中的所有面板(见图)。

在此处输入图像描述

我希望始终像在 GWT 堆栈面板中一样打开一个面板。

这是我的菜单的代码:

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);
}

}

你能帮我处理这个案子吗?提前致谢。

4

0 回答 0