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

BasicTreeUI should use factory method to construct drop target listener

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Duplicate
    • Icon: P4 P4
    • None
    • 5.0
    • client-libs

      A DESCRIPTION OF THE REQUEST :
      The BasicTreeUI installListeners() method directly instantiates a TreeDropTargetListener to respond to DropTarget events. The rest of the installListeners() method use factory methods to add a level of indirection in creating these listener classes.


      JUSTIFICATION :
      A factory method should be used for TreeDropTargetListener too to allow custom L&Fs to provide custom TreeDropTargetListener.

      The pattern of using factory methods should be part of the L&F coding standards.


      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      I'd like to see a createDropTargetListener() method in BasicTreeUI with installListeners() calling it.

      CUSTOMER SUBMITTED WORKAROUND :
      The workaround is to copy the BasicTreeUI installListeners() method to BasicTreeUI subclass and change the creation of TreeDropTargetListener to desired class.
      ###@###.### 10/26/04 22:30 GMT

            shickeysunw Shannon Hickey (Inactive)
            rmandalasunw Ranjith Mandala (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: