public interface Chat
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
ACTION_MESSAGE
The message type representing action messages.
|
static int |
CHAT_BUFFER_SIZE
The size of the buffer that indicates how many messages will be stored
in the conversation area in the chat window.
|
static java.lang.String |
ERROR_MESSAGE
The message type representing error messages.
|
static java.lang.String |
HISTORY_INCOMING_MESSAGE
The history incoming message type.
|
static java.lang.String |
HISTORY_OUTGOING_MESSAGE
The history outgoing message type.
|
static java.lang.String |
INCOMING_MESSAGE
The message type representing incoming messages.
|
static java.lang.String |
OUTGOING_MESSAGE
The message type representing outgoing messages.
|
static java.lang.String |
SMS_MESSAGE
The message type representing sms messages.
|
static java.lang.String |
STATUS_MESSAGE
The message type representing status messages.
|
static java.lang.String |
SYSTEM_MESSAGE
The message type representing system messages.
|
Modifier and Type | Method and Description |
---|---|
void |
addChatEditorCaretListener(javax.swing.event.CaretListener l)
Adds the given
CaretListener to this Chat. |
void |
addChatEditorDocumentListener(javax.swing.event.DocumentListener l)
Adds the given
DocumentListener to this Chat. |
void |
addChatEditorKeyListener(java.awt.event.KeyListener l)
Adds the given
KeyListener to this Chat. |
void |
addChatEditorMenuListener(ChatMenuListener l)
Adds the given
ChatMenuListener to this Chat. |
void |
addChatFocusListener(ChatFocusListener l)
Adds the given ChatFocusListener to this Chat.
|
void |
addChatLinkClickedListener(ChatLinkClickedListener listener)
Adds a new ChatLinkClickedListener.
|
void |
addMessage(java.lang.String contactName,
java.util.Date date,
java.lang.String messageType,
java.lang.String message,
java.lang.String contentType)
Adds a message to this Chat.
|
int |
getCaretPosition()
Gets the caret position in the chat editor.
|
javax.swing.text.Highlighter |
getHighlighter()
Provides the
Highlighter used in rendering the chat editor. |
java.lang.String |
getMessage()
Returns the message written by user in the chat write area.
|
boolean |
isChatFocused()
Checks if this Chat is currently focused.
|
void |
promptRepaint()
Causes the chat to validate its appearance (suggests a repaint operation
may be necessary).
|
void |
removeChatEditorCaretListener(javax.swing.event.CaretListener l)
Removes the given
CaretListener from this Chat. |
void |
removeChatEditorDocumentListener(javax.swing.event.DocumentListener l)
Removes the given
DocumentListener from this Chat. |
void |
removeChatEditorKeyListener(java.awt.event.KeyListener l)
Removes the given
KeyListener from this Chat. |
void |
removeChatEditorMenuListener(ChatMenuListener l)
Removes the given
ChatMenuListener to this Chat. |
void |
removeChatFocusListener(ChatFocusListener l)
Removes the given ChatFocusListener from this Chat.
|
void |
removeChatLinkClickedListener(ChatLinkClickedListener listener)
Removes an existing ChatLinkClickedListener
|
void |
setChatVisible(boolean isVisible)
Bring this chat to front if b is true, hide it otherwise.
|
void |
setMessage(java.lang.String message)
Sets the given message as a message in the chat write area.
|
static final java.lang.String OUTGOING_MESSAGE
static final java.lang.String INCOMING_MESSAGE
static final java.lang.String STATUS_MESSAGE
static final java.lang.String ACTION_MESSAGE
static final java.lang.String SYSTEM_MESSAGE
static final java.lang.String SMS_MESSAGE
static final java.lang.String ERROR_MESSAGE
static final java.lang.String HISTORY_INCOMING_MESSAGE
static final java.lang.String HISTORY_OUTGOING_MESSAGE
static final int CHAT_BUFFER_SIZE
boolean isChatFocused()
java.lang.String getMessage()
void setChatVisible(boolean isVisible)
isVisible
- tells if the chat will be made visible or not.void setMessage(java.lang.String message)
message
- the text that would be set to the chat write areavoid addChatFocusListener(ChatFocusListener l)
l
- the ChatFocusListener to addvoid removeChatFocusListener(ChatFocusListener l)
l
- the ChatFocusListener to removevoid addChatEditorKeyListener(java.awt.event.KeyListener l)
KeyListener
to this Chat.
The KeyListener is used to inform other bundles when a user has
typed in the chat editor area.l
- the KeyListener to addvoid removeChatEditorKeyListener(java.awt.event.KeyListener l)
KeyListener
from this Chat.
The KeyListener is used to inform other bundles when a user has
typed in the chat editor area.l
- the ChatFocusListener to removevoid addChatEditorMenuListener(ChatMenuListener l)
ChatMenuListener
to this Chat.
The ChatMenuListener is used to determine menu elements
that should be added on right clicks.l
- the ChatMenuListener to addvoid addChatEditorCaretListener(javax.swing.event.CaretListener l)
CaretListener
to this Chat.
The CaretListener is used to inform other bundles when a user has
moved the caret in the chat editor area.l
- the CaretListener to addvoid addChatEditorDocumentListener(javax.swing.event.DocumentListener l)
DocumentListener
to this Chat.
The DocumentListener is used to inform other bundles when a user has
modified the document in the chat editor area.l
- the DocumentListener to addvoid removeChatEditorMenuListener(ChatMenuListener l)
ChatMenuListener
to this Chat.
The ChatMenuListener is used to determine menu elements
that should be added on right clicks.l
- the ChatMenuListener to addvoid removeChatEditorCaretListener(javax.swing.event.CaretListener l)
CaretListener
from this Chat.
The CaretListener is used to inform other bundles when a user has
moved the caret in the chat editor area.l
- the CaretListener to removevoid removeChatEditorDocumentListener(javax.swing.event.DocumentListener l)
DocumentListener
from this Chat.
The DocumentListener is used to inform other bundles when a user has
modified the document in the chat editor area.l
- the DocumentListener to removevoid addMessage(java.lang.String contactName, java.util.Date date, java.lang.String messageType, java.lang.String message, java.lang.String contentType)
contactName
- the name of the contact sending the messagedate
- the time at which the message is sent or receivedmessageType
- the type of the messagemessage
- the message textcontentType
- the content typevoid addChatLinkClickedListener(ChatLinkClickedListener listener)
listener
- callback that is notified when a link was clicked.void removeChatLinkClickedListener(ChatLinkClickedListener listener)
listener
- the already registered listener to remove.javax.swing.text.Highlighter getHighlighter()
Highlighter
used in rendering the chat editor.int getCaretPosition()
void promptRepaint()
Jitsi, the OpenSource Java VoIP and Instant Messaging client.
Distributable under Apache license.