Package net.rim.blackberry.api.mail

Examples of net.rim.blackberry.api.mail.Folder


     */
    private void sendInvitations() {
        Address[] to;

        // Find an outbox folder and use it to construct a new message
        Folder outbox = null;

        final Session session = Session.getDefaultInstance();
        if (session != null) {
            final ServiceConfiguration serviceConfiguration =
                    session.getServiceConfiguration();
View Full Code Here


                        .getFileName(), stream);

        final TextBodyPart tbp = new TextBodyPart(mp, messageData);
        mp.addBodyPart(tbp);
        mp.addBodyPart(sap);
        final Folder folders[] =
                Session.getDefaultInstance().getStore().list(Folder.SENT);
        final Message message = new Message(folders[0]);
        final Address[] toAdds = new Address[1];
        toAdds[0] = new Address(email, email);
        message.addRecipients(Message.RecipientType.TO, toAdds);
View Full Code Here

             */
            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();
                }
            }
        }));
    }
View Full Code Here

     *
     * @return A new message
     */
    Message getMessage() {
        // Find an outbox folder and use it to construct a new message
        final Folder outbox = _store.findFolder("Outbox")[FIRST];
        final Message message = new Message(outbox);

        // Add all the current headers
        for (int keyNo = 0; keyNo < HEADER_KEYS.length; keyNo++) {
            final Vector fieldsByType =
View Full Code Here

            if (newMessage != null) {
                // Retrieve an outbox to save the message in
                final Store store = Session.waitForDefaultSession().getStore();
                final Folder[] allOutboxFolders = store.list(Folder.OUTBOX);

                Folder outbox = null;
                for (int i = allOutboxFolders.length - 1; i >= 0; --i) {
                    final Folder parent = allOutboxFolders[i].getParent();
                    if (parent != null
                            && parent.getName().startsWith("Mailbox")) {
                        outbox = allOutboxFolders[i];
                        break;
                    }
                }
View Full Code Here

        // Add the different objects to the array of objects to display
        int indexToAddNewObjects = 0;

        // Add an entry to go back up a level if we are not in the root folder
        final Folder parent = _currentFolder.getParent();
        if (parent != null) {
            objectsToDisplay[0] = "..";
            indexToAddNewObjects++;
        }
View Full Code Here

TOP

Related Classes of net.rim.blackberry.api.mail.Folder

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.