public abstract class ApplicationController
extends no.esito.jvine.controller.JVineApplicationController
implements no.esito.jvine.communication.SystemMessagePipe
| Constructor and Description |
|---|
ApplicationController(String applicationName)
Constructs a new application controller
|
| Modifier and Type | Method and Description |
|---|---|
String |
addCallBack(DialogController actionInvoker,
DialogConstant callee,
CallBack callBack)
Add the given call back to the map of pending call backs for this application.
|
boolean |
closeDialogInstance(DialogInstance dialogInstance)
Close dialog instance identified by the
dialogInstance key. |
DialogInstance |
createDialogInstance(DialogConstant dialogConstant,
int instanceNumber)
Creates a new dialog instance and pushes it on top of the stack.
|
void |
forward(String codedMessage)
Forward a message towards the receiver.
|
void |
forward(SystemMessage decodedMessage)
Forward a message towards the receiver.
|
protected void |
forwardToDialog(SystemMessage decodedMessage,
DialogConstant dialogConstant)
Try forwarding a message to a dialog.
|
protected void |
forwardToExternal(SystemMessage decodedMessage)
Forward a message towards an external receiver.
|
protected ActionHookList<?> |
getActionHookList(ActionTarget actionTarget,
ActionType actionType)
Get the specified action hooks.
|
List<DialogInstance> |
getActiveDialogInstances(DialogConstant dialogConstant)
Gets a list of active dialog instances.
|
abstract <T extends DialogConstant> |
getApplicationDialogConstant()
Return the dialog constant of the application window.
|
String |
getApplicationId()
Gets the application ID.
|
String |
getApplicationName()
Gets the application name
|
ApplicationView |
getApplicationView()
Gets the application's view.
|
ClientContext |
getClientContext()
Returns the client context
|
static ApplicationController |
getCurrentApplicationController()
Get the current application controller for this thread.
|
DialogInstance |
getCurrentDialogInstance(DialogConstant dialogConstant)
Gets the current instance number, i.e.
|
<T extends DialogConstant> |
getDialogConst(String dialogInternalName)
Get the dialog constant for the specified dialog.
|
<T extends DialogController> |
getDialogController(DialogConstant dialogConstant)
Get the current dialog controller for the specified dialog.
|
<T extends DialogController> |
getDialogController(DialogInstance dialogInstance)
Gets the dialog controller identified by the dialog instance key.
|
protected DialogInstanceManager |
getDialogInstanceManager()
Getter
|
<T extends DialogView> |
getDialogView(DialogConstant dialogConstant)
Gets the specified dialog view.
|
CallBack |
getExternalCallBack(SystemMessage callBackMessage)
Get a CallBack object which will forward the call back value to the given
receiver/port.
|
List<DialogInstance> |
getOpenDialogInstanceList(DialogConstant dialogConstant)
Get a list of open dialog instances, ordered by when the instance was created (oldest first).
|
List<DialogController> |
getOpenDialogs()
Get a list of dialog controllers for all open dialogs.
|
JGrapeService |
getServiceProxy()
Returns the jgrape service
|
ViewModel |
getViewModel(DialogConstant dialog)
Get the ViewModel for the given dialog.
|
void |
handleCommunicationError(CommunicationError commErr)
This method is called when there was a problem sending a message to an external application.
|
boolean |
hasAvailableDialogInstance(DialogConstant dialogConstant)
Checks for available dialog instance.
|
void |
invokeOnGui(Runnable task)
Invokes the specified task on the gui thread.
|
void |
performAction(ActionType action,
DialogConstant target)
Performs the specified action.
|
void |
performAction(ActionType action,
DialogConstant target,
boolean flag)
Performs the specified action.
|
void |
performActionFromExternal(ActionType action,
DialogConstant target,
boolean flag)
Performs the specified action.
|
void |
registerController(int instanceNumber,
DialogController newController)
Registers the controller.
Warning: this method should not be used by developers. |
void |
registerHook(ActionTarget actionTarget,
ActionType actionType,
ActionHook<?> hook)
Register the specified action hook
|
void |
removeDialogInstance(DialogInstance dialogInstance)
Removes the dialog instance identified by the instance key from the
stack.
|
DialogController |
setActiveDialogInstance(DialogInstance dialogInstanceKey)
Sets the active dialog instance.
|
void |
setApplicationView(ApplicationView applicationView)
Sets the application's view.
|
public ApplicationController(String applicationName)
applicationName - the name of the application controller.protected DialogInstanceManager getDialogInstanceManager()
public final <T extends DialogConstant> T getDialogConst(String dialogInternalName)
T - The expected dialog controller type.dialogInternalName - the dialog name as it is defined in the bean id.ClassCastException - if the returned type does not match the expected type.public final DialogInstance getCurrentDialogInstance(DialogConstant dialogConstant)
dialogConstant - the dialog constantnull if no active dialog found for this
dialog constantpublic final DialogController setActiveDialogInstance(DialogInstance dialogInstanceKey)
dialogInstanceKey - the key identifying the dialog instancenull if no instance found with the given idpublic void removeDialogInstance(DialogInstance dialogInstance)
Use closeDialogInstance(DialogInstance) to close a dialog.
dialogInstance - the dialog instance key of the dialog to remove.public boolean closeDialogInstance(DialogInstance dialogInstance)
dialogInstance key.dialogInstance - the dialog instance to closepublic boolean hasAvailableDialogInstance(DialogConstant dialogConstant)
dialogConstant - the dialog constantpublic List<DialogInstance> getActiveDialogInstances(DialogConstant dialogConstant)
dialogConstant - the dialog constant identifying the dialogpublic List<DialogInstance> getOpenDialogInstanceList(DialogConstant dialogConstant)
dialogConstant - constant identifying the dialogpublic List<DialogController> getOpenDialogs()
public void registerController(int instanceNumber,
DialogController newController)
instanceNumber - instance numbernewController - controllerpublic final <T extends DialogController> T getDialogController(DialogConstant dialogConstant)
T - The expected dialog controller typedialogConstant - the dialog constant denoting the dialog controller.ClassCastException - if the returned type does not match the expected dialog
controller type.public final <T extends DialogController> T getDialogController(DialogInstance dialogInstance)
T - the generic type of the controller.dialogInstance - the dialog instancenull if not found.public DialogInstance createDialogInstance(DialogConstant dialogConstant, int instanceNumber)
dialogConstant - the dialog constantinstanceNumber - the instance number, set to -1 to get the next available
instanceNumberInstanceNumberOutOfBoundsException - when no more dialogs of this dialog can be created.IllegalStateException - when instanceNumber refers to an instance that already existspublic String getApplicationName()
public String getApplicationId()
public ClientContext getClientContext()
public JGrapeService getServiceProxy()
public final ApplicationView getApplicationView()
public final <T extends DialogView> T getDialogView(DialogConstant dialogConstant)
T - the dialog view typedialogConstant - the (generated) constant denoting the dialog.public final void setApplicationView(ApplicationView applicationView)
applicationView - the application view.public final void performAction(ActionType action, DialogConstant target, boolean flag)
action - the action to perform.target - the target of the action.flag - a general purpose flagpublic final void performActionFromExternal(ActionType action, DialogConstant target, boolean flag)
action - the action to perform.target - the target of the action.flag - a general purpose flagpublic final void performAction(ActionType action, DialogConstant target)
action - the action to perform.target - the target of the action.public final void registerHook(ActionTarget actionTarget, ActionType actionType, ActionHook<?> hook)
actionTarget - the action targetactionType - the action typehook - the action hook that should be invoked when the action runs.protected final ActionHookList<?> getActionHookList(ActionTarget actionTarget, ActionType actionType)
actionTarget - the action targetactionType - the action typepublic final ViewModel getViewModel(DialogConstant dialog)
dialog - the dialog which "owns" the ViewModel.ApplicationView.getViewModel(DialogConstant)public final void invokeOnGui(Runnable task) throws InvocationTargetException
run method is simply invoked as is.task - the task to perform.InvocationTargetException - exceptions that occurred during invocation of the runnable
are wrapped and re-thrown.public abstract <T extends DialogConstant> T getApplicationDialogConstant()
T - the actual type of the dialog constant.public void forward(String codedMessage)
codedMessage - The coded messagepublic void forward(SystemMessage decodedMessage)
forward in interface no.esito.jvine.communication.SystemMessagePipedecodedMessage - The decoded messagepublic void handleCommunicationError(CommunicationError commErr)
commErr - an object containing error informationpublic String addCallBack(DialogController actionInvoker, DialogConstant callee, CallBack callBack)
actionInvoker - the dialog which invoked the actioncallee - the dialog which is the action targetcallBack - the call backpublic CallBack getExternalCallBack(SystemMessage callBackMessage)
callBackMessage - the return port messageprotected void forwardToDialog(SystemMessage decodedMessage, DialogConstant dialogConstant)
decodedMessage - the message to forwarddialogConstant - the receiving dialogprotected void forwardToExternal(SystemMessage decodedMessage)
decodedMessage - the message to forwardpublic static final ApplicationController getCurrentApplicationController()
Copyright © 2006–2020 Esito AS. All rights reserved.