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

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


    Project project = e.getData(DataKeys.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);
    }
View Full Code Here


  @Override
  public void update(AnActionEvent e)
  {
    boolean enabled;

    Issue currentIssue = e.getData(RevuDataKeys.ISSUE);
    if (currentIssue == null)
    {
      enabled = false;
    }
    else
    {
      Review review = currentIssue.getReview();
      User user = RevuUtils.getCurrentUser(review);
      enabled = (user != null) &&
        (RevuUtils.isActive(review) && user.hasRole(User.Role.REVIEWER) || (user.hasRole(User.Role.ADMIN)));
    }
View Full Code Here

  }

  public void updateUI(boolean requestFocus)
  {
    updateMessageCount();
    Issue current = issueTree.getSelectedIssue();
    if (current == null)
    {
      ((CardLayout) pnIssuePaneContainer.getLayout()).show(pnIssuePaneContainer, "message");
    }
    else
    {
      ((CardLayout) pnIssuePaneContainer.getLayout()).show(pnIssuePaneContainer, "issuePane");
      issuePane.updateUI(current.getReview(), current, requestFocus);
    }
  }
View Full Code Here

    getModel().addTreeModelListener(new TreeModelAdapter()
    {
      @Override
      public void treeStructureChanged(TreeModelEvent e)
      {
        final Issue issue = getSelectedIssue();
        SwingUtilities.invokeLater(new Runnable()
        {
          public void run()
          {
            expandAll();
View Full Code Here

      getRowCount());
  }

  public Object getData(@NonNls String dataId)
  {
    final Issue selectedIssue = getSelectedIssue();

    if (PlatformDataKeys.NAVIGATABLE_ARRAY.is(dataId))
    {
      final VirtualFile selectedIssueFile = selectedIssue == null ? null : selectedIssue.getFile();
      if ((selectedIssue != null) && (selectedIssueFile != null)) {
        OpenFileDescriptor fileDescriptor = new OpenFileDescriptor(project, selectedIssueFile,
            selectedIssue.getLineStart(), 0);
        return new Navigatable[]{fileDescriptor};
      }

      return null;
    }
View Full Code Here

    getModel().addTreeModelListener(new TreeModelAdapter()
    {
      @Override
      public void treeStructureChanged(TreeModelEvent e)
      {
        final Issue issue = getSelectedIssue();
        SwingUtilities.invokeLater(new Runnable()
        {
          public void run()
          {
            expandAll();
View Full Code Here

  public Object getData(@NonNls String dataId)
  {
    if (PlatformDataKeys.NAVIGATABLE_ARRAY.is(dataId))
    {
      Issue currentIssue = getSelectedIssue();
      if ((currentIssue != null) && (currentIssue.getFile() != null))
      {
        OpenFileDescriptor fileDescriptor = new OpenFileDescriptor(project, currentIssue.getFile(),
          currentIssue.getLineStart(), 0);
        return new Navigatable[]{fileDescriptor};
      }

      return null;
    }
View Full Code Here

  private void updateIssues(int lineStart)
  {
    Map<Issue, RangeMarker> markersCopy = new HashMap<Issue, RangeMarker>(markers);
    for (Map.Entry<Issue, RangeMarker> entry : markersCopy.entrySet())
    {
      Issue issue = entry.getKey();
      if (issue.getLineStart() >= lineStart)
      {
        updateIssue(issue, entry.getValue());
      }
    }
  }
View Full Code Here

  public String getTooltipText()
  {
    StringBuilder buffer = new StringBuilder("<html><body>");
    for (Iterator<Issue> it = issues.keySet().iterator(); it.hasNext();)
    {
      Issue issue = it.next();
      buffer
        .append("[")
        .append(issue.getReview().getName())
        .append("]<br/><b>")
        .append(issue.getHistory().getCreatedBy().getDisplayName())
        .append("</b> - <i>")
        .append(DateFormat.getDateTimeInstance(DateFormat.SHORT, DateFormat.SHORT).format(
          issue.getHistory().getCreatedOn()))
        .append("</i><br/>")
        .append(issue.getSummary());
      if (it.hasNext())
      {
        buffer.append("<hr/>");
      }
    }
View Full Code Here

  }

  @Nullable
  public Review getSelectedReview()
  {
    Issue issue = issueTree.getSelectedIssue();

    return (issue == null) ? null : issue.getReview();
  }
View Full Code Here

TOP

Related Classes of org.sylfra.idea.plugins.revu.model.Issue

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.