Search in sources :

Example 1 with RepositoryBrowserDialog

use of org.jetbrains.idea.svn.dialogs.RepositoryBrowserDialog in project intellij-community by JetBrains.

the class BrowseRepositoryAction method actionPerformed.

public void actionPerformed(AnActionEvent e) {
    Project project = e.getData(CommonDataKeys.PROJECT);
    if (project == null) {
        RepositoryBrowserDialog dialog = new RepositoryBrowserDialog(ProjectManager.getInstance().getDefaultProject());
        dialog.show();
    } else {
        ToolWindowManager manager = ToolWindowManager.getInstance(project);
        ToolWindow w = manager.getToolWindow(REPOSITORY_BROWSER_TOOLWINDOW);
        if (w == null) {
            RepositoryToolWindowPanel component = new RepositoryToolWindowPanel(project);
            w = manager.registerToolWindow(REPOSITORY_BROWSER_TOOLWINDOW, true, ToolWindowAnchor.BOTTOM, project, true);
            final Content content = ContentFactory.SERVICE.getInstance().createContent(component, "", false);
            Disposer.register(content, component);
            w.getContentManager().addContent(content);
        }
        w.show(null);
        w.activate(null);
    }
}
Also used : Project(com.intellij.openapi.project.Project) ToolWindow(com.intellij.openapi.wm.ToolWindow) Content(com.intellij.ui.content.Content) ToolWindowManager(com.intellij.openapi.wm.ToolWindowManager) RepositoryBrowserDialog(org.jetbrains.idea.svn.dialogs.RepositoryBrowserDialog)

Aggregations

Project (com.intellij.openapi.project.Project)1 ToolWindow (com.intellij.openapi.wm.ToolWindow)1 ToolWindowManager (com.intellij.openapi.wm.ToolWindowManager)1 Content (com.intellij.ui.content.Content)1 RepositoryBrowserDialog (org.jetbrains.idea.svn.dialogs.RepositoryBrowserDialog)1