Example usage for com.google.gwt.user.client.ui DisclosurePanel getContent

List of usage examples for com.google.gwt.user.client.ui DisclosurePanel getContent

Introduction

In this page you can find the example usage for com.google.gwt.user.client.ui DisclosurePanel getContent.

Prototype

public Widget getContent() 

Source Link

Document

Gets the widget that was previously set in #setContent(Widget) .

Usage

From source file:us.asciiroth.editor.client.ui.TypePalette.java

License:Apache License

public TypePalette() {
    super();/*from   ww w . j ava 2 s  .c o m*/
    setTitle("Piece Library");

    ScrollPanel panel = new ScrollPanel();
    panel.setStyleName("n-typePalette");
    panel.setWidth("100%");
    panel.setHeight("326px");

    VerticalPanel outerVpanel = new VerticalPanel();
    outerVpanel.setWidth("100%");
    panel.add(outerVpanel);

    widgetToTemplate = new HashMap<Widget, String>();
    tagToDpanel = new HashMap<String, DisclosurePanel>();

    for (Map.Entry<String, Map<String, String>> entry : Registry.get().getSerializersByTags().entrySet()) {

        String tag = entry.getKey();
        List<String> types = getSortedListOfTypes(entry.getValue());
        for (String type : types) {
            String template = entry.getValue().get(type);
            HTML paletteItem = createPaletteItem(type, template);
            DisclosurePanel dpanel = (DisclosurePanel) tagToDpanel.get(tag);
            if (dpanel == null) {
                dpanel = new DisclosurePanel(tag, false);
                VerticalPanel vpanel = new VerticalPanel();
                vpanel.setWidth("100%");
                vpanel.setHeight("100%");
                dpanel.setContent(vpanel);
                outerVpanel.add(dpanel);
                tagToDpanel.put(tag, dpanel);
            }
            ((VerticalPanel) dpanel.getContent()).add(paletteItem);
        }
    }
    setBodyWidget(panel);
    RootPanel.get("sideViews").add(this);
}