1 package org.columba.mail.folder.command; 19 20 import org.columba.api.command.ICommandReference; 21 import org.columba.api.command.IWorkerStatusController; 22 import org.columba.core.command.Command; 23 import org.columba.core.command.StatusObservableImpl; 24 import org.columba.core.command.Worker; 25 import org.columba.mail.command.IMailFolderCommandReference; 26 import org.columba.mail.folder.IMailbox; 27 28 37 public class MarkMessageCommand extends Command { 38 39 public final static int MARK_AS_READ = 1; 40 41 public final static int MARK_AS_UNREAD = -1; 42 43 public final static int MARK_AS_FLAGGED = 2; 44 45 public final static int MARK_AS_UNFLAGGED = -2; 46 47 public final static int MARK_AS_EXPUNGED = 3; 48 49 public final static int MARK_AS_UNEXPUNGED = -3; 50 51 public final static int MARK_AS_ANSWERED = 4; 52 53 public final static int MARK_AS_UNANSWERED = -4; 54 55 public final static int MARK_AS_SPAM = 5; 56 57 public final static int MARK_AS_NOTSPAM = -5; 58 59 public final static int MARK_AS_DRAFT = 6; 60 61 public final static int MARK_AS_NOTDRAFT = -6; 62 63 public final static int MARK_AS_RECENT = 7; 64 65 public final static int MARK_AS_NOTRECENT = -7; 66 67 73 public MarkMessageCommand(ICommandReference reference) { 74 super(reference); 75 } 76 77 80 public void execute(IWorkerStatusController worker) throws Exception { 81 82 88 IMailFolderCommandReference r = (IMailFolderCommandReference) getReference(); 89 90 Object [] uids = r.getUids(); 92 93 IMailbox srcFolder = (IMailbox) r.getSourceFolder(); 95 96 ((StatusObservableImpl) srcFolder.getObservable()).setWorker(worker); 98 99 int markVariant = r.getMarkVariant(); 101 102 srcFolder.setLastSelection(uids[0]); 104 105 srcFolder.markMessage(uids, markVariant); 107 108 } 109 110 } | Popular Tags |