Java Code Examples for com.intellij.openapi.vcs.versionBrowser.CommittedChangeList#getCommitterName()

The following examples show how to use com.intellij.openapi.vcs.versionBrowser.CommittedChangeList#getCommitterName() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: CommittedChangesPanel.java    From consulo with Apache License 2.0 5 votes vote down vote up
private static boolean changeListMatches(@Nonnull final CommittedChangeList changeList, final String[] filterWords) {
  for(String word: filterWords) {
    final String comment = changeList.getComment();
    final String committer = changeList.getCommitterName();
    if ((comment != null && comment.toLowerCase().indexOf(word) >= 0) ||
        (committer != null && committer.toLowerCase().indexOf(word) >= 0) ||
        Long.toString(changeList.getNumber()).indexOf(word) >= 0) {
      return true;
    }
  }
  return false;
}
 
Example 2
Source File: ReceivedChangeList.java    From consulo with Apache License 2.0 5 votes vote down vote up
public ReceivedChangeList(@Nonnull CommittedChangeList baseList) {
  super(baseList.getName(), baseList.getComment(), baseList.getCommitterName(),
        baseList.getNumber(), baseList.getCommitDate(), Collections.<Change>emptyList());
  myBaseList = baseList;
  myBaseCount = baseList.getChanges().size();
  myForcePartial = false;
}
 
Example 3
Source File: ChangeListColumn.java    From consulo with Apache License 2.0 4 votes vote down vote up
public Object getValue(final CommittedChangeList changeList) {
  return changeList.getCommitterName();
}
 
Example 4
Source File: ChangeListGroupingStrategy.java    From consulo with Apache License 2.0 4 votes vote down vote up
public String getGroupName(final CommittedChangeList changeList) {
  return changeList.getCommitterName();
}
 
Example 5
Source File: ChangeListDetailsAction.java    From consulo with Apache License 2.0 4 votes vote down vote up
public static void showDetailsPopup(final Project project, final CommittedChangeList changeList) {
  StringBuilder detailsBuilder = new StringBuilder("<html><head>");
  detailsBuilder.append(UIUtil.getCssFontDeclaration(UIUtil.getLabelFont())).append("</head><body>");
  final AbstractVcs vcs = changeList.getVcs();
  CachingCommittedChangesProvider provider = null;
  if (vcs != null) {
    provider = vcs.getCachingCommittedChangesProvider();
    if (provider != null && provider.getChangelistTitle() != null) {
      detailsBuilder.append(provider.getChangelistTitle()).append(" #").append(changeList.getNumber()).append("<br>");
    }
  }
  @NonNls String committer = "<b>" + changeList.getCommitterName() + "</b>";
  detailsBuilder.append(VcsBundle.message("changelist.details.committed.format", committer,
                                          DateFormatUtil.formatPrettyDateTime(changeList.getCommitDate())));
  detailsBuilder.append("<br>");

  if (provider != null) {
    final CommittedChangeList originalChangeList;
    if (changeList instanceof ReceivedChangeList) {
      originalChangeList = ((ReceivedChangeList) changeList).getBaseList();
    }
    else {
      originalChangeList = changeList;
    }
    for(ChangeListColumn column: provider.getColumns()) {
      if (ChangeListColumn.isCustom(column)) {
        String value = column.getValue(originalChangeList).toString();
        if (value.length() == 0) {
          value = "<none>";
        }
        detailsBuilder.append(column.getTitle()).append(": ").append(XmlStringUtil.escapeString(value)).append("<br>");
      }
    }
  }

  detailsBuilder.append(IssueLinkHtmlRenderer.formatTextWithLinks(project, changeList.getComment()));
  detailsBuilder.append("</body></html>");

  JEditorPane editorPane = new JEditorPane(UIUtil.HTML_MIME, detailsBuilder.toString());
  editorPane.setEditable(false);
  editorPane.setBackground(HintUtil.INFORMATION_COLOR);
  editorPane.select(0, 0);
  editorPane.addHyperlinkListener(BrowserHyperlinkListener.INSTANCE);
  JScrollPane scrollPane = ScrollPaneFactory.createScrollPane(editorPane);
  final JBPopup hint =
    JBPopupFactory.getInstance().createComponentPopupBuilder(scrollPane, editorPane)
      .setDimensionServiceKey(project, "changelist.details.popup", false)
      .setResizable(true)
      .setMovable(true)
      .setRequestFocus(true)
      .setTitle(VcsBundle.message("changelist.details.title"))
      .createPopup();
  hint.showInBestPositionFor(DataManager.getInstance().getDataContext());
}