Package org.sgx.yuigwt.yui.asyncqueue

Examples of org.sgx.yuigwt.yui.asyncqueue.AsyncQueue


        // All AsyncQueue instances will execute all callbacks
        // synchronously by default
        Y.AsyncQueue().defaults().timeout(-1);

        final AsyncQueue aq = Y.newAsyncQueue().add(aqItem).add(aqItem2).add(aqItem3);
        ta.set("text", "indexOf A = " + aq.indexOf("aq1"));

        EventCallback<AsyncQueueEvent> callback1 = new EventCallback<AsyncQueueEvent>() {
          @Override
          public void call(AsyncQueueEvent e) {
            console.log("Event type: " + e.type(), "", "");
          }
        };

        aq.on(new String[] { AsyncQueue.EVENT_COMPLETE, AsyncQueue.EVENT_SHIFT, AsyncQueue.EVENT_PROMOTE }, callback1);

        // a button to start and later promote item 3
        Y.newButton(ButtonConfig.create().label("start").on("click", new EventCallback<EventFacade>() {
          @Override
          public void call(EventFacade e) {
            aq.run();

            JsUtil.setTimeout(new SimpleCallback() {
              @Override
              public void call() {
                aq.promote("aq3");
              }
            }, 200);
          }
        })).render(parent);
View Full Code Here

TOP

Related Classes of org.sgx.yuigwt.yui.asyncqueue.AsyncQueue

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.