mirror of
https://github.com/SuspiciousActivity/ByteEdit.git
synced 2026-08-13 17:56:17 +00:00
Fixes and updates
This commit is contained in:
1 parent
d1710ea6a5
commit
fb4da77359
211 files changed
+45363
-45571
No files matched your search
@@ -14,17 +14,16 @@ import java.io.IOException;
|
||||
import java.io.StringReader;
|
||||
|
||||
/**
|
||||
* Object used during copy/paste and DnD operations to represent RTF text.
|
||||
* It can return the text being moved as either RTF or plain text. This
|
||||
* class is basically the same as
|
||||
* <code>java.awt.datatransfer.StringSelection</code>, except that it can also
|
||||
* return the text as RTF.
|
||||
* Object used during copy/paste and DnD operations to represent RTF text. It
|
||||
* can return the text being moved as either RTF or plain text. This class is
|
||||
* basically the same as <code>java.awt.datatransfer.StringSelection</code>,
|
||||
* except that it can also return the text as RTF.
|
||||
*
|
||||
* @author Robert Futrell
|
||||
* @version 1.0
|
||||
*/
|
||||
class RtfTransferable implements Transferable {
|
||||
|
||||
|
||||
/**
|
||||
* The RTF data, in bytes (the RTF is 7-bit ascii).
|
||||
*/
|
||||
@@ -32,19 +31,19 @@ class RtfTransferable implements Transferable {
|
||||
/**
|
||||
* The "flavors" the text can be returned as.
|
||||
*/
|
||||
private static final DataFlavor[] FLAVORS = { new DataFlavor("text/rtf", "RTF"), DataFlavor.stringFlavor, DataFlavor.plainTextFlavor // deprecated
|
||||
private static final DataFlavor[] FLAVORS = { new DataFlavor("text/rtf", "RTF"), DataFlavor.stringFlavor,
|
||||
DataFlavor.plainTextFlavor // deprecated
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
* @param data
|
||||
* The RTF data.
|
||||
* @param data The RTF data.
|
||||
*/
|
||||
RtfTransferable(byte[] data) {
|
||||
this.data = data;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public Object getTransferData(DataFlavor flavor) throws UnsupportedFlavorException, IOException {
|
||||
if (flavor.equals(FLAVORS[0])) { // RTF
|
||||
@@ -61,12 +60,12 @@ class RtfTransferable implements Transferable {
|
||||
throw new UnsupportedFlavorException(flavor);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public DataFlavor[] getTransferDataFlavors() {
|
||||
return FLAVORS.clone();
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean isDataFlavorSupported(DataFlavor flavor) {
|
||||
for (int i = 0; i < FLAVORS.length; i++) {
|
||||
|
||||
Reference in new issue
Block a user