public void cancel() { connectionTaskWrapper.cancel(); }
public void asyncReloadAppFolders() { if (appFoldersTree == null) return; folderUpdateBackgroundTaskWrapper.restart(); }
public CubaFoldersPane() { setSizeFull(); setMargin(false); setSpacing(true); setStyleName(C_FOLDERS_PANE); //noinspection unchecked folderUpdateBackgroundTaskWrapper = new BackgroundTaskWrapper(new AppFolderUpdateBackgroundTask(10)); }
connectionTaskWrapper = new BackgroundTaskWrapper<>(connectionTask);
@Override protected boolean preClose(String actionId) { connectionTaskWrapper.cancel(); return super.preClose(actionId); }
public void execute() { Integer limit = entityLimitField.getValue(); if (limit != null && limit <= 0) { showNotification(getMessage("entityLimitWarning"), WARNING); return; } executeProgressBar.setIndeterminate(true); connectionTaskWrapper.restart(); }
/** * Cancel running task if there is at the moment. * Launch it again. */ public void restart() { cancel(); Objects.requireNonNull(task, "Task must be specified either in constructor or by passing it to restart() method"); taskHandler = backgroundWorker.handle(task); taskHandler.execute(); }
/** * Cancel running task if there is at the moment. * Launch new task specified as parameter. * * @param task task to start, also will be saved for future restarts */ public void restart(BackgroundTask<T, V> task) { cancel(); this.task = task; taskHandler = backgroundWorker.handle(task); taskHandler.execute(); }