use of com.intellij.vcs.log.VcsShortCommitDetails in project intellij-community by JetBrains.
the class GraphTableController method getArrowTooltipText.
@NotNull
private String getArrowTooltipText(int commit, @Nullable Integer row) {
VcsShortCommitDetails details;
if (row != null && row >= 0) {
// preload rows around the commit
details = myTable.getModel().getShortDetails(row);
} else {
// preload just the commit
details = myLogData.getMiniDetailsGetter().getCommitData(commit, Collections.singleton(commit));
}
String balloonText = "";
if (details instanceof LoadingDetails) {
CommitId commitId = myLogData.getCommitId(commit);
if (commitId != null) {
balloonText = "Jump to commit" + " " + commitId.getHash().toShortString();
if (myUi.isMultipleRoots()) {
balloonText += " in " + commitId.getRoot().getName();
}
}
} else {
balloonText = "Jump to <b>\"" + StringUtil.shortenTextWithEllipsis(details.getSubject(), 50, 0, "...") + "\"</b> by " + VcsUserUtil.getShortPresentation(details.getAuthor()) + CommitPanel.formatDateTime(details.getAuthorTime());
}
return balloonText;
}
use of com.intellij.vcs.log.VcsShortCommitDetails in project intellij-community by JetBrains.
the class VcsLogGraphTable method getStyle.
private VcsLogHighlighter.VcsCommitStyle getStyle(int row, int column, boolean hasFocus, boolean selected) {
VcsLogHighlighter.VcsCommitStyle baseStyle = getBaseStyle(row, column, hasFocus, selected);
VisibleGraph<Integer> visibleGraph = getVisibleGraph();
if (row < 0 || row >= visibleGraph.getVisibleCommitCount()) {
LOG.error("Visible graph has " + visibleGraph.getVisibleCommitCount() + " commits, yet we want row " + row);
return baseStyle;
}
RowInfo<Integer> rowInfo = visibleGraph.getRowInfo(row);
VcsLogHighlighter.VcsCommitStyle defaultStyle = VcsCommitStyleFactory.createStyle(rowInfo.getRowType() == RowType.UNMATCHED ? JBColor.GRAY : baseStyle.getForeground(), baseStyle.getBackground(), VcsLogHighlighter.TextStyle.NORMAL);
final VcsShortCommitDetails details = myLogData.getMiniDetailsGetter().getCommitDataIfAvailable(rowInfo.getCommit());
if (details == null)
return defaultStyle;
List<VcsLogHighlighter.VcsCommitStyle> styles = ContainerUtil.map(myHighlighters, highlighter -> highlighter.getStyle(details, selected));
return VcsCommitStyleFactory.combine(ContainerUtil.append(styles, defaultStyle));
}
Aggregations