Search in sources :

Example 1 with VcsLogPanel

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);
}
Also used : ToolWindow(com.intellij.openapi.wm.ToolWindow) AbstractVcsLogUi(com.intellij.vcs.log.ui.AbstractVcsLogUi) ContentManager(com.intellij.ui.content.ContentManager) VcsLogPanel(com.intellij.vcs.log.ui.VcsLogPanel)

Example 2 with VcsLogPanel

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();
}
Also used : ToolWindow(com.intellij.openapi.wm.ToolWindow) VcsLogPanel(com.intellij.vcs.log.ui.VcsLogPanel)

Aggregations

ToolWindow (com.intellij.openapi.wm.ToolWindow)2 VcsLogPanel (com.intellij.vcs.log.ui.VcsLogPanel)2 ContentManager (com.intellij.ui.content.ContentManager)1 AbstractVcsLogUi (com.intellij.vcs.log.ui.AbstractVcsLogUi)1