public class ChatWindowManager
extends java.lang.Object
Constructor and Description |
---|
ChatWindowManager() |
Modifier and Type | Method and Description |
---|---|
void |
addChatListener(ChatListener listener)
Registers a NewChatListener to be informed when new Chats
are created.
|
(package private) void |
closeAllChats(ChatContainer chatContainer,
boolean warningEnabled)
Closes all chats in the specified ChatContainer and makes them
available for garbage collection.
|
void |
closeChat(ChatPanel chatPanel)
Closes the given chat panel.
|
java.util.Collection<ChatPanel> |
getAllChats()
Returns all currently instantiated ChatPanels.
|
java.util.List<ChatPanel> |
getChatPanels()
Returns all open
ChatPanel s. |
ChatPanel |
getContactChat(MetaContact metaContact,
boolean create)
Gets the ChatPanel corresponding to the specified
MetaContact and optionally creates it if it does not exist.
|
ChatPanel |
getContactChat(MetaContact metaContact,
boolean create,
java.lang.String escapedMessageID)
Gets the ChatPanel corresponding to the specified
MetaContact and optionally creates it if it does not exist.
|
ChatPanel |
getContactChat(MetaContact metaContact,
Contact protocolContact)
Returns the chat panel corresponding to the given meta contact
|
ChatPanel |
getContactChat(MetaContact metaContact,
Contact protocolContact,
ContactResource contactResource,
java.lang.String escapedMessageID)
Returns the chat panel corresponding to the given meta contact
|
ChatPanel |
getMultiChat(AdHocChatRoom adHocChatRoom,
boolean create)
Gets the ChatPanel corresponding to the specified
AdHocChatRoom and optionally creates it if it does not exist.
|
ChatPanel |
getMultiChat(AdHocChatRoom adHocChatRoom,
boolean create,
java.lang.String escapedMessageID)
Gets the ChatPanel corresponding to the specified
AdHocChatRoom and optionally creates it if it does not exist.
|
ChatPanel |
getMultiChat(AdHocChatRoomWrapper chatRoomWrapper,
boolean create)
Gets the ChatPanel corresponding to the specified
AdHocChatRoomWrapper and optionally creates it if it does not
exist yet.
|
ChatPanel |
getMultiChat(ChatRoom chatRoom,
boolean create)
Gets the ChatPanel corresponding to the specified
ChatRoom and optionally creates it if it does not exist.
|
ChatPanel |
getMultiChat(ChatRoom chatRoom,
boolean create,
java.lang.String escapedMessageID)
Gets the ChatPanel corresponding to the specified
ChatRoom and optionally creates it if it does not exist.
|
ChatPanel |
getMultiChat(ChatRoomWrapper chatRoomWrapper,
boolean create)
Gets the ChatPanel corresponding to the specified
ChatRoomWrapper and optionally creates it if it does not exist
yet.
|
ChatPanel |
getSelectedChat()
Returns the currently selected ChatPanel.
|
boolean |
isChatOpenedFor(MetaContact metaContact)
Returns true if there is an opened ChatPanel for the
given MetaContact.
|
void |
openChat(ChatPanel chatPanel,
boolean setSelected)
Opens the specified ChatPanel and optionally brings it to the
front.
|
void |
openPrivateChatForChatRoomMember(ChatRoom room,
Contact sourceContact)
Opens the specified ChatPanel and optionally brings it to the
front.
|
void |
openPrivateChatForChatRoomMember(ChatRoom room,
java.lang.String nickname)
Opens the specified ChatPanel and optionally brings it to the
front.
|
void |
removeChatListener(ChatListener listener)
Removes the registration of a NewChatListener.
|
void |
removeNonReadChatState(ChatPanel chatPanel)
Removes the non read state of the currently selected chat session.
|
void |
startChat(MetaContact metaContact)
Starts a chat with the given MetaContact.
|
void |
startChat(MetaContact metaContact,
Contact protocolContact,
boolean isSmsMessage)
Starts a chat with the given MetaContact.
|
boolean |
startChat(java.lang.String contactString) |
boolean |
startChat(java.lang.String contactString,
boolean isSmsEnabled) |
boolean |
startChat(java.lang.String contactID,
ProtocolProviderService pps)
Start the chat with contact which is using the supplied protocol
provider.
|
public void openChat(ChatPanel chatPanel, boolean setSelected)
chatPanel
- the ChatPanel to be openedsetSelected
- true if chatPanel (and respectively
its ChatWindow) should be brought to the front; otherwise,
falsepublic void openPrivateChatForChatRoomMember(ChatRoom room, java.lang.String nickname)
room
- the chat room associated with the contact.nickname
- the nickname of the contact in the chat room.public void openPrivateChatForChatRoomMember(ChatRoom room, Contact sourceContact)
room
- the chat room associated with the contact.sourceContact
- the contact.public boolean isChatOpenedFor(MetaContact metaContact)
metaContact
- the MetaContact, for which the chat is aboutpublic void closeChat(ChatPanel chatPanel)
chatPanel
- the chat panel to closevoid closeAllChats(ChatContainer chatContainer, boolean warningEnabled)
chatContainer
- the ChatContainer containing the chats to
closewarningEnabled
- indicates if the user should be warned that we're
closing all the chats. This would be done only if there are currently
active file transfers or waiting messagespublic ChatPanel getContactChat(MetaContact metaContact, boolean create)
metaContact
- the MetaContact to get the corresponding
ChatPanel ofcreate
- true to create a ChatPanel corresponding
to the specified MetaContact if such ChatPanel does not
exist yetpublic ChatPanel getContactChat(MetaContact metaContact, boolean create, java.lang.String escapedMessageID)
metaContact
- the MetaContact to get the corresponding
ChatPanel ofcreate
- true to create a ChatPanel corresponding
to the specified MetaContact if such ChatPanel does not
exist yetescapedMessageID
- the message ID of the message that should be
excluded from the history when the last one is loaded in the chatpublic ChatPanel getContactChat(MetaContact metaContact, Contact protocolContact)
metaContact
- the meta contact.protocolContact
- the protocol specific contactpublic ChatPanel getContactChat(MetaContact metaContact, Contact protocolContact, ContactResource contactResource, java.lang.String escapedMessageID)
metaContact
- the meta contact.protocolContact
- the protocol specific contactcontactResource
- the resource from which the contact is writingescapedMessageID
- the message ID of the message that should be
excluded from the history when the last one is loaded in the chatpublic ChatPanel getSelectedChat()
public ChatPanel getMultiChat(ChatRoomWrapper chatRoomWrapper, boolean create)
chatRoomWrapper
- the ChatRoomWrapper to get the
corresponding ChatPanel ofcreate
- true to create a new ChatPanel for the
specified ChatRoomWrapper if no such ChatPanel exists
already; otherwise, falsepublic ChatPanel getMultiChat(AdHocChatRoomWrapper chatRoomWrapper, boolean create)
chatRoomWrapper
- the AdHocChatRoomWrapper to get the
corresponding ChatPanel ofcreate
- true to create a new ChatPanel for the
specified AdHocChatRoomWrapper if no such ChatPanel
exists already; otherwise, falsepublic ChatPanel getMultiChat(AdHocChatRoom adHocChatRoom, boolean create)
adHocChatRoom
- the AdHocChatRoom to get the corresponding
ChatPanel ofcreate
- true to create a ChatPanel corresponding
to the specified AdHocChatRoom if such ChatPanel does
not exist yetpublic ChatPanel getMultiChat(ChatRoom chatRoom, boolean create)
chatRoom
- the ChatRoom to get the corresponding
ChatPanel ofcreate
- true to create a ChatPanel corresponding
to the specified ChatRoom if such ChatPanel does not
exist yetpublic ChatPanel getMultiChat(ChatRoom chatRoom, boolean create, java.lang.String escapedMessageID)
chatRoom
- the ChatRoom to get the corresponding
ChatPanel ofcreate
- true to create a ChatPanel corresponding
to the specified ChatRoom if such ChatPanel does not
exist yetescapedMessageID
- the message ID of the message that should be
excluded from the history when the last one is loaded in the chatpublic ChatPanel getMultiChat(AdHocChatRoom adHocChatRoom, boolean create, java.lang.String escapedMessageID)
adHocChatRoom
- the AdHocChatRoom to get the corresponding
ChatPanel ofcreate
- true to create a ChatPanel corresponding
to the specified AdHocChatRoom if such ChatPanel does
not exist yetescapedMessageID
- the message ID of the message that should be
excluded from the history when the last one is loaded in the chatpublic java.util.List<ChatPanel> getChatPanels()
ChatPanel
s.ChatPanel
spublic void startChat(MetaContact metaContact)
metaContact
- the destination MetaContactpublic void startChat(MetaContact metaContact, Contact protocolContact, boolean isSmsMessage)
metaContact
- the destination MetaContactprotocolContact
- the protocol contact of the destinationisSmsMessage
- indicates if the chat should be opened for an SMS
messagepublic boolean startChat(java.lang.String contactString)
public boolean startChat(java.lang.String contactID, ProtocolProviderService pps)
contactID
- the contact id to start chat withpps
- the protocol providerpublic boolean startChat(java.lang.String contactString, boolean isSmsEnabled)
public void removeNonReadChatState(ChatPanel chatPanel)
chatPanel
- the ChatPanel for which we would like to remove
non read chat statepublic java.util.Collection<ChatPanel> getAllChats()
public void addChatListener(ChatListener listener)
listener
- listener to be registeredpublic void removeChatListener(ChatListener listener)
listener
- listener to be unregistered
Jitsi, the OpenSource Java VoIP and Instant Messaging client.
Distributable under Apache license.