static class: BasicTextUI.TextTransferHandler
All Implemented Interfaces:
|Nested Class Summary:|
|static class ||TextTransferHandler.TextTransferable ||A possible implementation of the Transferable interface
for text components. For a JEditorPane with a rich set
of EditorKit implementations, conversions could be made
giving a wider set of formats. This is implemented to
offer up only the active content type and text/plain
(if that is not the active format) since that can be
extracted from other formats. |
|Methods from javax.swing.TransferHandler:|
canImport, canImport, createTransferable, exportAsDrag, exportDone, exportToClipboard, getCopyAction, getCutAction, getDragImage, getDragImageOffset, getPasteAction, getSourceActions, getVisualRepresentation, importData, importData, setDragImage, setDragImageOffset|
|Methods from java.lang.Object:|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait|
|Method from javax.swing.plaf.basic.BasicTextUI$TextTransferHandler Detail:|
public boolean canImport(JComponent comp,
This method indicates if a component would accept an import of the given
set of data flavors prior to actually attempting to import it.
protected Transferable createTransferable(JComponent comp)
Create a Transferable to use as the source for a data transfer.
protected void exportDone(JComponent source,
This method is called after data has been exported. This method should remove
the data that was transfered if the action was MOVE.
protected DataFlavor getImportFlavor(DataFlavor flavors,
Try to find a flavor that can be used to import a Transferable.
The set of usable flavors are tried in the following order:
- First, an attempt is made to find a flavor matching the content type
of the EditorKit for the component.
- Second, an attempt to find a text/plain flavor is made.
- Third, an attempt to find a flavor representing a String reference
in the same VM is made.
- Lastly, DataFlavor.stringFlavor is searched for.
public int getSourceActions(JComponent c)
This is the type of transfer actions supported by the source. Some models are
not mutable, so a transfer operation of COPY only should
be advertised in that case.
protected void handleReaderImport(Reader in,
boolean useRead) throws BadLocationException, IOException
Import the given stream data into the text component.
public boolean importData(TransferSupport support)
public boolean importData(JComponent comp,
This method causes a transfer to a component from a clipboard or a
DND drop operation. The Transferable represents the data to be
imported into the component.