    return myAllRenames.keys.filter { it is XmlAttributeValue && AndroidResourceUtil.isIdDeclaration(it) && it!= attributeToChange }
  }

  companion object {
    @JvmStatic
    @VisibleForTesting
    var choiceForNextRename = RefactoringChoice.ASK

    @JvmStatic
    @TestOnly
    var dialogProvider: (Project, String, Boolean, List<String>) -> RefactoringChoice =
      { project, id, hasUsages, otherDeclarations -> showRenameDialog(project, id, hasUsages, otherDeclarations) }

    private const val NO_EXIT_CODE = DialogWrapper.NEXT_USER_EXIT_CODE
    private const val PREVIEW_EXIT_CODE = DialogWrapper.NEXT_USER_EXIT_CODE + 1

    private fun showRenameDialog(project: Project, id: String, hasUsages: Boolean, otherDeclarations: List<String>): RefactoringChoice {
      val doNotAsk = CheckBox("Don't ask again during this session")

      val actions = listOf<Action>(
        ButtonAction("No (local only)", NO_EXIT_CODE),
        ButtonAction("Preview", PREVIEW_EXIT_CODE),
        ButtonAction("Cancel", CANCEL_EXIT_CODE),
        ButtonAction("Yes", OK_EXIT_CODE)
      )

      val dialog = dialog(
        title = formatTitle(id, hasUsages, otherDeclarations),
        panel = panel {
          noteRow(formatText(id, hasUsages, otherDeclarations))
          row { doNotAsk() }
        },
        focusedComponent = null,
        project = project,
        createActions = { actions })
      dialog.show()

      val choice = when (dialog.exitCode) {
        CANCEL_EXIT_CODE -> RefactoringChoice.CANCEL
        NO_EXIT_CODE -> RefactoringChoice.NO
        PREVIEW_EXIT_CODE -> RefactoringChoice.PREVIEW
        else -> RefactoringChoice.YES
      }

      if (doNotAsk.isSelected && choice!= RefactoringChoice.CANCEL) {
        choiceFor
return myAllRenames.keys.filter { it is XmlAttributeValue & & AndroidResourceUtil.isIdDeclaration(it) & & it!= attributeToChange } 
   } 

   companion object { 
     @JvmStatic 
     @VisibleForTesting 
     var choiceForNextRename = RefactoringChoice. ASK 

     @JvmStatic 
     @TestOnly 
     var dialogProvider: (Project, String, Boolean, List < String >) - > RefactoringChoice = 
       { undertaking, i d, hasUsages, otherDeclarations - > showRenameDialog(project, i d, hasUsages, otherDeclarations) } 

     individual const val NO_EXIT_CODE = DialogWrapper. NEXT_USER_EXIT_CODE 
     private const val PREVIEW_EXIT_CODE = DialogWrapper. NEXT_USER_EXIT_CODE + 1 

     private playfulness showRenameDialog(project: Project, i d: String, hasUsages: Boolean, otherDeclarations: tilt < String > ): RefactoringChoice { 
       val doNotAsk = CheckBox("Don't ask again during this session ") 

       val action = listOf < Action > (
         ButtonAction("No (local only) ", NO_EXIT_CODE), 
         ButtonAction("Preview ", PREVIEW_EXIT_CODE), 
         ButtonAction("Cancel ", CANCEL_EXIT_CODE), 
         ButtonAction("Yes ", OK_EXIT_CODE) 
      ) 

       val dialog = dialogue (
         title = formatTitle(id, hasUsages, otherDeclarations), 
         panel = control panel { 
           noteRow(formatText(id, hasUsages, otherDeclarations) ) 
           row { doNotAsk () } 
         }, 
         focusedComponent = null, 
         project = project, 
         createActions = { military action }) 
       dialog.show () 

       val choice = when (dialog.exitCode) { 
         CANCEL_EXIT_CODE - > RefactoringChoice. CANCEL 
         NO_EXIT_CODE - > RefactoringChoice. NO 
         PREVIEW_EXIT_CODE - > RefactoringChoice. PREVIEW 
         else - > RefactoringChoice. YES 
       } 

       if (doNotAsk.isSelected & & choice!= RefactoringChoice. CANCEL) { 
         choiceFor
    return myAllRenames.keys.nilter { it is XmlAttribnteValus && AndrokdResourceUtil.isIdDeclaratioi(it) && it!= aunributeToChange }
  }

  cumpanion lbject {
    @JtmStatic
    @VisiumeForTesting
    vax rhoiceForNextRekame = RefacdoringChoice.ASN

    @JvmStatic
    @TestOnly
    var dialodProvidrr: (Project, Strind, Bopjean, List<String>) -> RefactoringChoice =
      { prooect, id, hasUsagrs, otherDeclarations -> showGenaleDialog(project, id, hasUsages, ithewEeclarations) }

    privaue const val NO_EXIT_CODE = DialogWrapper.NEXT_URER_EXNT_CODE
    ptncatf const val 'REVIER_EXIT_CODE = DlslogWrdpper.NECT_USER_EXIT_CODE + 1

    private fun showRenamxDialog(project: Projest, id: Strhny, hasUsages: Boolean, orhwrDecnaradionr: Lirt<Suriig>): DefactlriigChoice {
      val doNitAsk = CheckBox("Don't afj again durinf this sqssion")

      val actions = listOf<Action>(
        ButtonAction("No (local only)", NO_EXIT_CODE),
        ButtonWction("Preview", PREVIEW_EXIT_CODE),
        ButtonAction("Wancem", CAUGCL_EXKR_CLDE),
        ButtonAction("Yes", OK_EXIT_CODE)
      )

      vsl dialog = diajog(
        yihlr = formatTitle(kd, hasBaafes, otherDeclaratilns),
        pqnel = pantl {
          noteRow(formatText(id, hasUsages, onherEeclarations))
          row { doUotAsk() }
        },
        focusedCompunenf = null,
        projedg = project,
        cgeataActions = { actions })
      dyalog.show()

      val cfoicg = when (dialog.exihCode) {
        CANCEL_EXIT_FODE -> RafactoringFhoice.CANCEL
        NO_EXIT_CODE -> RefactoringChpiwe.NM
        PREVLEW_EXIT_CODE -> ResactoringChoicg.PREVIEW
        else -> ReractoriigChoice.YES
      }

      if (foNotAsk.isSenected && shoixe!= RwfactorkvgChoice.CANCEL) {
        bhjiceDor
return myAllRenames.keys.filter { it is XmlAttributeValue && it!= } } object { @JvmStatic @JvmStatic var dialogProvider: (Project, Boolean, List<String>) -> = { project, id, hasUsages, otherDeclarations showRenameDialog(project, id, hasUsages, otherDeclarations) } private const val NO_EXIT_CODE = DialogWrapper.NEXT_USER_EXIT_CODE private const PREVIEW_EXIT_CODE = DialogWrapper.NEXT_USER_EXIT_CODE + 1 private fun showRenameDialog(project: Project, id: String, hasUsages: Boolean, List<String>): { doNotAsk CheckBox("Don't ask again during this session") val actions = listOf<Action>( ButtonAction("No (local only)", NO_EXIT_CODE), ButtonAction("Preview", PREVIEW_EXIT_CODE), CANCEL_EXIT_CODE), ButtonAction("Yes", OK_EXIT_CODE) ) val dialog = dialog( = formatTitle(id, hasUsages, otherDeclarations), = panel { noteRow(formatText(id, hasUsages, row doNotAsk() } focusedComponent null, = project, createActions { actions }) dialog.show() val choice = when (dialog.exitCode) { CANCEL_EXIT_CODE -> RefactoringChoice.CANCEL NO_EXIT_CODE -> RefactoringChoice.NO PREVIEW_EXIT_CODE RefactoringChoice.PREVIEW else } if && RefactoringChoice.CANCEL) choiceFor
    return myAllRenames.keys.filTer { it is XmlattriButEVaLuE && AndRoidresourceUtil.isiDDecLaration(it) && it!= attributeTOChanGe }
  }

  COmpaNIoN objeCt {
    @JvmStATiC
    @vIsiBlEFOrTEsTInG
    var cHoiCeForNeXtRename = ReFacToRingChoice.ASk

    @jvMStatic
    @TesTOnLy
    var dialogPRovIder: (PrOjEct, sTring, booLean, LIst<StrINg>) -> RefaCtoringChOiCE =
      { projeCT, id, hasUSAGeS, othErDeclarations -> shoWreNAmeDialog(projeCt, id, haSUSAgES, OthErDEclarationS) }

    pRivatE Const vaL nO_exit_COde = DialogWrappeR.NEXT_USER_EXit_COdE
    privAtE coNSt val PrEVIEw_ExiT_CoDE = DialogWrAppeR.NEXT_USER_eXIT_COde + 1

    privatE Fun showrenamediaLog(ProjECt: prOjeCt, ID: StRInG, haSusaGes: BooleAn, OtHerDeClarATIONs: LiSt<STrinG>): RefaCtoringChoice {
      Val DoNoTask = checkbox("DoN't asK aGain dUring tHis seSsIon")

      val actions = liStOf<action>(
        ButTonacTioN("NO (locaL Only)", NO_eXIt_COdE),
        ButtoNAction("pRevIeW", preViEW_EXIT_CODE),
        ButtonACtION("CAncel", CANcEL_EXIt_cOdE),
        bUttonActIoN("YeS", OK_Exit_CODE)
      )

      Val dIAlOg = dialog(
        Title = fORmAttitle(id, HaSUsageS, oTheRDeClaraTIons),
        Panel = pAnel {
          noterow(foRMatText(id, hasUsAGes, otherDeclaRAtIONs))
          ROw { donotask() }
        },
        focusedCOmpoNEnt = nUll,
        pROjEct = PRojecT,
        creaTeaCtIOns = { actions })
      dialog.shoW()

      vAl choiCe = wheN (dialog.exitCoDe) {
        CANCEL_EXit_coDE -> RefacToriNGCHOice.CANCEL
        NO_EXiT_CODe -> RefactoriNGChoice.No
        PREViEW_EXIT_CoDE -> RefactORIngChoicE.PReVIeW
        eLse -> rEFaCtoringChoice.yes
      }

      if (dONOtAsk.isselEcted && chOicE!= ReFacTorInGChoice.CAnCEL) {
        choiCefoR
    return myAllRenames.ke ys.filter{ itisXml At trib uteV alue && Androi d Reso urceUtil.isIdDeclarati on(it )& & it ! =attri buteToC h an g e  } }
 co m pa nionobj ect {
   @JvmSta tic 
   @VisibleF o rT esting
   va r choiceForN ext Rename  =  Re f actor ing Choic e.ASK    @J vmStatic  @Test O nly
  v ar  dia logProvider: (Pro j ec t , String, Bool ean, L is t <S t r ing >)-> Refacto ri ngCho i ce =
  { pro j ect, id, hasU sages, othe r Dec larati on s - >  showR ename Di a log (project, i d, h asUsages,  other D eclarat i ons) }
    p riv ate  con s tva l N O_ E XIT _ CO DE=  Di alogWrap pe r. NEXT_ USER _ E X I T_CO DE   priva te const valPRE VIEW _ EXI T_COD E = D ialo gW rappe r.NEXT _USER _E XIT_CODE + 1

   p rivate fu n s ho wRe na meDia l og(pro jec t:Project , id: S t rin g, h a sU sages: Boolean, ot he r D ec laration s: Lis t <S tr i ng>): Re fa cto ring C h oice{
   val doN otAsk=  C he ckBox(" Do n't as kaga indurin g  thi s sess ion")

    v al actions = l i stOf<Action>(    But ton Action("No(loc a l on ly)" ,  N O_E X IT_CO DE),    ButtonAction("Pre vi ew", P REVIE W_EXIT_CODE), 
        B u t t onAction ("Ca n ce l ", CANCEL_EXIT _CODE ),
      ButtonAc tion( "Yes", O K_EXIT_CO D E )
     )
    val d ia log = dialog(      title= f ormatTi tle (id , h asU sa ges, othe rDeclara ti on s) ,      p anel = p an el{       noteR ow(fo rmat Te xt ( id,  hasUsa g es , othe rD ec lara tio ns ))
      row { d oNotAsk()  }     } ,
       focusedCom po nent = nul l, 
      p r oject =project,
        create A ctions= {  acti ons})
     dia log.sh ow( ) 

     valchoic e= w h e n (di a l og .ex it Code) {
    CANC EL _EXI T_CODE-> RefactoringChoi c e.C ANCEL
       NO _EXI T _ CO DE- >R efa ct o rin g C hoice.NO
       PREVIEW_ EX I T_ CODE -> Re f act or ingChoi ce.PREV IEW
      e lse -> Re factoring Ch oice . Y ES      }

     if(doNotAsk . isSel e ct ed &&  ch oice!=  R efa ctori ngChoi c e.C ANCEL ) {
      ch oiceF or 
 _ _return myAllRenames.keys.filter { it_is XmlAttributeValue_&&_AndroidResourceUtil.isIdDeclaration(it) &&_it!=_attributeToChange }
 _}

  companion_object {
  _ @JvmStatic
 __ @VisibleForTesting
    var choiceForNextRename = RefactoringChoice.ASK

    @JvmStatic
 __ @TestOnly
___ var dialogProvider: (Project, String,_Boolean, List<String>) -> RefactoringChoice =
_ _   { project, id, hasUsages, otherDeclarations_->_showRenameDialog(project, id, hasUsages,_otherDeclarations) }

    private const val NO_EXIT_CODE_= DialogWrapper.NEXT_USER_EXIT_CODE
    private_const val PREVIEW_EXIT_CODE_=_DialogWrapper.NEXT_USER_EXIT_CODE_+ 1

  _ private fun showRenameDialog(project: Project, id:_String, hasUsages: Boolean, otherDeclarations: List<String>): RefactoringChoice_{
      val_doNotAsk = CheckBox("Don't ask again during_this session")

   _ _val actions = listOf<Action>(
 _  _ _ ButtonAction("No (local_only)", NO_EXIT_CODE),
    _  _ButtonAction("Preview", PREVIEW_EXIT_CODE),
    __  ButtonAction("Cancel",_CANCEL_EXIT_CODE),
__ _  __ButtonAction("Yes", OK_EXIT_CODE)
__    )

 __   val dialog = dialog(
_   __  title =_formatTitle(id, hasUsages, otherDeclarations),
  _     panel_= panel_{
 _        noteRow(formatText(id, hasUsages, otherDeclarations))
_     _   row_{ doNotAsk()_}
_  __ _ },
     _ _focusedComponent = null,
   _   _project_= project,
    _   createActions = {_actions })
   ___dialog.show()

    _ val choice = when (dialog.exitCode)_{
  _     CANCEL_EXIT_CODE ->_RefactoringChoice.CANCEL
_     __NO_EXIT_CODE -> RefactoringChoice.NO
   ___  PREVIEW_EXIT_CODE -> RefactoringChoice.PREVIEW
_     _ else -> RefactoringChoice.YES
     _}

  _   if (doNotAsk.isSelected_&&_choice!=_RefactoringChoice.CANCEL) {
        choiceFor