1 | public class AddSenderToAddressbookAction extends AbstractColumbaAction↵ | | 1 | public class ReplyWithTemplateAction extends AbstractColumbaAction↵
|
2 | implements ↵ | | 2 | implements↵
|
3 | ISelectionListener {↵ | | 3 | ISelectionListener {↵
|
4 | public AddSenderToAddressbook↵ | | 4 | /**↵
|
| | | 5 | * ↵
|
| | | 6 | */↵
|
5 | Action(IFrameMediator frameMediator) {↵ | | 7 | public ReplyWithTemplateAction(IFrameMediator frameMediator) {↵
|
6 | super(frameMediator, MailResourceLoader.getString("menu", "mainframe",↵ | | 8 | super(frameMediator, MailResourceLoader.getString("menu", "mainframe",↵
|
7 | "menu_message_addsender"));↵ | | 9 | "menu_message_replywithtemplate"));↵
|
|
8 | // tooltip text↵ | | 10 | // tooltip text↵
|
9 | putValue(SHORT_DESCRIPTION, MailResourceLoader.getString("menu",↵ | | 11 | putValue(SHORT_DESCRIPTION, MailResourceLoader.getString("menu",↵
|
10 | "mainframe", "menu_message_addsender_tooltip")↵ | | 12 | "mainframe", "menu_message_replywithtemplate_tooltip")↵
|
11 | .replaceAll("&",↵ | | 13 | .replaceAll("&",↵
|
12 | ""));↵ | | 14 | ""));↵
|
|
13 | // icon for menu↵ | | |
|
14 | putValue(SMALL_ICON, ImageLoader.getSmallIcon(IconKeys.CONTACT_NEW));↵ | | 15 | putValue(SMALL_ICON, MailImageLoader.getSmallIcon(↵
|
|
15 | // icon for toolbar↵ | | 16 | "internet-news-reader.png"));↵
|
16 | putValue(LARGE_ICON, ImageLoader.getIcon(IconKeys.CONTACT_NEW));↵ | | 17 | putValue(LARGE_ICON, MailImageLoader.getIcon("internet-news-reader.png"));↵
|
|
17 | setEnabled(false);↵ | | 18 | setEnabled(false);↵
|
|
18 | ((MailFrameMediator) frameMediator)↵ | | 19 | ((MailFrameMediator) frameMediator)↵
|
19 | .registerTableSelectionListener(this);↵ | | 20 | .registerTableSelectionListener(this);↵
|
20 | }↵ | | 21 | }↵
|
|
21 | /*↵ | | 22 | /*↵
|
22 | * (non-Javadoc)↵ | | 23 | * (non-Javadoc)↵
|
23 | * ↵ | | 24 | * ↵
|
24 | * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)↵ | | 25 | * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)↵
|
25 | */↵ | | 26 | */↵
|
26 | public void actionPerformed(ActionEvent evt) {↵ | | 27 | public void actionPerformed(ActionEvent evt) {↵
|
27 | IMailFolderCommandReference r = ((MailFrameMediator) getFrameMediator())↵ | | 28 | IMailFolderCommandReference r1 = ((MailFrameMediator) getFrameMediator())↵
|
28 | .getTableSelection();↵ | | 29 | .getTableSelection();↵
|
|
29 | CommandProcessor.getInstance().addOp(↵ | | 30 | CommandProcessor.getInstance().addOp(↵
|
30 | new AddSenderToAddressbookCommand(r));↵ | | 31 | new ReplyWithTemplateCommand(getFrameMediator(), r1));↵
|
31 | }↵ | | 32 | }↵
|
|
32 | /*↵ | | 33 | /*↵
|
33 | * (non-Javadoc)↵ | | 34 | * (non-Javadoc)↵
|
34 | * ↵ | | 35 | * ↵
|
35 | * @see org.columba.core.gui.util.ISelectionListener#selectionChanged(org.columba.core.gui.util.SelectionChangedEvent)↵ | | 36 | * @see org.columba.core.gui.util.ISelectionListener#selectionChanged(org.columba.core.gui.util.SelectionChangedEvent)↵
|
36 | */↵ | | 37 | */↵
|
37 | public void selectionChanged(SelectionChangedEvent e) {↵ | | 38 | public void selectionChanged(SelectionChangedEvent e) {↵
|
38 | setEnabled(((TableSelectionChangedEvent) e).getUids().length > 0) | | 39 | setEnabled(((TableSelectionChangedEvent) e).getUids().length > 0)
|