scijava / ui-behaviour

Configurable input handling, via mapped behaviours
Other
4 stars 2 forks source link

Visual editor panel (cosmetic) refactoring #24

Closed xulman closed 4 years ago

xulman commented 4 years ago

This is supposed to be the solution to the issue #23 (at least the first commit is)

then I noticed public getter returing directly some private attribute and thought such getter is unnecessary (does not secure/protect anything), besides the getter was ill-named and should be deprecated anyway; I hope you'd like it ;-)

tpietzsch commented 4 years ago

Please make the fields private again and add back public getters.

Note, that these are (were) not the same type! The private field is Listeners.List<ConfigChangeListener> while the getter method returns Listeners<ConfigChangeListener>

Listeners.List allows to iterate the registered listeners and send messages to them. Listeners does not allow that.

We expose only Listeners via the getter, so that clients can use that to register listeners, but they cannot themselves send events or mess with other listeners.

xulman commented 4 years ago

Hi @tpietzsch , thanks for reviewing and esp. for the careful reading... I have totally overlooked last time the "detail", I'm sorry for that.

I've basically reverted and revised again. The current change in this branch is essentially: