void () { setDownloadStatus(true); final Application application = ApplicationManager.getApplication(); application.executeOnPooledThread(() -> { try { myPackagesModel = new PackagesModel(myController.getAllPackages()); application.invokeLater(() -> { myPackages.setModel(myPackagesModel); ((MyPackageFilter)myFilter).filter(); doSelectPackage(mySelectedPackageName); setDownloadStatus(false); }, ModalityState.any()); } catch (final IOException e) { application.invokeLater(() -> { if (myMainPanel.isShowing()) { Messages.showErrorDialog(myMainPanel, IdeBundle.message("error.loading.package.list", e.getMessage()), IdeBundle.message("packages.title")); } LOG.info("Error initializing model", e); setDownloadStatus(false); }, ModalityState.any()); } }); }