use of com.intellij.vcs.log.data.LoadingDetails 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.data.LoadingDetails in project intellij-community by JetBrains.
the class CommitPanel method setCommit.
public void setCommit(@NotNull VcsFullCommitDetails commitData) {
if (!Comparing.equal(myCommit, commitData)) {
if (commitData instanceof LoadingDetails) {
myDataPanel.setData(null);
myRootPanel.setRoot("", null);
} else {
myDataPanel.setData(commitData);
VirtualFile root = commitData.getRoot();
if (myColorManager.isMultipleRoots()) {
myRootPanel.setRoot(root.getName(), VcsLogGraphTable.getRootBackgroundColor(root, myColorManager));
} else {
myRootPanel.setRoot("", null);
}
}
myCommit = commitData;
}
List<String> branches = null;
if (!(commitData instanceof LoadingDetails)) {
branches = myLogData.getContainingBranchesGetter().requestContainingBranches(commitData.getRoot(), commitData.getId());
}
myContainingBranchesPanel.setBranches(branches);
myDataPanel.update();
myContainingBranchesPanel.update();
revalidate();
}
use of com.intellij.vcs.log.data.LoadingDetails in project intellij-community by JetBrains.
the class FileHistorySingleCommitAction method update.
@Override
public void update(@NotNull AnActionEvent e) {
Project project = e.getProject();
FileHistoryUi ui = e.getData(VcsLogInternalDataKeys.FILE_HISTORY_UI);
if (project == null || ui == null) {
e.getPresentation().setEnabledAndVisible(false);
return;
}
e.getPresentation().setVisible(true);
List<VcsFullCommitDetails> details = ui.getVcsLog().getSelectedDetails();
if (details.isEmpty()) {
e.getPresentation().setEnabled(false);
return;
}
VcsFullCommitDetails detail = getFirstItem(details);
if (detail instanceof LoadingDetails)
detail = null;
e.getPresentation().setEnabled(details.size() == 1 && isEnabled(ui, detail, e));
}
use of com.intellij.vcs.log.data.LoadingDetails in project intellij-community by JetBrains.
the class CompareRevisionsFromHistoryAction method update.
public void update(@NotNull AnActionEvent e) {
Project project = e.getProject();
FileHistoryUi ui = e.getData(VcsLogInternalDataKeys.FILE_HISTORY_UI);
FilePath filePath = e.getData(VcsDataKeys.FILE_PATH);
if (project == null || ui == null || filePath == null) {
e.getPresentation().setEnabledAndVisible(false);
return;
}
e.getPresentation().setVisible(true);
List<VcsFullCommitDetails> details = ui.getVcsLog().getSelectedDetails();
if (e.getInputEvent() instanceof KeyEvent) {
e.getPresentation().setEnabled(true);
} else {
if (details.size() == 2) {
VcsFullCommitDetails detail0 = details.get(0);
VcsFullCommitDetails detail1 = details.get(1);
if (detail0 != null && !(detail0 instanceof LoadingDetails) && detail1 != null && !(detail1 instanceof LoadingDetails)) {
VcsFileRevision newestRevision = ui.createRevision(detail0);
VcsFileRevision olderRevision = ui.createRevision(detail1);
e.getPresentation().setEnabled(newestRevision != null && olderRevision != null && !filePath.isDirectory());
} else {
e.getPresentation().setEnabled(!filePath.isDirectory());
}
} else {
e.getPresentation().setEnabled(details.size() == 1);
}
}
if (details.size() == 2) {
e.getPresentation().setText(COMPARE_TEXT);
e.getPresentation().setDescription(COMPARE_DESCRIPTION);
} else {
e.getPresentation().setText(DIFF_TEXT);
e.getPresentation().setDescription(DIFF_DESCRIPTION);
}
}
Aggregations