Package org.sylfra.idea.plugins.revu.model

Examples of org.sylfra.idea.plugins.revu.model.Review


    if ((context == null) || (subId == null))
    {
      return false;
    }

    Review review = reviewManager.getReviewByName(subId);
    return (review != null) && (fileScopeManager.belongsToScope(myProject, review, context.getVirtualFile()));
  }
View Full Code Here


    {
        Boolean aBoolean = revisionHighlight.get(number);
        if (null == aBoolean) {
            aBoolean = true;
            if (number != null) {
                Review review = RevuUtils.getReviewingReview(project);
                if (review != null) {
                    if (!fileScopeManager.matchFrom(project, review.getFileScope(), vFile, number)) {
                        aBoolean = false;
                    }
                }
            } else {
                aBoolean = false;
View Full Code Here

  {
    Map<String, ReviewExtendedDepth> reviewByNames = new HashMap<String, ReviewExtendedDepth>(relativePaths.size());
    for (String relativePath : relativePaths)
    {
      File file = RevuVfsUtils.findFileFromRelativePath(project, relativePath);
      Review review = reviewsByFiles.get(file);
      if (review == null)
      {
        review = new Review();
        review.setFile(file);
      }

      if (load(review, true))
      {
        ReviewExtendedDepth reviewExtendedDepth = new ReviewExtendedDepth(review, 0);
        reviewByNames.put(review.getName(), reviewExtendedDepth);
      }
    }

    List<ReviewExtendedDepth> reviewExtendedDepths = new ArrayList<ReviewExtendedDepth>(reviewByNames.values());
    for (ReviewExtendedDepth reviewExtendedDepth : reviewExtendedDepths)
    {
      Review review = reviewExtendedDepth.review;
      if (review.getExtendedReview() != null)
      {
        try
        {
          checkCyclicLink(review, review.getExtendedReview());
        }
        catch (RevuException e)
        {
          LOGGER.warn("Cyclic link: " + review.getFile(), e);
          fireReviewLoadFailed(e, review.getFile());
        }

        while ((review != null) && (review.getExtendedReview() != null))
        {
          reviewExtendedDepth.depth++;
          review = reviewsByNames.get(review.getExtendedReview().getName());
        }
      }
    }

    Collections.sort(reviewExtendedDepths, new Comparator<ReviewExtendedDepth>()
View Full Code Here

    {
      enabled = false;
    }
    else
    {
      Review review = currentIssue.getReview();
      User user = RevuUtils.getCurrentUser(review);
      enabled = (user != null) &&
        (RevuUtils.isActive(review) && user.hasRole(User.Role.REVIEWER) || (user.hasRole(User.Role.ADMIN)));
    }
View Full Code Here

        RevuBundle.message("friendlyError.externalizing.cyclicReview.details.text",
          main.getFile(), main.getName(),
          extendedRoot.getFile(), extendedRoot.getName()));
    }

    Review extendedChild2;
    while ((extendedChild2 = extendedChild.getExtendedReview()) != null)
    {
      checkCyclicLink(main, extendedRoot, extendedChild2);
    }
  }
View Full Code Here

        @Override
        public void contentsChanged(VirtualFileEvent event)
        {
          VirtualFile vFile = event.getFile();

          Review review = reviewManager.getReviewByFile(new File(vFile.getPath()));
          if ((review != null)
            && (vFile.getTimeStamp() > reviewManager.getLastSavedTStamp(review))
            && (!reviewManager.isSaving(review)))
          {
            if (Messages.showOkCancelDialog(project,
              RevuBundle.message("general.reviewFileChanged.text", review.getName()),
              RevuBundle.message("general.reviewFileChanged.title"),
              Messages.getWarningIcon()) == DialogWrapper.OK_EXIT_CODE)
            {
              reviewManager.load(review, false);
              reviewManager.fireReviewChanged(review);
            }
          }
        }

        @Override
        public void fileDeleted(VirtualFileEvent event)
        {
          VirtualFile vFile = event.getFile();
          Review review = reviewManager.getReviewByFile(new File(vFile.getPath()));
          if (review != null)
          {
            reviewManager.removeReview(review);
          }
        }
View Full Code Here

      messageBusConnection.subscribe(AppTopics.FILE_DOCUMENT_SYNC, fileDocumentManagerListener);
    }

    private void pathChanged(VirtualFile vFile, String oldPath)
    {
      Review review = reviewManager.getReviewByFile(new File(oldPath));
      if (review != null)
      {
        reviewManager.reviewFileChanged(review, vFile);
      }
    }
View Full Code Here

    if ((filePath == null) || (!vcs.fileIsUnderVcs(filePath)))
    {
      return;
    }

    Review review = RevuUtils.getReviewingReview(project);

    VcsRevisionNumber revision;
    if (review.getFileScope().getVcsAfterRev() != null)
    {
      revision = vcs.parseRevisionNumber(review.getFileScope().getVcsAfterRev());
    }
    else
    {
      ItemLatestState itemLatestState = vcs.getDiffProvider().getLastRevision(vFile);
      if (itemLatestState == null)
View Full Code Here

    if (project == null)
    {
      return;
    }

    Review review = RevuUtils.getReviewingReview(project);
    if (review == null)
    {
      e.getPresentation().setText(RevuBundle.message("reviewing.comparewith.template.text"));
      e.getPresentation().setEnabled(false);
    }
    else
    {
      e.getPresentation().setText(RevuBundle.message("reviewing.comparewith.review.text", review.getName()));
      VirtualFile vFile = e.getData(DataKeys.VIRTUAL_FILE);
      e.getPresentation().setEnabled((vFile != null)
        && RevuVcsUtils.isUnderVcs(project, vFile)
        && fileScopeManager.belongsToScope(project, review, vFile));
    }
View Full Code Here

{
  public void actionPerformed(AnActionEvent e)
  {
    JList liReviews = (JList) e.getData(DataKeys.CONTEXT_COMPONENT);
    DefaultListModel model = (DefaultListModel) liReviews.getModel();
    Review selectedReview = (Review) liReviews.getSelectedValue();

    // Check afferent link
    List<Review> afferentReviews = new ArrayList<Review>();
    for (int i=0; i<model.getSize(); i++)
    {
      Review review = (Review) model.get(i);
      if (selectedReview.equals(review.getExtendedReview()))
      {
        afferentReviews.add(review);
      }
    }

    String msgKey = afferentReviews.isEmpty()
      ? "projectSettings.confirmRemoveReview.text"
      : "projectSettings.confirmRemoveReviewWithAfferentLink.text";
    int result = Messages.showOkCancelDialog(liReviews,
      RevuBundle.message(msgKey, selectedReview.getName()),
      RevuBundle.message("projectSettings.confirmRemoveReview.title"),
      Messages.getWarningIcon());

    if (result == DialogWrapper.OK_EXIT_CODE)
    {
      model.removeElement(selectedReview);
      for (Review review : afferentReviews)
      {
        review.setExtendedReview(null);
      }
      liReviews.setSelectedIndex(0);
    }
  }
View Full Code Here

TOP

Related Classes of org.sylfra.idea.plugins.revu.model.Review

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.