Examples of VNotification


Examples of com.vaadin.client.ui.VNotification

    private static void recompileWidgetsetAndStartInDevMode(
            final String serverUrl) {
        VConsole.log("Recompiling widgetset using<br/>" + serverUrl
                + "<br/>and then reloading in super dev mode");
        VNotification n = new VNotification();
        n.show("<b>Recompiling widgetset, please wait</b>",
                VNotification.CENTERED, VNotification.STYLE_SYSTEM);

        JsonpRequestBuilder b = new JsonpRequestBuilder();
        b.setCallbackParam("_callback");
        b.setTimeout(COMPILE_TIMEOUT_IN_SECONDS * 1000);
        b.requestObject(serverUrl + "recompile/" + GWT.getModuleName() + "?"
                + getRecompileParameters(GWT.getModuleName()),
                new AsyncCallback<RecompileResult>() {

                    @Override
                    public void onSuccess(RecompileResult result) {
                        VConsole.log("JSONP compile call successful");

                        if (!result.ok()) {
                            VConsole.log("* result: " + result);
                            failed();
                            return;
                        }

                        setSession(
                                getSuperDevModeHookKey(),
                                getSuperDevWidgetSetUrl(GWT.getModuleName(),
                                        serverUrl));
                        setSession(SKIP_RECOMPILE, "1");

                        VConsole.log("* result: OK. Reloading");
                        Location.reload();
                    }

                    @Override
                    public void onFailure(Throwable caught) {
                        VConsole.error("JSONP compile call failed");
                        // Don't log exception as they are shown as
                        // notifications
                        VConsole.error(Util.getSimpleName(caught) + ": "
                                + caught.getMessage());
                        failed();

                    }

                    private void failed() {
                        VNotification n = new VNotification();
                        n.addEventListener(new EventListener() {

                            @Override
                            public void notificationHidden(HideEvent event) {
                                recompileWidgetsetAndStartInDevMode(serverUrl);
                            }
                        });
                        n.show("Recompilation failed.<br/>"
                                + "Make sure CodeServer is running, "
                                + "check its output and click to retry",
                                VNotification.CENTERED,
                                VNotification.STYLE_SYSTEM);
                    }
View Full Code Here

Examples of com.vaadin.client.ui.VNotification

        }
        return false;
    }

    private static void showError(String message) {
        VNotification n = new VNotification();
        n.show(message, VNotification.CENTERED_TOP, VNotification.STYLE_SYSTEM);
    }
View Full Code Here

Examples of com.vaadin.client.ui.VNotification

        List<SelectorPredicate> predicates = SelectorPredicate
                .extractPredicates(path);
        for (SelectorPredicate p : predicates) {

            if (p.getIndex() > -1) {
                VNotification n = notifications.get(p.getIndex());
                notifications.clear();
                if (n != null) {
                    notifications.add(n);
                }
            }
View Full Code Here

Examples of com.vaadin.client.ui.VNotification

                html.append("<p><i style=\"font-size:0.7em\">");
                html.append(details);
                html.append("</i></p>");
            }

            VNotification n = VNotification.createNotification(1000 * 60 * 45,
                    uIConnector.getWidget());
            n.addEventListener(new NotificationRedirect(url));
            n.show(html.toString(), VNotification.CENTERED_TOP,
                    VNotification.STYLE_SYSTEM);
        } else {
            redirect(url);
        }
    }
View Full Code Here

Examples of com.vaadin.terminal.gwt.client.ui.VNotification

            // Add error description
            html.append("<br/><p><I style=\"font-size:0.7em\">");
            html.append(details);
            html.append("</I></p>");

            VNotification n = new VNotification(1000 * 60 * 45);
            n.addEventListener(new NotificationRedirect(url));
            n.show(html.toString(), VNotification.CENTERED_TOP,
                    VNotification.STYLE_SYSTEM);
        } else {
            redirect(url);
        }
    }
View Full Code Here

Examples of com.vaadin.terminal.gwt.client.ui.VNotification

                            url = error.getString("url");
                        }

                        if (html.length() != 0) {
                            /* 45 min */
                            VNotification n = new VNotification(1000 * 60 * 45);
                            n.addEventListener(new NotificationRedirect(url));
                            n.show(html, VNotification.CENTERED_TOP,
                                    VNotification.STYLE_SYSTEM);
                        } else {
                            redirect(url);
                        }
                        applicationRunning = false;
View Full Code Here

Examples of com.vaadin.terminal.gwt.client.ui.VNotification

            // Add error description
            html.append("<br/><p><I style=\"font-size:0.7em\">");
            html.append(details);
            html.append("</I></p>");

            VNotification n = VNotification.createNotification(1000 * 60 * 45);
            n.addEventListener(new NotificationRedirect(url));
            n.show(html.toString(), VNotification.CENTERED_TOP,
                    VNotification.STYLE_SYSTEM);
        } else {
            redirect(url);
        }
    }
View Full Code Here

Examples of com.vaadin.terminal.gwt.client.ui.VNotification

                            url = error.getString("url");
                        }

                        if (html.length() != 0) {
                            /* 45 min */
                            VNotification n = VNotification
                                    .createNotification(1000 * 60 * 45);
                            n.addEventListener(new NotificationRedirect(url));
                            n.show(html, VNotification.CENTERED_TOP,
                                    VNotification.STYLE_SYSTEM);
                        } else {
                            redirect(url);
                        }
                        applicationRunning = false;
View Full Code Here

Examples of com.vaadin.terminal.gwt.client.ui.VNotification

            // Add error description
            html.append("<br/><p><I style=\"font-size:0.7em\">");
            html.append(details);
            html.append("</I></p>");

            VNotification n = new VNotification(1000 * 60 * 45);
            n.addEventListener(new NotificationRedirect(url));
            n.show(html.toString(), VNotification.CENTERED_TOP,
                    VNotification.STYLE_SYSTEM);
        } else {
            redirect(url);
        }
    }
View Full Code Here

Examples of com.vaadin.terminal.gwt.client.ui.VNotification

                            url = error.getString("url");
                        }

                        if (html.length() != 0) {
                            /* 45 min */
                            VNotification n = new VNotification(1000 * 60 * 45);
                            n.addEventListener(new NotificationRedirect(url));
                            n.show(html, VNotification.CENTERED_TOP,
                                    VNotification.STYLE_SYSTEM);
                        } else {
                            redirect(url);
                        }
                        applicationRunning = false;
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.