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

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


    super.reset();

    // Change extended reviews so the point to clones
    for (Review review : originalItemsMap.keySet())
    {
      Review extendedReview = review.getExtendedReview();
      if (extendedReview != null)
      {
        review.setExtendedReview(retrieveCloneItem(extendedReview));
      }
    }
View Full Code Here


    // 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;
      }

      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
View Full Code Here

    super.internalValidateInput(data);

    // Check if current user is contained in list
    boolean adminFound;

    Review enclosingReview = getEnclosingReview(data);
    if ((data == null) || (enclosingReview == null) || (enclosingReview.isEmbedded()))
    {
      adminFound = true;
    }
    else
    {
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

    return true;
  }

  protected boolean isHabilitedToEditReview(@Nullable T data, User user)
  {
    Review enclosingReview = getEnclosingReview(data);

    return (enclosingReview != null) && (!enclosingReview.isEmbedded())
      && (user != null) && (user.hasRole(User.Role.ADMIN));
  }
View Full Code Here

            RevuBundle.message("projectSettings.review.shareWithPrivateLink.text", extendedReview.getName()),
            RevuBundle.message("projectSettings.confirmRemoveReview.title"),
            Messages.getWarningIcon());
          if (result == DialogWrapper.OK_EXIT_CODE)
          {
            Review tmpReview = extendedReview;
            while (tmpReview != null)
            {
              tmpReview.setShared(true);
              tmpReview = tmpReview.getExtendedReview();
            }
          }
        }
      }
    });

    bnImport.addActionListener(new ActionListener()
    {
      public void actionPerformed(ActionEvent e)
      {
        Review currentReview = new Review();
        internalUpdateData(currentReview);

        if (extendedReview == null)
        {
          CreateReviewDialog dialog = new CreateReviewDialog(project, false);
          dialog.show(editedReviews, currentReview);
          if (!dialog.isOK())
          {
            return;
          }

          switch (dialog.getImportType())
          {
            case COPY:
              currentReview.getDataReferential().copyFrom(dialog.getImportedReview().getDataReferential());
              break;
            case LINK:
              extendedReview = dialog.getImportedReview();
              currentReview.setExtendedReview(extendedReview);
              break;
          }

          updateUI(currentReview, currentReview, true);
        }
        else
        {
          extendedReview = null;
          currentReview.setExtendedReview(null);
          updateUI(currentReview, currentReview, true);
        }
      }
    });
View Full Code Here

      nameAlreadyExists = false;
    }
    else
    {
      ReviewManager reviewManager = project.getComponent(ReviewManager.class);
      Review review = reviewManager.getReviewByName(tfName.getText());
      nameAlreadyExists = ((review != null) && (!review.getFile().equals(data.getFile())));
    }
   
    updateError(tfName, nameAlreadyExists,
      RevuBundle.message("projectSettings.review.importDialog.nameAlreadyExists.text"));
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.