Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4715176

RFE: PopupFactory difficult to customize, it has a bad interface

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Unresolved
    • Icon: P4 P4
    • None
    • 1.4.0
    • client-libs



      Name: jk109818 Date: 07/15/2002


      FULL PRODUCT VERSION :
      java version "1.4.0"
      Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.0-b92)
      Java HotSpot(TM) Client VM (build 1.4.0-b92, mixed mode)

      FULL OPERATING SYSTEM VERSION :

      This is generic, not OS-specific
      ADDITIONAL OPERATING SYSTEMS :

      FYI, I'm using Windows XP and Windows 2000


      A DESCRIPTION OF THE PROBLEM :
      PopupFactory needs an interface to help creating customized
      popupfactories. Another option would be an
      AbstractPopupFactory, or simply making the PopupFactory
      methods more public.

      Setting a new, customized shared instance is difficult, due
      to the fact that only PopupFactory objects are accepted.
      There are not many public methods in PopupFactory to allow
      customizing.

      For example, forcing heavy-weight popups to be used VM-wide
      (or, should I say, AppContext-wide) takes some hacking. It
      is possible, but not easy, nor pretty, at least with my
      skills.

      Heavy-weight popups (with individual window handles) are a
      necessity for mixed applications with lightweight,
      heavyweight and completely native UI-components.

      REPRODUCIBILITY :
      This bug can be reproduced always.

      CUSTOMER WORKAROUND :
      For forcing the use of heavy-weight popups, I used this
      hack: Create a new PopupFactory and assign it as the shared
      instance, override

      getPopup(Component owner, Component contents, int x, int y)

      Call super.getPopup with the owner as a (0,0) sized JWindow
      at the same location where the real owner is. Result should
      be a heavy-weight popup.

      Then you can get the window handle with the help of the not-
      so-well-documented sun.awt.windows.WToolkit, and do
      whatever tricks you need to do at the native side.
      (Review ID: 159385)
      ======================================================================

            Unassigned Unassigned
            jkimsunw Jeffrey Kim (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Imported:
              Indexed: