use of com.intellij.vcs.log.impl.VcsLogManager in project intellij-community by JetBrains.
the class OpenAnotherLogTabAction method update.
@Override
public void update(AnActionEvent e) {
Project project = e.getProject();
if (project == null || !Registry.is("vcs.log.open.another.log.visible")) {
e.getPresentation().setEnabledAndVisible(false);
return;
}
VcsProjectLog projectLog = VcsProjectLog.getInstance(project);
VcsLogManager logManager = e.getData(VcsLogInternalDataKeys.LOG_MANAGER);
e.getPresentation().setEnabledAndVisible(// only for main log (it is a question, how and where we want to open tabs for external logs)
logManager != null && projectLog.getLogManager() == logManager);
}
use of com.intellij.vcs.log.impl.VcsLogManager in project intellij-community by JetBrains.
the class RefreshLogAction method actionPerformed.
@Override
public void actionPerformed(AnActionEvent e) {
VcsLogUtil.triggerUsage(e);
VcsLogManager logManager = e.getRequiredData(VcsLogInternalDataKeys.LOG_MANAGER);
// diagnostic for possible refresh problems
VcsLogUi ui = e.getRequiredData(VcsLogDataKeys.VCS_LOG_UI);
if (ui instanceof AbstractVcsLogUi) {
VisiblePackRefresher refresher = ((AbstractVcsLogUi) ui).getRefresher();
if (!refresher.isValid()) {
String message = "Trying to refresh invalid log tab.";
if (!logManager.getDataManager().getProgress().isRunning()) {
LOG.error(message);
} else {
LOG.warn(message);
}
refresher.setValid(true);
}
}
logManager.getDataManager().refreshSoftly(VcsLogUtil.getVisibleRoots(ui));
}
use of com.intellij.vcs.log.impl.VcsLogManager in project intellij-community by JetBrains.
the class RefreshLogAction method update.
@Override
public void update(AnActionEvent e) {
VcsLogManager logManager = e.getData(VcsLogInternalDataKeys.LOG_MANAGER);
e.getPresentation().setEnabledAndVisible(logManager != null && e.getData(VcsLogDataKeys.VCS_LOG_UI) != null);
}
use of com.intellij.vcs.log.impl.VcsLogManager in project intellij-community by JetBrains.
the class GitShowExternalLogAction method createManagerAndContent.
@NotNull
private static MyContentComponent createManagerAndContent(@NotNull Project project, @NotNull final GitVcs vcs, @NotNull final List<VirtualFile> roots, @Nullable String tabName) {
final GitRepositoryManager repositoryManager = GitRepositoryManager.getInstance(project);
for (VirtualFile root : roots) {
repositoryManager.addExternalRepository(root, GitRepositoryImpl.getInstance(root, project, true));
}
VcsLogManager manager = new VcsLogManager(project, ServiceManager.getService(project, VcsLogTabsProperties.class), ContainerUtil.map(roots, root -> new VcsRoot(vcs, root)));
return new MyContentComponent(manager.createLogPanel(calcLogId(roots), tabName), roots, () -> {
for (VirtualFile root : roots) {
repositoryManager.removeExternalRepository(root);
}
});
}
use of com.intellij.vcs.log.impl.VcsLogManager in project intellij-community by JetBrains.
the class VcsLogFileHistoryProviderImpl method showFileHistory.
@Override
public void showFileHistory(@NotNull Project project, @NotNull FilePath path, @Nullable String revisionNumber) {
if (!VcsLogContentProvider.findAndSelectContent(project, FileHistoryUi.class, ui -> ui.getPath().equals(path))) {
VcsLogManager logManager = VcsProjectLog.getInstance(project).getLogManager();
assert logManager != null;
VcsLogContentProvider.openLogTab(project, logManager, TAB_NAME, path.getName(), new FileHistoryUiFactory(path));
}
}
Aggregations