super.onFirstShowPage();
final PDockLayoutPanel dockLayoutPanel = new PDockLayoutPanel(PUnit.PX);
dockLayoutPanel.setSizeFull();
final PTabLayoutPanel tabPanel = new PTabLayoutPanel();
tabPanel.setSizeFull();
tabPanel.setAnimationVertical(false);
tabPanel.setAnimationDuration(1000);
tabPanel.addBeforeSelectionHandler(new PBeforeSelectionHandler<Integer>() {
@Override
public void onBeforeSelection(final PBeforeSelectionEvent<Integer> event) {
PNotificationManager.showTrayNotification("onBeforeSelection, tab index : " + event.getSelectedItem());
}
});
tabPanel.addSelectionHandler(new PSelectionHandler<Integer>() {
@Override
public void onSelection(final PSelectionEvent<Integer> event) {
PNotificationManager.showTrayNotification("onSelection, tab index : " + event.getSelectedItem());
}
});
final PButton button = new PButton("Add Tab");
button.setStyleProperty("margin", "10px");
button.addClickHandler(new PClickHandler() {
@Override
public void onClick(final PClickEvent clickEvent) {
addTabContent(tabPanel);
}
});
final PButton addCustomTabButton = new PButton("Add Tab (custom tab)");
addCustomTabButton.setStyleProperty("margin", "10px");
addCustomTabButton.addClickHandler(new PClickHandler() {
@Override
public void onClick(final PClickEvent clickEvent) {
addCustomTabContent(tabPanel);
}
});
final PTextBox indexTextBox = new PTextBox();
final PButton selectButton = new PButton("Select Tab");
selectButton.setStyleProperty("margin", "10px");
selectButton.addClickHandler(new PClickHandler() {
@Override
public void onClick(final PClickEvent clickEvent) {
final String text = indexTextBox.getText();
tabPanel.selectTab(Integer.valueOf(text));
}
});
final PHorizontalPanel horizontalPanel = new PHorizontalPanel();
horizontalPanel.setVerticalAlignment(PVerticalAlignment.ALIGN_MIDDLE);