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

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


  }

  @NotNull
  protected User retrieveUser(@NotNull UnmarshallingContext context, @Nullable String login)
  {
    Review review = getReview(context);

    return RevuUtils.getNonNullUser(review.getDataReferential(), login);
  }
View Full Code Here


    return contentPane;
  }

  protected List<Object> retrieveItemsForReview()
  {
    Review review = getReview();

    boolean includeNoneValue = false;
    SortedSet<T> set = new TreeSet<T>();
    for (Issue issue : review.getIssues())
    {
      List<T> users = retrieveItemsForIssue(issue);
      if (users.isEmpty())
      {
        includeNoneValue = true;
View Full Code Here

    if (project == null)
    {
      return;
    }

    Review reviewingReview = RevuUtils.getReviewingReview(project);
    if (reviewingReview != null)
    {
      e.getPresentation().setText(RevuBundle.message("reviewing.stopReviewing.review.text", reviewingReview.getName()));
      e.getPresentation().setVisible(true);
    }
    else
    {
      e.getPresentation().setVisible(false);
View Full Code Here

  @Override
  public void actionPerformed(AnActionEvent e)
  {
    Project project = e.getData(PlatformDataKeys.PROJECT);

    Review review = RevuUtils.getReviewingReview(project);
    if (review == null)
    {
      return;
    }

    review.setStatus(ReviewStatus.FIXING);
    project.getComponent(ReviewManager.class).saveChanges(review);

    RevuWorkspaceSettingsComponent workspaceSettingsComponent =
      project.getComponent(RevuWorkspaceSettingsComponent.class);
    RevuWorkspaceSettings workspaceSettings = workspaceSettingsComponent.getState();
View Full Code Here

{
  public void actionPerformed(AnActionEvent e)
  {
    JList liReviews = (JList) e.getData(PlatformDataKeys.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

public class ShowFileScopeAction extends AnAction
{
  public void actionPerformed(AnActionEvent e)
  {
    Project project = e.getData(PlatformDataKeys.PROJECT);
    Review review = e.getData(RevuDataKeys.REVIEW);

    if ((project == null) || (review == null))
    {
      return;
    }

    ProjectViewSelectInTarget.select(project, this, RevuProjectViewPane.ID, review.getName(), null, true);
  }
View Full Code Here

    IssueDialog dialog = new IssueDialog(project, true);
    dialog.show(issue);
    if ((dialog.isOK()) && dialog.updateData(issue))
    {
      Review review = issue.getReview();

      assert (RevuUtils.getCurrentUserLogin() != null) : "Login should be set";

      issue.setHistory(RevuUtils.buildHistory(review));

      if (RevuVcsUtils.fileIsModifiedFromVcs(project, vFile))
      {
        issue.setLocalRev(String.valueOf(System.currentTimeMillis()));
      }

      if (issue.getFile() != null)
      {
        VcsRevisionNumber vcsRev = RevuVcsUtils.getVcsRevisionNumber(project, issue.getFile());
        if (vcsRev != null)
        {
          issue.setVcsRev(vcsRev.toString());
        }
      }

      review.addIssue(issue);

      ReviewManager reviewManager = project.getComponent(ReviewManager.class);
      reviewManager.saveSilently(review);
    }
  }
View Full Code Here

    if (project == null)
    {
      return;
    }

    Review review = RevuUtils.getReviewingReview(project);
    if (review == null)
    {
      e.getPresentation().setText(RevuBundle.message("reviewing.annotate.template.text"));
      e.getPresentation().setEnabled(false);
    }
    else
    {
      e.getPresentation().setText(RevuBundle.message("reviewing.annotate.review.text", review.getName()));

      VirtualFile vFile = e.getData(PlatformDataKeys.VIRTUAL_FILE);
      e.getPresentation().setEnabled((vFile != null)
        && RevuVcsUtils.isUnderVcs(project, vFile)
        && fileScopeManager.belongsToScope(project, review, vFile));
View Full Code Here

    VirtualFile vFile = fileChooser.selectFileToOpen(
      RevuVfsUtils.findFile(RevuUtils.getWorkspaceSettings(project).getLastSelectedReviewDir()));
    if (vFile != null)
    {
      ReviewManager reviewManager = project.getComponent(ReviewManager.class);
      Review review = reviewManager.getReviewByFile(new File(vFile.getPath()));
      if (review != null)
      {
        Messages.showWarningDialog(project,
          RevuBundle.message("projectSettings.review.import.fileAlreadyExists.text", review.getName()),
          RevuBundle.message("projectSettings.review.import.error.title"));
        return;
      }

      //@TODO check path outside from project
      review = new Review();
      review.setFile(new File(vFile.getPath()));

      if (!reviewManager.load(review, false))
      {
        return;
      }

      if (reviewManager.getReviewByName(review.getName()) != null)
      {
        Messages.showWarningDialog(project,
          RevuBundle.message("projectSettings.review.import.nameAlreadyExists.text", review.getName()),
          RevuBundle.message("projectSettings.review.import.error.title"));
        return;
      }

      final RevuProjectSettingsForm form = project.getComponent(RevuProjectSettingsForm.class);
View Full Code Here

        if (reviewName == null)
        {
          return;
        }

        Review review = project.getComponent(ReviewManager.class).getReviewByName(reviewName);
        if (review != null)
        {
          FileStatus fileStatus = retrieveFileStatus(review, vFile);
          textAttributes.setForegroundColor(fileStatus.getColor());
        }
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.