void () { boolean wasCustom = myVcsConfiguration.USE_CUSTOM_SHELF_PATH; String prevPath = myVcsConfiguration.CUSTOM_SHELF_PATH; String customPath = FileUtil.toSystemIndependentName(myShelfDirectoryPath.getText()); boolean nowCustom = myUseCustomShelfDirectory.isSelected(); if (nowCustom && !checkAndIgnoreIfCreated(customPath)) { PopupUtil .showBalloonForComponent(myShelfDirectoryPath, VcsBundle.message("configurable.shelf.storage.cant.find.or.create.new.shelf.directory"), MessageType.WARNING, false, myProject); return; } myVcsConfiguration.USE_CUSTOM_SHELF_PATH = nowCustom; myVcsConfiguration.CUSTOM_SHELF_PATH = customPath; myVcsConfiguration.MOVE_SHELVES = myMoveShelvesCheckBox.isSelected(); Path fromFile = wasCustom ? Paths.get(prevPath) : getDefaultShelfPath(myProject); Path toFile = nowCustom ? Paths.get(customPath) : getDefaultShelfPath(myProject); if (!FileUtil.pathsEqual(fromFile.toString(), toFile.toString())) { myProject.save(); if (wasCustom) { ApplicationManager.getApplication().saveSettings(); } ShelveChangesManager.getInstance(myProject).checkAndMigrateUnderProgress(fromFile.toFile(), toFile.toFile(), wasCustom); } super.doOKAction(); }