Search in sources :

Example 66 with Transferable

use of java.awt.datatransfer.Transferable in project otapij by FellowTraveler.

the class SendTransferDialog method jButton2ActionPerformed.

//GEN-LAST:event_jComboBox1ActionPerformed
private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {
    //GEN-FIRST:event_jButton2ActionPerformed
    Transferable clipboardContent = getToolkit().getSystemClipboard().getContents(this);
    if ((clipboardContent != null) && (clipboardContent.isDataFlavorSupported(DataFlavor.stringFlavor))) {
        try {
            String tempString;
            tempString = (String) clipboardContent.getTransferData(DataFlavor.stringFlavor);
            jTextField1.setText(tempString);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}
Also used : Transferable(java.awt.datatransfer.Transferable)

Example 67 with Transferable

use of java.awt.datatransfer.Transferable in project otapij by FellowTraveler.

the class ServerAcctDialog method jButton4ActionPerformed.

//GEN-LAST:event_jComboBox1ActionPerformed
private void jButton4ActionPerformed(java.awt.event.ActionEvent evt) {
    //GEN-FIRST:event_jButton4ActionPerformed
    Transferable clipboardContent = getToolkit().getSystemClipboard().getContents(this);
    if ((clipboardContent != null) && (clipboardContent.isDataFlavorSupported(DataFlavor.stringFlavor))) {
        try {
            String tempString;
            tempString = (String) clipboardContent.getTransferData(DataFlavor.stringFlavor);
            jTextField2.setText(tempString);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}
Also used : Transferable(java.awt.datatransfer.Transferable)

Example 68 with Transferable

use of java.awt.datatransfer.Transferable in project otapij by FellowTraveler.

the class WithdrawVoucherDialog method jButton2ActionPerformed.

//GEN-LAST:event_jComboBox1ActionPerformed
private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {
    //GEN-FIRST:event_jButton2ActionPerformed
    Transferable clipboardContent = getToolkit().getSystemClipboard().getContents(this);
    if ((clipboardContent != null) && (clipboardContent.isDataFlavorSupported(DataFlavor.stringFlavor))) {
        try {
            String tempString;
            tempString = (String) clipboardContent.getTransferData(DataFlavor.stringFlavor);
            jTextField1.setText(tempString);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}
Also used : Transferable(java.awt.datatransfer.Transferable)

Example 69 with Transferable

use of java.awt.datatransfer.Transferable in project otapij by FellowTraveler.

the class ProposePaymentDialog method jButton4ActionPerformed.

//GEN-LAST:event_jComboBox1ActionPerformed
private void jButton4ActionPerformed(java.awt.event.ActionEvent evt) {
    //GEN-FIRST:event_jButton4ActionPerformed
    Transferable clipboardContent = getToolkit().getSystemClipboard().getContents(this);
    if ((clipboardContent != null) && (clipboardContent.isDataFlavorSupported(DataFlavor.stringFlavor))) {
        try {
            String tempString;
            tempString = (String) clipboardContent.getTransferData(DataFlavor.stringFlavor);
            jTextField2.setText(tempString);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}
Also used : Transferable(java.awt.datatransfer.Transferable)

Example 70 with Transferable

use of java.awt.datatransfer.Transferable in project jadx by skylot.

the class MainDropTarget method drop.

@Override
@SuppressWarnings("unchecked")
public void drop(DropTargetDropEvent dtde) {
    if (!dtde.isDataFlavorSupported(DataFlavor.javaFileListFlavor)) {
        dtde.rejectDrop();
        return;
    }
    dtde.acceptDrop(dtde.getDropAction());
    try {
        Transferable transferable = dtde.getTransferable();
        List<File> transferData = (List<File>) transferable.getTransferData(DataFlavor.javaFileListFlavor);
        if (transferData != null && transferData.size() > 0) {
            dtde.dropComplete(true);
            // load first file
            mainWindow.openFile(transferData.get(0));
        }
    } catch (Exception e) {
        LOG.error("File drop operation failed", e);
    }
}
Also used : Transferable(java.awt.datatransfer.Transferable) List(java.util.List) File(java.io.File)

Aggregations

Transferable (java.awt.datatransfer.Transferable)96 UnsupportedFlavorException (java.awt.datatransfer.UnsupportedFlavorException)30 IOException (java.io.IOException)30 List (java.util.List)18 DataFlavor (java.awt.datatransfer.DataFlavor)14 ArrayList (java.util.ArrayList)14 File (java.io.File)13 Clipboard (java.awt.datatransfer.Clipboard)12 Point (java.awt.Point)9 StringSelection (java.awt.datatransfer.StringSelection)5 Project (com.intellij.openapi.project.Project)4 ClipboardOwner (java.awt.datatransfer.ClipboardOwner)4 TransferHandler (javax.swing.TransferHandler)4 Editor (com.intellij.openapi.editor.Editor)3 ActionEvent (java.awt.event.ActionEvent)3 JComponent (javax.swing.JComponent)3 TreePath (javax.swing.tree.TreePath)3 AsynchClientTask (cbit.vcell.client.task.AsynchClientTask)2 DataContext (com.intellij.openapi.actionSystem.DataContext)2 PsiElement (com.intellij.psi.PsiElement)2