in idea-plugin/src/main/java/org/jetbrains/bunches/idea/vcs/BunchToolWindowFactory.kt [59:77]
fun createReduceActionWindow(
toolWindow: ToolWindow,
project: Project,
repoPath: String,
bunchPath: String
) {
val window = ReduceActionWindow(toolWindow, project, repoPath, bunchPath)
val contentFactory = ContentFactory.SERVICE.getInstance()
val content = contentFactory.createContent(window.content, reduceDisplayName, false)
toolWindow.contentManager.apply {
var index = contentCount
val oldContent = findContent(reduceDisplayName)
if (oldContent != null) {
index = getIndexOfContent(oldContent)
removeContent(oldContent, true)
}
toolWindow.setContent(content, index)
}
}