/* Ċ Ġ* Ġ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 . settings Ċ Ċ import Ġcom . android . tools . idea . Ide Info Ċ import Ġcom . android . tools . idea . emulator . DEFAULT _ SNAPSHOT _ AUTO _ DE LE TION _ POLICY Ċ import Ġcom . android . tools . idea . emulator . Em ulator Settings Ċ import Ġcom . android . tools . idea . emulator . Em ulator Settings . Snapshot Auto Deletion Policy Ċ import Ġcom . intellij . openapi . options . Configurable Ċ import Ġcom . intellij . openapi . options . ConfigurationException Ċ import Ġcom . intellij . openapi . options . Search able Configurable Ċ import Ġcom . intellij . openapi . ui . ComboBox Ċ import Ġcom . intellij . ui . Enum ComboBox Model Ċ import Ġcom . intellij . ui . Simple List Cell Renderer Ċ import Ġcom . intellij . ui . layout . panel Ċ import Ġcom . intellij . ui . layout . selected Ċ import Ġorg . jetbrains . annotations . N ls Ċ import Ġjavax . swing . J CheckBox Ċ Ċ /** Ċ Ġ* ĠImplementation Ġof ĠSettings Ġ> ĠTools Ġ> ĠEm ulator Ġpreference Ġpage . Ċ Ġ*/ Ċ class ĠEm ulator Settings Ui Ġ: ĠSearch able Configurable , ĠConfigur able . No Scroll Ġ{ ĊĊĠ Ġprivate Ġlateinit Ġvar Ġlaunch In Tool Window CheckBox : ĠJ CheckBox ĊĠ Ġprivate Ġlateinit Ġvar Ġsnapshot Auto Deletion Policy ComboBox : ĠCombo Box < Snapshot Auto Deletion Policy > ĊĠ Ġprivate Ġval Ġsnapshot Auto Deletion Policy ComboBox Model Ġ= ĠEnum ComboBox Model ( Snapshot Auto Deletion Policy :: class . java ) ĊĊĠ Ġprivate Ġval Ġstate Ġ= ĠEm ulator Settings . getInstance () ĊĊĠ Ġoverride Ġfun ĠgetId () Ġ= Ġ" emulator . options " ĊĊĠ Ġoverride Ġfun Ġcreate Component () Ġ= Ġpanel Ġ{ ĊĠĠĠ Ġrow Ġ{ ĊĠĠĠĠĠ Ġlaunch In Tool Window CheckBox Ġ= ĊĠĠĠĠĠĠĠĠĠ ĠcheckBox (" Launch Ġin Ġa Ġtool Ġwindow ", ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġcomment Ġ= Ġ" En abling Ġthis Ġsetting Ġwill Ġcause ĠAndroid ĠEm ulator Ġto Ġlaunch Ġin Ġa Ġtool Ġwindow . Ġ" Ġ+ ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ" Other wise ĠAndroid ĠEm ulator Ġwill Ġlaunch Ġas Ġa Ġstandalone Ġapplication . "). component ĊĠĠĠ Ġ} ĊĠĠĠ Ġblock Row Ġ{} Ġ// ĠVisual Ġseparator . ĊĠĠĠ Ġrow Ġ{ ĊĠĠĠĠĠ Ġcell ( is Vertical Flow Ġ= Ġtrue ) Ġ{ ĊĠĠĠĠĠĠĠ Ġlabel (" When Ġencounter ing Ġsnapshots Ġincompatible Ġwith Ġthe Ġcurrent Ġconfiguration :") ĊĠĠĠĠĠĠĠ Ġsnapshot Auto Deletion Policy ComboBox Ġ= ĊĠĠĠĠĠĠĠĠĠĠĠ Ġcombo Box ( snapshot Auto Deletion Policy ComboBox Model , ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ{ Ġsnapshot Auto Deletion Policy ComboBox Model . selected Item Ġ}, ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ{ Ġsnapshot Auto Deletion Policy ComboBox Model . setSelected Item ( it ) Ġ}, ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġrenderer Ġ= ĠSimple List Cell Renderer . create ( DEFAULT _ SNAPSHOT _ AUTO _ DE LE TION _ POLICY . displayName ) Ġ{ Ġit ?. displayName Ġ}) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ. enable If ( launch In Tool Window CheckBox . selected ) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ. component ĊĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} ĊĠ Ġ} ĊĊĠ Ġoverride Ġfun Ġis Modified (): ĠBoolean Ġ{ ĊĠĠĠ Ġreturn Ġlaunch In Tool Window CheckBox . isSelected Ġ!= Ġstate . launch In Tool Window Ġ|| ĊĠĠĠĠĠĠĠĠĠĠ Ġsnapshot Auto Deletion Policy ComboBox Model . selected Item Ġ!= Ġstate . snapshot Auto Deletion Policy ĊĠ Ġ} ĊĊĠ Ġ@ Throws ( ConfigurationException :: class ) ĊĠ Ġoverride Ġfun Ġapply () Ġ{ ĊĠĠĠ Ġstate . launch In Tool Window Ġ= Ġlaunch In Tool Window CheckBox . isSelected ĊĠĠĠ Ġstate . snapshot Auto Deletion Policy Ġ= Ġsnapshot Auto Deletion Policy ComboBox Model . selected Item ĊĠ Ġ} ĊĊĠ Ġoverride Ġfun Ġreset () Ġ{ ĊĠĠĠ Ġlaunch In Tool Window CheckBox . isSelected Ġ= Ġstate . launch In Tool Window ĊĠĠĠ Ġsnapshot Auto Deletion Policy ComboBox Model . setSelected Item ( state . snapshot Auto Deletion Policy ) ĊĠ Ġ} ĊĊĠ Ġ@ N ls ĊĠ Ġoverride Ġfun Ġget DisplayName () Ġ= Ġif Ġ( Ide Info . getInstance (). is Android Studio ) Ġ" Em ulator " Ġelse Ġ" Android ĠEm ulator " Ċ }