LEONARDI Application Composer - 8.9.0.40 by W4 S.A.

leon.app.behavior
Class LyChatBehavior

java.lang.Object
  extended by leon.app.behavior.LyBehavior
      extended by leon.app.behavior.LyActionBehavior
          extended by leon.app.behavior.LyUserInputBehavior
              extended by leon.app.behavior.LyChatBehavior
All Implemented Interfaces:
LyActionBehaviorInterface, LyBehaviorInterface, LySessionListenerInterface, LyUserInputBehaviorInterface, LyGetSessionInterface, LyAnswerInterface, LyQuestionAnswerInterface

public class LyChatBehavior
extends LyUserInputBehavior
implements LyQuestionAnswerInterface, LySessionListenerInterface

Behavior for chat action.


Field Summary
static java.lang.String __VERSION
          File version
 
Constructor Summary
LyChatBehavior()
           
 
Method Summary
 void free()
          Free this behavior.
 LyText getChatWindow()
           
 LyConversation getConversation()
          Conversation accessor.
 boolean handleDemand(LyController controller, LyDemand demand)
          Method invoked when a demand is sent to this listener.
 void initChatWindow(LyAreaController areaController)
          Draw chat window.
 void questionAnswer(boolean result, java.lang.Object clientData)
          Answer to a askQuestion request.
 void sessionAdded(LyApplication application, LyDataSession session)
          Method called when a session is added to the application.
 void sessionLoggedIn(LyApplication application, LyDataSession session, LyObject user)
          Method called when a user logged in a session.
 void sessionRemoved(LyApplication application, LyDataSession session)
          Method called when a session is removed from the application.
 void setConversation(LyConversation conversation)
          Conversation setter.
 void setConversationTab(LyTab tab)
          Set conversation tab.
 boolean startAction(LyAreaController areaController, LyAction action)
          Starts an action for the given controller.
 void tabRemoveSession(LySession session)
          Remove session from conversation.
 void updateActorsLabel()
          update Actors Label.
 void updateSessionStatus(LySession session, boolean chat)
          Update status of session.
 boolean validate(LyController controller, LyParameterValues values)
          Method invoked when the user validates the content of the input.
 void writeMessage(java.lang.String message, LyObject user, boolean serverMessage)
          Write a message in chat window.
 
Methods inherited from class leon.app.behavior.LyUserInputBehavior
cancel, close, userInputDemand
 
Methods inherited from class leon.app.behavior.LyActionBehavior
endAction, getClientContext, getContextTitle, getHelpFile, getImage, getImageTooltip, getKeyValue, getMenuItemImage, getTitle, reset
 
Methods inherited from class leon.app.behavior.LyBehavior
getSession, init
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface leon.app.behaviorinterface.LyActionBehaviorInterface
endAction, getClientContext, getContextTitle, getHelpFile, getImage, getImageTooltip, getKeyValue, getMenuItemImage, getTitle, reset
 
Methods inherited from interface leon.app.behaviorinterface.LyBehaviorInterface
init
 

Field Detail

__VERSION

public static final java.lang.String __VERSION
File version

See Also:
Constant Field Values
Constructor Detail

LyChatBehavior

public LyChatBehavior()
Method Detail

initChatWindow

public void initChatWindow(LyAreaController areaController)
Draw chat window.

Parameters:
areaController - The area.

writeMessage

public void writeMessage(java.lang.String message,
                         LyObject user,
                         boolean serverMessage)
Write a message in chat window.

Parameters:
message - The message
user - The user
me - true if i am the sender

startAction

public boolean startAction(LyAreaController areaController,
                           LyAction action)
Description copied from class: LyActionBehavior
Starts an action for the given controller. This method is the right place to allocate specific resources requiered for the given action. The default implementation does nothing and returns true.

Specified by:
startAction in interface LyActionBehaviorInterface
Overrides:
startAction in class LyActionBehavior
Parameters:
areaController - the current LyAreaController instance
action - the action that will be executed
Returns:
true

validate

public boolean validate(LyController controller,
                        LyParameterValues values)
Description copied from class: LyUserInputBehavior
Method invoked when the user validates the content of the input.
The default implementation does nothing.

Overrides:
validate in class LyUserInputBehavior
Parameters:
controller - the current LyUserInputController instance
values - values set by the user.
Returns:
True if validation is successfull, false otherwise.

handleDemand

public boolean handleDemand(LyController controller,
                            LyDemand demand)
Description copied from class: LyBehavior
Method invoked when a demand is sent to this listener.
The default implementation does nothing and return false.

Specified by:
handleDemand in interface LyBehaviorInterface
Overrides:
handleDemand in class LyBehavior
Parameters:
controller - controller that routed the demand.
demand - demand parameters sent by the view component.
Returns:
Return true if the demand was handled, false otherwise. If false, the demand is transmitted to the controller to try to handle it.

questionAnswer

public void questionAnswer(boolean result,
                           java.lang.Object clientData)
Description copied from interface: LyQuestionAnswerInterface
Answer to a askQuestion request.

Specified by:
questionAnswer in interface LyQuestionAnswerInterface
Parameters:
result - true if the user has clicked on Yes or Ok
See Also:
LyQuestionAnswerInterface.questionAnswer(boolean, Object)

updateActorsLabel

public void updateActorsLabel()
update Actors Label.


updateSessionStatus

public void updateSessionStatus(LySession session,
                                boolean chat)
Update status of session.

Parameters:
session - Session
chat - new status.

tabRemoveSession

public void tabRemoveSession(LySession session)
Remove session from conversation.

Parameters:
session - session to remove

sessionAdded

public void sessionAdded(LyApplication application,
                         LyDataSession session)
Description copied from interface: LySessionListenerInterface
Method called when a session is added to the application.

Specified by:
sessionAdded in interface LySessionListenerInterface
Parameters:
application - Application in which a session is added.
session - Session added to the application.
See Also:
LySessionListenerInterface.sessionAdded(LyApplication, LyDataSession)

sessionLoggedIn

public void sessionLoggedIn(LyApplication application,
                            LyDataSession session,
                            LyObject user)
Description copied from interface: LySessionListenerInterface
Method called when a user logged in a session.

Specified by:
sessionLoggedIn in interface LySessionListenerInterface
Parameters:
application - Application in which a session is added.
session - Session added to the application.
user - User that logged in.
See Also:
LySessionListenerInterface.sessionLoggedIn(LyApplication, LyDataSession, LyObject)

sessionRemoved

public void sessionRemoved(LyApplication application,
                           LyDataSession session)
Description copied from interface: LySessionListenerInterface
Method called when a session is removed from the application.

Specified by:
sessionRemoved in interface LySessionListenerInterface
Parameters:
application - Application in which a session is removed.
session - Session removed from the application.
See Also:
LySessionListenerInterface.sessionRemoved(LyApplication, LyDataSession)

getConversation

public LyConversation getConversation()
Conversation accessor.

Returns:
conversation

setConversation

public void setConversation(LyConversation conversation)
Conversation setter.


free

public void free()
Free this behavior. This method is provided to allow behavior to unregister itself from object sources or workspaces if needed. It should be called only by the controller that built this behavior.
The default implementation does nothing.

Specified by:
free in interface LyBehaviorInterface
Overrides:
free in class LyBehavior

setConversationTab

public void setConversationTab(LyTab tab)
Set conversation tab.

Parameters:
tab - Tab

getChatWindow

public LyText getChatWindow()

(c) January 2013 - W4 S.A.

Website: W4 S.A., contact us: support@w4global.com