Package com.vaadin.client.ui

Examples of com.vaadin.client.ui.VNotification$EventListener


    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


        }
        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

        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

                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

TOP

Related Classes of com.vaadin.client.ui.VNotification$EventListener

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.