FileDocCategorySizeDatePackage
MessageInboxScreen.javaAPI DocWireless Messaging API3792Mon Nov 10 21:11:18 GMT 2003wmafw

MessageInboxScreen

public class MessageInboxScreen extends Object
MessageInboxScreen displays the short message inbox.

Fields Summary
protected static Command
VIEW
/ /** View Command
protected static Command
NEW
Compose Command
protected static Command
BACK
Back Command
protected static Command
RESET
Reset Command
private Display
display
/ /** Current display context
private CommandListener
commandListener
The command listener responsible of application navigation
private List
list
The menu screen
Constructors Summary
protected MessageInboxScreen(Display d, CommandListener cl)
Constructor.

param
d is the display context.
param
cl is the command listener for this screen.


                         
         
        display = d;
        commandListener = cl;
        list = new List(UIConstants.TXT_SMS_INBOX, List.IMPLICIT);
        list.addCommand(VIEW);
        list.addCommand(NEW);
        list.addCommand(BACK);
        list.addCommand(RESET);
        list.setCommandListener(commandListener);
    
Methods Summary
protected intgetMenuSelection()
Returns the main menu selected item.

return
the index of the selected entry in the menu.

        return list.getSelectedIndex();
    
protected DisplayablegetScreen()
Returns the main menu Displayable.

return
the message inbox screen.

        return list;
    
protected voidsetInbox(java.util.Vector inbox)
Make the main menu visible.

param
inbox is the inbox to display.

        try {
            //  First, clear the list.
            for (int i=list.size()-1; i>=0; i--) {
                list.delete(i);
            }
            //  Now, populate the list.
            for (int i=0; i<inbox.size(); i++) {
                ShortMessage sm = (ShortMessage) inbox.elementAt(i);
                list.append(UIConstants.TXT_FROM+sm.from, null);
            }
        } catch (Exception e) {
            System.out.println("setInbox Exception: " + e);
        }
    
protected voidshowScreen(java.util.Vector inbox)
Make the main menu visible.

param
inbox is the inbox to display.

        //  Set the inbox' content.
        setInbox(inbox);
        //  Display the list.
        if (display != null) display.setCurrent(list);