Class RTATextTransferHandler.TextTransferable

java.lang.Object
org.fife.ui.rtextarea.RTATextTransferHandler.TextTransferable
All Implemented Interfaces:
Transferable
Enclosing class:
RTATextTransferHandler

static class RTATextTransferHandler.TextTransferable extends Object implements Transferable
A possible implementation of the Transferable interface for RTextAreas.
  • Field Details

  • Constructor Details

    • TextTransferable

      TextTransferable(JTextComponent c, int start, int end)
  • Method Details

    • getPlainData

      protected String getPlainData()
      Fetch the data in a text/plain format.
    • getTransferData

      public Object getTransferData(DataFlavor flavor) throws UnsupportedFlavorException
      Returns an object which represents the data to be transferred. The class of the object returned is defined by the representation class of the flavor.
      Specified by:
      getTransferData in interface Transferable
      Parameters:
      flavor - the requested flavor for the data
      Throws:
      UnsupportedFlavorException - if the requested data flavor is not supported.
      See Also:
    • getTransferDataFlavors

      public DataFlavor[] getTransferDataFlavors()
      Returns an array of DataFlavor objects indicating the flavors the data can be provided in. The array should be ordered according to preference for providing the data (from most richly descriptive to least descriptive).
      Specified by:
      getTransferDataFlavors in interface Transferable
      Returns:
      an array of data flavors in which this data can be transferred
    • isDataFlavorSupported

      public boolean isDataFlavorSupported(DataFlavor flavor)
      Returns whether the specified data flavor is supported for this object.
      Specified by:
      isDataFlavorSupported in interface Transferable
      Parameters:
      flavor - the requested flavor for the data
      Returns:
      boolean indicating whether the data flavor is supported
    • isPlainFlavor

      protected boolean isPlainFlavor(DataFlavor flavor)
      Returns whether the specified data flavor is a plain flavor that is supported.
      Parameters:
      flavor - the requested flavor for the data
      Returns:
      boolean indicating whether the data flavor is supported
    • isPlainSupported

      protected boolean isPlainSupported()
      Should the plain text flavors be offered? If so, the method getPlainData should be implemented to provide something reasonable.
    • isStringFlavor

      protected boolean isStringFlavor(DataFlavor flavor)
      Returns whether the specified data flavor is a String flavor that is supported.
      Parameters:
      flavor - the requested flavor for the data
      Returns:
      boolean indicating whether the data flavor is supported
    • removeText

      void removeText()