com.funambol.client.ui
Interface DisplayManager


public interface DisplayManager

Interface to manage the display of application screens and alert dialogs. To be implemented on cient side. The calls to this class instance are usually made by the DialogController Class.


Field Summary
static int FIRST_SYNC_DIALOG_ID
          first sync alert dialog id
static long NO_LIMIT
          int value related to the infinitive time to wait before dismissing a screen or a dialog
static int REFRESH_DIRECTION_DIALOG_ID
          Refresh direction alert dialog id
static int REFRESH_TYPE_DIALOG_ID
          Refresh type alert dialog id
 
Method Summary
 void addPostDismissSelectionDialogAction(int id, java.lang.Runnable dismissAction)
          Record the action to be executed after dismissing the alert
 boolean askAcceptDenyQuestion(java.lang.String question, boolean defaultyes, long timeToWait)
          Helper function to prompt the user for an accept/deny answer Helper function to prompt the user for a yes/no answer
 void askYesNoQuestion(Screen screen, java.lang.String question, java.lang.Runnable yesAction, java.lang.Runnable noAction, long timeToWait)
          Helper function to prompt the user for a yes/no answer
 void dismissProgressDialog(Screen screen, int id)
          Dismisses a progress dialog given its id
 void dismissSelectionDialog(int id)
          Dismiss a previously shown selection dialog given its id
 void hideScreen(Screen screen)
          Hide a screen pulling it to the background
 void loadBrowser(java.lang.String url)
          Load the browser to the given url To be implemented.
 boolean promptNext(java.lang.String message)
          Prompt a message to continue or cancel some pending process
 void promptSelection(Screen screen, java.lang.String question, DialogOption[] options, int defaultValue, int dialogId)
          Prompt a selection of different options to the user
 void removePostDismissSelectionDialogAction(int id)
          Remove the action to be executed after dismissing a given alert
 void showMessage(Screen screen, java.lang.String message)
          Prompt a message to the user
 void showMessage(Screen screen, java.lang.String message, int delay)
          Prompt a message to the user for a given amount of time
 int showProgressDialog(Screen screen, java.lang.String prompt)
          Shows a progress dialog with the given text prompt
 void showScreen(Screen screen, int screenId)
          Shows a screen putting it in foreground
 void showScreen(Screen screen, int screenId, boolean donotwait)
          Shows a screen putting it in foreground
 void toBackground()
          Put the application in background (unactive state)
 void toForeground()
          Put the application in foreground (Active satus)
 

Field Detail

REFRESH_DIRECTION_DIALOG_ID

static final int REFRESH_DIRECTION_DIALOG_ID
Refresh direction alert dialog id

See Also:
Constant Field Values

REFRESH_TYPE_DIALOG_ID

static final int REFRESH_TYPE_DIALOG_ID
Refresh type alert dialog id

See Also:
Constant Field Values

FIRST_SYNC_DIALOG_ID

static final int FIRST_SYNC_DIALOG_ID
first sync alert dialog id

See Also:
Constant Field Values

NO_LIMIT

static final long NO_LIMIT
int value related to the infinitive time to wait before dismissing a screen or a dialog

See Also:
Constant Field Values
Method Detail

hideScreen

void hideScreen(Screen screen)
                throws java.lang.Exception
Hide a screen pulling it to the background

Parameters:
screen - The screen to be hidden
Throws:
java.lang.Exception

showScreen

void showScreen(Screen screen,
                int screenId)
                throws java.lang.Exception
Shows a screen putting it in foreground

Parameters:
screen - the Screen to be shown
screenId - the screen id related to the Screen to be shown
Throws:
java.lang.Exception - if an error occurred

showScreen

void showScreen(Screen screen,
                int screenId,
                boolean donotwait)
                throws java.lang.Exception
Shows a screen putting it in foreground

Parameters:
screen - the Screen to be shown
screenId - the screen id related to the Screen to be shown
donotwait - if true the screen must be shown immediately
Throws:
java.lang.Exception - if an error occurred

askYesNoQuestion

void askYesNoQuestion(Screen screen,
                      java.lang.String question,
                      java.lang.Runnable yesAction,
                      java.lang.Runnable noAction,
                      long timeToWait)
Helper function to prompt the user for a yes/no answer

Parameters:
question - the question to be displayed
defaultyes - the default otpion
timeToWait - time to wait before dismissing the dialog in milliseconds

askAcceptDenyQuestion

boolean askAcceptDenyQuestion(java.lang.String question,
                              boolean defaultyes,
                              long timeToWait)
Helper function to prompt the user for an accept/deny answer Helper function to prompt the user for a yes/no answer

Parameters:
question - the question to be displayed
defaultyes - the default otpion
timeToWait - time to wait before dismissing the dialog in milliseconds
Returns:
True on accept

showProgressDialog

int showProgressDialog(Screen screen,
                       java.lang.String prompt)
Shows a progress dialog with the given text prompt

Parameters:
screen - the alert dialog owner Screen
prompt - the message to be prompted
Returns:
the id associated to the given dialog (use it when calling dismissProgressDialog)

dismissProgressDialog

void dismissProgressDialog(Screen screen,
                           int id)
Dismisses a progress dialog given its id

Parameters:
screen - the alert dialog owner Screen
id - the dialog id related to the dialog to be dismissed

dismissSelectionDialog

void dismissSelectionDialog(int id)
Dismiss a previously shown selection dialog given its id

Parameters:
id - the int id of the dialog to be dismissed

addPostDismissSelectionDialogAction

void addPostDismissSelectionDialogAction(int id,
                                         java.lang.Runnable dismissAction)
Record the action to be executed after dismissing the alert

Parameters:
id - the int id of the dialog to be dismissed
dismissAction - the Runnable that represents what to do after the alert is dismissed

removePostDismissSelectionDialogAction

void removePostDismissSelectionDialogAction(int id)
Remove the action to be executed after dismissing a given alert

Parameters:
id - the int id of the dialog for wich the action is pending

promptNext

boolean promptNext(java.lang.String message)
Prompt a message to continue or cancel some pending process

Parameters:
message - the message to be prompted
Returns:
boolean true if the user selects to continue, false otherwise

showMessage

void showMessage(Screen screen,
                 java.lang.String message)
Prompt a message to the user

Parameters:
screen - the screen where to prompt the message
message - the String formatted message to display

showMessage

void showMessage(Screen screen,
                 java.lang.String message,
                 int delay)
Prompt a message to the user for a given amount of time

Parameters:
screen - the screen where to prompt the message
message - the String formatted message to display
delay - the message delay

promptSelection

void promptSelection(Screen screen,
                     java.lang.String question,
                     DialogOption[] options,
                     int defaultValue,
                     int dialogId)
Prompt a selection of different options to the user

Parameters:
screen - the alert dialog owner Screen
question - the message that describe the selection
options - An array of DialogOption objects
defaultValue - The default value for this selection
dialogId - the dialog id related to the type of scelection dialog to be prompted

toForeground

void toForeground()
Put the application in foreground (Active satus)


toBackground

void toBackground()
Put the application in background (unactive state)


loadBrowser

void loadBrowser(java.lang.String url)
Load the browser to the given url To be implemented.

Parameters:
url - the url to be set on the browser


Copyright © 2001-2009 Funambol.