Exemplo n.º 1
0
    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);
      }
    }
 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 boolean isToBeShown() {
   return myOption.getValue() == VcsShowConfirmationOption.Value.SHOW_CONFIRMATION;
 }