package Ġcom . int elligent comments . core . comments . listeners Ċ Ċ import Ġcom . int elligent comments . ui . comments . render ers . Renderer With Rectangle Model Ċ import Ġcom . intellij . openapi . editor . Custom Fold Region Ċ import Ġcom . intellij . openapi . editor . event . Editor MouseEvent Ċ import Ġcom . intellij . openapi . editor . event . Editor Mouse Listener Ċ import Ġjava . awt . Rectangle Ċ Ċ class ĠComment Mouse Listener ( private Ġval Ġfold Region : ĠCustom Fold Region ) Ġ: ĠEditor Mouse Listener Ġ{ ĊĠ Ġprivate Ġval Ġrenderer Ġ= Ġfold Region . renderer Ġas ĠRenderer With Rectangle Model ĊĊĊĠ Ġoverride Ġfun Ġmouse Clicked ( event : ĠEditor MouseEvent ) Ġ{ ĊĠĠĠ Ġif Ġ(! Comments Listeners Util . can Process Event ( event )) Ġreturn ĊĊĠĠĠ Ġval Ġrect angles Model Ġ= Ġrenderer . rect angles Model Ġ?: Ġreturn ĊĠĠĠ Ġval Ġbounds Ġ= Ġfold Region . get Bounds () Ġ?: Ġreturn ĊĊĠĠĠ Ġif Ġ( rect angles Model . dispatch Mouse Click ( event , Ġbounds )) Ġ{ ĊĠĠĠĠĠ Ġfold Region . update () ĊĠĠĠĠĠ Ġfold Region . rep aint () ĊĠĠĠĠĠ Ġevent . editor . component . re validate () ĊĠĠĠĠĠ Ġevent . editor . component . rep aint () ĊĠĠĠ Ġ} ĊĠ Ġ} Ċ } Ċ Ċ fun ĠCustom Fold Region . get Bounds (): ĠRectangle ? Ġ{ ĊĠ Ġval Ġlocation Ġ= Ġthis . location Ġ?: Ġreturn Ġnull ĊĊĠ Ġreturn ĠRectangle ( location . x , Ġlocation . y , Ġwidth In Pixels , Ġheight In Pixels ) Ċ }