@Override
    protected void setup(VaadinRequest request) {
        addComponent(new ProgressIndicator() {
            {
                registerRpc(new ProgressIndicatorServerRpc() {
                    @Override
                    public void poll() {
                        // System.out.println("Pausing poll request");
                        try {
                            // Make the XHR request last longer to make it
                            // easier to click the link at the right moment.
                            Thread.sleep(1000);
                        } catch (InterruptedException e) {
                            e.printStackTrace();
                        }
                        // System.out.println("Continuing poll request");
                    }
                });
                setPollingInterval(3000);
            }
        });
        // Hacky URLs that are might not work in all deployment scenarios
        addComponent(new Link("Navigate away", new ExternalResource(
                "slowRequestHandler")));
        addComponent(new Link("Start download", new ExternalResource(
                "slowRequestHandler?download")));
    }
@Override
    protected void setup(VaadinRequest request) {
        addComponent(new ProgressIndicator() {
            {
                registerRpc(new ProgressIndicatorServerRpc() {
                    @Override
                    public void poll() {
                       
                        try {
                           
                           
                            Thread.sleep(1000);
                        } catch (InterruptedException e) {
                            e.printStackTrace();
                        }
                       
                    }
                });
                setPollingInterval(3000);
            }
        });
       
        addComponent(new Link("Navigate away", new ExternalResource(
                "slowRequestHandler")));
        addComponent(new Link("Start download", new ExternalResource(
                "slowRequestHandler?download")));
    }
@override protected void setup(vaadinrequest request) { addcomponent(new progressindicator() { { registerrpc(new progressindicatorserverrpc() { @override public void poll() { try { thread.sleep(1000); } catch (interruptedexception e) { e.printstacktrace(); } } }); setpollinginterval(3000); } }); addcomponent(new link("navigate away", new externalresource( "slowrequesthandler"))); addcomponent(new link("start download", new externalresource( "slowrequesthandler?download"))); }