Examples of PButton


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

        table.setWidget(1, 0, new PLabel("Name"));
        table.setWidget(1, 1, nameTextBox = new PTextBox("PonySDK"));
        table.setWidget(2, 0, new PLabel("Features"));
        table.setWidget(2, 1, featuresTextBox = new PTextBox("width=1280,height=800,resizable,status=1"));

        final PButton open = new PButton("Open new window");
        open.addClickHandler(new PClickHandler() {

            @Override
            public void onClick(final PClickEvent event) {
                final String url = urlTextBox.getText();
                final String name = nameTextBox.getText();
                final String features = featuresTextBox.getText();
                final PWindow w = new PWindow(url, name, features);
                w.open();
            }
        });

        // Open popup that communicate with server
        final PFlexTable table2 = new PFlexTable();
        table2.setWidget(0, 0, new PLabel("Name"));
        table2.setWidget(0, 1, popNameTextBox = new PTextBox("Popup"));
        table2.setWidget(1, 0, new PLabel("Features"));
        table2.setWidget(1, 1, popFeaturesTextBox = new PTextBox("width=500,height=300,resizable"));

        final PButton open2 = new PButton("Open new window");
        open2.addClickHandler(new PClickHandler() {

            @Override
            public void onClick(final PClickEvent event) {
                final String disc = windows.size() == 0 ? "" : Integer.toString(windows.size());
                final String name = popNameTextBox.getText();
                final String features = popFeaturesTextBox.getText();
                final MyWindow window = new MyWindow(name + disc, features);
                window.open();
                window.addCloseHandler(WindowPageActivity.this);
                windows.add(window);
            }
        });

        final PButton postHello = new PButton("Post message");
        postHello.addClickHandler(new PClickHandler() {

            @Override
            public void onClick(final PClickEvent event) {
                for (final PWindow window : windows) {
                    window.acquire();
                    try {
                        PNotificationManager.showHumanizedNotification("Hello from opener");
                        window.flush();
                    } finally {
                        window.release();
                    }
                }
            }
        });

        final PButton closeAllWindow = new PButton("Close all windows");
        closeAllWindow.addClickHandler(new PClickHandler() {

            @Override
            public void onClick(final PClickEvent event) {
                for (final PWindow window : windows) {
                    window.close();
View Full Code Here

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

        protected void onLoad() {
            script = PScript.get();
            rootLayoutPanel = PRootLayoutPanel.get();

            final PFlowPanel flow = new PFlowPanel();
            final PButton addMessage = new PButton("Add message");
            addMessage.addClickHandler(new PClickHandler() {

                @Override
                public void onClick(final PClickEvent event) {
                    flow.add(new PLabel("Hello " + (count++)));
                }
            });
            final PButton clearMessage = new PButton("Clear message");
            clearMessage.addClickHandler(new PClickHandler() {

                @Override
                public void onClick(final PClickEvent event) {
                    for (int i = flow.getWidgetCount() - 1; i > 2; i--) {
                        flow.remove(i);
                    }
                }
            });
            final PButton postMessage = new PButton("Post message");
            postMessage.addClickHandler(new PClickHandler() {

                @Override
                public void onClick(final PClickEvent event) {
                    MyWindow.this.postOpenerCommand(new SayHelloCommand());
                }
            });
            final PButton execJs = new PButton("Exec javascript");
            execJs.addClickHandler(new PClickHandler() {

                @Override
                public void onClick(final PClickEvent event) {
                    script.execute("alert('from the popup');");
                }
View Full Code Here

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

    protected void onFirstShowPage() {
        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() {

                    @Override
                    protected void run() {
                        changeColorsBUtton.setStyleProperty("color", "blue");
                    }
                };
                deferred1.schedule(2000);

                final PTerminalScheduledCommand deferred2 = new PTerminalScheduledCommand() {

                    @Override
                    protected void run() {
                        changeColorsBUtton.setStyleProperty("color", "orange");
                    }
                };
                deferred2.schedule(4000);

                final PTerminalScheduledCommand deferred3 = new PTerminalScheduledCommand() {

                    @Override
                    protected void run() {
                        changeColorsBUtton.setStyleProperty("color", "black");
                    }
                };
                deferred3.schedule(6000);
            }
        });
View Full Code Here

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

        final PHorizontalPanel controlsPanel = new PHorizontalPanel();
        controlsPanel.setStyleName(PonySDKTheme.DIALOGBOX_CONTROLS);
        controlsPanel.setHorizontalAlignment(PHorizontalAlignment.ALIGN_CENTER);

        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.PButton

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

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

        controlsPanel.setStyleName(PonySDKTheme.DIALOGBOX_CONTROLS);
        controlsPanel.setHorizontalAlignment(PHorizontalAlignment.ALIGN_CENTER);
        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.PButton

        table.setSizeFull();

        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

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

    private PWidget buildCustomToolbar(final PRichTextArea richTextArea) {

        final PTextBox color = new PTextBox();
        color.setPlaceholder("Color");
        final PButton update = new PButton("Set back color");
        update.addClickHandler(new PClickHandler() {

            @Override
            public void onClick(final PClickEvent event) {
                final String c = color.getValue();
                richTextArea.getFormatter().setBackColor(c);
View Full Code Here

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

        add(bottomListCustomInformationLayout);
    }

    @Override
    public void addAction(final String caption, final PClickHandler clickHandler) {
        final PButton button = new PButton(caption);
        button.addClickHandler(clickHandler);
        toolbarLayout.add(button);
    }
View Full Code Here

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

        formLayout.setWidget(3, 0, formFieldComponent7);
        formLayout.setWidget(3, 1, formFieldComponent8);
        formLayout.setWidget(4, 0, formFieldComponent9);
        formLayout.setWidget(4, 1, formFieldComponent10);

        final PButton validateButton = new PButton("Validate");
        validateButton.addClickHandler(new PClickHandler() {

            @Override
            public void onClick(final PClickEvent clickEvent) {
                final boolean isValid = form.isValid();
                PNotificationManager.showTrayNotification("The form is valid? " + (isValid ? "YES" : "NO"));
            }
        });

        final PButton resetButton = new PButton("Reset");
        resetButton.addClickHandler(new PClickHandler() {

            @Override
            public void onClick(final PClickEvent clickEvent) {
                form.reset();
                PNotificationManager.showHumanizedNotification("The form has been reseted");
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.