*/
public void execute(final ReadOnlyCommandMetadata metadata,
final Object context) {
_currentDisplayMode = FOLDERS_VIEW_MODE;
final Folder currentFolder =
((Message) getSelectedItem()).getFolder();
final FoldersViewScreen foldersViewScreen =
new FoldersViewScreen(currentFolder);
UiApplication.getUiApplication().pushScreen(foldersViewScreen);
}
}));
_deleteMenuItem =
new MenuItem(new StringProvider("Delete Message"), 0x230010, 0);
_deleteMenuItem.setCommand(new Command(new CommandHandler() {
/**
* @see net.rim.device.api.command.CommandHandler#execute(ReadOnlyCommandMetadata,
* Object)
*/
public void execute(final ReadOnlyCommandMetadata metadata,
final Object context) {
final int choice =
Dialog.ask(Dialog.D_YES_NO, "Delete message?",
Dialog.YES);
if (choice == Dialog.YES) {
final Message message = (Message) getSelectedItem();
final Folder folder = message.getFolder();
folder.deleteMessage(message);
updateScreen();
}
}
}));
}