private void returnConfirmationBack() { if (mySystemOperation) { final ProjectLevelVcsManager vcsManager = ProjectLevelVcsManager.getInstance(myProject); final VcsShowConfirmationOption addConfirmation = vcsManager.getStandardConfirmation(VcsConfiguration.StandardConfirmation.ADD, null); addConfirmation.setValue(myAddconfirmationvalue); final VcsShowConfirmationOption deleteConfirmation = vcsManager.getStandardConfirmation(VcsConfiguration.StandardConfirmation.REMOVE, null); deleteConfirmation.setValue(myDeleteconfirmationvalue); } }
public static boolean requestForConfirmation( @NotNull VcsShowConfirmationOption option, @NotNull Project project, @NotNull String message, @NotNull String title, @Nullable Icon icon, @Nullable String okActionName, @Nullable String cancelActionName) { if (option.getValue() == VcsShowConfirmationOption.Value.DO_NOTHING_SILENTLY) return false; final ConfirmationDialog dialog = new ConfirmationDialog( project, message, title, icon, option, okActionName, cancelActionName); if (!option.isPersistent()) { dialog.setDoNotAskOption(null); } else { dialog.setDoNotShowAgainMessage(CommonBundle.message("dialog.options.do.not.ask")); } dialog.show(); return dialog.isOK(); }
@Override protected void setToBeShown(boolean value, boolean onOk) { final VcsShowConfirmationOption.Value optionValue; if (value) { optionValue = VcsShowConfirmationOption.Value.SHOW_CONFIRMATION; } else { if (onOk) { optionValue = VcsShowConfirmationOption.Value.DO_ACTION_SILENTLY; } else { optionValue = VcsShowConfirmationOption.Value.DO_NOTHING_SILENTLY; } } myOption.setValue(optionValue); }
private void setConfirmationToDefault() { if (mySystemOperation) { final ProjectLevelVcsManager vcsManager = ProjectLevelVcsManager.getInstance(myProject); final VcsShowConfirmationOption addConfirmation = vcsManager.getStandardConfirmation(VcsConfiguration.StandardConfirmation.ADD, null); myAddconfirmationvalue = addConfirmation.getValue(); addConfirmation.setValue(VcsShowConfirmationOption.Value.DO_ACTION_SILENTLY); final VcsShowConfirmationOption deleteConfirmation = vcsManager.getStandardConfirmation(VcsConfiguration.StandardConfirmation.REMOVE, null); myDeleteconfirmationvalue = deleteConfirmation.getValue(); deleteConfirmation.setValue(VcsShowConfirmationOption.Value.DO_ACTION_SILENTLY); } }
@Override protected boolean isToBeShown() { return myOption.getValue() == VcsShowConfirmationOption.Value.SHOW_CONFIRMATION; }