inputAttemptWhenModal callback without inheriting?

I want to display a TextEditor over a ListBox for renaming one of the entries.
I want that TextEditor to be dismissed if the user interacts with any other part of the UI.

Calling enterModalState() on the TextEditor would be perfect to accomplish the behavior, if only I had (for example) a ComponentListener callback to register, from which to dismiss the TextEditor itself.

Inheriting a completely new subclass just to have a different behavior in inputAttemptWhenModal seems overkill, is that really the only alternative?

If so, I’m considering adding a FR for that.

Even a onInputAttemptWhenModal lambda in Component would do in this case.