Package com.ponysdk.ui.server.breadcrumbs

Examples of com.ponysdk.ui.server.breadcrumbs.PBreadCrumbs$ItemLevel


    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);
View Full Code Here

TOP

Related Classes of com.ponysdk.ui.server.breadcrumbs.PBreadCrumbs$ItemLevel

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.