KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > columba > mail > gui > action > SearchMessageAction


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.action;
17
18 import java.awt.Toolkit JavaDoc;
19 import java.awt.event.ActionEvent JavaDoc;
20 import java.awt.event.KeyEvent JavaDoc;
21
22 import javax.swing.KeyStroke JavaDoc;
23
24 import org.columba.api.gui.frame.IFrameMediator;
25 import org.columba.core.gui.action.AbstractColumbaAction;
26 import org.columba.core.resourceloader.ImageLoader;
27 import org.columba.mail.folder.IMailbox;
28 import org.columba.mail.gui.config.search.SearchFrame;
29 import org.columba.mail.gui.frame.AbstractMailFrameController;
30 import org.columba.mail.gui.tree.FolderTreeModel;
31 import org.columba.mail.util.MailResourceLoader;
32
33
34 public class SearchMessageAction extends AbstractColumbaAction {
35     public SearchMessageAction(IFrameMediator controller) {
36         super(controller,
37             MailResourceLoader.getString("menu", "mainframe",
38                 "menu_edit_searchmessages"));
39
40         // tooltip text
41
putValue(SHORT_DESCRIPTION,
42             MailResourceLoader.getString("menu", "mainframe",
43                 "menu_edit_searchmessages").replaceAll("&", ""));
44
45         // small icon for menu
46
putValue(SMALL_ICON, ImageLoader.getSmallIcon("system-search.png"));
47
48         // large icon for toolbar
49
putValue(LARGE_ICON, ImageLoader.getIcon("system-search.png"));
50
51         // shortcut key
52
putValue(ACCELERATOR_KEY,
53             KeyStroke.getKeyStroke(KeyEvent.VK_S, Toolkit.getDefaultToolkit().getMenuShortcutKeyMask()));
54     }
55
56     /* (non-Javadoc)
57      * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
58      */

59     public void actionPerformed(ActionEvent JavaDoc evt) {
60         IMailbox searchFolder = (IMailbox) FolderTreeModel.getInstance().getFolder("106");
61
62         SearchFrame frame = new SearchFrame((AbstractMailFrameController) getFrameMediator(),
63                 searchFolder);
64     }
65 }
66
Popular Tags