/** Removes the room that is currently selected. */
  void removeSelectedRoom() {
    ChatRoomWrapper chatRoomWrapper = chatRoomsTableModel.getValueAt(chatRoomList.getSelectedRow());

    ConferenceChatManager conferenceManager =
        GuiActivator.getUIService().getConferenceChatManager();
    conferenceManager.removeChatRoom(chatRoomWrapper);
  }
  /** Opens the currently selected chat. */
  void openChatForSelection() {
    Object selectedValue = this.chatRoomsTableModel.getValueAt(this.chatRoomList.getSelectedRow());

    ChatRoomWrapper chatRoomWrapper;
    if (selectedValue instanceof ChatRoomWrapper) chatRoomWrapper = (ChatRoomWrapper) selectedValue;
    else return;

    if (!chatRoomWrapper.getChatRoom().isJoined()) {
      GuiActivator.getUIService().getConferenceChatManager().joinChatRoom(chatRoomWrapper);
    }

    ChatWindowManager chatWindowManager = GuiActivator.getUIService().getChatWindowManager();
    ChatPanel chatPanel = chatWindowManager.getMultiChat(chatRoomWrapper, true);

    chatWindowManager.openChat(chatPanel, true);
  }
  /** Initializes the chat rooms list interface. */
  private void initChatRoomList() {
    this.chatRoomsTableModel = new ChatRoomTableModel(chatRoomList);

    this.chatRoomList.addMouseListener(this);

    this.chatRoomList.setDefaultRenderer(
        ProtocolProviderService.class, new ProtocolProviderTableCellRenderer());
    this.chatRoomList.setDefaultRenderer(ChatRoomWrapper.class, new ChatRoomTableCellRenderer());

    this.chatRoomList.setOpaque(false);
    this.chatRoomList.setModel(chatRoomsTableModel);

    ConferenceChatManager confChatManager = GuiActivator.getUIService().getConferenceChatManager();

    confChatManager.addChatRoomListChangeListener(chatRoomsTableModel);

    //        this.chatRoomList.setAutoResizeMode(JTable.AUTO_RESIZE_ALL_COLUMNS);
    //        this.chatRoomList.getColumnModel().getColumn(0).setMinWidth(250);
    //        this.chatRoomList.getColumnModel().getColumn(1).setMinWidth(250);
    //        this.chatRoomList.getColumnModel().getColumn(2).setPreferredWidth(50);
  }