01: //The contents of this file are subject to the Mozilla Public License Version 1.1
02: //(the "License"); you may not use this file except in compliance with the
03: //License. You may obtain a copy of the License at http://www.mozilla.org/MPL/
04: //
05: //Software distributed under the License is distributed on an "AS IS" basis,
06: //WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
07: //for the specific language governing rights and
08: //limitations under the License.
09: //
10: //The Original Code is "The Columba Project"
11: //
12: //The Initial Developers of the Original Code are Frederik Dietz and Timo Stich.
13: //Portions created by Frederik Dietz and Timo Stich are Copyright (C) 2003.
14: //
15: //All Rights Reserved.
16: package org.columba.mail.gui.composer;
17:
18: import javax.swing.JMenuItem;
19: import javax.swing.JPopupMenu;
20:
21: import org.columba.core.resourceloader.IconKeys;
22: import org.columba.core.resourceloader.ImageLoader;
23: import org.columba.mail.resourceloader.MailImageLoader;
24:
25: /**
26: * Popup menu for the attachment view.
27: *
28: * @author frdietz
29: */
30:
31: public class AttachmentMenu extends JPopupMenu {
32: private JMenuItem menuItem;
33:
34: /**
35: * Creates a popup menu for the attachment view.
36: *
37: * @param c
38: * the attachment controller.
39: */
40: public AttachmentMenu(AttachmentController c) {
41: super ();
42:
43: initComponents(c);
44: }
45:
46: /**
47: * Inits the components for the popup menu.
48: *
49: * @param c
50: * the attachment controller.
51: */
52: private void initComponents(AttachmentController c) {
53: menuItem = new JMenuItem("Attach File..", MailImageLoader
54: .getSmallIcon("mail-attachment.png"));
55: menuItem.setActionCommand("ADD");
56: menuItem.addActionListener(c.getActionListener());
57: add(menuItem);
58: addSeparator();
59: menuItem = new JMenuItem("Remove Selected Attachments",
60: ImageLoader.getSmallIcon(IconKeys.EDIT_DELETE));
61: menuItem.setActionCommand("REMOVE");
62: menuItem.addActionListener(c.getActionListener());
63: add(menuItem);
64: }
65: }
|