Package ui.tabs

Source Code of ui.tabs.PrivateChatTab$FeedListener

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);
    }

  }

}
TOP

Related Classes of ui.tabs.PrivateChatTab$FeedListener

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.