protected void onFirstShowPage() {
super.onFirstShowPage();
final PFlowPanel panel = new PFlowPanel();
final PBreadCrumbs breadCrumbs = new PBreadCrumbs();
breadCrumbs.addItem("level 1");
breadCrumbs.addItem("level 2");
breadCrumbs.addItem("level 3");
breadCrumbs.addItem("level 4");
breadCrumbs.addItem("level 5");
breadCrumbs.addItem("location");
breadCrumbs.addSelectionHandler(new PSelectionHandler<PBreadCrumbs.ItemLevel>() {
@Override
public void onSelection(final PSelectionEvent<ItemLevel> event) {
level = event.getSelectedItem().getLevel();
PNotificationManager.showHumanizedNotification("Selected level : " + level);
}
});
final PFlowPanel inputPanel = new PFlowPanel();
final PTextBox input = new PTextBox();
final PButton add = new PButton("Add Level");
add.setStyleName(PonySDKTheme.BUTTON_BLUE);
add.addClickHandler(new PClickHandler() {
@Override
public void onClick(final PClickEvent event) {
if (input.getText().isEmpty()) breadCrumbs.addItem("level " + ++level);
else breadCrumbs.addItem(input.getText());
input.setText("");
}
});
inputPanel.add(input);
inputPanel.add(add);