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

datatransfer.Clipboard.setContent invokes listeners.flavorsChanged later

XMLWordPrintable

    • sparc
    • solaris_2.6



      Name: sdR10048 Date: 07/03/2003


      Filed By : SPB JCK team (###@###.###)
      JDK : java full version "1.5.0-beta-b09"
      JCK : 1.5

      Specification excerpt:
      ======================
      --------- J2SE API spec v.1.5 ---------
      ...
      public void addFlavorListener(FlavorListener?listener)

      Registers the specified FlavorListener to receive FlavorEvents
      from this clipboard. If listener is null, no exception is thrown
      and no action is performed.

      Parameters:
          listener - the listener to be added


      public void setContents(Transferable?contents,
                              ClipboardOwner?owner)

      Sets the current contents of the clipboard to the specified
      transferable object and registers the specified clipboard
      owner as the owner of the new contents. If there is an existing
      owner registered, that owner is notified that it no longer
      holds ownership of the clipboard contents. The method throws
      IllegalStateException if the clipboard is currently unavailable.
      For example, on some platforms, the system clipboard is unavailable
      while it is accessed by another application.

      Parameters:
          contents - the transferable object representing the clipboard
                     content
          owner - the object which owns the clipboard content

      Throws:
          IllegalStateException - if the clipboard is currently unavailable

      ...
      ---------- end-of-excerpt ---------------

      Problem description
      ===================
      Currently when we change Clipboard's DataFlavors (by calling
      Clipboard.setContents method) all registered flavor listeners receive
      appropriate FlavorEvent. But setContent uses EventQueue.invokeLater for it.

      That has been moved in with CCC 4259272 implementation.

      Javadoc says nothing about it, asynchronous behavior should be specified explicitly.

      ======================================================================

            agerasimsunw Alexander Gerasimov (Inactive)
            dsvsunw Dsv Dsv (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: