本文整理汇总了Java中com.intellij.openapi.vcs.history.VcsFileRevision.getAuthor方法的典型用法代码示例。如果您正苦于以下问题:Java VcsFileRevision.getAuthor方法的具体用法?Java VcsFileRevision.getAuthor怎么用?Java VcsFileRevision.getAuthor使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.intellij.openapi.vcs.history.VcsFileRevision
的用法示例。
在下文中一共展示了VcsFileRevision.getAuthor方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: showAffectedPaths
import com.intellij.openapi.vcs.history.VcsFileRevision; //导入方法依赖的package包/类
@Override
protected void showAffectedPaths(int lineNum) {
if (lineNum < myLineRevisions.length) {
final VcsFileRevision revision = myLineRevisions[lineNum];
final int changeset = ((VcsRevisionNumber.Int)revision.getRevisionNumber()).getValue();
final CommittedChangeList changeList =
new TFSChangeList(myWorkspace, changeset, revision.getAuthor(), revision.getRevisionDate(), revision.getCommitMessage(), myVcs);
String changesetString = ((TfsRevisionNumber)revision.getRevisionNumber()).getChangesetString();
final String progress = MessageFormat.format("Loading changeset {0}...", changesetString);
ProgressManager.getInstance().runProcessWithProgressSynchronously(new Runnable() {
public void run() {
changeList.getChanges();
}
}, progress, false, myVcs.getProject());
final String title = MessageFormat.format("Changeset {0}", changesetString);
AbstractVcsHelper.getInstance(myVcs.getProject()).showChangesListBrowser(changeList, title);
}
}
示例2: computeBgColors
import com.intellij.openapi.vcs.history.VcsFileRevision; //导入方法依赖的package包/类
@Nullable
private static Map<String, Color> computeBgColors(FileAnnotation fileAnnotation) {
final Map<String, Color> bgColors = new HashMap<String, Color>();
final Map<String, Color> revNumbers = new HashMap<String, Color>();
final int length = BG_COLORS.length;
final List<VcsFileRevision> fileRevisionList = fileAnnotation.getRevisions();
final boolean darcula = UIUtil.isUnderDarcula();
if (fileRevisionList != null) {
for (VcsFileRevision revision : fileRevisionList) {
final String author = revision.getAuthor();
final String revNumber = revision.getRevisionNumber().asString();
if (author != null && !bgColors.containsKey(author)) {
final int size = bgColors.size();
Color color = BG_COLORS[size < length ? size : size % length];
if (darcula) {
color = ColorUtil.shift(color, 0.3);
}
bgColors.put(author, color);
}
if (revNumber != null && !revNumbers.containsKey(revNumber)) {
revNumbers.put(revNumber, bgColors.get(author));
}
}
}
return bgColors.size() < 2 ? null : revNumbers;
}
示例3: revisionToCommit
import com.intellij.openapi.vcs.history.VcsFileRevision; //导入方法依赖的package包/类
private Commit revisionToCommit(VcsFileRevision revision) {
String committer = null;
String committerEmail = null;
String authorEmail = null;
if (revision instanceof VcsFileRevisionEx) {
committer = ((VcsFileRevisionEx) revision).getCommitterName();
committerEmail = ((VcsFileRevisionEx) revision).getCommitterEmail();
authorEmail = ((VcsFileRevisionEx) revision).getAuthorEmail();
}
String author = revision.getAuthor();
return new Commit(
revision,
author,
authorEmail,
committer,
committerEmail);
}
示例4: createDefaultAuthorsMappingProvider
import com.intellij.openapi.vcs.history.VcsFileRevision; //导入方法依赖的package包/类
@Nullable
private static AuthorsMappingProvider createDefaultAuthorsMappingProvider(@Nonnull FileAnnotation annotation) {
List<VcsFileRevision> revisions = annotation.getRevisions();
if (revisions == null) return null;
Map<VcsRevisionNumber, String> authorsMapping = new HashMap<>();
for (VcsFileRevision revision : revisions) {
String author = revision.getAuthor();
if (author != null) authorsMapping.put(revision.getRevisionNumber(), author);
}
return () -> authorsMapping;
}