/** * Runs the task in the background if it can. * * @param task Task that will create an issue on Github * @param direct {@code true} to run directly with {@link Task#run(ProgressIndicator)}; {@code false} to run with * the {@link com.intellij.openapi.project.ProjectManager}. */ private static void run(Task task, boolean direct) { if (direct) { task.run(new EmptyProgressIndicator()); } else { ProgressManager.getInstance().run(task); } }
private boolean doFetchRemote(@NotNull BranchInfo branch) { if (branch.getName() == null) { return false; } GitFetchResult result = new GitFetcher(project, new EmptyProgressIndicator(), false).fetch(gitRepository.getRoot(), branch.getRemoteName(), null); if (!result.isSuccess()) { GitFetcher.displayFetchResult(project, result, null, result.getErrors()); return false; } return true; }
private void checkForUpdates() { UpdateSettings.getInstance().setCheckNeeded(true); UpdateSettings.getInstance().forceCheckForUpdateAfterRestart(); ApplicationManager.getApplication().executeOnPooledThread(() -> { Collection<PluginDownloader> availableUpdates = UpdateChecker.getPluginUpdates(); if (availableUpdates == null) { LOG.info("Some plugin updates found"); return; } PluginDownloader pluginDownloader = availableUpdates.stream() .filter(downloader -> HybrisConstants.PLUGIN_ID.equals(downloader.getPluginId())) .findAny().orElse(null); if (pluginDownloader == null) { LOG.info("Hybris integration plugin update not found"); return; } LOG.info("Hybris integration plugin update available"); if (UpdateInstaller.installPluginUpdates(availableUpdates, new EmptyProgressIndicator())) { LOG.info("Hybris integration plugin update succeeded"); } else { LOG.info("Hybris integration plugin update failed"); } }); }
boolean proceed = UnusedSymbolUtil.processUsages(project, memberFile, member, new EmptyProgressIndicator(), null, info -> { PsiElement element = info.getElement(); if (element == null) {
new AnonymousFeedbackTask(project, ErrorReportBundle.message("report.error.progress.dialog.text"), true, reportValues, notifyingCallback); if (project == null) { task.run(new EmptyProgressIndicator()); } else { ProgressManager.getInstance().run(task);
errorCallback); if (project == null) { task.run(new EmptyProgressIndicator()); } else { ProgressManager.getInstance().run(task);