package ui.tabs;
import java.awt.BorderLayout;
import main.settings.Settings;
import ui.misc.feeder.FeederFieldListener;
import chat.ChatForm;
import chat.PrivateChatSession;
public class PrivateChatTab extends AbstractDynamicTab
{
private static final long serialVersionUID = 9143584345143812444L;
private PrivateChatSession session;
private ChatForm form;
public PrivateChatTab(PrivateChatSession session)
{
super();
setLayout(new BorderLayout());
this.session = session;
form = new ChatForm(this, new FeedListener(), session.getNickname());
}
public ChatForm getForm()
{
return form;
}
public void disable()
{
form.disable();
}
public void close()
{
session.terminate();
super.close();
}
private class FeedListener implements FeederFieldListener
{
public void feed(String text)
{
session.queueMessage(text);
form.logMessage(Settings.application.nickname, text);
}
}
}