Collection<VirtualFile> (@NotNull Collection<? extends VirtualFile> files) { ChangeListManager changeListManager = ChangeListManager.getInstance(myProject); ChangelistConflictTracker conflictTracker = ChangelistConflictTracker.getInstance(myProject); ChangelistConflictTracker.Options options = conflictTracker.getOptions(); if (!options.SHOW_DIALOG) { return Collections.emptyList(); } ArrayList<VirtualFile> denied = new ArrayList<>(); for (VirtualFile file : files) { if (file != null && !conflictTracker.isWritingAllowed(file)) { denied.add(file); } } if (!denied.isEmpty()) { HashSet<ChangeList> changeLists = new HashSet<>(); ArrayList<Change> changes = new ArrayList<>(); for (VirtualFile file : denied) { changeLists.add(changeListManager.getChangeList(file)); changes.add(changeListManager.getChange(file)); } ChangelistConflictDialog dialog; final int savedEventCount = IdeEventQueue.getInstance().getEventCount(); do { dialog = new ChangelistConflictDialog(myProject, new ArrayList<>(changeLists), denied); dialog.show(); } while (dialog.isOK() && !dialog.getResolution().resolveConflict(myProject, changes, null)); IdeEventQueue.getInstance().setEventCount(savedEventCount); if (dialog.isOK()) { options.LAST_RESOLUTION = dialog.getResolution(); return Collections.emptyList(); } } return denied; }