Newbie question: why is Button.ClickEvent an inner class?

I would have expected either that:

  • ClickEvent would be a static class
  • ClickEvent would be an inner class, but with a no-arg constructor, and then #getButton() would simply return the enclosing instance

Instead, it’s both an inner class but with a constructor that allows you to specify what component caused it.

So the net effect is that you’re dragging around a Button instance even if you were to specify a different source.

Is this a typo, or am I just not understanding?