public HandlerRegistration addWindowClosingHandler(ClosingHandler handler) { return Window.addWindowClosingHandler(handler); }
@Deprecated public static void add(WindowCloseListener listener) { WrapWindowClose handler = new WrapWindowClose(listener); Window.addWindowClosingHandler(handler); Window.addCloseHandler(handler); }
private void releaseLockOnClose() { closeHandler = Window.addWindowClosingHandler(new ClosingHandler() { @Override public void onWindowClosing(ClosingEvent event) { releaseLock(); } }); }
public HandlerRegistration addWindowClosingHandler(ClosingHandler handler) { return Window.addWindowClosingHandler(handler); }
public HandlerRegistration addWindowClosingHandler(ClosingHandler handler) { return Window.addWindowClosingHandler(handler); }
@Override public void setOnLeaveConfirmation(String question) { if (question == null && onLeaveQuestion == null) { return; } if (question != null && onLeaveQuestion == null) { windowClosingHandlerRegistration = Window.addWindowClosingHandler(this); } if (question == null) { windowClosingHandlerRegistration.removeHandler(); } onLeaveQuestion = question; }
@Inject protected AutoConfigBoot(final XmppConnection connection, final XmppSession session) { this.connection = checkNotNull(connection); this.session = checkNotNull(session); Scheduler.get().scheduleDeferred(this); Window.addWindowClosingHandler(this); }
@Deprecated public static void add(WindowCloseListener listener) { WrapWindowClose handler = new WrapWindowClose(listener); Window.addWindowClosingHandler(handler); Window.addCloseHandler(handler); }
@Deprecated public static void add(WindowCloseListener listener) { WrapWindowClose handler = new WrapWindowClose(listener); Window.addWindowClosingHandler(handler); Window.addCloseHandler(handler); }
/** * Ensures that a window closing warning is present when uploads are in progress. */ private void setWindowClosingHandler() { Window.addWindowClosingHandler(event -> { boolean isAnyPolling = uploadImageHandlers.stream().anyMatch( UploadImageHandler::isContinuePolling); if (isAnyPolling) { // If the window is closed, uploads will time out and pause event.setMessage(constants.uploadImageLeaveWindowPopupWarning()); } }); } }
public static Observable<Window.ClosingEvent> windowClosing() { return Observable.create(s -> register(s, Window.addWindowClosingHandler(s::onNext)), uiBackpressureMode()); }
public static Observable<Window.ClosingEvent> windowClosing() { return Observable.create(s -> register(s, Window.addWindowClosingHandler(s::onNext))); }
protected SearchApplicationContext(final SearchUIConfig uiConfig) { this.uiConfig = uiConfig; History.addValueChangeHandler( this ); SessionContext.INSTANCE.addListener( this ); Window.addWindowClosingHandler( new ClosingHandler() { @Override public void onWindowClosing(ClosingEvent event) { // store the current page params for the results page if they exist // as a cookie in case this is a refresh final String existingCookie = Cookies.getCookie( PAGE_PARAMS_COOKIE ); // remove the existing cookie if it exists if ( existingCookie != null ) { Cookies.removeCookie( PAGE_PARAMS_COOKIE ); } if ( currentResultsPageParams != null ) { // Set the expire date for 10 minutes from now final Date expires = new Date( ( new Date() ).getTime() + PAGE_REFRESH_EXPIRES ); Cookies.setCookie( PAGE_PARAMS_COOKIE, currentResultsPageParams, expires ); } } }); }
@Override public void execute() { if (!running) { running = true; if (unloadHandlerReg != null) { unloadHandlerReg.removeHandler(); } UnloadHandler handler = new UnloadHandler(); final HandlerRegistration reg1 = Window.addCloseHandler(handler); final HandlerRegistration reg2 = Window.addWindowClosingHandler(handler); unloadHandlerReg = new HandlerRegistration() { @Override public void removeHandler() { reg1.removeHandler(); reg2.removeHandler(); } }; doConnect(); } } });
private GwtCommandDispatcher() { locale = LocaleInfo.getCurrentLocale().getLocaleName(); if ("default".equals(locale)) { locale = null; } deferreds = new ArrayList<Deferred>(); service = (GeomajasServiceAsync) GWT.create(GeomajasService.class); setServiceEndPointUrl(GWT.getModuleBaseURL() + "geomajasService"); setUseLazyLoading(true); setShowError(true); Window.addWindowClosingHandler(new ClosingHandler() { public void onWindowClosing(ClosingEvent event) { GwtCommandDispatcher.getInstance().setShowError(false); // Cancel all outstanding requests: for (Deferred deferred : deferreds) { deferred.cancel(); } } }); }
@Override public void execute() { if (!running) { running = true; if (unloadHandlerReg != null) { unloadHandlerReg.removeHandler(); } UnloadHandler handler = new UnloadHandler(); final HandlerRegistration reg1 = Window.addCloseHandler(handler); final HandlerRegistration reg2 = Window.addWindowClosingHandler(handler); unloadHandlerReg = new HandlerRegistration() { @Override public void removeHandler() { reg1.removeHandler(); reg2.removeHandler(); } }; doConnect(); } } });
@Inject public NavigationHandler(final EventBus eventBus, final @Root Frame root) { this.eventBus = eventBus; this.root = root; eventBus.addListener(NAVIGATION_REQUESTED, new Listener<NavigationEvent>() { @Override public void handleEvent(NavigationEvent be) { onNavigationRequested(be); } }); Log.debug("PageManager: connected to EventBus and listening."); if(GWT.isClient()) { Window.addWindowClosingHandler(new Window.ClosingHandler() { @Override public void onWindowClosing(Window.ClosingEvent event) { if (activeNavigation != null && activeNavigation.currentPage != null) { event.setMessage(activeNavigation.currentPage.beforeWindowCloses()); } } }); } }
private Operation<Void> showUI() { return aVoid -> { standardComponentsInitializerProvider.get().initialize(); showRootPresenter(); // Bind browser's window events Window.addWindowClosingHandler(event -> eventBus.fireEvent(createWindowClosingEvent(event))); Window.addCloseHandler(event -> eventBus.fireEvent(createWindowClosedEvent())); }; }
com.google.gwt.user.client.Window.addWindowClosingHandler(new ClosingHandler() { @Override public void onWindowClosing(ClosingEvent event) {
Window.addWindowClosingHandler(new ClosingHandler() {