Example usage for com.google.gwt.user.client.ui DeckLayoutPanel setAnimationDuration

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

Introduction

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

Prototype

public void setAnimationDuration(int duration) 

Source Link

Document

Set the duration of the animated transition between tabs.

Usage

From source file:org.geosdi.geoplatform.gui.client.widget.NotifyListPanel.java

License:Open Source License

public NotifyListPanel(final List<SingleNotify> listComponent, final DeckLayoutPanel deckLayoutPanel) {
    this.listComponent = listComponent;
    initWidget(uiBinder.createAndBindUi(this));
    ScrollPanel scrollPanel = new ScrollPanel();
    HTMLPanel newsPanel = new HTMLPanel("");
    newsPanel.setWidth("100%");
    newsPanel.setHeight("100%");
    scrollPanel.setSize("400px", "250px");
    for (int i = 0; i < listComponent.size(); i++) {
        final int j = i + 1;
        SingleNotify singleNotify = listComponent.get(i);
        singleNotify.setIndex(j);/*from   w  ww.  jav  a  2s.com*/
        singleNotify.setStyleName(style.singleNews(), true);
        deckLayoutPanel.insert(new NotifyMessagePanel(listComponent.get(i)), j);
        singleNotify.addDomHandler(new ClickHandler() {
            @Override
            public void onClick(ClickEvent event) {
                deckLayoutPanel.setAnimationDuration(300);
                deckLayoutPanel.showWidget((j));
            }
        }, ClickEvent.getType());
        newsPanel.add(singleNotify);
    }
    scrollPanel.add(newsPanel);
    centerPanel.add(scrollPanel);
}