Package com.ponysdk.ui.server.basic

Examples of com.ponysdk.ui.server.basic.PCommand


        }
        pagingView.setSelectedPage(activePageIndex);
    }

    public PCommand newCommand(final int pageIndex) {
        return new PCommand() {

            @Override
            public void execute() {
                activePageIndex = pageIndex;
                eventBus.fireEvent(new PagingSelectionChangeEvent(PagingActivity.this, activePageIndex));
View Full Code Here


        final PMenuBar fileBar = new PMenuBar(vertical);

        menuBar.addItem("File", fileBar);

        final PMenuItem newItem = new PMenuItem("New");
        newItem.setCommand(new PCommand() {

            @Override
            public void execute() {
                PNotificationManager.notify("Menu Selection, " + newItem.getText(), Notification.HUMANIZED);
            }
        });
        final PMenuItem openItem = new PMenuItem("Open");
        openItem.setCommand(new PCommand() {

            @Override
            public void execute() {
                PNotificationManager.notify("Menu Selection, " + openItem.getText(), Notification.HUMANIZED);
            }
        });

        final PMenuItem closeItem = new PMenuItem("Close");
        openItem.setCommand(new PCommand() {

            @Override
            public void execute() {
                PNotificationManager.notify("Menu Selection, " + closeItem.getText(), Notification.HUMANIZED);
            }
        });

        fileBar.addItem(newItem);
        fileBar.addItem(openItem);
        fileBar.addItem(closeItem);
        fileBar.addSeparator();

        final PMenuBar recentItem = new PMenuBar(vertical);

        fileBar.addItem("Recent", recentItem);

        final PMenuItem recent1 = new PMenuItem("recent1");
        recent1.setCommand(new PCommand() {

            @Override
            public void execute() {
                PNotificationManager.notify("Menu Selection, " + recent1.getText(), Notification.HUMANIZED);
            }
        });
        final PMenuItem recent2 = new PMenuItem("recent2");
        recent2.setCommand(new PCommand() {

            @Override
            public void execute() {
                PNotificationManager.notify("Menu Selection, " + recent2.getText(), Notification.HUMANIZED);
            }
View Full Code Here

        menuBar.insertItem(item, 4 + items.values().size());
        items.put(pageIndex, item);
    }

    private PCommand getClickCommand(final int pageIndex) {
        return new PCommand() {

            @Override
            public void execute() {
                for (final PagerListener pagerListener : pagerListeners) {
                    pagerListener.onPageChange(pageIndex);
View Full Code Here

    protected void buildActions() {
        final PMenuBar actionBar = new PMenuBar();
        actionBar.setStyleName("pony-ActionToolbar");

        refreshButton = new PMenuItem("Refresh", new PCommand() {

            @Override
            public void execute() {
                refresh();
            }
        });
        actionBar.addItem(refreshButton);
        actionBar.addSeparator();

        resetButton = new PMenuItem("Reset", new PCommand() {

            @Override
            public void execute() {
                reset();
            }
        });

        actionBar.addItem(resetButton);

        if (complexListConfiguration.getExportConfiguration() != null) {
            actionBar.addSeparator();
            final PMenuBar exportListMenuBar = new PMenuBar(true);

            for (final Exporter<D> exporter : complexListConfiguration.getExportConfiguration().getExporters()) {
                final PMenuItem item = new PMenuItem(exporter.name(), new PCommand() {

                    @Override
                    public void execute() {

                        final SelectionResult<D> selectionResult = getSelectedData();
View Full Code Here

        final PMenuBar menuBarAction = new PMenuBar(true);
        menuBar.addItem("Preferences", menuBarAction);
        menuBar.setStyleName("pony-ActionToolbar");
        boolean hasPreferenceAction = false;
        if (complexListConfiguration.isCustomColumnEnabled()) {
            menuBarAction.addItem("Add Custom Column", new PCommand() {

                @Override
                public void execute() {
                    localEventBus.fireEvent(new ShowCustomColumnDescriptorFormEvent(this));

                }
            });
            hasPreferenceAction = true;
        }

        if (complexListConfiguration.isShowPreferences()) {
            menuBarAction.addItem(new PMenuItem("Order columns", new PCommand() {

                @Override
                public void execute() {

                    PConfirmDialog.show("Column Ordering", new PreferenceForm(descriptorsByCaption.values(), localEventBus, complexListConfiguration.getTableName()), new PConfirmDialogHandler() {
View Full Code Here

    public PWidget asWidget() {
        return this;
    }

    private PCommand getSelectAllCommand() {
        return new PCommand() {

            @Override
            public void execute() {
                for (final SelectorViewListener selectorListener : selectorViewListeners) {
                    selectorListener.onSelectionChange(SelectionMode.PAGE);
View Full Code Here

            }
        };
    }

    private PCommand getSelectNoneCommand() {
        return new PCommand() {

            @Override
            public void execute() {
                for (final SelectorViewListener selectorListener : selectorViewListeners) {
                    selectorListener.onSelectionChange(SelectionMode.NONE);
View Full Code Here

TOP

Related Classes of com.ponysdk.ui.server.basic.PCommand

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.