package Ġcom . github . sz y mon 2 6 0 3 . fixed length record sed itor . mappings . components Ċ Ċ import Ġcom . github . sz y mon 2 6 0 3 . fixed length record sed itor . mappings . model . Record Fields Mapping File Link Ċ import Ġcom . github . sz y mon 2 6 0 3 . fixed length record sed itor . with Re placed Item At Ċ import Ġcom . intellij . openapi . components . Persistent State Component Ċ import Ġcom . intellij . openapi . components . State Ċ import Ġcom . intellij . openapi . components . Storage Ċ import Ġcom . intellij . openapi . vfs . Virtual File Ċ import Ġcom . intellij . util . xml b . Xml Serializer Util Ċ import Ġjava . util . UUID Ċ Ċ @ State ( ĊĠĠĠ Ġname Ġ= Ġ" Record Fields Mapping Links Store ", ĊĠĠĠ Ġstorage s Ġ= Ġ[ Storage ( value Ġ= Ġ" fl r - editor / records - fields - mappings - links . xml ")] Ċ ) Ċ class ĠRecord Fields Mapping Links Store Ġ: ĠPersistent State Component < Record Fields Mapping Links State > Ġ{ ĊĊĠĠĠ Ġprivate Ġvar Ġstate Ġ= ĠRecord Fields Mapping Links State () ĊĠĠĠ Ġval Ġmapping Links : ĠList < Record Fields Mapping File Link > ĊĠĠĠĠĠĠĠ Ġget () Ġ= Ġstate . convert (). mapping Links ĊĊĠĠĠ Ġoverride Ġfun ĠgetState (): ĠRecord Fields Mapping Links State ? Ġ= Ġstate ĊĊĠĠĠ Ġoverride Ġfun Ġload State ( state : ĠRecord Fields Mapping Links State ) Ġ{ ĊĠĠĠĠĠĠĠ ĠXml Serializer Util . copy Bean ( state , Ġthis . state ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġfun Ġget Link ( opened File : ĠVirtual File ): ĠRecord Fields Mapping File Link ? Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġpath Ġ= Ġopened File . path ĊĠĠĠĠĠĠĠ Ġreturn Ġmapping Links . find Ġ{ Ġit . file Project Path Ġ== Ġpath Ġ} ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġfun Ġadd Link ( link : ĠRecord Fields Mapping File Link ) Ġ{ ĊĠĠĠĠĠĠĠ Ġsynchronized ( state ) Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġadd Link Intern ally ( link ) ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġprivate Ġfun Ġadd Link Intern ally ( link : ĠRecord Fields Mapping File Link ) Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġmapping Links Ġ= Ġstate . mapping Links . plus ( Record Fields Mapping File Link Element ( link )) ĊĠĠĠĠĠĠĠ Ġstate Ġ= Ġstate . copy ( mapping Links Ġ= Ġmapping Links ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġfun Ġupdate Link ( opened File : ĠVirtual File , Ġkey : ĠUUID ) Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġpath Ġ= Ġopened File . path ĊĠĠĠĠĠĠĠ Ġsynchronized ( state ) Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġval Ġindex Ġ= Ġmapping Links . indexOf First Ġ{ Ġit . file Project Path Ġ== Ġpath Ġ} ĊĠĠĠĠĠĠĠĠĠĠĠ Ġif Ġ( index Ġ!= Ġ- 1 ) Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġval Ġcurrent Mapping Links Ġ= Ġstate . mapping Links ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġval Ġnew Link Ġ= ĠRecord Fields Mapping File Link Element ( path , Ġkey ) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġstate Ġ= Ġstate . copy ( mapping Links Ġ= Ġcurrent Mapping Links . with Re placed Item At ( index , Ġnew Link )) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ} Ġelse Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġadd Link Intern ally ( Record Fields Mapping File Link ( path , Ġkey )) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ} ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġfun Ġremove Link ( opened File : ĠVirtual File ) Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġpath Ġ= Ġopened File . path ĊĠĠĠĠĠĠĠ Ġsynchronized ( state ) Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġval Ġlink Ġ= Ġmapping Links . find Ġ{ Ġit . file Project Path Ġ== Ġpath Ġ} ĊĠĠĠĠĠĠĠĠĠĠĠ Ġif Ġ( link Ġ!= Ġnull ) Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġremove Link Intern ally ( link ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ} ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġfun Ġremove Link ( link : ĠRecord Fields Mapping File Link ) Ġ{ ĊĠĠĠĠĠĠĠ Ġsynchronized ( state ) Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġremove Link Intern ally ( link ) ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġprivate Ġfun Ġremove Link Intern ally ( link : ĠRecord Fields Mapping File Link ) Ġ{ ĊĠĠĠĠĠĠĠ Ġif Ġ( state . mapping Links . contains ( Record Fields Mapping File Link Element ( link ))) Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġval Ġmapping Links Ġ= Ġstate . mapping Links . minus ( Record Fields Mapping File Link Element ( link )) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġstate Ġ= Ġstate . copy ( mapping Links Ġ= Ġmapping Links ) ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} Ċ } Ċ