Enum Class ContentProviders.CLIPBOARD_DATA

java.lang.Object
java.lang.Enum<ContentProviders.CLIPBOARD_DATA>
org.eclipse.swt.dnd.ContentProviders.CLIPBOARD_DATA
All Implemented Interfaces:
Serializable, Comparable<ContentProviders.CLIPBOARD_DATA>, Constable
Enclosing class:
ContentProviders

public static enum ContentProviders.CLIPBOARD_DATA extends Enum<ContentProviders.CLIPBOARD_DATA>
There are multiple clipboards in GTK, each with its own current contents (providers). We use this enum to store our view of the state of each of these clipboard types.
  • Enum Constant Details

  • Field Details

    • sourceId

      private final long sourceId
      Used to map the data passed through the serializers (from gdk_content_serializer_get_value) back to the clipboard data that value is referring to.
    • data

      private final Map<String,Object> data
      This contains the collection of data for each type of clipboard. Map of transferKey() -> associated data
    • providers

      private long providers
      The collection of GdkContentProviders that this clipboard currently has assigned to it.
  • Constructor Details

    • CLIPBOARD_DATA

      private CLIPBOARD_DATA(long id)
  • Method Details

    • values

      public static ContentProviders.CLIPBOARD_DATA[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static ContentProviders.CLIPBOARD_DATA valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • fromDNDConstants

      public static ContentProviders.CLIPBOARD_DATA fromDNDConstants(int clipboards)
      Return the DESTINATION instance matching the clipboards using the constants DND.CLIPBOARD and DND.SELECTION_CLIPBOARD
    • fromSourceId

      public static ContentProviders.CLIPBOARD_DATA fromSourceId(long sourceId)
      Returns the clipboard data matching the given sourceId
    • clear

      void clear()
      At the beginning of a set contents operation clear out any old data we have copied to the clipboard. TODO call clear when we lose ownership of this clipboard by registering with https://docs.gtk.org/gdk4/signal.Clipboard.changed.html and then maybe checking https://docs.gtk.org/gdk4/method.Clipboard.is_local.html and if not local anymore then we should clear the data we placed.