public ReturnResult beforeCheckin()

in src/net/sourceforge/transparent/Checkin/CCaseCheckinHandler.java [26:59]


  public ReturnResult beforeCheckin()
  {
    Collection<VirtualFile> files = panel.getVirtualFiles();
    Set<VirtualFile> set = new HashSet<>();

    //  Add those folders which are renamed and are parents for the files
    //  marked for checkin.
    for( VirtualFile file : files )
    {
      for( String newFolderName : host.renamedFolders.keySet() )
      {
        if( file.getPath().startsWith( newFolderName ) )
        {
          VirtualFile parent = VcsUtil.getVirtualFile( newFolderName );
          set.add( parent );
        }
      }
    }

    //  Remove all folders which are marked for checkin, leave only those
    //  which are absent in the list.
    for( VirtualFile file : files )
      set.remove( file );

    if( set.size() > 0 )
    {
      int result = Messages.showOkCancelDialog( "Renamed folder(s) for committed file(s) will be added to the changelist",
                                                "Change list is incomplete", Messages.getWarningIcon() );
      if (result != Messages.OK) {
        return ReturnResult.CANCEL;
      }
    }
    return ReturnResult.COMMIT;
  }