/* Ċ Ġ* ĠCopyright Ġ( C ) Ġ 2 0 2 0 ĠThe ĠAndroid ĠOpen ĠSource ĠProject Ċ Ġ* Ċ Ġ* ĠLicensed Ġunder Ġthe ĠApache ĠLicense , ĠVersion Ġ 2 . 0 Ġ( the Ġ" License "); Ċ Ġ* Ġyou Ġmay Ġnot Ġuse Ġthis Ġfile Ġexcept Ġin Ġcompliance Ġwith Ġthe ĠLicense . Ċ Ġ* ĠYou Ġmay Ġobtain Ġa Ġcopy Ġof Ġthe ĠLicense Ġat Ċ Ġ* Ċ Ġ* ĠĠĠĠĠ Ġhttp :// www . apache . org / licenses / LICENSE - 2 . 0 Ċ Ġ* Ċ Ġ* ĠUnless Ġrequired Ġby Ġapplicable Ġlaw Ġor Ġagreed Ġto Ġin Ġwriting , Ġsoftware Ċ Ġ* Ġdistributed Ġunder Ġthe ĠLicense Ġis Ġdistributed Ġon Ġan Ġ" AS ĠIS " ĠBASIS , Ċ Ġ* ĠWITHOUT ĠWARRANTIES ĠOR ĠCONDITIONS ĠOF ĠANY ĠKIND , Ġeither Ġexpress Ġor Ġimplied . Ċ Ġ* ĠSee Ġthe ĠLicense Ġfor Ġthe Ġspecific Ġlanguage Ġgoverning Ġpermissions Ġand Ċ Ġ* Ġlimitations Ġunder Ġthe ĠLicense . Ċ Ġ*/ Ċ package Ġcom . android . tools . idea . emulator . actions Ċ Ċ import Ġcom . android . tools . idea . emulator . EM UL ATOR _ CONTROLLER _ KEY Ċ import Ġcom . android . tools . idea . emulator . EM UL ATOR _ VIEW _ KEY Ċ import Ġcom . android . tools . idea . emulator . Em ulator Controller Ċ import Ġcom . android . tools . idea . emulator . Em ulator View Ċ import Ġcom . android . tools . idea . emulator . NUMBER _ OF _ DISPLAY S Ċ import Ġcom . intellij . openapi . action System . An Action Ċ import Ġcom . intellij . openapi . action System . An ActionEvent Ċ import Ġcom . intellij . openapi . action System . Common Data Keys Ċ import Ġcom . intellij . openapi . project . D umb Aware Ċ import Ġcom . intellij . openapi . project . Project Ċ Ċ /** Ċ Ġ* ĠCommon Ġsuperclass Ġfor Ġtoolbar Ġactions Ġof Ġthe ĠEm ulator Ġwindow . Ċ Ġ*/ Ċ abstract Ġclass ĠAbstract Em ulator Action Ġ: ĠAn Action (), ĠD umb Aware Ġ{ ĊĊĠ Ġoverride Ġfun Ġupdate ( event : ĠAn ActionEvent ) Ġ{ ĊĠĠĠ Ġevent . presentation . isEnabled Ġ= Ġis Enabled ( event ) ĊĠ Ġ} ĊĊĠ Ġprotected Ġopen Ġfun Ġis Enabled ( event : ĠAn ActionEvent ): ĠBoolean Ġ= ĊĠĠĠ Ġis Em ulator Connected ( event ) Ċ } Ċ Ċ internal Ġfun Ġget Project ( event : ĠAn ActionEvent ): ĠProject Ġ= ĊĠ Ġevent . get Required Data ( Common Data Keys . PROJECT ) Ċ Ċ internal Ġfun Ġget Em ulator Controller ( event : ĠAn ActionEvent ): ĠEm ulator Controller ? Ġ= ĊĠ Ġevent . data Context . getData ( EM UL ATOR _ CONTROLLER _ KEY ) Ċ Ċ internal Ġfun Ġget Em ulator View ( event : ĠAn ActionEvent ): ĠEm ulator View ? Ġ= ĊĠ Ġevent . data Context . getData ( EM UL ATOR _ VIEW _ KEY ) Ċ Ċ internal Ġfun Ġget NumberOf Display s ( event : ĠAn ActionEvent ): ĠInt Ġ= ĊĠ Ġevent . data Context . getData ( NUMBER _ OF _ DISPLAY S ) Ġ?: Ġ 0 Ċ Ċ internal Ġfun Ġis Em ulator Connected ( event : ĠAn ActionEvent ) Ġ= ĊĠ Ġget Em ulator Controller ( event )?. connection State Ġ== ĠEm ulator Controller . Connection State . CONNECTED Ċ