[FR] TextEditor::onFocusGained


#1

Thanks for the new lambda callbacks!

One that would be useful in a current project: TextEditor::onFocusGained


#2

The lambda callbacks are only really mirroring the equivalent Listener methods and I can imagine that it might get a bit out of hand if we start adding callbacks for everything. Couldn’t you register a global FocusChangeListener with the Desktop and use that to determine when the text editor gains focus?


#3

I ended up subclassing TextEditor in the end, hadn’t thought of the FocusChangeListener approach.

There is the focusGained overridable method; wouldn’t it make sense to expose lambda methods for those as well as the listener methods? It would reduce the need to subclass components.