public class UserDialogManager extends Object implements IDialogManager, IUIPreferencesChangeListener
DialogManagerImpl
cares
for Interaction with just one user.Constructor and Description |
---|
UserDialogManager(User user,
AbsLocation location,
IUIPreferencesBuffer uiPreferencesBuffer)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
adaptationParametersChanged(String parameter)
change the AdaptationParameters of the current dialog.
|
void |
add(ISubmitGroupListener sgl)
Add a
ISubmitGroupListener to listen to UIResponse s. |
void |
changedUIPreferences(UIPreferencesSubProfile subProfile)
Callback when the
UIPreferencesSubProfile is changed. |
boolean |
checkNewDialog(UIRequest request)
This method is called by the UI bus and determines whether a dialog can
be shown directly (e.g.
|
void |
dialogAborted(String dialogID,
Resource data)
This method is called when an event on the bus occurs indicating that a
dialog was aborted.
|
void |
dialogFinished(String dialogID)
This method is called by the UI bus to inform the dialog manager that a
dialog was successfully finished.
|
AbsLocation |
getCurrentUserLocation()
Last estimated location of the user.
|
IUIRequestPool |
getDialogPool() |
MessageLocaleHelper |
getLocaleHelper()
Get the
MessageLocaleHelper , to access internationalized strings
and user locale. |
IUIRequestPool |
getMessagePool() |
UIRequest |
getSuspendedDialog(String dialogID)
Get a suspended dialog.
|
UIPreferencesSubProfile |
getUiPreferencesSubProfile() |
String |
getUserId()
Get the user's URI for this
UserDialogManager target User
. |
void |
handleUIResponse(UIResponse response)
Handle the response.
|
void |
openPendingDialogsDialog() |
void |
openPendingMessagedDialog() |
void |
pushDialog(Form form)
Present a dialog to the user.
|
void |
pushUIRequest(UIRequest req)
Order a
UIRequest to be sent. |
void |
refreshMainMenu()
Re send the main menu, if the current dialog is the main menu.
|
void |
resumeUIRequest(UIRequest req)
Resume an existing dialog.
|
void |
setCurrentUserLocation(AbsLocation currentUserLocation)
This method is for the context susbscriber to update the user's location.
|
void |
showMainMenu()
Trigger a main menu.
|
void |
showSomething()
Find something to show.
|
void |
suspendDialog(String dialogID)
Suspend a dialog.
|
void |
userLogIn(Resource user,
AbsLocation location)
A User has logged in at a location resend the appropriate dialog.
|
public UserDialogManager(User user, AbsLocation location, IUIPreferencesBuffer uiPreferencesBuffer)
user
- the User
this DM is only attending.location
- the initial location for this user.public void changedUIPreferences(UIPreferencesSubProfile subProfile)
UIPreferencesSubProfile
is changed.changedUIPreferences
in interface IUIPreferencesChangeListener
subProfile
- the new changed UIPreferencesSubProfile
public final String getUserId()
UserDialogManager
target User
.public final IUIRequestPool getMessagePool()
public final IUIRequestPool getDialogPool()
public boolean checkNewDialog(UIRequest request)
checkNewDialog
in interface IDialogManager
request
- The UI request containing a dialog.IDialogManager.checkNewDialog(UIRequest)
public void dialogAborted(String dialogID, Resource data)
DialogManagerImpl#runningDialogs
,
DialogManagerImpl#suspendedDialogs
, and
DialogManagerImpl#waitingDialogs
).dialogID
- public void dialogFinished(String dialogID)
dialogFinished
in interface IDialogManager
dialogID
- ID of the dialog that is now finished.IDialogManager.dialogFinished(String)
public void showSomething()
public final void resumeUIRequest(UIRequest req)
req
- the Request to be resumed.public final void userLogIn(Resource user, AbsLocation location)
userLogIn
in interface IDialogManager
user
- User
of a system. It is declared as Resource because
the type User is defined in the Profiling Ontology. The type
is not needed for for matchmaking Either.location
- Location
from which User
has logged in to the
systempublic final UIRequest getSuspendedDialog(String dialogID)
getSuspendedDialog
in interface IDialogManager
dialogID
- ID of the dialog.UIRequest
, null if not found.public final void suspendDialog(String dialogID)
suspendDialog
in interface IDialogManager
dialogID
- ID of the dialog.public void handleUIResponse(UIResponse response)
UIResponse
corresponds to one of the
registered ISubmitGroupListener
s then delegate method, and remove
all its IDs from map.response
- the response to be handled.public final void add(ISubmitGroupListener sgl)
ISubmitGroupListener
to listen to UIResponse
s.sgl
- the ISubmitGroupListener
to be added to the list of
listeners.public final AbsLocation getCurrentUserLocation()
public final void setCurrentUserLocation(AbsLocation currentUserLocation)
currentUserLocation
- the new location of the user.public void pushUIRequest(UIRequest req)
UIRequest
to be sent. pushing a UIRequest
through
this method will skip the priority check and the UIRequest
will
be sent Immediately to any UIHandler
.req
- the UIRequest
to be sent by the DM.public final void pushDialog(Form form)
form
- the form to be presented to the user.public final void showMainMenu()
public final void refreshMainMenu()
public final void openPendingDialogsDialog()
public final void openPendingMessagedDialog()
public UIPreferencesSubProfile getUiPreferencesSubProfile()
public MessageLocaleHelper getLocaleHelper()
MessageLocaleHelper
, to access internationalized strings
and user locale.public void adaptationParametersChanged(String parameter)
parameter
- the parameter that has changed.Copyright © 2018 universAAL Consortium. All rights reserved.