Package org.fife.ui.rtextarea
Class RTATextTransferHandler.TextTransferable
java.lang.Object
org.fife.ui.rtextarea.RTATextTransferHandler.TextTransferable
- All Implemented Interfaces:
Transferable
- Enclosing class:
RTATextTransferHandler
A possible implementation of the Transferable interface for RTextAreas.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate JTextComponent
private Position
private Position
protected String
private static DataFlavor[]
private static DataFlavor[]
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected String
Fetch the data in a text/plain format.getTransferData
(DataFlavor flavor) Returns an object which represents the data to be transferred.Returns an array of DataFlavor objects indicating the flavors the data can be provided in.boolean
isDataFlavorSupported
(DataFlavor flavor) Returns whether the specified data flavor is supported for this object.protected boolean
isPlainFlavor
(DataFlavor flavor) Returns whether the specified data flavor is a plain flavor that is supported.protected boolean
Should the plain text flavors be offered? If so, the method getPlainData should be implemented to provide something reasonable.protected boolean
isStringFlavor
(DataFlavor flavor) Returns whether the specified data flavor is a String flavor that is supported.(package private) void
-
Field Details
-
p0
-
p1
-
c
-
plainData
-
stringFlavors
-
plainFlavors
-
-
Constructor Details
-
TextTransferable
TextTransferable(JTextComponent c, int start, int end)
-
-
Method Details
-
getPlainData
Fetch the data in a text/plain format. -
getTransferData
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 interfaceTransferable
- Parameters:
flavor
- the requested flavor for the data- Throws:
UnsupportedFlavorException
- if the requested data flavor is not supported.- See Also:
-
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 interfaceTransferable
- Returns:
- an array of data flavors in which this data can be transferred
-
isDataFlavorSupported
Returns whether the specified data flavor is supported for this object.- Specified by:
isDataFlavorSupported
in interfaceTransferable
- Parameters:
flavor
- the requested flavor for the data- Returns:
- boolean indicating whether the data flavor is supported
-
isPlainFlavor
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
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()
-