package Ġcom . github . sh ir aji . permissions dispatcher plugin . actions Ċ Ċ import Ġcom . github . sh ir aji . permissions dispatcher plugin . data . ActionEvent Common Java Data Ċ import Ġcom . github . sh ir aji . permissions dispatcher plugin . extent ions . is Annotated Runtime Permissions Ċ import Ġcom . intellij . openapi . action System . An ActionEvent Ċ import Ġcom . intellij . openapi . action System . Common Data Keys Ċ import Ġcom . intellij . openapi . editor . Editor Ċ import Ġcom . intellij . psi . Psi Annotation Ċ import Ġcom . intellij . psi . Psi Class Ċ import Ġcom . intellij . psi . Psi Java File Ċ import Ġcom . intellij . psi . Psi Method Ċ import Ġcom . intellij . psi . util . Psi Tree Util Ċ Ċ fun Ġcreate ActionEvent Common Data ( e : ĠAn ActionEvent ): ĠAction Event Common Java Data ? Ġ{ ĊĠĠĠ Ġval Ġfile Ġ= Ġe . getData ( Common Data Keys . P SI _ FILE ) Ġas ? ĠPsi Java File Ġ?: Ġreturn Ġnull ĊĠĠĠ Ġval Ġeditor Ġ= Ġe . getData ( Common Data Keys . EDITOR ) Ġ?: Ġreturn Ġnull ĊĠĠĠ Ġreturn Ġcreate ActionEvent Common Data ( file , Ġeditor ) Ċ } Ċ Ċ fun Ġcreate ActionEvent Common Data ( file : ĠPsi Java File , Ġeditor : ĠEditor ): ĠAction Event Common Java Data ? Ġ{ ĊĠĠĠ Ġval Ġelement Ġ= Ġget Point ing Element ( editor , Ġfile ) Ġ?: Ġreturn Ġnull ĊĠĠĠ Ġval Ġclazz Ġ= ĠPsi Tree Util . getParent OfType ( element , ĠPsi Class :: class . java ) Ġ?: Ġreturn Ġnull ĊĠĠĠ Ġif Ġ(! clazz . is Annotated Runtime Permissions ()) Ġreturn Ġnull ĊĠĠĠ Ġreturn ĠAction Event Common Java Data ( file , Ġeditor , Ġelement , Ġclazz ) Ċ } Ċ Ċ fun Ġget Point ing Element ( editor : ĠEditor , Ġfile : ĠPsi Java File ) Ġ= Ġfile . findElement At ( editor . caret Model . offset )