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

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

Introduction

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

Prototype

@Deprecated
public DisclosurePanel(Widget header, boolean isOpen) 

Source Link

Document

Creates a DisclosurePanel using a widget as the header and an initial open/close state.

Usage

From source file:com.italianasoftware.echoes.client.Echoes.java

License:Open Source License

public void onModuleLoad() {
    createLyricsDialog();/*from w w w  .j a  v a  2 s  .  c  o  m*/

    Image.prefetch(logoURL);
    location.setText("socket://localhost:10100");

    VerticalPanel mainVPanel = new VerticalPanel();
    mainVPanel.setHorizontalAlignment(VerticalPanel.ALIGN_CENTER);
    RootPanel.get().add(mainVPanel);

    HorizontalPanel hPanel;
    hPanel = new HorizontalPanel();
    mainVPanel.add(hPanel);

    VerticalPanel vPanel = new VerticalPanel();
    hPanel.add(vPanel);
    VerticalPanel playlistVPanel = new VerticalPanel();
    playlistVPanel.setHorizontalAlignment(VerticalPanel.ALIGN_CENTER);
    playlistVPanel.setVerticalAlignment(VerticalPanel.ALIGN_MIDDLE);
    hPanel.add(playlistVPanel);

    vPanel.setHorizontalAlignment(VerticalPanel.ALIGN_CENTER);
    vPanel.setVerticalAlignment(VerticalPanel.ALIGN_MIDDLE);
    Image logo = new Image(logoURL);
    createAboutDialog();
    logo.addClickListener(new ClickListener() {
        public void onClick(Widget arg0) {
            aboutDialog.center();
            aboutDialog.show();
        }
    });
    vPanel.add(logo);
    vPanel.addStyleName("panel-rightborder");

    //hPanel = new HorizontalPanel();
    DisclosurePanel dPanel = new DisclosurePanel("Location", false);
    VerticalPanel locVPanel = new VerticalPanel();
    locVPanel.setHorizontalAlignment(HorizontalPanel.ALIGN_CENTER);
    locVPanel.add(location);
    final Button connectButton = new NativeButton("Connect");
    connectButton.addClickListener(new ClickListener() {
        public void onClick(Widget arg0) {
            startClientSession();
            waitForStateChange();
            connectButton.setText("Connected");
            connectButton.setEnabled(false);
        }
    });

    dPanel.add(locVPanel);
    //hPanel.add( dPanel );
    vPanel.add(dPanel);
    vPanel.add(connectButton);

    //hPanel = new HorizontalPanel();
    Label l = new Label("Currently playing");
    l.addStyleName("label-bold");
    mainVPanel.add(l);
    mainVPanel.add(cpLabel);
    //mainvPanel.add( hPanel );

    HorizontalPanel buttonsPanel = new HorizontalPanel();
    mainVPanel.add(buttonsPanel);

    Button playButton = new NativeButton("Play");
    playButton.addClickListener(new ClickListener() {
        public void onClick(Widget arg0) {
            JolieService.Util.getInstance().call("play", getLocationValue(), new EchoesCallback() {
                @Override
                public void onSuccess(Value response) {
                    //updateNowPlaying();
                }
            });
        }
    });

    Button pauseButton = new NativeButton("Pause");
    pauseButton.addClickListener(new ClickListener() {
        public void onClick(Widget arg0) {
            JolieService.Util.getInstance().call("pause", getLocationValue(), new EchoesCallback() {
                @Override
                public void onSuccess(Value response) {
                }
            });
        }
    });

    Button prevButton = new NativeButton("<");
    prevButton.addClickListener(new ClickListener() {
        public void onClick(Widget arg0) {
            JolieService.Util.getInstance().call("previous", getLocationValue(), new EchoesCallback() {
                @Override
                public void onSuccess(Value response) {
                    //updateNowPlaying();
                }
            });
        }
    });

    Button nextButton = new NativeButton(">");
    nextButton.addClickListener(new ClickListener() {
        public void onClick(Widget arg0) {
            JolieService.Util.getInstance().call("next", getLocationValue(), new EchoesCallback() {
                @Override
                public void onSuccess(Value response) {
                    //updateNowPlaying();
                }
            });
        }
    });

    buttonsPanel.add(prevButton);
    buttonsPanel.add(playButton);
    buttonsPanel.add(pauseButton);
    buttonsPanel.add(nextButton);

    playlistBox = new ListBox();
    playlistBox.setVisibleItemCount(8);
    playlistVPanel.add(playlistBox);
    playlistBox.setWidth("250px");

    playlistBox.addClickListener(new ClickListener() {
        public void onClick(Widget widget) {
            playSongByIndex(playlistBox.getSelectedIndex());
        }
    });

    hPanel = new HorizontalPanel();

    Button showLyricsButton = new NativeButton("Show lyrics");
    showLyricsButton.addClickListener(new ClickListener() {
        public void onClick(Widget arg0) {
            showLyrics();
        }
    });

    hPanel.add(showLyricsButton);
    playlistVPanel.add(hPanel);

    dPanel = new DisclosurePanel("Volume");
    playlistVPanel.add(dPanel);
    volumeMenu = new ListBox();
    dPanel.add(volumeMenu);
    addVolumeMenuItems(volumeMenu);
    volumeMenu.addChangeListener(new ChangeListener() {
        public void onChange(Widget arg0) {
            String volume = volumeMenu.getValue(volumeMenu.getSelectedIndex());
            setVolume(volume);
        }
    });
}

From source file:org.apache.sling.explorer.client.SlingExplorerApplication.java

License:Apache License

private Widget createExplorerPanel() {
    HorizontalSplitPanel explorerPanel = new HorizontalSplitPanel();
    explorerPanel.setSize("100%", "100%");
    explorerPanel.setSplitPosition("20%");

    DisclosurePanel propertiesPanel = new DisclosurePanel(constants.propertiesDescripton(), true);
    propertiesPanel.add(resourceGrid.getPropertyGrid());
    propertiesPanel.setStyleName("application-DisclosurePanel");

    DisclosurePanel nodeChildrenPanel = new DisclosurePanel(constants.subResourcesDescription(), true);
    nodeChildrenPanel.add(resourceGrid.getResourceChildrenGrid());
    nodeChildrenPanel.setStyleName("application-DisclosurePanel");

    propertiesPanel.setAnimationEnabled(true);
    nodeChildrenPanel.setAnimationEnabled(true);

    FlexTable layout = new FlexTable();
    layout.setCellSpacing(6);//from   w w w.ja  v  a 2 s.  co m
    layout.setWidget(0, 0, propertiesPanel);
    layout.setWidget(1, 0, nodeChildrenPanel);

    explorerPanel.setRightWidget(layout);
    explorerPanel.setLeftWidget(resourceTree);

    return explorerPanel;
}

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

License:Apache License

public TypePalette() {
    super();//  ww w. jav  a  2s  .  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);
}