@Override public void onPlayerEvent(PlayerEvent event) { if (testMode) { return; } if (event.getType() == PAGE_LOADED) { Timer timer = new Timer() { @Override public void run() { setEnabled(!isEnd()); setStyleName(); } }; timer.schedule(300); } else if (event.getType() == BEFORE_FLOW) { setEnabled(false); setStyleName(); } }
@Inject public VideoControlHideTimer(@Assisted VideoFullScreenView view, EventsBus eventsBus) { this.view = view; this.eventsBus = eventsBus; view.getContainer().addDomHandler(this, TouchEndEvent.getType()); view.getContainer().addDomHandler(this, ClickEvent.getType()); view.getContainer().addDomHandler(this, MouseMoveEvent.getType()); controlsHideTimer = new Timer() { @Override public void run() { hideCotrols(); } }; controlsHideTimer.schedule(CONTROLS_SHOW_TIME); }
public MyFlexTable() { super(); setCellPadding(2); setCellSpacing(0); sinkEvents(Event.ONMOUSEOVER); sinkEvents(Event.ONMOUSEOUT); sinkEvents(Event.ONCLICK); sinkEvents(Event.ONKEYDOWN); setStylePrimaryName("unitime-MainTable"); iTimer = new Timer() { @Override public void run() { saveOrder(); } }; }
public HorizontalPanelWithHint(Widget hint) { super(); iHint = new PopupPanel(); iHint.setWidget(hint); iHint.setStyleName("unitime-PopupHint"); sinkEvents(Event.ONMOUSEOVER); sinkEvents(Event.ONMOUSEOUT); sinkEvents(Event.ONMOUSEMOVE); iShowHint = new Timer() { @Override public void run() { iHint.show(); } }; iHideHint = new Timer() { @Override public void run() { iHint.hide(); } }; }
public CourseRelatedObjectsTable(AcademicSessionProvider session) { iSession = session; setStyleName("unitime-EventOwners"); List<Widget> header = new ArrayList<Widget>(); header.add(new UniTimeTableHeader(MESSAGES.colSubject())); header.add(new UniTimeTableHeader(MESSAGES.colCourseNumber())); header.add(new UniTimeTableHeader(MESSAGES.colConfigOrSubpart())); header.add(new UniTimeTableHeader(MESSAGES.colClassNumber())); header.add(new UniTimeTableHeader(" ")); addRow(null, header); iChangeTimer = new Timer() { @Override public void run() { List<RelatedObjectInterface> value = getValue(); if (iLastChange != null && iLastChange.equals(value)) return; iLastChange = value; ValueChangeEvent.fire(CourseRelatedObjectsTable.this, value); } }; }
protected void addNotification(final Notification notification) { for (Iterator<Notification> i = iNotifications.iterator(); i.hasNext(); ) { Notification n = i.next(); if (n.getText().equals(notification.getText())) { i.remove(); } } iNotifications.add(notification); populate("slideup"); Timer timer = new Timer() { @Override public void run() { iNotifications.remove(notification); populate(null); } }; timer.schedule(10000); }
private UniTimePageHeader() { iHeader = new PageHeader(); getLeft().setCallback(new Callback() { @Override public void execute(Callback callback) { reloadSolverInfo(true, callback); } }); reloadSessionInfo(); reloadUserInfo(); iTimer = new Timer() { @Override public void run() { reloadSolverInfo(getLeft().isPopupShowing(), null); } }; iTimer.schedule(1000); }
private Calendar(Integer tenantId, Fetchable<Collection<I>> dataProvider, Fetchable<List<G>> groupProvider, DataProvider<G, I> instanceCreator, SyncBeanManager beanManager) { this.beanManager = beanManager; this.tenantId = tenantId; shifts = new HashMap<>(); didTenantChange = true; setInstanceCreator(instanceCreator); setGroupProvider(groupProvider); setDataProvider(dataProvider); timer = new Timer() { @Override public void run() { forceUpdate(); } }; refresh(); }
/** * Creates the editor manager. */ public EditorManager() { openProjectEditors = Maps.newHashMap(); dirtyProjectSettings = new HashSet<ProjectSettings>(); dirtyFileEditors = new HashSet<FileEditor>(); autoSaveTimer = new Timer() { @Override public void run() { // When the timer goes off, save all dirtyProjectSettings and // dirtyFileEditors. Ode.getInstance().lockScreens(true); // Lock out changes saveDirtyEditors(new Command() { @Override public void execute() { Ode.getInstance().lockScreens(false); // I/O finished, unlock } }); } }; }
private void executeCommandPause(final PromptlyPanel panel) { panel.setBlockingHyperlinks(true); panel.append("Pausing for 3 seconds (all input ignored) ...."); panel.setCommandLineMode(false /* is command line mode */, false /* is collect key events */, false /* is collect mouse events */); Timer t = new Timer() { @Override public void run() { panel.append("... and we are back !"); panel.setBlockingHyperlinks(false); panel.setCommandLineMode(true /* is command line mode */, true /* is collect key events */, true /* is collect mouse events */); } }; t.schedule(3000); }
/** Verify that no events are issued via newItem if there were not reqeuested. */ public void testNoEvents() { delayTestFinish(5000); addHistoryListenerImpl(event -> fail("onHistoryChanged should not have been called")); History.newItem("testNoEvents", false); timer = new Timer() { @Override public void run() { finishTest(); } }; timer.schedule(500); }
/** * Test to make sure that there is no double unescaping of hash values. See * https://bugzilla.mozilla.org/show_bug.cgi?id=483304 */ @DoNotRunWith(Platform.HtmlUnitUnknown) public void testNoDoubleTokenUnEscaping() { final String shouldBeEncoded = "abc%20abc"; delayTestFinish(5000); History.newItem(shouldBeEncoded); History.newItem("someOtherToken"); History.back(); // allow browser to update the url timer = new Timer() { @Override public void run() { // make sure that value in url actually matches the original token assertEquals(shouldBeEncoded, History.getToken()); finishTest(); } }; timer.schedule(200); }
public static void it(String html) { try { buildFrame(html); if (USE_TIMER) { Timer timer = new Timer() { public void run() { printFrame(); } }; timer.schedule(TIMER_DELAY * 1000); } else { DeferredCommand.addCommand(new Command() { public void execute() { printFrame(); } }); } } catch (Throwable exc) { Window.alert(exc.getMessage()); } }
@Inject GoogleDriveView(Binder uiBinder) { initWidget(uiBinder.createAndBindUi(this)); splash.show(); Timer t = new Timer() { @Override public void run() { splash.hide(); } }; t.schedule(5000); search.addCloseHandler(event -> { appNav.setVisible(true); searchNav.setVisible(false); }); search.addKeyUpHandler(event -> { List<DriveDTO> filteredFiles = DataHelper.getAllDrives().stream().filter(dto -> dto.getFileName().toLowerCase().contains(search.getText().toLowerCase())).collect(Collectors.toList()); populateFiles(filteredFiles); }); populateFiles(DataHelper.getAllDrives()); }
@Inject GoogleContactsView(Binder uiBinder) { initWidget(uiBinder.createAndBindUi(this)); splash.show(); Timer t = new Timer() { @Override public void run() { splash.hide(); } }; t.schedule(5000); search.addCloseHandler(event -> { appNav.setVisible(true); searchNav.setVisible(false); }); search.addKeyUpHandler(event -> { List<UserDTO> filteredUser = DataHelper.getAllUsers().stream().filter(dto -> dto.getName().toLowerCase().contains(search.getText().toLowerCase())).collect(Collectors.toList()); populateUsers(filteredUser); }); populateUsers(DataHelper.getAllUsers()); }
@Override public void onChange(FolderEventConstant event) { if (event.equals(HasFolderEvent.FOLDER_CHANGED)) { Workflow.get().setTabFolderSelected(); workflowManager.findProcessInstancesByNode(Workflow.get().getUuid()); } else if (event.equals(HasFolderEvent.TAB_CHANGED)) { if (TabFolderComunicator.isWidgetExtensionVisible(this)) { Timer timer = new Timer() { @Override public void run() { workflowManager.fillWidth(); } }; timer.schedule(100); } } }
@Override public void onChange(DocumentEventConstant event) { if (event.equals(HasDocumentEvent.DOCUMENT_CHANGED)) { Workflow.get().setTabDocumentSelected(); workflowManager.findProcessInstancesByNode(Workflow.get().getUuid()); } else if (event.equals(HasDocumentEvent.TAB_CHANGED)) { if (TabDocumentComunicator.isWidgetExtensionVisible(this)) { Timer timer = new Timer() { @Override public void run() { workflowManager.fillWidth(); } }; timer.schedule(100); } } }
@Override public void onChange(MailEventConstant event) { if (event.equals(HasMailEvent.MAIL_CHANGED)) { Workflow.get().setTabMailSelected(); workflowManager.findProcessInstancesByNode(Workflow.get().getUuid()); } else if (event.equals(HasMailEvent.TAB_CHANGED)) { if (TabMailComunicator.isWidgetExtensionVisible(this)) { Timer timer = new Timer() { @Override public void run() { workflowManager.fillWidth(); } }; timer.schedule(100); } } }
/** * logout */ private void logout(final HTML countDown, final int seconds) { Timer timer = new Timer() { @Override public void run() { countDown.setHTML(Main.i18n("ui.logout") + " " + secondsToHTML(seconds)); if (seconds > 1) { logout(countDown, seconds - 1); } else { hide(); Main.get().logoutPopup.logout(); } } }; timer.schedule(1000); }
/** * logoutAfterChat(); */ private void logoutAfterChat() { Timer timer = new Timer() { @Override public void run() { if (!Main.get().mainPanel.bottomPanel.userInfo.isPendingToClose()) { authService.logout(callbackLogout); } else { logoutAfterChat(); } } }; timer.schedule(100); // Each minute seconds refreshing connected users Log.debug("Logout: void"); }
/** * refreshUsersInRoom() */ private void refreshUsersInRoom(final String room) { if (chatRoomActive) { chatService.usersInRoom(room, new AsyncCallback<String>() { @Override public void onSuccess(String result) { usersInRoomText.setHTML("(" + result + ") " + Main.i18n("chat.users.in.room")); Timer timer = new Timer() { @Override public void run() { refreshUsersInRoom(room); } }; timer.schedule(DELAY_USERS_IN_ROOM); } @Override public void onFailure(Throwable caught) { Main.get().showError("UsersInRoom", caught); } }); } }
/** * Evaluate */ public void evaluate(String name) { if (name.equals("futurama")) { left = -180; top = Window.getClientHeight() - 80 - 21; show(); setPopupPosition(left, top); move = new Timer() { public void run() { left += 2; setPopupPosition(left, top); if (left < Window.getClientWidth() + 180) { move.schedule(40); } else { move.cancel(); hide(); } } }; move.schedule(40); } }
public void downloadFileById(String resourceId) { final String url = getResourceUrl(resourceId); if (url != null && !url.isEmpty()) { final IFrameElement iframe = Document.get().createIFrameElement(); Style style = iframe.getStyle(); style.setVisibility(Style.Visibility.HIDDEN); style.setHeight(0, Style.Unit.PX); style.setWidth(0, Style.Unit.PX); iframe.setFrameBorder(0); iframe.setTabIndex(-1); iframe.setSrc(url); RootPanel.getBodyElement().appendChild(iframe); Timer removeTimer = new Timer() { @Override public void run() { iframe.removeFromParent(); } }; removeTimer.schedule(60 * 1000); } }
SearchPresenter(TimerService scheduler, Search search, SearchesService searchPatternsService, SearchPanelView searchUi, WaveActionHandler actionHandler, SearchesModifyHandler searchesModifyHandler) { this.search = search; this.searchesService = searchPatternsService; this.searchUi = searchUi; this.scheduler = scheduler; this.actionHandler = actionHandler; this.searchesModifyHandler = searchesModifyHandler; digestsUpdateTimer = new Timer() { @Override public void run() { digestUis.each(new IdentityMap.ProcV<DigestView, Digest>() { @Override public void apply(DigestView digestView, Digest digest) { digestView.update(); } }); } }; }
@Override public void onKeyDown(KeyDownEvent event) { int keyCode = event.getNativeKeyCode(); if((keyCode == KEY_BACKSPACE || keyCode >= KEY_DELETE) && keyCode != 91 && keyCode != 93) { // Command/Window keyboard keys cancelTimer(); timer = new Timer() { public void run() { dataProvider.setFilter(filterTextBox.getValue()); } }; timer.schedule(TIMEOUT); } else if(keyCode == KEY_ENTER) { cancelTimer(); dataProvider.setFilter(filterTextBox.getValue()); } }
private static void fade(final Element element, final float startOpacity, final float endOpacity, final int totalTimeMillis) { final int numberOfSteps = 30; int stepLengthMillis = totalTimeMillis / numberOfSteps; stepCount = 0; final float deltaOpacity = (endOpacity - startOpacity) / numberOfSteps; timerFader = new Timer() { @Override public void run() { float opacity = startOpacity + stepCount * deltaOpacity; DOM.setStyleAttribute(element, "opacity", Float.toString(opacity)); stepCount++; if (stepCount == numberOfSteps) { DOM.setStyleAttribute(element, "opacity", Float.toString(endOpacity)); cancel(); } } }; timerFader.scheduleRepeating(stepLengthMillis); }
@Override public void onModuleLoad() { canvas = Document.get().createElement("canvas").cast(); Document.get().getBody().appendChild(canvas); canvas.setWidth(CANVAS_WIDTH); canvas.setHeight(CANVAS_HEIGHT); gl = WebGLRenderingContext.getContext(canvas); gl.viewport(0, 0, CANVAS_WIDTH, CANVAS_HEIGHT); init(); new Timer() { @Override public void run() { draw(); } }.scheduleRepeating(100); }
private void handleBackgrounding(final MonitorItem monItem) { DefaultWorkingWidget working= new DefaultWorkingWidget((ClickHandler)null); working.setText("Backgrounding..."); final MaskPane maskPane = new MaskPane(getMaskWidget(), working); maskPane.show(); Timer t= new Timer() { @Override public void run() { BackgroundMonitor monitor= Application.getInstance().getBackgroundMonitor(); if (doAnimation) { Application.getInstance().getBackgroundManager().animateToManager(_animationX, _animationY, 1300); } monItem.setWatchable(true); monItem.setImmediately(showImmediately); monitor.addItem(monItem); _response.status(CatalogSearchResponse.RequestStatus.BACKGROUNDING); maskPane.hide(); } }; t.schedule(1000); }
protected void expando(final FlowPanel div2, final DivElement[] notes) { Timer t = new Timer() { int i = 0; final int last = notes.length; @Override public void run() { if (i >= last) this.cancel(); else div2.getElement().appendChild(notes[i++]); } }; // Eye candy t.scheduleRepeating(10); }
public void testToastWithCallback() { final boolean[] isCallbackFired = new boolean[1]; new MaterialToast(() -> { isCallbackFired[0] = true; }).toast("callback", 1000); Timer t = new Timer() { @Override public void run() { assertTrue(isCallbackFired[0]); } }; t.schedule(1000); Element toastContainer = $("body").find("#toast-container").asElement(); assertNotNull(toastContainer); toastContainer.setInnerHTML(""); }
private void scheduleRemoval(final K key, final V value) { // from MapMaker /* * TODO: Keep weak reference to map, too. Build a priority queue out of the entries themselves * instead of creating a task per entry. Then, we could have one recurring task per map (which * would clean the entire map and then reschedule itself depending upon when the next * expiration comes). We also want to avoid removing an entry prematurely if the entry was set * to the same value again. */ Timer timer = new Timer() { @Override public void run() { remove(key, value); } }; timer.schedule((int) expirationMillis); }
/** * Set whether scrollbars are enabled. * * @param enabled Whether scrollbars are enabled. */ public void setScrollEnabled(final boolean enabled) { final Element element = getElement(); boolean scrollEnabled = element.hasClassName(CLASS_NAME_SCROLL); if ((scrollEnabled && !enabled) || (!scrollEnabled && enabled)) { if (enabled) { (new Timer() { @Override public void run() { element.addClassName(CLASS_NAME_SCROLL); } }).schedule(SCROLL_DELAY); } else { element.removeClassName(CLASS_NAME_SCROLL); } } }
@Override public void open() { final int delay = propertyManager.getConnectionDelay(url); if (isClosed() || isClosing()) { if (delay == 0) { webSocketJsoWrapper = WebSocketJsoWrapper.connect(url, endpoint); } else { new Timer() { @Override public void run() { webSocketJsoWrapper = WebSocketJsoWrapper.connect(url, endpoint); } }.schedule(delay); } } else { Log.warn(getClass(), "Opening already opened or connecting web socket."); } }
@Override public void setSuccess() { // Stop animation timer playTimer.cancel(); // Start hide animation getElement().addClassName("outDown"); // Remove from the parent new Timer() { @Override public void run() { removeFromParent(); } }.schedule(1000); }
private void close() { opacity = 10; // Hide animation new Timer() { @Override public void run() { opacity--; if (opacity <= 0) { cancel(); getElement().getParentElement().removeChild(getElement()); } else { getElement().getStyle().setProperty("opacity", "0." + opacity); } } }.scheduleRepeating(50); }
@Override public void showDialog() { acceptButton.setEnabled(false); isUseFileMask.setValue(false); filesMask.setEnabled(false); isUseDirectory.setValue(false); wholeWordsOnly.setValue(false); directory.setEnabled(false); selectPathButton.setEnabled(false); directory.setText(""); filesMask.setText("*.*"); directory.setText("/"); errLabel.setText(""); new Timer() { @Override public void run() { text.setFocus(true); } }.schedule(100); super.show(); }
private void scrollToLine(EditorPartPresenter editor, String lineParam) { if (!(editor instanceof TextEditor)) { return; } new Timer() { @Override public void run() { try { int lineNumber = parseInt(lineParam); TextEditor textEditor = (TextEditor) editor; textEditor.getDocument().setCursorPosition(new TextPosition(lineNumber - 1, 0)); } catch (NumberFormatException e) { Log.error(getClass(), localization.fileToOpenLineIsNotANumber()); } } }.schedule(300); }
private void showSelectFromMap() { if(!showedSelectFromMapOnce) { showedSelectFromMapOnce = true; final DecoratedPopupPanel simplePopup = new DecoratedPopupPanel(true); simplePopup.setWidth("150px"); simplePopup.setWidget(new HTML(CONSTANTS.selectFromMap())); simplePopup.addStyleName("popup"); simplePopup.center(); Timer t = new Timer() { public void run() { simplePopup.hide(); } }; t.schedule(2000); } }