Example usage for com.google.gwt.user.client Timer Timer

List of usage examples for com.google.gwt.user.client Timer Timer

Introduction

In this page you can find the example usage for com.google.gwt.user.client Timer Timer.

Prototype

Timer

Source Link

Usage

From source file:com.dimdim.conference.ui.common.client.common.TimeAndFocusSensitiveModalDialog.java

License:Open Source License

private void initialize() {
    pane.setSize("100%", "100%");
    pane.addMouseListener(this);
    this.addPopupListener(this);

    this.add(pane);

    timer = new Timer() {
        public void run() {
            timer = null;/* ww  w.ja v a 2  s .co  m*/
            hide();
            //            if( null != parentMenu)
            //            {
            //               parentMenu.setSubMeuOpen(false);
            //            }
        }
    };

    //this is to start the timer so that if user does not enter dialogue still timer will work 
    closePopup();
}

From source file:com.dimdim.conference.ui.common.client.list.ListEntryHoverPopupPanel.java

License:Open Source License

public void popupVisible() {
    this.timer = new Timer() {
        public void run() {
            timer = null;// w ww  .  jav  a  2s. com
            hideHoverPopup();
        }
    };
    this.timer.schedule(this.showTime);
}

From source file:com.dimdim.conference.ui.common.client.list.ListEntryHoverPopupPanel.java

License:Open Source License

public void closePopup() {
    if (this.timer != null) {
        this.timer.cancel();
        this.timer = null;
    }//  ww w . j  ava 2  s .  c  om
    if (!this.hasFocus) {
        timer = new Timer() {
            public void run() {
                timer = null;
                hideHoverPopup();
            }
        };
        timer.schedule(this.showTime);
    }
}

From source file:com.dimdim.conference.ui.common.client.tab.CommonTab.java

License:Open Source License

public void startBlinker(final String styleName) {
    if (counter > 1) {
        //         Window.alert("value of counter : " + counter);
        actualPanel.remove(image);/* ww  w .  j  av a  2s .co  m*/
        actualPanel.remove(imageChange);
    }
    image = new Image("images/new-incoming.png");
    image.setStyleName("blink-chat-popup");
    imageChange = new Image("images/no-incoming.png");
    imageChange.setStyleName("blink-chat-popup");

    checkImageFirstTime = true;

    //      Window.alert("Check Image first time : " + checkImageFirstTime + " checkMinimized : " + checkMinimizedMessageAgain);

    if (this.toggle == null && !this.tabContentVisible) {
        this.toggle = new Timer() {
            boolean unread = true;

            public void run() {
                //               checkMinimizedMessageAgain = true;               
                if (unread) {
                    //                  addBackgroundStyle(styleName);
                    if (checkImageFirstTime != true) {
                        actualPanel.remove(imageChange);
                        actualPanel.add(image);
                    } else {
                        actualPanel.add(image);
                    }
                    unread = false;
                } else {
                    //                  removeBackgroundStyle(styleName);
                    checkImageFirstTime = false;
                    actualPanel.remove(image);
                    actualPanel.add(imageChange);
                    unread = true;
                }
                //               Window.alert("checkImageFirstTime: " + checkImageFirstTime);               
                /*if(tabContentVisible)
                {
                   actualPanel.remove(image);
                   actualPanel.remove(imageChange);
                }*/
            }
        };
        this.toggle.scheduleRepeating(1000);
    }
}

From source file:com.dimdim.conference.ui.common.client.user.NewChatPopup.java

License:Open Source License

public void hasNewUnreadHiddenMessage() {
    image.setStyleName("blink-chat-popup");
    imageChange.setStyleName("blink-chat-popup");
    image.addClickListener(this);
    imageChange.addClickListener(this);

    if (counter > 1) {
        headerButtons.remove(image);//from w  w  w . j  a v a2s .c  o  m
        headerButtons.remove(imageChange);
    }

    checkImageFirstTime = true;

    if (this.toggle == null) {
        this.toggle = new Timer() {
            boolean unread = true;

            public void run() {
                if (unread) {
                    if (checkImageFirstTime != true) {
                        headerButtons.remove(imageChange);
                        headerButtons.insert(image, 0);
                    } else {
                        headerButtons.insert(image, 0);
                    }
                    unread = false;
                } else {
                    checkImageFirstTime = false;
                    headerButtons.remove(image);
                    headerButtons.insert(imageChange, 0);
                    unread = true;
                }
            }
        };
    }
    this.toggle.scheduleRepeating(1000);
    hasUnreadMessage = true;
}

From source file:com.dimdim.conference.ui.common.client.util.RunningClockWidget.java

License:Open Source License

public void startConfClock() {
    timer = new Timer() {
        public void run() {
            setTime();//w w  w .j  ava2s  .  c om
        }
    };
    timer.scheduleRepeating(1000);
}

From source file:com.dimdim.conference.ui.dialogues.client.common.TimeAndFocusSensitivePopupPanel.java

License:Open Source License

public TimeAndFocusSensitivePopupPanel(boolean autoClose) {
    super(autoClose);

    pane.setSize("100%", "100%");
    pane.addMouseListener(this);
    this.addPopupListener(this);

    this.add(pane);

    timer = new Timer() {
        public void run() {
            timer = null;/*w  w w  . j  ava 2 s  .  c o  m*/
            hide();
        }
    };
}

From source file:com.dimdim.conference.ui.envcheck.client.layout.TimeSensitiveModalDialog.java

License:Open Source License

public TimeSensitiveModalDialog() {
    pane.setSize("100%", "100%");
    pane.addMouseListener(this);
    this.addPopupListener(this);

    this.add(pane);

    timer = new Timer() {
        public void run() {
            timer = null;//w  ww  .  j a va  2  s  .c  o m
            hide();
        }
    };
}

From source file:com.dimdim.conference.ui.envcheck.client.main.CommandProcessor.java

License:Open Source License

public CommandProcessor(String actionId, String browserType, String osType) {
    this.actionId = actionId;
    this.browserType = browserType;
    this.osType = osType;
    this.totalNumberOfChecks = EnvGlobals.getTotalNumberOfChecks();

    this.osCheck = new OSCheck(getOSType());
    this.browserTypeCheck = new BrowserTypeCheck(getBrowserType());
    this.flashVersionCheck = new FlashVersionCheck(getOSType(), getBrowserType());
    this.flashVersionCheck.setPanelWidth(300);
    this.publisherCheck = new PublisherCheck(getOSType());
    this.publisherCheck.setPanelWidth(300);

    this.checksPanel = new EnvChecksPanel(actionId, browserType, osType, 300);
    this.currentCommand = UserCommandFactory.getFactory().getUserCommand(actionId);

    this.checkTimer = new Timer() {
        public void run() {
            try {
                DeferredCommand.add(new Command() {
                    public void execute() {
                        runCheck();/*  w w w. jav a  2 s  .  com*/
                    }
                });
            } catch (Exception e) {

            }
        }
    };

}

From source file:com.dimdim.conference.ui.envcheck.client.main.EnvCheck.java

License:Open Source License

public void onModuleLoad() {
    //Window.alert("inside module load...");
    EnvGlobals.setOriginalURL(this.getCurrentURL());

    //windowWidth = Window.getClientWidth();
    //windowHeight = Window.getClientHeight();

    String actionId = getActionId();
    String browserType = getBrowserType();
    String osType = getOSType();/*from   ww  w.j ava 2  s . c  o m*/

    final CommandProcessor cp = new CommandProcessor(actionId, browserType, osType);
    //Window.alert("created command processor");
    //      this.fullPage = new SignInFullPage();
    //      cp.setFormContainer(this.fullPage.getFormContainerPanel());

    //      RootPanel.get().clear();
    //      RootPanel.get().add(this.fullPage);

    RootPanel.get("check_header_text").add(new HTML(
            EnvGlobals.getDisplayString("checkpanel.title", "<strong>The checking of essentials...</strong>")));
    RootPanel.get("check_message_text_1").add(new Label(EnvGlobals.getDisplayString("checkpanel.text",
            "This may take a few moments, thanks for your patience")));

    changeUIForAction();

    if (null != skipCheck() && "true".equals(skipCheck())) {
        //Window.alert("ignoring checks...");
        cp.allChecksSuccessful();
    } else {
        //Window.alert("starting timer...");
        Timer t = new Timer() {
            public void run() {
                cp.startChecks();
            }
        };
        t.schedule(500);
    }

    Window.addWindowResizeListener(this);
    History.addHistoryListener(this);
}