Package com.ponysdk.ui.server.basic.PScheduler

Examples of com.ponysdk.ui.server.basic.PScheduler.RepeatingCommand


        final PButton fixedDelayButton = new PButton("Start");
        fixedDelayButton.addClickHandler(new PClickHandler() {

            @Override
            public void onClick(final PClickEvent clickEvent) {
                PScheduler.get().scheduleFixedDelay(new RepeatingCommand() {

                    @Override
                    public boolean execute() {
                        dateLabel.setText(dateFormat.format(Calendar.getInstance().getTime()));
                        return true;
View Full Code Here


        // execute once
        updateUI(new RequestHandler() {

            @Override
            public void onRequest() {
                PScheduler.get().scheduleFixedDelay(new RepeatingCommand() {

                    @Override
                    public boolean execute() {
                        eventsListener.stackCommandResult(new PTestEvent(this, "Timer execution 1"));
                        return false;
                    }
                }, 50);
            }
        });

        final PTestEvent e1 = eventsListener.poll();
        Assert.assertEquals("Timer execution 1", e1.getBusinessMessage());

        // execute 3 times
        final AtomicInteger count = new AtomicInteger(0);
        updateUI(new RequestHandler() {

            @Override
            public void onRequest() {
                PScheduler.get().scheduleFixedDelay(new RepeatingCommand() {

                    @Override
                    public boolean execute() {
                        final int ct = count.incrementAndGet();
                        eventsListener.stackCommandResult(new PTestEvent(this, "Repeating timer execution " + ct));
View Full Code Here

TOP

Related Classes of com.ponysdk.ui.server.basic.PScheduler.RepeatingCommand

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.