From 0950fae11e3199a4e8f3345ba11bbbe0bf2d4521 Mon Sep 17 00:00:00 2001 From: Yana Stamcheva Date: Wed, 19 Sep 2007 19:10:13 +0000 Subject: [PATCH] Subclipse doesn't add automatically new files to SVN when we make a commit:( --- .../chat/history/HistoryWindowManager.java | 65 +++++++++++++++++++ 1 file changed, 65 insertions(+) create mode 100644 src/net/java/sip/communicator/impl/gui/main/chat/history/HistoryWindowManager.java diff --git a/src/net/java/sip/communicator/impl/gui/main/chat/history/HistoryWindowManager.java b/src/net/java/sip/communicator/impl/gui/main/chat/history/HistoryWindowManager.java new file mode 100644 index 000000000..396c5c209 --- /dev/null +++ b/src/net/java/sip/communicator/impl/gui/main/chat/history/HistoryWindowManager.java @@ -0,0 +1,65 @@ +/* + * SIP Communicator, the OpenSource Java VoIP and Instant Messaging client. + * + * Distributable under LGPL license. + * See terms of license at gnu.org. + */ +package net.java.sip.communicator.impl.gui.main.chat.history; + +import java.util.*; + +/** + * Manages all history windows within the gui. + * + * @author Yana Stamcheva + */ +public class HistoryWindowManager +{ + private Hashtable contactHistory = new Hashtable(); + + /** + * Checks if there's an open history window for the given history contact. + * + * @param historyContact the contact to check for + * @return TRUE if there's an opened history window for the given contact, + * FALSE otherwise. + */ + public boolean containsHistoryWindowForContact(Object historyContact) + { + return contactHistory.containsKey(historyContact); + } + + /** + * Returns the history window for the given contact. + * + * @param historyContact the contact to search for + * @return the history window for the given contact + */ + public HistoryWindow getHistoryWindowForContact(Object historyContact) + { + return (HistoryWindow) contactHistory.get(historyContact); + } + + /** + * Adds a history window for a given contact in the table of opened history + * windows. + * + * @param historyContact the contact to add + * @param historyWindow the history window to add + */ + public void addHistoryWindowForContact(Object historyContact, + HistoryWindow historyWindow) + { + contactHistory.put(historyContact, historyWindow); + } + + /** + * Removes the history window for the given contact. + * + * @param historyContact the contact to remove the history window + */ + public void removeHistoryWindowForContact(Object historyContact) + { + contactHistory.remove(historyContact); + } +}