diff --git a/src/net/java/sip/communicator/impl/gui/main/contactlist/ContactListPanel.java b/src/net/java/sip/communicator/impl/gui/main/contactlist/ContactListPanel.java
index 30f6d5a6b..173ce3381 100755
--- a/src/net/java/sip/communicator/impl/gui/main/contactlist/ContactListPanel.java
+++ b/src/net/java/sip/communicator/impl/gui/main/contactlist/ContactListPanel.java
@@ -99,12 +99,12 @@ public ContactListPanel(MainFrame mainFrame) {
}
/**
- * Initialize the contact list tree.
+ * Initializes the contact list.
*
* @param contactListService The MetaContactListService which will
* be used for a contact list data model.
*/
- public void initTree(MetaContactListService contactListService) {
+ public void initList(MetaContactListService contactListService) {
this.contactList = new ContactList(contactListService);
@@ -680,7 +680,7 @@ public void setChatNotificationMsg(MetaContact metaContact,
ChatWindow msgWindow = (ChatWindow) contactMsgWindows
.get(metaContact);
msgWindow.getChatPanel(metaContact)
- .setChatStatus(notificationMsg);
+ .setChatStatusMessage(notificationMsg);
}
} else if (tabbedChatWindow != null) {
Hashtable contactTabsTable
@@ -689,7 +689,7 @@ public void setChatNotificationMsg(MetaContact metaContact,
if (contactTabsTable.get(metaContact.getMetaUID()) != null) {
tabbedChatWindow.getChatPanel(metaContact)
- .setChatStatus(notificationMsg);
+ .setChatStatusMessage(notificationMsg);
}
}
}
diff --git a/src/net/java/sip/communicator/impl/gui/main/message/ChatPanel.java b/src/net/java/sip/communicator/impl/gui/main/message/ChatPanel.java
index fd8fa4785..dd33372d8 100644
--- a/src/net/java/sip/communicator/impl/gui/main/message/ChatPanel.java
+++ b/src/net/java/sip/communicator/impl/gui/main/message/ChatPanel.java
@@ -15,6 +15,7 @@
import java.awt.event.ComponentListener;
import java.io.IOException;
import java.util.Date;
+import java.util.Hashtable;
import java.util.Vector;
import javax.swing.JButton;
@@ -385,10 +386,12 @@ public void requestFocusInWriteArea(){
}
/**
- * Sets the current contact typing status.
+ * Sets the message text to the status panel in the bottom of the chat
+ * window. Used to show typing notification messages, links' hrefs, etc.
+ * @param statusMessage The message text to be displayed.
*/
- public void setChatStatus(String statusMessage){
- this.sendPanel.setChatStatus(statusMessage);
+ public void setChatStatusMessage(String statusMessage){
+ this.sendPanel.setChatStatusMessage(statusMessage);
}
/**
@@ -514,8 +517,8 @@ public void sendMessage(){
* which moves the scrollbar up.
*/
public void setCaretToEnd(){
- HTMLDocument doc = (HTMLDocument)this.conversationPanel.getChatEditorPane()
- .getDocument();
+ HTMLDocument doc = (HTMLDocument)this.conversationPanel
+ .getChatEditorPane().getDocument();
Element root = doc.getDefaultRootElement();
try {
@@ -530,6 +533,11 @@ public void setCaretToEnd(){
this.conversationPanel.setCarretToEnd();
}
+ /**
+ * Opens the selector box containing the protocol contact icons. This is the
+ * menu, where user could select the protocol specific contact to
+ * communicate through.
+ */
public void openProtocolSelectorBox() {
SIPCommSelectorBox contactSelector
= this.sendPanel.getContactSelectorBox();
@@ -542,25 +550,51 @@ public void openProtocolSelectorBox() {
}
}
+ /**
+ * Returns the PresenceStatus of the default contact for this chat
+ * panel.
+ * @return the PresenceStatus of the default contact for this chat
+ * panel.
+ */
public PresenceStatus getPresenceStatus() {
return getDefaultContact().getDefaultContact().getPresenceStatus();
}
+ /**
+ * Implements the ExportedDialog.isDialogVisible method, to
+ * check whether this chat panel is currently visible.
+ * @return true if this chat panel is currently visible,
+ * false otherwise.
+ */
public boolean isDialogVisible() {
return this.isVisible;
}
+ /**
+ * Implements the ExportedDialog.showDialog method, to
+ * make a chat panel visible.
+ */
public void showDialog() {
+ Hashtable contactChats = chatWindow.getContactChatsTable();
+
if(Constants.TABBED_CHAT_WINDOW) {
- this.chatWindow.addChatTab(this);
+ if(!contactChats.containsValue(this))
+ this.chatWindow.addChatTab(this);
+ else
+ this.chatWindow.setSelectedContactTab(getDefaultContact());
}
else {
- this.chatWindow.addChat(this);
+ if(!contactChats.containsValue(this))
+ this.chatWindow.addChat(this);
}
this.chatWindow.setVisible(true);
}
+ /**
+ * Implements the ExportedDialog.hideDialog method, to
+ * hide a chat panel.
+ */
public void hideDialog() {
this.isVisible = false;
@@ -572,14 +606,31 @@ public void hideDialog() {
}
}
+ /**
+ * Implements the ExportedDialog.resizeDialog method, to
+ * resize the chat window to the given width and height.
+ * @param width The new width to set.
+ * @param height The new height to set.
+ */
public void resizeDialog(int width, int height) {
this.chatWindow.setSize(width, height);
}
+ /**
+ * Implements the ExportedDialog.moveDialog method, to
+ * move the chat window to the given x and y coordinates.
+ * @param x The x coordinate.
+ * @param y The y coordinate.
+ */
public void moveDialog(int x, int y) {
this.chatWindow.setLocation(x, y);
}
+ /**
+ * Sets the chat isVisible variable to true or
+ * false to indicate that this chat panel is visible or
+ * invisible.
+ */
public void setChatVisible(boolean isVisible) {
this.isVisible = isVisible;
}