List of usage examples for com.google.gwt.user.client.ui TabLayoutPanel setAnimationDuration
public void setAnimationDuration(int duration)
From source file:com.google.gwt.sample.showcase.client.content.panels.CwTabLayoutPanel.java
License:Apache License
/** * Initialize this example./*from ww w .ja va 2s. c o m*/ */ @ShowcaseSource @Override public Widget onInitialize() { // Create a tab panel TabLayoutPanel tabPanel = new TabLayoutPanel(2.5, Unit.EM); tabPanel.setAnimationDuration(1000); tabPanel.getElement().getStyle().setMarginBottom(10.0, Unit.PX); // Add a home tab String[] tabTitles = constants.cwTabPanelTabs(); HTML homeText = new HTML(constants.cwTabPanelTab0()); tabPanel.add(homeText, tabTitles[0]); // Add a tab with an image SimplePanel imageContainer = new SimplePanel(); imageContainer.setWidget(new Image(Showcase.images.gwtLogo())); tabPanel.add(imageContainer, tabTitles[1]); // Add a tab HTML moreInfo = new HTML(constants.cwTabPanelTab2()); tabPanel.add(moreInfo, tabTitles[2]); // Return the content tabPanel.selectTab(0); tabPanel.ensureDebugId("cwTabPanel"); return tabPanel; }
From source file:fr.drop.client.content.about.CwTabLayoutPanel.java
License:Apache License
/** * Initialize this example./*from w w w . j a va 2 s . c o m*/ */ @DropSource @Override public Widget onInitialize() { // Create a tab panel TabLayoutPanel tabPanel = new TabLayoutPanel(2.5, Unit.EM); tabPanel.setAnimationDuration(1000); tabPanel.getElement().getStyle().setMarginBottom(10.0, Unit.PX); // Add a home tab String[] tabTitles = constants.cwTabPanelTabs(); HTML homeText = new HTML(constants.cwTabPanelTab0()); tabPanel.add(homeText, tabTitles[0]); // Add a tab with an image SimplePanel imageContainer = new SimplePanel(); imageContainer.setWidget(new Image(Drop.images.gwtLogo())); tabPanel.add(imageContainer, tabTitles[1]); // Add a tab HTML moreInfo = new HTML(constants.cwTabPanelTab2()); tabPanel.add(moreInfo, tabTitles[2]); // Return the content tabPanel.selectTab(0); tabPanel.ensureDebugId("cwTabPanel"); return tabPanel; }