* @param escapedMessageID the id of the message to be ignored;
* <tt>null</tt> if no message is to be ignored
*/
public void loadHistory(final String escapedMessageID)
{
SwingWorker historyWorker = new SwingWorker()
{
private Collection<Object> historyList;
public Object construct() throws Exception
{
// Load the history period, which initializes the
// firstMessageTimestamp and the lastMessageTimeStamp variables.
// Used to disable/enable history flash buttons in the chat
// window tool bar.
loadHistoryPeriod();
// Load the last N=CHAT_HISTORY_SIZE messages from history.
historyList = chatSession.getHistory(
ConfigurationManager.getChatHistorySize());
return historyList;
}
/**
* Called on the event dispatching thread (not on the worker thread)
* after the <code>construct</code> method has returned.
*/
public void finished()
{
if(historyList != null && historyList.size() > 0)
{
processHistory(historyList, escapedMessageID);
}
isHistoryLoaded = true;
// Add incoming events accumulated while the history was loading
// at the end of the chat.
addIncomingEvents();
}
};
historyWorker.start();
}