1 19 20 package org.netbeans.modules.tasklist.usertasks.actions; 21 22 import java.awt.datatransfer.Clipboard ; 23 import java.awt.datatransfer.Transferable ; 24 import java.awt.event.ActionEvent ; 25 import javax.swing.AbstractAction ; 26 import javax.swing.TransferHandler ; 27 import javax.swing.event.ListSelectionEvent ; 28 import javax.swing.tree.TreePath ; 29 import org.netbeans.modules.tasklist.usertasks.UserTaskListTreeTableNode; 30 import org.netbeans.modules.tasklist.usertasks.UserTaskTreeTableNode; 31 import org.netbeans.modules.tasklist.usertasks.UserTaskView; 32 import org.netbeans.modules.tasklist.usertasks.transfer.MyTransferHandler; 33 import org.openide.util.NbBundle; 34 35 40 public final class UTPasteAtTopLevelAction extends AbstractAction { 41 private UserTaskView utv; 42 43 48 public UTPasteAtTopLevelAction(UserTaskView utv) { 49 super(NbBundle.getMessage(UTPasteAtTopLevelAction.class, 50 "PasteAtTopLevel")); this.utv = utv; 52 setEnabled(true); 53 } 54 55 public void actionPerformed(ActionEvent e) { 56 TransferHandler th = utv.getTreeTable().getTransferHandler(); 57 Clipboard clipboard = utv.getToolkit().getSystemClipboard(); 58 Transferable t = clipboard.getContents(this); 59 if (t != null) 60 ((MyTransferHandler) th).importData(utv.getTreeTable(), t, true); 61 } 62 } 63 | Popular Tags |