void () { if (myProject.isDisposed()) { return; } long count = counter.incrementAndGet(); EdtExecutorService.getScheduledExecutorInstance().schedule(() -> { // is this request still actual after 10 ms? if (count != counter.get()) { return; } ProjectView view = myProject.isDisposed() ? null : ProjectView.getInstance(myProject); if (view == null) { return; } myFilters.set(map(myDependencyValidationManager, myNamedScopeManager)); String currentId = view.getCurrentViewId(); String currentSubId = getSubId(); // update changes subIds if needed view.removeProjectPane(ScopeViewPane.this); view.addProjectPane(ScopeViewPane.this); if (currentId == null) { return; } if (currentId.equals(getId())) { // try to restore selected subId view.changeView(currentId, currentSubId); } else { view.changeView(currentId); } }, 10, MILLISECONDS); }