1 | package org.columba.mail.gui.config.subscribe;↵ | | 1 | package org.columba.mail.gui.config.subscribe;↵
|
|
2 | import org.columba.api.command.IWorkerStatusController;↵ | | 2 | import org.columba.api.command.IWorkerStatusController;↵
|
3 | import org.columba.core.command.Command;↵ | | 3 | import org.columba.core.command.Command;↵
|
4 | import org.columba.mail.folder.imap.IMAPRootFolder;↵ | | 4 | import org.columba.mail.folder.imap.IMAPRootFolder;↵
|
5 | import org.columba.mail.imap.IImapServer;↵ | | 5 | import org.columba.mail.imap.IImapServer;↵
|
|
6 | public class SubscribeFolderCommand extends Command {↵ | | 6 | public class UnsubscribeFolderCommand extends Command {↵
|
7 | private IMAPRootFolder root;↵ | | 7 | private IMAPRootFolder root;↵
|
|
8 | private IImapServer store;↵ | | 8 | private IImapServer store;↵
|
|
9 | /**↵ | | 9 | /**↵
|
10 | * @param references↵ | | 10 | * @param references↵
|
11 | */↵ | | 11 | */↵
|
12 | public SubscribeFolderCommand(SubscribeCommandReference reference) {↵ | | 12 | public UnsubscribeFolderCommand(SubscribeCommandReference reference) {↵
|
13 | super(reference);↵ | | 13 | super(reference);↵
|
14 | }↵ | | 14 | }↵
|
|
15 | /*↵ | | 15 | /*↵
|
16 | * (non-Javadoc)↵ | | 16 | * (non-Javadoc)↵
|
17 | * ↵ | | 17 | * ↵
|
18 | * @see org.columba.api.command.Command#execute(org.columba.api.command.Worker)↵ | | 18 | * @see org.columba.api.command.Command#execute(org.columba.api.command.Worker)↵
|
19 | */↵ | | 19 | */↵
|
20 | public void execute(IWorkerStatusController worker) throws Exception {↵ | | 20 | public void execute(IWorkerStatusController worker) throws Exception {↵
|
21 | SubscribeCommandReference subscribeReference = (SubscribeCommandReference) getReference();↵ | | 21 | SubscribeCommandReference subscribeReference = (SubscribeCommandReference) getReference();↵
|
22 | root = (IMAPRootFolder) subscribeReference.getSourceFolder();↵ | | 22 | root = (IMAPRootFolder) subscribeReference.getSourceFolder();↵
|
|
23 | store = root.getServer();↵ | | 23 | store = root.getServer();↵
|
|
24 | store.subscribeFolder(subscribeReference.getMailbox());↵ | | 24 | store.unsubscribeFolder(subscribeReference.getMailbox());↵
|
25 | }↵ | | 25 | }↵
|
|
26 | /*↵ | | 26 | /*↵
|
27 | * (non-Javadoc)↵ | | 27 | * (non-Javadoc)↵
|
28 | * ↵ | | 28 | * ↵
|
29 | * @see org.columba.api.command.Command#updateGUI()↵ | | 29 | * @see org.columba.api.command.Command#updateGUI()↵
|
30 | */↵ | | 30 | */↵
|
31 | public void updateGUI() throws Exception {↵ | | 31 | public void updateGUI() throws Exception {↵
|
32 | SubscribeDialog dialog = ((SubscribeCommandReference) getReference())↵ | | 32 | SubscribeDialog dialog = ((SubscribeCommandReference) getReference())↵
|
33 | .getDialog();↵ | | 33 | .getDialog();↵
|
|
34 | dialog.subscribeDone();↵ | | 34 | dialog.unsubscribeDone();↵
|
35 | | | 35 |
|