// ĠCopyright Ġ 2 0 0 0 - 2 0 2 0 ĠJetBrains Ġs . r . o . ĠUse Ġof Ġthis Ġsource Ġcode Ġis Ġgoverned Ġby Ġthe ĠApache Ġ 2 . 0 Ġlicense Ġthat Ġcan Ġbe Ġfound Ġin Ġthe ĠLICENSE Ġfile . Ċ package Ġcom . intellij . openapi . vcs . changes . actions Ċ Ċ import Ġcom . intellij . openapi . action System . Action Places . CHANG ES _ VIEW _ TOOL BAR Ċ import Ġcom . intellij . openapi . action System . An ActionEvent Ċ import Ġcom . intellij . openapi . file Editor . File Document Manager Ċ import Ġcom . intellij . openapi . project . D umb Aware Action Ċ import Ġcom . intellij . openapi . util . text . StringUtil . remove El lipsis Suffix Ċ import Ġcom . intellij . openapi . vcs . V cs Bundle . message Ċ import Ġcom . intellij . openapi . vcs . V cs Data Keys Ċ import Ġcom . intellij . openapi . vcs . actions . is Project Uses Non Modal Commit Ċ import Ġcom . intellij . openapi . vcs . changes . Change List Manager Ċ import Ġcom . intellij . openapi . vcs . changes . ui . Changes ListView Ċ import Ġcom . intellij . openapi . vcs . changes . ui . Rollback Changes Dialog Ċ import Ġcom . intellij . util . ui . UI Util . remove Mnemonic Ċ import Ġcom . intellij . vcs Util . Rollback Util . get Rollback Operation Name Ċ Ċ class ĠRoll back Files Action Ġ: ĠD umb Aware Action () Ġ{ ĊĠ Ġoverride Ġfun Ġupdate ( e : ĠAn ActionEvent ) Ġ{ ĊĠĠĠ Ġe . presentation . isEnabled And Visible Ġ= Ġfalse ĊĊĠĠĠ Ġif Ġ(! e . is Project Uses Non Modal Commit ()) Ġreturn ĊĠĠĠ Ġval Ġproject Ġ= Ġe . project Ġ?: Ġreturn ĊĠĠĠ Ġval Ġchanges View Ġ= Ġe . getData ( Changes ListView . DATA _ KEY ) Ġ?: Ġreturn ĊĠĠĠ Ġval Ġchanges Ġ= Ġchanges View . selected Changes . take ( 2 ). toList () ĊĊĠĠĠ Ġwith ( e . presentation ) Ġ{ ĊĠĠĠĠĠ Ġis Visible Ġ= Ġtrue ĊĠĠĠĠĠ Ġis Enabled Ġ= Ġchanges . isNotEmpty () ĊĠĠĠĠĠ Ġtext Ġ= Ġmessage (" action . for . file . with . dialog . text ", Ġget Rollback Operation Name ( project ), Ġchanges . size ) ĊĠĠĠ Ġ} ĊĠ Ġ} ĊĊĠ Ġoverride Ġfun ĠactionPerformed ( e : ĠAn ActionEvent ) Ġ{ ĊĠĠĠ Ġif Ġ(! check Cl m Active ( e )) Ġreturn ĊĊĠĠĠ Ġval Ġproject Ġ= Ġe . project !! ĊĠĠĠ Ġval Ġchanges Ġ= Ġe . getData ( V cs Data Keys . CHANG ES ) !!. toList () ĊĊĠĠĠ ĠFile Document Manager . getInstance (). save All Documents () ĊĠĠĠ ĠRoll back Changes Dialog . rollback Changes ( project , Ġchanges ) ĊĠ Ġ} ĊĊĠ Ġcompanion Ġobject Ġ{ ĊĠĠĠ Ġ@ Jvm Static ĊĠĠĠ Ġfun Ġcheck Cl m Active ( e : ĠAn ActionEvent ): ĠBoolean Ġ{ ĊĠĠĠĠĠ Ġval Ġproject Ġ= Ġe . project Ġ?: Ġreturn Ġfalse ĊĠĠĠĠĠ Ġval Ġtitle Ġ= ĊĠĠĠĠĠĠĠ Ġif Ġ( CHANG ES _ VIEW _ TOOL BAR Ġ== Ġe . place ) Ġnull ĊĠĠĠĠĠĠĠ Ġelse Ġmessage (" error . cant . perform . operation . now ", Ġremove El lipsis Suffix ( remove Mnemonic ( get Rollback Operation Name ( project )))) ĊĊĠĠĠĠĠ Ġreturn Ġ! Change List Manager . getInstance ( project ). is Free zed With Notification ( title ) ĊĠĠĠ Ġ} ĊĠ Ġ} Ċ }