com.funambol.client.controller
Class DialogController

java.lang.Object
  extended by com.funambol.client.controller.DialogController

public class DialogController
extends java.lang.Object

Control dialog alert flow on the client using the client's controller and DisplayManager. This class is just a controller. Refer to DisplayManager implementation in order to manage the alert diplaying logic.


Nested Class Summary
protected  class DialogController.FirstSyncDialogOption
          Container for the first sync dialog options
protected  class DialogController.ResetDirectionDialogOption
          Dialog option related to the refresh direction to be used.
protected  class DialogController.ResetTypeDialogOption
          Container for the reset type dialog option
 
Field Summary
static java.lang.String TAG_LOG
          TAG to be displayed into log messages
 
Constructor Summary
DialogController(DisplayManager displayManager, Controller controller)
          Public constructor
 
Method Summary
 boolean askAcceptDenyQuestion(java.lang.String message, boolean defaultyes)
          Prompt an alert with 2 choices on the screen
 boolean askYesNoQuestion(java.lang.String message, boolean defaultyes)
          Not implemented.
 boolean askYesNoQuestion(java.lang.String message, boolean defaultyes, int timeToWait)
          Not implemented.
 boolean promptNext(java.lang.String message)
          Prompt a message alert on the screen
 void resumeLastFirstSyncDialog(Screen screen)
          Resumes the last fisrt sync alert dialog if it was paused before the user answered.
 void resumeLastRefreshTypeDialog(Screen screen)
          Resumes the last refresh type alert dialog if it was paused before the user answered.
 void showFirstSyncDialog(Screen screen, AppSyncSource[] appSourceList, java.lang.String syncType, java.util.Vector filteredSources, boolean refresh, int direction, int delay, boolean fromOutside, int questionCounter, int sourceIndex)
          Show the first sync alert dialogs for all the sources that are listed into the given appSourceList array.
 void showMessage(Screen screen, java.lang.String language)
          Show an alert message on the screen
 void showMessage(Screen screen, java.lang.String language, int delay)
          Show an alert message on the screen for a given amount of time
 void showRefreshDirectionDialog(Screen screen)
          Use the localization field to build the reset direction alert dialog.
 void showRefreshTypeDialog(Screen screen, int direction)
          Use the localization field to build the reset type alert dialog that use the DisplayManager client implementation to ask the user whose sources must be refreshed.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TAG_LOG

public static final java.lang.String TAG_LOG
TAG to be displayed into log messages

See Also:
Constant Field Values
Constructor Detail

DialogController

public DialogController(DisplayManager displayManager,
                        Controller controller)
Public constructor

Parameters:
displayManager - the DisplayManager object to be used.
controller -
Method Detail

promptNext

public boolean promptNext(java.lang.String message)
Prompt a message alert on the screen

Parameters:
message - is the String to be displayed on the screen
Returns:
boolean true if the alert was displayed.

askYesNoQuestion

public boolean askYesNoQuestion(java.lang.String message,
                                boolean defaultyes)
Not implemented.

Parameters:
message - the message to be displayed
defaultyes - the default parameter in the selection
Returns:
boolean true is the user answered yes, false otherwise

askAcceptDenyQuestion

public boolean askAcceptDenyQuestion(java.lang.String message,
                                     boolean defaultyes)
Prompt an alert with 2 choices on the screen

Parameters:
message - the message to be displayed
defaultyes - the default parameter in the selection
Returns:
boolean true is the user accepted, false otherwise

askYesNoQuestion

public boolean askYesNoQuestion(java.lang.String message,
                                boolean defaultyes,
                                int timeToWait)
Not implemented.

Parameters:
message - the message to be displayed
defaultyes - the default parameter in the selection
timeToWait - the time to wait before dismiss the alert
Returns:
boolean true is the user answered yes, false otherwise

showMessage

public void showMessage(Screen screen,
                        java.lang.String language)
Show an alert message on the screen

Parameters:
screen - the dialog alert owner Screen
language - the message to be dispalyed

showMessage

public void showMessage(Screen screen,
                        java.lang.String language,
                        int delay)
Show an alert message on the screen for a given amount of time

Parameters:
screen - the dialog alert owner Screen
language - the message to be dispalyed
delay - the duration of the message in milliseconds

showRefreshDirectionDialog

public void showRefreshDirectionDialog(Screen screen)
Use the localization field to build the reset direction alert dialog. This dialog builds ResetDirectionDialogOption objects to refer to the dialog choiches.

Parameters:
screen - the dialog alert owner Screen

showRefreshTypeDialog

public void showRefreshTypeDialog(Screen screen,
                                  int direction)
Use the localization field to build the reset type alert dialog that use the DisplayManager client implementation to ask the user whose sources must be refreshed. This dialog builds ResetTypeDialogOption objects to refer to the dialog choiches. Actual client implementation requires this alert to be diaplayed after the showRefreshDirectionDialog call in order to have full information abaout the direction.

Parameters:
screen - the dialog alert owner Screen
int - the refresh direction for the selected sources.

resumeLastRefreshTypeDialog

public void resumeLastRefreshTypeDialog(Screen screen)
Resumes the last refresh type alert dialog if it was paused before the user answered. This could be due to any pausing event on the client side (screen rotation, incoming calls ...). This method works if and only if a previous call to the method was performed because it needs the last saved state of the field lastSelectedDirection that is updated by the RefreshDirectionDialog class when the user chose the reset direction

Parameters:
screen - the dialog alert owner Screen

resumeLastFirstSyncDialog

public void resumeLastFirstSyncDialog(Screen screen)
Resumes the last fisrt sync alert dialog if it was paused before the user answered. This could be due to any pausing event on the client side (screen rotation, incoming calls ...). This method works if and only if a previous call to the showFirstSyncDialog method was performed because it needs the last saved state of the field lastFirstSyncDialogState that is updated by the showFirstSyncDialog method when called.

Parameters:
screen - the dialog alert owner Screen

showFirstSyncDialog

public void showFirstSyncDialog(Screen screen,
                                AppSyncSource[] appSourceList,
                                java.lang.String syncType,
                                java.util.Vector filteredSources,
                                boolean refresh,
                                int direction,
                                int delay,
                                boolean fromOutside,
                                int questionCounter,
                                int sourceIndex)
Show the first sync alert dialogs for all the sources that are listed into the given appSourceList array.

Parameters:
appSourceList - the list of appSyncSources
syncType - the String representation for the sync type (manual...)
filteredSources - the sources Vector to be updated in case the user select to sync now
refresh - specifies if this sync is a refresh
direction - in case of refresh, this is the direction (client to server or server to client)
delay - request the sync scheduler to be initiate the sync after the given amount of milliseconds
fromOutside - used by the sync scheduler to manage the incoming sync request from outside if true
questionCounter - the number of question to be displayed to the user. This number depends by the number of sources that have a warning messgae to be displayed at the first sync
sourceIndex - the sync source index source which this dialog alert is related.


Copyright © 2001-2009 Funambol.