Package org.sylfra.idea.plugins.revu.business

Examples of org.sylfra.idea.plugins.revu.business.ReviewManager$MetaReview


      {
        review.setExtendedReview(null);
      }
      else
      {
        ReviewManager reviewManager = getProject(context).getComponent(ReviewManager.class);
        review.setExtendedReview(reviewManager.getReviewByName(extendedReviewName));
      }
    }

    String status = reader.getAttribute("status");
    String shared = reader.getAttribute("shared");
View Full Code Here


        }
      }

      review.addIssue(issue);

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

    installListeners();
  }

  private void installListeners()
  {
    ReviewManager reviewManager = myProject.getComponent(ReviewManager.class);
    CustomReviewListener reviewListener = new CustomReviewListener();
    reviewManager.addReviewListener(reviewListener);
    for (Review review : reviewManager.getReviews(RevuUtils.getCurrentUserLogin(), VISIBLE_STATUSES_ARRAY))
    {
      reviewListener.reviewAdded(review);
    }

    myProject.getComponent(RevuWorkspaceSettingsComponent.class).addListener(new CustomWorkspaceSettingsListener());
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;
View Full Code Here

    {
      e.getPresentation().setEnabled(false);
      return;
    }

    ReviewManager reviewManager = project.getComponent(ReviewManager.class);
    Collection<Review> reviews = reviewManager.getReviews(RevuUtils.getCurrentUserLogin(), REVIEWABLE_STATUSES);

    SortedSet<StartReviewAction> actions = new TreeSet<StartReviewAction>();
    for (Review review : reviews)
    {
      if (RevuUtils.hasRole(review, User.Role.REVIEWER))
View Full Code Here

      review.removeIssue(issue);

      reviewsToSave.add(review);
    }

    ReviewManager reviewManager = project.getComponent(ReviewManager.class);
    for (Review review : reviewsToSave)
    {
      reviewManager.saveSilently(review);
    }
  }
View Full Code Here

   * {@inheritDoc}
   */
  @Override
  protected void apply(Map<Review, Review> items) throws ConfigurationException
  {
    ReviewManager reviewManager = project.getComponent(ReviewManager.class);
    List<Review> originalReviews = getOriginalItems();

    // Manage existing reviews
    List<String> projectReviewFiles = new ArrayList<String>();
    List<String> workspaceReviewFiles = new ArrayList<String>();
    for (Map.Entry<Review, Review> entry : items.entrySet())
    {
      Review editedReview = entry.getKey();
      Review originalReview = entry.getValue();
      if (editedReview.isEmbedded())
      {
        continue;
      }

      if (editedReview.isExternalizable())
      {
        String reviewFilePath = RevuVfsUtils.buildRelativePath(project, editedReview.getFile());

        if (editedReview.isShared()) {
          projectReviewFiles.add(reviewFilePath);
        } else {
          workspaceReviewFiles.add(reviewFilePath);
        }
      }

      // No change
      if ((originalReview != null) && (originalReview.equals(editedReview)))
      {
        continue;
      }

      // Change original review to avoid handling an obsolete instance
      if (originalReview == null)
      {
        originalReview = editedReview;
      }
      else
      {
        originalReview.copyFromTemplate(editedReview);
      }

      try
      {
        reviewManager.save(originalReview);
      }
      catch (Exception e)
      {
        LOGGER.warn(e);
        final String details = ((e.getLocalizedMessage() == null) ? e.toString() : e.getLocalizedMessage());
        throw new ConfigurationException(
          RevuBundle.message("projectSettings.error.save.title.text", originalReview.getName(), details),
          RevuBundle.message("general.plugin.title"));
      }
    }

    // Delete obsolete reviews
    for (Review review : originalReviews)
    {
      if (!items.containsValue(review))
      {
        reviewManager.removeReview(review);
      }
    }

    RevuProjectSettingsComponent projectSettingsComponent =
      project.getComponent(RevuProjectSettingsComponent.class);
View Full Code Here

    {
      nameAlreadyExists = false;
    }
    else
    {
      ReviewManager reviewManager = project.getComponent(ReviewManager.class);
      Review review = reviewManager.getReviewByName(tfName.getText());
      nameAlreadyExists = ((review != null)
        && review.isExternalizable()
        && data.isExternalizable()
        && (!FileUtil.filesEqual(review.getFile(), data.getFile())));
    }
View Full Code Here

    {
      this.project = project;
      reviews = new ArrayList<Review>(1);
      reviews.add(null);

      ReviewManager reviewManager = project.getComponent(ReviewManager.class);
      reviewManager.addReviewListener(this);
    }
View Full Code Here

    return RevuPlugin.PLUGIN_NAME + "." + getClass().getSimpleName();
  }

  public void initComponent()
  {
    ReviewManager reviewManager = project.getComponent(ReviewManager.class);
    for (Review review : reviewManager.getReviews())
    {
      review.addIssueListener(issueListener);
    }

    reviewManager.addReviewListener(reviewListener);

    EditorFactory.getInstance().addEditorFactoryListener(editorFactoryListener);

    project.getComponent(RevuWorkspaceSettingsComponent.class).addListener(workspaceSettingsListener);
  }
View Full Code Here

TOP

Related Classes of org.sylfra.idea.plugins.revu.business.ReviewManager$MetaReview

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.