Package com.intellij.openapi.project

Examples of com.intellij.openapi.project.Project


  }

  @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();
    workspaceSettings.setReviewingReviewName(null);
    workspaceSettingsComponent.loadState(workspaceSettings);
  }
View Full Code Here


  @Override
  public void update(AnActionEvent e)
  {
    boolean enabled = false;
    Project project = e.getData(PlatformDataKeys.PROJECT);
    VirtualFile vFile = RevuUtils.getVirtualFile(e);

    if ((project != null) && (vFile != null))
    {
      Collection<Review> reviews = RevuUtils.getActiveReviewsForCurrentUser(project);
View Full Code Here

    fileScopeManager = ApplicationManager.getApplication().getComponent(FileScopeManager.class);
  }

  public void update(AnActionEvent e)
  {
    Project project = e.getData(PlatformDataKeys.PROJECT);
    if (project == null)
    {
      return;
    }
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;
View Full Code Here

{
  private ReviewFileChooser fileChooser;

  public void actionPerformed(AnActionEvent e)
  {
    Project project = e.getData(PlatformDataKeys.PROJECT);
    if (project == null)
    {
      return;
    }

    if (fileChooser == null)
    {
      fileChooser = new ReviewFileChooser(project);
    }

    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);
      form.addItem(review);
    }
  }
View Full Code Here

    = {ReviewStatus.DRAFT, ReviewStatus.FIXING, ReviewStatus.REVIEWING};

  @Override
  public void update(AnActionEvent e)
  {
    Project project = e.getData(PlatformDataKeys.PROJECT);
    if (project == null)
    {
      return;
    }

    Review reviewingReview = RevuUtils.getReviewingReview(project);
    if (reviewingReview != null)
    {
      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)
    {
View Full Code Here

public class RemoveIssueAction extends AbstractIssueAction
{
  @Override
  public void actionPerformed(AnActionEvent e)
  {
    Project project = e.getData(PlatformDataKeys.PROJECT);
    List<Issue> issues = e.getData(RevuDataKeys.ISSUE_LIST);

    if (issues == null)
    {
      Issue issue = e.getData(RevuDataKeys.ISSUE);
      if (issue == null)
      {
        return;
      }

      issues = new ArrayList<Issue>();
      issues.add(issue);
    }

    Set<Review> reviewsToSave = new HashSet<Review>();
    for (Issue issue : issues)
    {
      Review review = issue.getReview();
      review.removeIssue(issue);

      reviewsToSave.add(review);
    }

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

    }

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

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

      ProjectViewSelectInTarget.select(project, this, RevuProjectViewPane.ID, review.getName(), null, true);

      RevuWorkspaceSettingsComponent workspaceSettingsComponent =
        project.getComponent(RevuWorkspaceSettingsComponent.class);
      RevuWorkspaceSettings workspaceSettings = workspaceSettingsComponent.getState();
      workspaceSettings.setReviewingReviewName(review.getName());
      workspaceSettingsComponent.loadState(workspaceSettings);
    }
View Full Code Here

    this.fromChangeList = fromChangeList;
  }

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

    Collection<Review> reviews = getExistingReviews(e);

    final CreateReviewDialog dialog = new CreateReviewDialog(project, true);
    dialog.show(reviews, null);
    if (!dialog.isOK())
    {
      return;
    }

    final RevuProjectSettingsForm form = project.getComponent(RevuProjectSettingsForm.class);
    if (!form.getContentPane().isShowing())
    {
      ShowSettingsUtil.getInstance().editConfigurable(project, form, new Runnable()
      {
        public void run()
View Full Code Here

    if (reviews != null)
    {
      return reviews;
    }

    Project project = e.getData(PlatformDataKeys.PROJECT);
    return project.getComponent(ReviewManager.class).getReviews();
  }
View Full Code Here

TOP

Related Classes of com.intellij.openapi.project.Project

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.