Examples of PClickHandler


Examples of com.ponysdk.ui.server.basic.event.PClickHandler

        super.onFirstShowPage();

        label = new PLabel("0");

        final PButton scheduleRepeatingButton = new PButton("Start");
        scheduleRepeatingButton.addClickHandler(new PClickHandler() {

            @Override
            public void onClick(final PClickEvent clickEvent) {
                timer.scheduleRepeating(Integer.valueOf(textBox.getText()));
            }
        });
        panel.add(new PLabel("Simple repeating timer"));
        panel.add(label);
        panel.add(textBox);
        panel.add(scheduleRepeatingButton);

        // Fixed delay
        final SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy MM dd hh:mm:ss");
        final PLabel dateLabel = new PLabel(dateFormat.format(Calendar.getInstance().getTime()));
        panel.add(new PHTML("<br>"));
        panel.add(new PLabel("Fixed delay timer"));
        panel.add(dateLabel);
        final PButton fixedDelayButton = new PButton("Start");
        fixedDelayButton.addClickHandler(new PClickHandler() {

            @Override
            public void onClick(final PClickEvent clickEvent) {
                PScheduler.get().scheduleFixedDelay(new RepeatingCommand() {

                    @Override
                    public boolean execute() {
                        dateLabel.setText(dateFormat.format(Calendar.getInstance().getTime()));
                        return true;
                    }
                }, 1000);
            }
        });
        panel.add(fixedDelayButton);

        // Client side only
        panel.add(new PHTML("<br>"));
        panel.add(new PLabel("Timer (terminal side)"));
        final PButton changeColorsBUtton = new PButton("Start");
        changeColorsBUtton.addClickHandler(new PClickHandler() {

            @Override
            public void onClick(final PClickEvent event) {
                final PTerminalScheduledCommand deferred1 = new PTerminalScheduledCommand() {
View Full Code Here

Examples of com.ponysdk.ui.server.basic.event.PClickHandler

            if (categoryPanel == null) throw new IllegalArgumentException("Category '" + categoryNode.name + "' not assigned to a parent category");

            final PAnchor category = new PAnchor(categoryNode.name);
            applyPadding(categoryNode, category);
            applyExpandableStyle(categoryNode, category);
            category.addClickHandler(new PClickHandler() {

                @Override
                public void onClick(final PClickEvent clickEvent) {
                    if (categoryNode.open) {
                        collapseNode(categoryNode);
View Full Code Here

Examples of com.ponysdk.ui.server.basic.event.PClickHandler

        actionPanel = new PHorizontalPanel();
        actionPanel.addStyleName(PonySDKTheme.LOG_CONSOLE_ACTIONS);

        final PAnchor clearLogs = new PAnchor("Clear logs");

        clearLogs.addClickHandler(new PClickHandler() {

            @Override
            public void onClick(final PClickEvent clickEvent) {
                logsPanel.clear();
            }
View Full Code Here

Examples of com.ponysdk.ui.server.basic.event.PClickHandler

        final PComplexPanel categoryPanel = categoriesByNode.get(categoryNode);
        final PAnchor item = new PAnchor(menuItem.getName());
        item.ensureDebugId("page_" + menuItem.getName());
        applyPadding(itemNode, item);
        item.addClickHandler(new PClickHandler() {

            @Override
            public void onClick(final PClickEvent clickEvent) {
                final PSelectionEvent<MenuItem> event = new PSelectionEvent<MenuItem>(this, menuItem);
                for (final PSelectionHandler<MenuItem> handler : selectionHandlers) {
View Full Code Here

Examples of com.ponysdk.ui.server.basic.event.PClickHandler

        panel.setSpacing(10);

        panel.add(new PLabel("Choose a section:"));

        final PAnchor checkBoxAnchor = new PAnchor("CheckBox");
        checkBoxAnchor.addClickHandler(new PClickHandler() {

            @Override
            public void onClick(final PClickEvent event) {
                goTo(new PagePlace("CheckBox"));
            }
        });
        panel.add(checkBoxAnchor);

        final PAnchor radioButtonAnchor = new PAnchor("RadioButton");
        radioButtonAnchor.addClickHandler(new PClickHandler() {

            @Override
            public void onClick(final PClickEvent event) {
                goTo(new PagePlace("Radio Button"));
            }
        });
        panel.add(radioButtonAnchor);

        final PAnchor basicButtonAnchor = new PAnchor("BasicButton");
        basicButtonAnchor.addClickHandler(new PClickHandler() {

            @Override
            public void onClick(final PClickEvent event) {
                goTo(new PagePlace("Basic Button"));
            }
        });
        panel.add(basicButtonAnchor);

        final PAnchor customButtonAnchor = new PAnchor("CustomButton");
        customButtonAnchor.addClickHandler(new PClickHandler() {

            @Override
            public void onClick(final PClickEvent event) {
                goTo(new PagePlace("Custom Button"));
            }
        });
        panel.add(customButtonAnchor);

        final PAnchor fileUpload = new PAnchor("FileUpload");
        fileUpload.addClickHandler(new PClickHandler() {

            @Override
            public void onClick(final PClickEvent event) {
                goTo(new PagePlace("File Upload"));
            }
View Full Code Here

Examples of com.ponysdk.ui.server.basic.event.PClickHandler

        for (final String option : options) {
            final PButton button = new PButton();
            button.setText(option);
            button.ensureDebugId("optionpane[" + option + "]");
            button.addClickHandler(new PClickHandler() {

                @Override
                public void onClick(final PClickEvent clickEvent) {
                    handler.onAction(dialogBox, option);
                }
View Full Code Here

Examples of com.ponysdk.ui.server.basic.event.PClickHandler

        layout.getFlexCellFormatter().setHorizontalAlignment(0, 0, PHorizontalAlignment.ALIGN_LEFT);
        layout.getFlexCellFormatter().setHorizontalAlignment(0, 1, PHorizontalAlignment.ALIGN_RIGHT);
        layout.getFlexCellFormatter().addStyleName(0, 0, PonySDKTheme.CLOSABLE_DIALOGBOX_HEADER);
        layout.getFlexCellFormatter().addStyleName(0, 1, PonySDKTheme.CLOSABLE_DIALOGBOX_HEADER);

        closeContainer.addDomHandler(new PClickHandler() {

            @Override
            public void onClick(final PClickEvent event) {
                hide();
            }
View Full Code Here

Examples of com.ponysdk.ui.server.basic.event.PClickHandler

            }
        });

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

Examples of com.ponysdk.ui.server.basic.event.PClickHandler

        controlsPanel.setWidth("100%");

        if (cancelCaption != null) {
            final PButton cancelButton = new PButton();
            cancelButton.setText(cancelCaption);
            cancelButton.addClickHandler(new PClickHandler() {

                @Override
                public void onClick(final PClickEvent clickEvent) {
                    if (confirmDialogHandler != null) {
                        confirmDialogHandler.onCancel();
                    }
                    confirmDialog.hide();
                }
            });
            controlsPanel.add(cancelButton);
            confirmDialog.setCancelButton(cancelButton);
        }
        if (okCaption != null) {
            final PButton okButton = new PButton();
            okButton.setText(okCaption);
            okButton.addClickHandler(new PClickHandler() {

                @Override
                public void onClick(final PClickEvent clickEvent) {
                    if (confirmDialogHandler != null) {
                        if (confirmDialogHandler.onOK(confirmDialog)) confirmDialog.hide();
View Full Code Here

Examples of com.ponysdk.ui.server.basic.event.PClickHandler

        final PVerticalPanel bodyLayout = new PVerticalPanel();
        bodyLayout.setSizeFull();

        final PButton button = new PButton("Remove last row");
        button.addClickHandler(new PClickHandler() {

            @Override
            public void onClick(final PClickEvent clickEvent) {
                table.removeRow(table.getRowCount() - 1);
            }
        });

        bodyLayout.add(button);
        bodyLayout.add(table);

        final PButton scheduleButton = new PButton("Schedule");
        scheduleButton.addClickHandler(new PClickHandler() {

            @Override
            public void onClick(final PClickEvent clickEvent) {
                if (currentTimer != null) {
                    currentTimer.cancel();
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.