com.google.gwt.core.client.Scheduler Java Examples
The following examples show how to use
com.google.gwt.core.client.Scheduler.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: Animate.java From gwtbootstrap3-extras with Apache License 2.0 | 7 votes |
/** * Animate any element with specific animation. Animation is done by CSS and runs multiple times. * * Animation is started when element is appended to the DOM or new (not same) animation is added * to already displayed element. Animation runs on hidden elements too and is not paused/stopped * when element is set as hidden. * * @param widget Widget to apply animation to. * @param animation Custom CSS class name used as animation. * @param count Number of animation repeats. 0 disables animation, any negative value set repeats to infinite. * @param duration Animation duration in ms. 0 disables animation, any negative value keeps default of original animation. * @param delay Delay before starting the animation loop in ms. Value <= 0 means no delay. * @param <T> Any object extending UIObject class (typically Widget). * @return Animation's CSS class name, which can be removed to stop animation. */ public static <T extends UIObject> String animate(final T widget, final String animation, final int count, final int duration, final int delay) { if (widget != null && animation != null) { // on valid input if (widget.getStyleName().contains(animation)) { // animation is present, remove it and run again. stopAnimation(widget, animation); Scheduler.get().scheduleFixedDelay(new Scheduler.RepeatingCommand() { @Override public boolean execute() { styleElement(widget.getElement(), animation, count, duration, delay); return false; } }, 200); return animation + " " + getStyleNameFromAnimation(animation,count,duration,delay); } else { // animation was not present, run immediately return styleElement(widget.getElement(), animation, count, duration, delay); } } else { return null; } }
Example #2
Source File: CubaMaskedFieldWidget.java From cuba with Apache License 2.0 | 6 votes |
@Override public void onFocus(FocusEvent event) { super.onFocus(event); if (!this.focused) { this.focused = true; if (!isReadOnly() && isEnabled()) { if (mask != null && nullRepresentation != null && nullRepresentation.equals(super.getText())) { addStyleName("c-focus-move"); Scheduler.get().scheduleDeferred(() -> { if (!isReadOnly() && isEnabled() && focused) { setSelectionRange(getPreviousPos(0), 0); } removeStyleName("c-focus-move"); }); } } } }
Example #3
Source File: SearchTool.java From core with GNU Lesser General Public License v2.1 | 6 votes |
public void showPopup() { popup.setWidth(640); popup.setHeight(480); popup.setModal(true); popup.setGlassEnabled(true); popup.center(); Scheduler.get().scheduleDeferred(new Scheduler.ScheduledCommand() { @Override public void execute() { if (index.isEmpty()) { popup.index(); } else { popup.showSearchPage(); } } }); }
Example #4
Source File: DigitalObjectChildrenEditor.java From proarc with GNU General Public License v3.0 | 6 votes |
private void initOnEdit() { // LOG.info("initOnEdit"); originChildren = null; lastClicked = null; updateReorderUi(false); attachListResultSet(); // select first if (!childrenListGrid.getOriginalResultSet().isEmpty()) { Scheduler.get().scheduleDeferred(new ScheduledCommand() { @Override public void execute() { // defer the select as it is ignored after refresh in onDataArrived selectChildFromHistory(); } }); } }
Example #5
Source File: Bootstrapper.java From core with GNU Lesser General Public License v2.1 | 6 votes |
private void prepareSecurityContext(Scheduler.ScheduledCommand andThen) { // creates an empty (always true) security context for the bootstrap steps /*securityFramework.createSecurityContext(null, Collections.<String>emptySet(), false, new AsyncCallback<SecurityContext>() { @Override public void onFailure(Throwable caught) { andThen.execute(); } @Override public void onSuccess(SecurityContext result) { andThen.execute(); } });*/ andThen.execute(); }
Example #6
Source File: CubaFileUploadProgressWindow.java From cuba with Apache License 2.0 | 6 votes |
@Override protected void onAttach() { super.onAttach(); /* * When this window gets reattached, set the tabstop to the previous * state. */ setTabStopEnabled(doTabStop); // Fix for #14413. Any pseudo elements inside these elements are not // visible on initial render unless we shake the DOM. if (BrowserInfo.get().isIE8()) { closeBox.getStyle().setDisplay(Style.Display.NONE); Scheduler.get().scheduleFinally(new Command() { @Override public void execute() { closeBox.getStyle().clearDisplay(); } }); } }
Example #7
Source File: PinDialog.java From unitime with Apache License 2.0 | 6 votes |
public void checkEligibility(boolean online, boolean sectioning, Long sessionId, Long studentId, PinCallback callback, AcademicSessionInfo session) { iOnline = online; iSectioning = sectioning; iSessionId = sessionId; iStudentId = studentId; iCallback = callback; if (session != null) { setText(MESSAGES.dialogPinForSession(session.getTerm(), session.getYear())); iPinLabel.setText(MESSAGES.pinForSession(session.getTerm(), session.getYear())); } else { setText(MESSAGES.dialogPin()); iPinLabel.setText(MESSAGES.pin()); } iPin.setText(""); center(); Scheduler.get().scheduleDeferred(new ScheduledCommand() { @Override public void execute() { iPin.setFocus(true); } }); }
Example #8
Source File: InteractionCoordinator.java From core with GNU Lesser General Public License v2.1 | 5 votes |
/** * Find and activate another IU. * Can delegate to another context (i.e. gwtp placemanager) or handle it internally (same dialog) * * @param event */ @Override public void onNavigationEvent(NavigationEvent event) { QName source = (QName)event.getSource(); QName target = event.getTarget(); //System.out.println("Navigate to " + target); InteractionUnit targetUnit = dialog.findUnit(target); if(targetUnit!=null) // local to dialog { Procedure activateProcedure = procedures.getSingle(CommonQNames.ACTIVATION_ID); activateProcedure.getCommand().execute(dialog, target); } else // absolute, external { navigationDelegate.onNavigation(dialog.getId(), target); // TODO: dialog || unit as source? } Scheduler.get().scheduleDeferred(new Scheduler.ScheduledCommand() { @Override public void execute() { InteractionCoordinator.this.reset(); } }); }
Example #9
Source File: DigitalObjectEditor.java From proarc with GNU General Public License v3.0 | 5 votes |
private void openEditor() { Scheduler.get().scheduleDeferred(new ScheduledCommand() { @Override public void execute() { openEditorImpl(); } }); }
Example #10
Source File: DigitalObjectNavigateAction.java From proarc with GNU General Public License v3.0 | 5 votes |
/** * Postpones {@link #fetchSiblings(java.lang.String, java.lang.String) fetch} * to force RPCManager to notify user with the request prompt. The invocation * from ResultSet's DataArrivedHandler ignores prompt settings and ResultSet * does not provide possibility to declare the prompt. */ private void scheduleFetchSiblings(final String parentPid, final String pid) { Scheduler.get().scheduleDeferred(new ScheduledCommand() { @Override public void execute() { fetchSiblings(parentPid, pid); } }); }
Example #11
Source File: CourseRequestsConfirmationDialog.java From unitime with Apache License 2.0 | 5 votes |
@Override public void center() { super.center(); if (iMessage != null && !iMessage.isEmpty()) AriaStatus.getInstance().setText(ARIA.dialogOpened(getText()) + " " + iMessage + " " + ARIA.confirmationEnterToAcceptEscapeToReject()); Scheduler.get().scheduleDeferred(new ScheduledCommand() { @Override public void execute() { if (iNote != null) iNote.setFocus(true); else iYes.setFocus(true); } }); }
Example #12
Source File: SystemErrorHandler.java From flow with Apache License 2.0 | 5 votes |
/** * Shows the session expiration notification. * * @param details * message details or null if there are no details */ public void handleSessionExpiredError(String details) { // Run asynchronously to guarantee that all executions in the Uidl are // done (#7581) Scheduler.get() .scheduleDeferred(() -> handleUnrecoverableError(details, registry.getApplicationConfiguration() .getSessionExpiredError())); }
Example #13
Source File: InputList.java From putnami-web-toolkit with GNU Lesser General Public License v3.0 | 5 votes |
private void resetFocusHandler() { this.registrationCollection.removeHandler(); boolean hasError = this.hasErrors(); if (!hasError && !this.focused) { this.setTabIndex(0); this.registrationCollection.add(this.addFocusHandler(this)); } else if (hasError && !this.focused) { this.setTabIndex(-1); if (this.input instanceof HasFocusHandlers) { this.registrationCollection.add(((HasFocusHandlers) this.input).addFocusHandler(this)); } } else { this.setTabIndex(-1); if (this.input instanceof HasBlurHandlers) { this.registrationCollection.add(((HasBlurHandlers) this.input).addBlurHandler(this)); } Scheduler.get().scheduleDeferred(new ScheduledCommand() { @Override public void execute() { if (InternalListItem.this.input instanceof Focusable) { ((Focusable) InternalListItem.this.input).setFocus(true); } } }); } }
Example #14
Source File: ColumnServerView.java From core with GNU Lesser General Public License v2.1 | 5 votes |
@Override public Widget createWidget() { Widget widget = splitlayout.asWidget(); Scheduler.get().scheduleDeferred(new Scheduler.ScheduledCommand() { @Override public void execute() { config.updateFrom(configLinks, false); } }); return widget; }
Example #15
Source File: SecurityFrameworkImpl.java From core with GNU Lesser General Public License v2.1 | 5 votes |
private void notifyWidgets(SecurityContextChangedEvent event, final String token) { if(event.getPostContruct()!=null) event.getPostContruct().execute(); Scheduler.get().scheduleDeferred(new Scheduler.ScheduledCommand() { @Override public void execute() { forceUpdate(token); } }); }
Example #16
Source File: SampleDecorator.java From putnami-web-toolkit with GNU Lesser General Public License v3.0 | 5 votes |
protected void addSources(Multimap<String, String> sources) { Panel panelToOpen = null; String sourceToOpen = null; this.sourceAccordion.clear(); for (String panelName : sources.keySet()) { List sourceList = new List(); sourceList.setType(Type.LIST); for (String source : sources.get(panelName)) { if (sourceToOpen == null) { sourceToOpen = source; } sourceList.add(new SourceItem(source)); } Panel sourcePanel = new Panel(); if (panelToOpen == null) { panelToOpen = sourcePanel; } sourcePanel.add(new Header(panelName)); sourcePanel.add(sourceList); this.sourceAccordion.add(sourcePanel); } this.requestFile(sourceToOpen); final Panel toOpen = panelToOpen; Scheduler.get().scheduleDeferred(new ScheduledCommand() { @Override public void execute() { toOpen.setCollapse(false); } }); }
Example #17
Source File: EnrollmentConfirmationDialog.java From unitime with Apache License 2.0 | 5 votes |
@Override public void center() { super.center(); AriaStatus.getInstance().setText(ARIA.dialogOpened(getText())); Scheduler.get().scheduleDeferred(new ScheduledCommand() { @Override public void execute() { iNo.setFocus(true); } }); }
Example #18
Source File: FinderColumn.java From core with GNU Lesser General Public License v2.1 | 5 votes |
/** * Central point for security context changes * This will be called when: * * a) the widget is attached (default) * b) the security context changes (i.e. scoped roles) * */ private void applySecurity(final SecurityContext securityContext, boolean update) { // System.out.println("<< Process SecurityContext on column "+title+": "+securityContext+">>"); // calculate accessible menu items filterNonPrivilegeOperations(securityContext, accessibleTopMenuItems, topMenuItems); filterNonPrivilegeOperations(securityContext,accessibleMenuItems, menuItems); // the top menu is build here if(!plain) buildTopMenu(headerMenu); // the row level menu is build when the celltable is filled // hence we need to refresh it toggleRowLevelTools(() -> true); // hide it Scheduler.get().scheduleDeferred(new Scheduler.ScheduledCommand() { @Override public void execute() { dataProvider.refresh(); Scheduler.get().scheduleDeferred(new Scheduler.ScheduledCommand() { @Override public void execute() { toggleRowLevelTools(() -> selectionModel.getSelectedObject() == null); // show when selected } }); } }); }
Example #19
Source File: MaterialDialog.java From gwt-material with Apache License 2.0 | 5 votes |
/** * Open modal with additional properties * * @param e - Modal Component * @param fireEvent - Flag whether this component fires Open Event */ protected void open(Element e, boolean fireEvent) { this.open = true; options.complete = () -> onNativeClose(true, true); options.ready = () -> onNativeOpen(fireEvent); $(e).openModal(options); Scheduler.get().scheduleDeferred(() -> $(getElement()).focus()); }
Example #20
Source File: HostPropertiesPresenter.java From core with GNU Lesser General Public License v2.1 | 5 votes |
@Override protected void onAction(Action action) { Scheduler.get().scheduleDeferred(new Scheduler.ScheduledCommand() { @Override public void execute() { loadProperties(); } }); }
Example #21
Source File: CommandFactory.java From core with GNU Lesser General Public License v2.1 | 5 votes |
/** * TODO: This is considered a temporary solution. * * It's difficult to manage the states of all interaction units after modification to the model. * This is a very naive and pragmatic approach with certain (usability) drawbacks. * * @param context */ private void clearReset(final OperationContext context) { context.getCoordinator().clearStatement(context.getUnit().getId(), "selected.entity"); Scheduler.get().scheduleDeferred(new Scheduler.ScheduledCommand() { @Override public void execute() { context.getCoordinator().reset(); } }); }
Example #22
Source File: MaterialSideNavDrawer.java From gwt-material with Apache License 2.0 | 5 votes |
/** * Provides an overlay / drawer sidenav that will float on top of the content not the navbar without * any grey overlay behind it. */ protected void applyDrawerWithHeader() { setType(SideNavType.DRAWER_WITH_HEADER); applyBodyScroll(); if (isShowOnAttach()) { Scheduler.get().scheduleDeferred(() -> { pushElement(getHeader(), 0); pushElement(getMain(), 0); }); } overlayOption.setVisibility(Style.Visibility.HIDDEN); }
Example #23
Source File: RunAsRoleTool.java From core with GNU Lesser General Public License v2.1 | 5 votes |
public void setScopedRoles(final Set<String> serverGroupScoped, final Set<String> hostScoped) { Scheduler.get().scheduleDeferred(new Scheduler.ScheduledCommand() { @Override public void execute() { initRoles(serverGroupScoped, hostScoped); String savedRole = Preferences.get(RUN_AS_ROLE); if (savedRole != null) { role.setValue(savedRole); } } }); }
Example #24
Source File: FilterBox.java From unitime with Apache License 2.0 | 5 votes |
@Override public void onBrowserEvent(Event event) { Element target = DOM.eventGetTarget(event); switch (DOM.eventGetType(event)) { case Event.ONMOUSEDOWN: boolean open = iFilterOpen.getElement().equals(target); boolean close = iFilterClose.getElement().equals(target); boolean clear = iFilterClear.getElement().equals(target); boolean filter = iFilter.getElement().equals(target); if (isFilterPopupShowing() || close) { hideFilterPopup(); } else if (open) { hideSuggestions(); showFilterPopup(); } if (clear) { iFilter.setText(""); removeAllChips(); setAriaLabel(toAriaString()); ValueChangeEvent.fire(FilterBox.this, getValue()); } if (!filter) { event.stopPropagation(); event.preventDefault(); Scheduler.get().scheduleDeferred(new ScheduledCommand() { @Override public void execute() { iFilter.setFocus(true); } }); } break; } }
Example #25
Source File: MaterialSearch.java From gwt-material with Apache License 2.0 | 5 votes |
public void close(boolean fireEvents) { setActive(false); if (fireEvents) { Scheduler.get().scheduleDeferred(() -> $(valueBoxBase.getElement()).blur()); CloseEvent.fire(MaterialSearch.this, getText()); } }
Example #26
Source File: Auth.java From requestor with Apache License 2.0 | 5 votes |
Auth(TokenStore tokenStore, Clock clock, UrlCodex urlCodex, Scheduler scheduler, String oauthWindowUrl) { this.tokenStore = tokenStore; this.clock = clock; this.urlCodex = urlCodex; this.scheduler = scheduler; this.oauthWindowUrl = oauthWindowUrl; }
Example #27
Source File: DomainRuntimeView.java From core with GNU Lesser General Public License v2.1 | 5 votes |
@Override public void setPreview(final SafeHtml html) { if (presenter.getPlaceManager().getCurrentPlaceRequest().getNameToken().equals(serverColumn.getToken())) { Scheduler.get().scheduleDeferred(() -> { contentCanvas.clear(); contentCanvas.add(new ScrollPanel(new HTML(html))); }); } }
Example #28
Source File: DomainDeploymentFinderView.java From core with GNU Lesser General Public License v2.1 | 5 votes |
@Override public void setPreview(final SafeHtml html) { Scheduler.get().scheduleDeferred(() -> { contentCanvas.clear(); contentCanvas.add(new ScrollPanel(new HTML(html))); }); }
Example #29
Source File: ConfigurePage.java From core with GNU Lesser General Public License v2.1 | 5 votes |
void reset() { configureStatus.setVisible(false); form.clearValues(); form.setEnabled(true); portItem.setValue(9990); Scheduler.get().scheduleDeferred(new Scheduler.ScheduledCommand() { @Override public void execute() { nameItem.getInputElement().focus(); } }); }
Example #30
Source File: StepConnector.java From gantt with Apache License 2.0 | 5 votes |
@Override public void onStateChanged(StateChangeEvent stateChangeEvent) { super.onStateChanged(stateChangeEvent); if (!(getParent() instanceof GanttConnector)) { return; } if (gantt == null) { gantt = getGanttConnector().getWidget(); } if (stateChangeEvent.hasPropertyChanged("step")) { updatePredecessorWidgetReference();// need to be called before // setStep getWidget().setStep(getState().step); } if (!getWidget().getElement().hasParentElement()) { gantt.addStep(getStepIndex(), getWidget(), true); } getWidget().updateWidth(); Scheduler.get().scheduleDeferred(new ScheduledCommand() { @Override public void execute() { getWidget().updatePredecessor(); GanttConnector ganttConnector = getGanttConnector(); for (StepWidget stepWidget : ganttConnector.findRelatedSteps(getState().step, ganttConnector.getChildComponents())) { stepWidget.updatePredecessor(); } } }); }