void (AWTEvent event) { switch (event.getID()) { case MouseEvent.MOUSE_PRESSED, MouseEvent.MOUSE_RELEASED, MouseEvent.MOUSE_DRAGGED -> { MouseEvent me = (MouseEvent)event; if (isDescendingFrom(me.getComponent(), this) || isPopupOverEditor(me.getComponent())) { requestUpdate(); } } case KeyEvent.KEY_PRESSED, KeyEvent.KEY_RELEASED -> { KeyEvent ke = (KeyEvent)event; if (isDescendingFrom(ke.getComponent(), this)) { requestUpdate(); } } } }