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

The Clipboard content is cleared by queued callback

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 2.0.3
    • 2.0.4, 2.1
    • None
    • None

    Description

      The Clipboard content is cleared by qued callback.

      We used LocalManifest value map to store references to POJO representing TreeView items participating in Cut and Paste.

      When we put LocalManifest to Clipboard using Clipboard.setContent, then we expected to get it back later using Clipboard.getContent().

      However this works only for the first time. Next, when we create new LocalManifest instance and put it to Clipboard we never get it back.

      The reason for this is implementation of org.apache.pivot.wtk.Clipboard.setContent method. The inner ClipboardOwner class clears the LocalManifest stored in Clipboard.content static variable. The problém is, that the call to lostOwnerhip notification method is not called directly from AWT Clipboard.setContents method, but queued to AWT Event queue.

      So the ClipboardOwner from previous call to org.apache.pivot.wtk.Clipboard.setContent method, clears the new Clipboard.content field immediately since it is executed later from AWT event queue.

      This is not problem for text, image and files, because of propagation to AWT clipboard.

      Patch will be uploaded...

      Attachments

        Activity

          People

            smartini Sandro Martini
            kaja78 Karel Hübl
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: