Package org.sylfra.idea.plugins.revu.externalizing

Examples of org.sylfra.idea.plugins.revu.externalizing.IReviewExternalizer


    return result;
  }

  public boolean load(@NotNull final Review review, boolean prepare)
  {
    IReviewExternalizer reviewExternalizer = project.getComponent(IReviewExternalizer.class);

    InputStream inputStream = null;
    Exception exception = null;
    if (!review.isExternalizable()) {
      return true;
    }
    File file = review.getFile();
    try
    {
      inputStream = getInputStream(review);
      if (inputStream == null)
      {
        LOGGER.warn("Can't retrieve stream for review: " + review.getFile());
        //noinspection ThrowableInstanceNeverThrown
        exception = new FileNotFoundException(file.getPath());
      }
      else
      {
        reviewExternalizer.load(review, inputStream, prepare);

        if (!prepare)
        {
          fireReviewLoadSucceeded(review);
        }
View Full Code Here


  public void save(@NotNull Review review) throws RevuException, IOException
  {
    assert (!review.isEmbedded()) : "Embedded review cannot be saved : " + review;

    IReviewExternalizer reviewExternalizer = project.getComponent(IReviewExternalizer.class);

    boolean newReview;
    MetaReview metaReview = metaReviews.get(review);
    if (metaReview == null)
    {
      reviewsByFiles.put(review.getFile(), review);
      reviewsByNames.put(review.getName(), review);

      metaReview = new MetaReview(review, -1, true);
      metaReviews.put(review, metaReview);

      newReview = true;
    }
    else
    {
      metaReview.isSaving = true;
      metaReview.updateReviewHashcode();

      newReview = false;
    }

    try
    {
      if (review.isExternalizable())
      {
        reviewExternalizer.save(review, review.getFile());
      }
    }
    finally
    {
      metaReview.isSaving = false;
View Full Code Here

    return result;
  }

  public boolean load(@NotNull final Review review, boolean prepare)
  {
    IReviewExternalizer reviewExternalizer = project.getComponent(IReviewExternalizer.class);

    InputStream inputStream = null;
    Exception exception = null;
    File file = review.getFile();
    try
    {
      inputStream = getInputStream(review);
      if (inputStream == null)
      {
        LOGGER.warn("Can't retrieve stream for review: " + review.getFile());
        //noinspection ThrowableInstanceNeverThrown
        exception = new FileNotFoundException(file.getPath());
      }
      else
      {
        reviewExternalizer.load(review, inputStream, prepare);

        if (!prepare)
        {
          fireReviewLoadSucceeded(review);
        }
View Full Code Here

  public void save(@NotNull Review review) throws RevuException, IOException
  {
    assert (!review.isEmbedded()) : "Embedded review cannot be saved : " + review;

    IReviewExternalizer reviewExternalizer = project.getComponent(IReviewExternalizer.class);

    boolean newReview;
    MetaReview metaReview = metaReviews.get(review);
    if (metaReview == null)
    {
      reviewsByFiles.put(review.getFile(), review);
      reviewsByNames.put(review.getName(), review);

      metaReview = new MetaReview(review, -1, true);
      metaReviews.put(review, metaReview);

      newReview = true;
    }
    else
    {
      metaReview.isSaving = true;
      metaReview.updateReviewHashcode();

      newReview = false;
    }

    try
    {
      reviewExternalizer.save(review, review.getFile());
    }
    finally
    {
      metaReview.isSaving = false;
    }
View Full Code Here

TOP

Related Classes of org.sylfra.idea.plugins.revu.externalizing.IReviewExternalizer

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.