1 package wjhk.jupload2.gui;
2
3 import java.awt.event.ActionEvent;
4 import java.awt.event.KeyEvent;
5
6 import javax.swing.Action;
7 import javax.swing.JMenuItem;
8 import javax.swing.JPopupMenu;
9 import javax.swing.KeyStroke;
10 import javax.swing.TransferHandler;
11
12 import wjhk.jupload2.policies.UploadPolicy;
13
14
15
16
17
18
19
20 public class JUploadMainPopupMenu extends JPopupMenu {
21
22
23 private static final long serialVersionUID = 4204344561680290852L;
24
25
26
27
28 private UploadPolicy uploadPolicy;
29
30
31
32
33
34
35
36 @SuppressWarnings("unused")
37 private JUploadPanel uploadPanel;
38
39 JUploadMainPopupMenu(UploadPolicy uploadPolicy, JUploadPanel uploadPanel) {
40 this.uploadPolicy = uploadPolicy;
41 this.uploadPanel = uploadPanel;
42
43
44
45
46 JMenuItem menuItem = new JMenuItem(this.uploadPolicy.getLocalizedString("menuitem_paste"));
47 menuItem.setActionCommand((String) TransferHandler.getPasteAction()
48 .getValue(Action.NAME));
49 menuItem.addActionListener(uploadPanel.getActionListener());
50 menuItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_V,
51 ActionEvent.CTRL_MASK));
52 menuItem.setMnemonic(KeyEvent.VK_P);
53
54 add(menuItem);
55 }
56
57 }