use of com.intellij.vcs.log.ui.VcsLogPanel in project intellij-community by JetBrains.
the class VcsLogContentProvider method findAndSelectContent.
public static <U extends AbstractVcsLogUi> boolean findAndSelectContent(@NotNull Project project, @NotNull Class<U> clazz, @NotNull Condition<U> condition) {
ToolWindow toolWindow = ToolWindowManager.getInstance(project).getToolWindow(ToolWindowId.VCS);
ContentManager manager = toolWindow.getContentManager();
JComponent component = ContentUtilEx.findContentComponent(manager, c -> {
if (c instanceof VcsLogPanel) {
AbstractVcsLogUi ui = ((VcsLogPanel) c).getUi();
return clazz.isInstance(ui) && condition.value((U) ui);
}
return false;
});
if (component == null)
return false;
if (!toolWindow.isVisible())
toolWindow.activate(null);
return ContentUtilEx.selectContent(manager, component, true);
}
use of com.intellij.vcs.log.ui.VcsLogPanel in project intellij-community by JetBrains.
the class VcsLogContentProvider method openLogTab.
public static <U extends AbstractVcsLogUi> void openLogTab(@NotNull Project project, @NotNull VcsLogManager logManager, @NotNull String tabGroupName, @NotNull String shortName, @NotNull VcsLogManager.VcsLogUiFactory<U> factory) {
ToolWindow toolWindow = ToolWindowManager.getInstance(project).getToolWindow(ToolWindowId.VCS);
String name = ContentUtilEx.getFullName(tabGroupName, shortName);
U logUi = logManager.createLogUi(name, factory);
ContentUtilEx.addTabbedContent(toolWindow.getContentManager(), new VcsLogPanel(logManager, logUi), tabGroupName, shortName, true, logUi);
toolWindow.activate(null);
logManager.scheduleInitialization();
}
Aggregations