Uploaded image for project: 'Pivot'
  1. Pivot
  2. PIVOT-765

Reintroduce WindowStateListener#previewWindowOpen

    XMLWordPrintableJSON

Details

    • New Feature
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • 2.0
    • 2.0.1
    • wtk
    • None

    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:

      http://apache-pivot-users.399431.n3.nabble.com/How-to-create-menu-for-MenuButton-dynamically-td3103392.html

      Code example:

      menuButton.getListPopup().getWindowStateListeners().add(new WindowStateListener.Adapter() {
      public Vote previewWindowOpen(Window window)

      { // Populate menuButton's menu return Vote.APPROVE; }

      }

      I will attach a patch that adds said functionality.

      Attachments

        1. Pivot765-test.patch
          2 kB
          Edvin Syse
        2. WindowStatelistener-previewWindowOpen.patch
          9 kB
          Edvin Syse

        Activity

          People

            edvin Edvin Syse
            edvin Edvin Syse
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: