// ĠCopyright Ġ 2 0 0 0 - 2 0 1 9 ĠJetBrains Ġs . r . o . ĠUse Ġof Ġthis Ġsource Ġcode Ġis Ġgoverned Ġby Ġthe ĠApache Ġ 2 . 0 Ġlicense Ġthat Ġcan Ġbe Ġfound Ġin Ġthe ĠLICENSE Ġfile . Ċ package Ġorg . jetbrains . plugins . template . ui Ċ Ċ import Ġcom . intellij . openapi . Disposable Ċ import Ġcom . intellij . openapi . components . service Ċ import Ġcom . intellij . openapi . project . Project Ċ import Ġcom . intellij . openapi . util . Dis poser Ċ import Ġcom . intellij . openapi . util . registry . Registry Ċ import Ġcom . intellij . openapi . vcs . changes . ui . Changes View Content Manager Ċ import Ġcom . intellij . openapi . wm . Tool Window Ċ import Ġcom . intellij . openapi . wm . Tool WindowManager Ċ import Ġcom . intellij . openapi . wm . ex . Tool WindowManager Listener Ċ import Ġcom . intellij . ui . content . Content Ċ import Ġcom . intellij . ui . content . Content Manager Listener Ċ import Ġcom . intellij . vcs . log . impl . V cs Log Editor Tab Selector ĊĊĊ Ċ internal Ġclass ĠBB PRE d itor Content Synchron izer Ġ{ ĊĠ Ġcompanion Ġobject Ġ{ ĊĠĠĠ Ġfun ĠgetInstance ( project : ĠProject ): ĠBB PRE d itor Content Synchron izer Ġ= Ġproject . service () ĊĠ Ġ} ĊĊĠ Ġprivate Ġfun Ġadd Content Manager Listener ( window : ĠTool Window , Ġlistener : ĠContent Manager Listener ) Ġ{ ĊĠĠĠ Ġwindow . content Manager . add Content Manager Listener ( listener ) ĊĠĠĠ ĠDis poser . register ( window . content Manager , ĠDis posable Ġ{ ĊĠĠĠĠĠ Ġif Ġ(! window . is Disposed ) Ġ{ ĊĠĠĠĠĠĠĠ Ġwindow . content Manager . remove Content Manager Listener ( listener ) ĊĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ}) ĊĠ Ġ} ĊĊĠ Ġinternal Ġclass ĠMy Tool window Listener ( private Ġval Ġproject : ĠProject ) Ġ: ĠTool WindowManager Listener Ġ{ ĊĠĠĠ Ġoverride Ġfun Ġtool Window Registered ( id : ĠString ) Ġ{ ĊĠĠĠĠĠ Ġif Ġ( id Ġ!= ĠChanges View Content Manager . TOOL WINDOW _ ID Ġ|| Ġ! Registry .` is ` (" show . log . as . editor . tab ")) Ġ{ ĊĠĠĠĠĠĠĠ Ġreturn ĊĠĠĠĠĠ Ġ} ĊĊĠĠĠĠĠ Ġval Ġtool window Ġ= ĠTool WindowManager . getInstance ( project ). get Tool Window ( id ) Ġ?: Ġreturn ĊĠĠĠĠĠ ĠgetInstance ( project ). add Content Manager Listener ( tool window , ĠMy Log Editor Listener ( project )) ĊĠĠĠ Ġ} ĊĠ Ġ} ĊĊĠ Ġprivate Ġclass ĠMy Log Editor Listener ( private Ġval Ġproject : ĠProject ) Ġ: ĠV cs Log Editor Tab Selector ( project ) Ġ{ ĊĠĠĠ Ġoverride Ġfun Ġselect Editor Tab ( content : ĠContent ) Ġ{ ĊĠĠĠĠĠ Ġval Ġcomponent Ġ= Ġcontent . component Ġas ? ĠGH PR Accounts Component ĊĠĠĠĠĠ Ġif Ġ( component Ġ!= Ġnull ) Ġ{ ĊĠĠĠĠĠĠĠ Ġproject . service < GH PR Component Factory >(). try Open GH PRE d itor Tab () ĊĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} ĊĠ Ġ} Ċ }