Home » openjdk-7 » javax » swing » plaf » basic » [javadoc | source]
static class: BasicTextUI.TextTransferHandler [javadoc | source]

All Implemented Interfaces:
    UIResource, Serializable

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. 
Fields inherited from javax.swing.TransferHandler:
NONE,  COPY,  MOVE,  COPY_OR_MOVE,  LINK,  cutAction,  copyAction,  pasteAction
Method from javax.swing.plaf.basic.BasicTextUI$TextTransferHandler Summary:
canImport,   createTransferable,   exportDone,   getImportFlavor,   getSourceActions,   handleReaderImport,   importData,   importData
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,
    DataFlavor[] flavors) 
    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,
    Transferable data,
    int action) 
    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,
    JTextComponent c) 
    Try to find a flavor that can be used to import a Transferable. The set of usable flavors are tried in the following order:
    1. First, an attempt is made to find a flavor matching the content type of the EditorKit for the component.
    2. Second, an attempt to find a text/plain flavor is made.
    3. Third, an attempt to find a flavor representing a String reference in the same VM is made.
    4. 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,
    JTextComponent c,
    boolean useRead) throws BadLocationException, IOException 
    Import the given stream data into the text component.
 public boolean importData(TransferSupport support) 
 public boolean importData(JComponent comp,
    Transferable t) 
    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.