Description
To support dynamic creation of the Menu for a MenuButton, the previewWindowOpen could be reintroduced so that one can populate the Menu before the popup window is opened. Today, one can only populate the menu in WindowStateListener#windowOpened, ie. after the popup window is displayed. This is problematic because correct positioning and sizing cannot be determined before the menu is populated. There are probably other use cases as well. This one was discussed here:
Code example:
menuButton.getListPopup().getWindowStateListeners().add(new WindowStateListener.Adapter() {
public Vote previewWindowOpen(Window window)
}
I will attach a patch that adds said functionality.