chromiumembedded / java-cef

Java Chromium Embedded Framework (JCEF). A simple framework for embedding Chromium-based browsers in other applications using the Java programming language.
https://bitbucket.org/chromiumembedded/java-cef
Other
605 stars 135 forks source link

Add way to add multiple load handlers to CefClient #462

Open TMSSassen opened 6 months ago

TMSSassen commented 6 months ago

Currently, CefClient.addLoadHandler is a bit of a misnomer - it would be more accurate to name it setLoaderHandler, as it's only possible to set one load handler, subsequent calls to addLoaderHandler are ignored.

This is inconsistent with regular behaviour of addHandlers/addListeners (e.g. calling Logger.addHandler twice does add two Handlers, not one).

To not have to change any method signatures of CefClient, a convenience class LoadHandlerCollection is created, which itself is a LoadHandler, and calls all its child LoadHandlers when its own handler methods are called.

1fxe commented 6 months ago

Hey, you should open a pr on bitbucket. Also, I can see one small change fix copyright year 2024. Make sure you also have run the fix style script 😉