1 | public class SaveMessageSourceAsAction extends AbstractColumbaAction↵ | | 1 | public class ToggleAnsweredFlagAction extends AbstractColumbaAction↵
|
2 | implements↵ | | 2 | implements↵
|
3 | ISelectionListener {↵ | | 3 | ISelectionListener {↵
|
|
4 | /** JDK 1.4+ logging framework logger, used for logging. */↵ | | 4 | ↵
|
5 | private static final Logger LOG = Logger.getLogger("org.columba.mail.gui.table.action");↵ | | |
|
|
6 | public SaveMessageSourceAsAction(IFrameMediator controller) {↵ | | 5 | public ToggleAnsweredFlagAction(IFrameMediator frameMediator) {↵
|
7 | super(controller,↵ | | 6 | super(↵
|
8 | MailResourceLoader.getString("menu", "mainframe", "menu_file_save↵ | | 7 | frameMediator, MailResourceLoader.getString("menu", "mainframe",↵
|
9 | "));↵ | | 8 | "menu_message_toggleanswered"));↵
|
|
10 | // tooltip text↵ | | 9 | // tooltip text↵
|
11 | putValue(SHORT_DESCRIPTION,↵ | | 10 | putValue(SHORT_DESCRIPTION,↵
|
12 | MailResourceLoader.getString("menu", "mainframe",↵ | | 11 | MailResourceLoader.getString("menu",↵
|
13 | "menu_file_save_tooltip").replaceAll("&",↵ | | 12 | "mainframe", "menu_message_toggleanswered_tooltip").replaceAll("&",↵
|
14 | ""));↵ | | 13 | ""));↵
|
|
15 | // icons↵ | | 14 | // icons↵
|
16 | putValue(SMALL_ICON, ImageLoader.getSmallIcon("document-save.png"));↵ | | 15 | putValue(SMALL_ICON, MailImageLoader.getSmallIcon("message-mail-replied.png"));↵
|
17 | putValue(LARGE_ICON, ImageLoader.getIcon("document-save.png"));↵ | | 16 | // putValue(LARGE_ICON, ImageLoader.getI↵
|
|
| | | 17 | mageIcon("reply_small.png"));↵
|
|
| | | 18 | // shortcut key↵
|
| | | 19 | putValue(ACCELERATOR_KEY, KeyStroke.getKeyStroke('a'));↵
|
18 | ↵ | | 20 | ↵
|
19 | setEnabled(false);↵ | | 21 | setEnabled(false);↵
|
20 | ↵ | | |
|
21 | ((MailFrameMediator) frameMediator)↵ | | 22 | ((MailFrameMediator) frameMediator)↵
|
22 | .registerTableSelectionListener(this);↵ | | 23 | .registerTableSelectionListener(this);↵
|
23 | }↵ | | 24 | }↵
|
|
24 | /**↵ | | 25 | /*↵
|
25 | * Executes this action - i.e. saves message source↵ | | 26 | ↵
|
26 | * by invocing the necessary command.↵ | | |
|
27 | ↵ | | 27 | * (non-Javadoc)↵
|
| | | 28 | * ↵
|
28 | * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)↵ | | 29 | * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)↵
|
29 | */↵ | | 30 | */↵
|
30 | public void actionPerformed(ActionEvent evt) {↵ | | 31 | public void actionPerformed(ActionEvent evt) {↵
|
31 | IMailFolderCommandReference r = ((MailFrameMediator) getFrameMediator())↵ | | 32 | IMailFolderCommandReference r = ((MailFrameMediator) getFrameMediator())↵
|
32 | .getTableSelection();↵ | | 33 | .getTableSelection();↵
|
|
33 | LOG.info("Save Message Source As... called");↵ | | 34 | ↵
|
|
34 | SaveMessageSourceAsCommand c = new SaveMessageSourceAs↵ | | 35 | r.setMarkVariant(MarkMessageCommand.MARK_AS_ANSWERED);↵
|
|
35 | Command(r);↵ | | 36 | ToggleMarkCommand c = new ToggleMarkCommand(r);↵
|
|
36 | CommandProcessor.getInstance().addOp(c);↵ | | 37 | CommandProcessor.getInstance().addOp(c);↵
|
37 | }↵ | | 38 | }↵
|
|
38 | /**↵ | | 39 | ↵
|
39 | * Handles enabling / disabling of menu/action depending↵ | | |
|
40 | * on selection↵ | | |
|
41 | ↵ | | 40 | /*↵
|
| | | 41 | * (non-Javadoc)↵
|
| | | 42 | * ↵
|
42 | * @see org.columba.core.gui.util.ISelectionListener#selectionChanged(org.columba.core.gui.util.SelectionChangedEvent)↵ | | 43 | * @see org.columba.core.gui.util.ISelectionListener#selectionChanged(org.columba.core.gui.util.SelectionChangedEvent)↵
|
43 | */↵ | | 44 | */↵
|
44 | public void selectionChanged(SelectionChangedEvent e) {↵ | | 45 | public void selectionChanged(SelectionChangedEvent e) {↵
|
45 | setEnabled(((TableSelectionChangedEvent) e).getUids().length > 0) | | 46 | setEnabled(((TableSelectionChangedEvent) e).getUids().length > 0)
|