KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > columba > mail > gui > composer > AttachmentMenu


1 //The contents of this file are subject to the Mozilla Public License Version 1.1
2
//(the "License"); you may not use this file except in compliance with the
3
//License. You may obtain a copy of the License at http://www.mozilla.org/MPL/
4
//
5
//Software distributed under the License is distributed on an "AS IS" basis,
6
//WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
7
//for the specific language governing rights and
8
//limitations under the License.
9
//
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 JavaDoc;
19 import javax.swing.JPopupMenu JavaDoc;
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 JavaDoc {
32     private JMenuItem JavaDoc 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 JavaDoc("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 JavaDoc("Remove Selected Attachments", ImageLoader
60                 .getSmallIcon(IconKeys.EDIT_DELETE));
61         menuItem.setActionCommand("REMOVE");
62         menuItem.addActionListener(c.getActionListener());
63         add(menuItem);
64     }
65 }
66
Popular Tags