Jitsi: the OpenSource Java VoIP and Instant Messaging client.

net.java.sip.communicator.service.gui
Interface Chat

All Known Implementing Classes:
ChatPanel

public interface Chat

The Chat interface is meant to be implemented by the GUI component class representing a chat. Through the isChatFocused method the other bundles could check the visibility of the chat component. The ChatFocusListener is used to inform other bundles when a chat has changed its focus state.

Author:
Yana Stamcheva

Field Summary
static 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 String ERROR_MESSAGE
          The message type representing error messages.
static String HISTORY_INCOMING_MESSAGE
          The history incoming message type.
static String HISTORY_OUTGOING_MESSAGE
          The history outgoing message type.
static String INCOMING_MESSAGE
          The message type representing incoming messages.
static String OUTGOING_MESSAGE
          The message type representing outgoing messages.
static String SMS_MESSAGE
          The message type representing sms messages.
static String STATUS_MESSAGE
          The message type representing status messages.
static String SYSTEM_MESSAGE
          The message type representing system messages.
 
Method Summary
 void addChatEditorCaretListener(CaretListener l)
          Adds the given CaretListener to this Chat.
 void addChatEditorDocumentListener(DocumentListener l)
          Adds the given DocumentListener to this Chat.
 void addChatEditorKeyListener(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(String contactName, long date, String messageType, String message, String contentType)
          Adds a message to this Chat.
 int getCaretPosition()
          Gets the caret position in the chat editor.
 Highlighter getHighlighter()
          Provides the Highlighter used in rendering the chat editor.
 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(CaretListener l)
          Removes the given CaretListener from this Chat.
 void removeChatEditorDocumentListener(DocumentListener l)
          Removes the given DocumentListener from this Chat.
 void removeChatEditorKeyListener(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(String message)
          Sets the given message as a message in the chat write area.
 

Field Detail

OUTGOING_MESSAGE

static final String OUTGOING_MESSAGE
The message type representing outgoing messages.

See Also:
Constant Field Values

INCOMING_MESSAGE

static final String INCOMING_MESSAGE
The message type representing incoming messages.

See Also:
Constant Field Values

STATUS_MESSAGE

static final String STATUS_MESSAGE
The message type representing status messages.

See Also:
Constant Field Values

ACTION_MESSAGE

static final String ACTION_MESSAGE
The message type representing action messages. These are message specific for IRC, but could be used in other protocols also.

See Also:
Constant Field Values

SYSTEM_MESSAGE

static final String SYSTEM_MESSAGE
The message type representing system messages.

See Also:
Constant Field Values

SMS_MESSAGE

static final String SMS_MESSAGE
The message type representing sms messages.

See Also:
Constant Field Values

ERROR_MESSAGE

static final String ERROR_MESSAGE
The message type representing error messages.

See Also:
Constant Field Values

HISTORY_INCOMING_MESSAGE

static final String HISTORY_INCOMING_MESSAGE
The history incoming message type.

See Also:
Constant Field Values

HISTORY_OUTGOING_MESSAGE

static final String HISTORY_OUTGOING_MESSAGE
The history outgoing message type.

See Also:
Constant Field Values

CHAT_BUFFER_SIZE

static final 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.

See Also:
Constant Field Values
Method Detail

isChatFocused

boolean isChatFocused()
Checks if this Chat is currently focused.

Returns:
TRUE if the chat is focused, FALSE - otherwise

getMessage

String getMessage()
Returns the message written by user in the chat write area.

Returns:
the message written by user in the chat write area

setChatVisible

void setChatVisible(boolean isVisible)
Bring this chat to front if b is true, hide it otherwise.

Parameters:
isVisible - tells if the chat will be made visible or not.

setMessage

void setMessage(String message)
Sets the given message as a message in the chat write area.

Parameters:
message - the text that would be set to the chat write area

addChatFocusListener

void addChatFocusListener(ChatFocusListener l)
Adds the given ChatFocusListener to this Chat. The ChatFocusListener is used to inform other bundles when a chat has changed its focus state.

Parameters:
l - the ChatFocusListener to add

removeChatFocusListener

void removeChatFocusListener(ChatFocusListener l)
Removes the given ChatFocusListener from this Chat. The ChatFocusListener is used to inform other bundles when a chat has changed its focus state.

Parameters:
l - the ChatFocusListener to remove

addChatEditorKeyListener

void addChatEditorKeyListener(KeyListener l)
Adds the given KeyListener to this Chat. The KeyListener is used to inform other bundles when a user has typed in the chat editor area.

Parameters:
l - the KeyListener to add

removeChatEditorKeyListener

void removeChatEditorKeyListener(KeyListener l)
Removes the given KeyListener from this Chat. The KeyListener is used to inform other bundles when a user has typed in the chat editor area.

Parameters:
l - the ChatFocusListener to remove

addChatEditorMenuListener

void addChatEditorMenuListener(ChatMenuListener l)
Adds the given ChatMenuListener to this Chat. The ChatMenuListener is used to determine menu elements that should be added on right clicks.

Parameters:
l - the ChatMenuListener to add

addChatEditorCaretListener

void addChatEditorCaretListener(CaretListener l)
Adds the given CaretListener to this Chat. The CaretListener is used to inform other bundles when a user has moved the caret in the chat editor area.

Parameters:
l - the CaretListener to add

addChatEditorDocumentListener

void addChatEditorDocumentListener(DocumentListener l)
Adds the given DocumentListener to this Chat. The DocumentListener is used to inform other bundles when a user has modified the document in the chat editor area.

Parameters:
l - the DocumentListener to add

removeChatEditorMenuListener

void removeChatEditorMenuListener(ChatMenuListener l)
Removes the given ChatMenuListener to this Chat. The ChatMenuListener is used to determine menu elements that should be added on right clicks.

Parameters:
l - the ChatMenuListener to add

removeChatEditorCaretListener

void removeChatEditorCaretListener(CaretListener l)
Removes the given CaretListener from this Chat. The CaretListener is used to inform other bundles when a user has moved the caret in the chat editor area.

Parameters:
l - the CaretListener to remove

removeChatEditorDocumentListener

void removeChatEditorDocumentListener(DocumentListener l)
Removes the given DocumentListener from this Chat. The DocumentListener is used to inform other bundles when a user has modified the document in the chat editor area.

Parameters:
l - the DocumentListener to remove

addMessage

void addMessage(String contactName,
                long date,
                String messageType,
                String message,
                String contentType)
Adds a message to this Chat.

Parameters:
contactName - the name of the contact sending the message
date - the time at which the message is sent or received
messageType - the type of the message
message - the message text
contentType - the content type

addChatLinkClickedListener

void addChatLinkClickedListener(ChatLinkClickedListener listener)
Adds a new ChatLinkClickedListener. The callback is called for every link whose scheme is jitsi. It is the callback's responsibility to filter the action based on the URI. Example:
jitsi://classname/action?query
Use the name of the registering class as the host, the action to execute as the path and any parameters as the query.

Parameters:
listener - callback that is notified when a link was clicked.

removeChatLinkClickedListener

void removeChatLinkClickedListener(ChatLinkClickedListener listener)
Removes an existing ChatLinkClickedListener

Parameters:
listener - the already registered listener to remove.

getHighlighter

Highlighter getHighlighter()
Provides the Highlighter used in rendering the chat editor.

Returns:
highlighter used to render message being composed

getCaretPosition

int getCaretPosition()
Gets the caret position in the chat editor.

Returns:
index of caret in message being composed

promptRepaint

void promptRepaint()
Causes the chat to validate its appearance (suggests a repaint operation may be necessary).


Jitsi: the OpenSource Java VoIP and Instant Messaging client.

Jitsi, the OpenSource Java VoIP and Instant Messaging client.
Distributable under LGPL license.