/* Ċ Ġ* ĠCopyright Ġ 2 0 0 0 - 2 0 1 9 Ġ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 Ġtraining . editor . actions Ċ Ċ import Ġcom . intellij . openapi . action System .* Ċ import Ġcom . intellij . openapi . editor . Editor Ċ import Ġcom . intellij . openapi . project . D umb Aware Action Ċ import Ġjava . util .* Ċ Ċ class ĠBlock Caret Action ( private Ġval Ġeditor : ĠEditor ) Ġ: ĠD umb Aware Action ( Learn Actions . LE ARN _ BLOCK _ EDITOR _ C ARE T _ ACTION ), ĠLearn Actions Ġ{ ĊĊĠ Ġoverride Ġval Ġaction Id : ĠString ĊĠĠĠ Ġget () Ġ= ĠLearn Actions . LE ARN _ BLOCK _ EDITOR _ C ARE T _ ACTION ĊĊĠ Ġprivate Ġval Ġaction Handlers Ġ= Ġmutable ListOf < Runnable >() ĊĊĠ Ġinit Ġ{ ĊĠĠĠ Ġ// collect Ġall Ġshortcuts Ġfor Ġcaret Ġactions ĊĠĠĠ Ġval Ġsuper Shortcut Ġ= Ġmutable ListOf < Shortcut >() ĊĠĠĠ Ġval Ġcaret Action Ids Ġ= Ġmutable Set Of < String >() ĊĠĠĠ Ġcaret Action Ids . add ( Ide Actions . ACTION _ EDITOR _ MOVE _ C ARE T _ DOWN ) ĊĠĠĠ Ġcaret Action Ids . add ( Ide Actions . ACTION _ EDITOR _ MOVE _ C ARE T _ DOWN _ WITH _ SELECTION ) ĊĠĠĠ Ġcaret Action Ids . add ( Ide Actions . ACTION _ EDITOR _ MOVE _ C ARE T _ LEFT ) ĊĠĠĠ Ġcaret Action Ids . add ( Ide Actions . ACTION _ EDITOR _ MOVE _ C ARE T _ LEFT _ WITH _ SELECTION ) ĊĠĠĠ Ġcaret Action Ids . add ( Ide Actions . ACTION _ EDITOR _ MOVE _ C ARE T _ UP ) ĊĠĠĠ Ġcaret Action Ids . add ( Ide Actions . ACTION _ EDITOR _ MOVE _ C ARE T _ UP _ WITH _ SELECTION ) ĊĠĠĠ Ġcaret Action Ids . add ( Ide Actions . ACTION _ EDITOR _ MOVE _ C ARE T _ RIGHT ) ĊĠĠĠ Ġcaret Action Ids . add ( Ide Actions . ACTION _ EDITOR _ MOVE _ C ARE T _ RIGHT _ WITH _ SELECTION ) ĊĊĠĠĠ Ġ// block Ġclone Ġcaret ĊĠĠĠ Ġcaret Action Ids . add ( Ide Actions . ACTION _ EDITOR _ CL ONE _ C ARE T _ AB O VE ) ĊĠĠĠ Ġcaret Action Ids . add ( Ide Actions . ACTION _ EDITOR _ CL ONE _ C ARE T _ BE LOW ) ĊĊĠĠĠ Ġ// tab ĊĠĠĠ Ġcaret Action Ids . add ( Ide Actions . ACTION _ EDITOR _ TAB ) ĊĠĠĠ Ġcaret Action Ids . add ( Ide Actions . ACTION _ EDITOR _ EM ACS _ TAB ) ĊĊĠĠĠ Ġcaret Action Ids ĊĠĠĠĠĠ Ġ. map Ġ{ ĠAction Manager . getInstance (). getAction ( it ). shortcut Set . shortcuts Ġ} ĊĠĠĠĠĠ Ġ. forEach Ġ{ ĠCollections . addAll ( super Shortcut , Ġ* it ) Ġ} ĊĊĠĠĠ Ġval Ġshortcut Set Ġ= ĠCustom Shortcut Set (* super Shortcut . to Typed Array ()) ĊĠĠĠ Ġthis . register Custom Shortcut Set ( shortcut Set , Ġeditor . component ) ĊĠ Ġ} ĊĊĠ Ġoverride Ġfun Ġunregister Action () Ġ{ ĊĠĠĠ Ġthis . unregister Custom Shortcut Set ( editor . component ) ĊĠ Ġ} ĊĊĠ Ġoverride Ġfun ĠactionPerformed ( e : ĠAn ActionEvent ) Ġ{ ĊĠĠĠ Ġaction Handlers . forEach Ġ{ Ġit . run () Ġ} ĊĠ Ġ} ĊĊĠ Ġfun Ġadd Action Handler ( run nable : ĠRunnable ) Ġ{ ĊĠĠĠ Ġaction Handlers . add ( run nable ) ĊĠ Ġ} Ċ Ċ } Ċ