public void actionPerformed()

in src/com/intellij/vssSupport/actions/CheckoutAction.java [71:121]


  public void actionPerformed( AnActionEvent e )
  {
    boolean isActionProduces = false;
    Project project = e.getData( CommonDataKeys.PROJECT );
    VirtualFile[] files = VssUtil.getVirtualFiles( e );
    ArrayList<VcsException> errors = new ArrayList<>();

    UpdatedFiles updatedFiles = UpdatedFiles.create();
    initializeGroups( updatedFiles );
    try
    {
      boolean showOptions = VssVcs.getInstance( project ).getCheckoutOptions().getValue();
      if( showOptions || isShiftPressed( e ) ) {
        OptionsDialog editor;
        editor = allFilesAreFolders(files) ? new CheckoutDirDialog(project) :
                 new CheckoutFilesDialog(project);
        editor.setTitle((files.length == 1) ? VssBundle.message("dialog.title.check.out.file", files[0].getName()) :
                        VssBundle.message("dialog.title.check.out.multiple"));
        if (!editor.showAndGet()) {
          return;
        }
      }

      isActionProduces = true;
      performActionOnFiles( files, project, updatedFiles, errors );
    }
    finally
    {
      if( isActionProduces )
      {
        /**
         * Show errors only once - collect information on checkout failures and
         * show the batch of messages in the toolwindow. This overall scheme
         * allows to successfully checkout all possible files without interruption.
         */
        if( !errors.isEmpty() && files.length == 1 )
        {
          String errMessage = VssBundle.message( "message.text.file.checked.out.failed" );
          Messages.showErrorDialog( errors.get( 0 ).getMessage(), errMessage );
        }
        else
        {
          ProjectLevelVcsManager.getInstance( project ).showProjectOperationInfo(
            updatedFiles, VssBundle.message("dialog.title.check.out.results" ) );
        }

        updateStatuses( updatedFiles.getGroupById( SUCCESS_GROUP_ID ).getFiles() );
        refreshRO( files );
      }
    }
  }