Package org.gwtoolbox.widget.client.button

Examples of org.gwtoolbox.widget.client.button.SimpleButton


    public GGrowlSamplePane() {
        HorizontalPanel buttons = new HorizontalPanel();
        buttons.setSpacing(4);

        SimpleButton button = new SimpleButton("Show Message", WidgetImages.Instance.get().notification_Message().createImage());
        button.addClickHandler(new ClickHandler() {
            public void onClick(ClickEvent clickEvent) {
                GGrowl.showMessage("Short Message", "This is the content of the message", 3500);
            }
        });
        buttons.add(button);

        button = new SimpleButton("Show Long Message", WidgetImages.Instance.get().notification_Message().createImage());
        button.addClickHandler(new ClickHandler() {
            public void onClick(ClickEvent clickEvent) {
                GGrowl.showMessage("Long Message", "This is the content of a very very very very very long message, so " + "long it seems it has no end, but it does... it's coming soon... very soon... wait... wait... " + "here it comes... no.. just kiding it's not coming... yes it is... now!", 8000);
            }
        });
        buttons.add(button);

        button = new SimpleButton("Show Sticky Message", WidgetImages.Instance.get().notification_Message().createImage());
        button.addClickHandler(new ClickHandler() {
            public void onClick(ClickEvent clickEvent) {
                GGrowl.showMessage("Short Message", "This is the content of the message, it's not a long as the logest " +
                        "message, but still it has its length", -1);
            }
        });
View Full Code Here


        renderer.addFieldGroup(generalGroup);
        renderer.addFieldGroup(addressGroup);
        Widget formPanel = renderer.render(form);
        formPanel.setWidth("300px");

        SimpleButton validateButton = new SimpleButton("Validate", new ClickHandler() {
            public void onClick(ClickEvent event) {
                form.validate();
            }
        });

        SimpleButton sendButton = new SimpleButton("Send", new ClickHandler() {
            public void onClick(ClickEvent event) {
                form.submit(new SubmitHandler.Adapter() {
                    public void success(Record record) {
                        StringBuilder sb = new StringBuilder();
                        for (Map.Entry<String, Object> entry : record.getAllValues().entrySet()) {
                            sb.append(entry.getKey()).append(" = ").append(entry.getValue()).append("\n");
                        }
                        Window.alert(sb.toString());
                    }
                });
            }
        });

        SimpleButton clearButton = new SimpleButton("Clear", new ClickHandler() {
            public void onClick(ClickEvent event) {
                form.reset();
            }
        });

        SimpleButton toggleMutableButton = new SimpleButton("Toggle Mutable", new ClickHandler() {

            public void onClick(ClickEvent event) {
                if (form.isMutable()) {
                    form.markUnMutable();
                } else {
View Full Code Here

@MiscSample
public class UserAgentSamplePane extends Composite implements SamplePanel {

    public UserAgentSamplePane() {

        SimpleButton button = new SimpleButton("Check User Agent", new ClickHandler() {
            public void onClick(ClickEvent event) {
                if (UserAgent.getInstance().isWebkit()) {
                    DefaultNotifier.getInstance().showInfo("User Agent", "Webkit", null);
                } else if (UserAgent.getInstance().isMozilla()) {
                    DefaultNotifier.getInstance().showInfo("User Agent", "Mozilla", null);
View Full Code Here

        HorizontalPanel buttons = new HorizontalPanel();
        buttons.setSpacing(4);
        main.add(buttons);

        SimpleButton button = new SimpleButton("Show Message", WidgetImages.Instance.get().notification_Message().createImage());
        button.addClickHandler(new ClickHandler() {
            public void onClick(ClickEvent clickEvent) {
                Notifiers.tray().notify(Notification.builder().title("Short Message").body("This is the content of the message").autoCloseDelay(3500).build());
            }
        });
        buttons.add(button);

        button = new SimpleButton("Show Long Message", WidgetImages.Instance.get().notification_Message().createImage());
        button.addClickHandler(new ClickHandler() {
            public void onClick(ClickEvent clickEvent) {
                Notifiers.tray().notify(Notification.builder().title("Long Message").body("This is the content of a very very very very very long message, so " + "long it seems it has no end, but it does... it's coming soon... very soon... wait... wait... " + "here it comes... no.. just kiding it's not coming... yes it is... now!").autoCloseDelay(8000).build());
            }
        });
        buttons.add(button);

        button = new SimpleButton("Show Sticky Message", WidgetImages.Instance.get().notification_Message().createImage());
        button.addClickHandler(new ClickHandler() {
            public void onClick(ClickEvent clickEvent) {
                Notifiers.tray().notify(Notification.builder().title("Sticky Message").body("This is the content of the message, it's not a long as the logest " + "message, but still it has its length").sticky(true).build());
            }
        });
        buttons.add(button);

        button = new SimpleButton("Show Info", WidgetImages.Instance.get().notification_Message().createImage());
        button.addClickHandler(new ClickHandler() {
            public void onClick(ClickEvent clickEvent) {
                Notifiers.tray().notify(Notifications.info()
                        .title("Sticky Message")
                        .body("This is the content of the message, it's not a long as the logest " + "message, but still it has its length")
                        .sticky(true)
                        .build());
            }
        });
        buttons.add(button);

        button = new SimpleButton("Show Warn", WidgetImages.Instance.get().notification_Message().createImage());
        button.addClickHandler(new ClickHandler() {
            public void onClick(ClickEvent clickEvent) {
                Notifiers.tray().notify(Notifications.warn()
                        .title("Sticky Message")
                        .body("This is the content of the message, it's not a long as the logest " + "message, but still it has its length")
                        .sticky(true)
                        .build());
            }
        });
        buttons.add(button);

        button = new SimpleButton("Show Error", WidgetImages.Instance.get().notification_Message().createImage());
        button.addClickHandler(new ClickHandler() {
            public void onClick(ClickEvent clickEvent) {
                Notifiers.tray().notify(Notifications.error().title("Sticky Message").body("This is the content of the message, it's not a long as the logest " + "message, but still it has its length").sticky(true).build());
            }
        });
        buttons.add(button);


        buttons = new HorizontalPanel();
        buttons.setSpacing(4);
        main.add(buttons);

        button = new SimpleButton("Set TOP_LEFT", WidgetImages.Instance.get().notification_Message().createImage());
        button.addClickHandler(new ClickHandler() {
            public void onClick(ClickEvent clickEvent) {
                TrayNotifier.get().setOrientation(Orientation.TOP_LEFT);
            }
        });
        buttons.add(button);

        button = new SimpleButton("Set TOP_RIGHT", WidgetImages.Instance.get().notification_Message().createImage());
        button.addClickHandler(new ClickHandler() {
            public void onClick(ClickEvent clickEvent) {
                TrayNotifier.get().setOrientation(Orientation.TOP_RIGHT);
            }
        });
        buttons.add(button);

        button = new SimpleButton("Set BOTTOM_RIGHT", WidgetImages.Instance.get().notification_Message().createImage());
        button.addClickHandler(new ClickHandler() {
            public void onClick(ClickEvent clickEvent) {
                TrayNotifier.get().setOrientation(Orientation.BOTTOM_RIGHT);
            }
        });
        buttons.add(button);

        button = new SimpleButton("Set BOTTOM_LEFT", WidgetImages.Instance.get().notification_Message().createImage());
        button.addClickHandler(new ClickHandler() {
            public void onClick(ClickEvent clickEvent) {
                TrayNotifier.get().setOrientation(Orientation.BOTTOM_LEFT);
            }
        });
        buttons.add(button);
View Full Code Here

                "address.street", "address.city", "address.country"
        ));

        final FormPanel formPanel = new FormPanel(form, layout);

        SimpleButton validateButton = new SimpleButton("Validate", new ClickHandler() {
            public void onClick(ClickEvent event) {
                formPanel.validate();
            }
        });
View Full Code Here

        FocusWidget focusButton = null;
        List<SimpleButton> buttons = new ArrayList<SimpleButton>();
        switch (optionType) {

            case OK_CANCEL:
                SimpleButton cancelButton = new SimpleButton("Cancel", new ClickHandler() {
                    public void onClick(ClickEvent event) {
                        callback.handle(Button.CANCEL);
                        box.hide();
                    }
                });
                LayoutUtils.setCssFloat(cancelButton.getElement(), CssFloat.RIGHT);
                DOM.setStyleAttribute(cancelButton.getElement(), "marginRight", "5px");
                buttons.add(cancelButton);

            case OK:
                SimpleButton okButton = new SimpleButton("OK", new ClickHandler() {
                    public void onClick(ClickEvent event) {
                        callback.handle(Button.OK);
                        box.hide();
                    }
                });
                LayoutUtils.setCssFloat(okButton.getElement(), CssFloat.RIGHT);
                DOM.setStyleAttribute(okButton.getElement(), "marginRight", "5px");
                buttons.add(0, okButton);
                focusButton = okButton;
                break;

            case YES_NO_CANCEL:
                cancelButton = new SimpleButton("Cancel", new ClickHandler() {
                    public void onClick(ClickEvent event) {
                        callback.handle(Button.CANCEL);
                        box.hide();
                    }
                });
                LayoutUtils.setCssFloat(cancelButton.getElement(), CssFloat.RIGHT);
                DOM.setStyleAttribute(cancelButton.getElement(), "marginRight", "5px");
                buttons.add(cancelButton);

            case YES_NO:
                SimpleButton noButton = new SimpleButton("No", new ClickHandler() {
                    public void onClick(ClickEvent event) {
                        callback.handle(Button.NO);
                        box.hide();
                    }
                });
                LayoutUtils.setCssFloat(noButton.getElement(), CssFloat.RIGHT);
                DOM.setStyleAttribute(noButton.getElement(), "marginRight", "5px");
                buttons.add(0, noButton);
                SimpleButton yesButton = new SimpleButton("Yes", new ClickHandler() {
                    public void onClick(ClickEvent event) {
                        callback.handle(Button.YES);
                        box.hide();
                    }
                });
                LayoutUtils.setCssFloat(yesButton.getElement(), CssFloat.RIGHT);
                DOM.setStyleAttribute(yesButton.getElement(), "marginRight", "5px");
                buttons.add(0, yesButton);
                focusButton = yesButton;

        }
        for (SimpleButton simpleButton : buttons) {
View Full Code Here

TOP

Related Classes of org.gwtoolbox.widget.client.button.SimpleButton

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.