void tabPaneChanged(MainFrame.Tab tab) {
   if (tab == MainFrame.Tab.CHATS) {
     Optional<Chat> optChat = mChatListView.getSelectedValue();
     if (optChat.isPresent()) {
       mContent.showChat(optChat.get());
       return;
     }
   } else {
     Optional<Contact> optContact = mContactListView.getSelectedValue();
     if (optContact.isPresent()) {
       mContent.showContact(optContact.get());
       return;
     }
   }
   mContent.showNothing();
 }
  private void statusChanged() {
    Control.Status status = mControl.getCurrentStatus();
    switch (status) {
      case CONNECTING:
        mStatusBarLabel.setText(Tr.tr("Connecting..."));
        break;
      case CONNECTED:
        mChatView.setColor(Color.WHITE);
        mStatusBarLabel.setText(Tr.tr("Connected"));
        NotificationManager.hideAllNotifications();
        break;
      case DISCONNECTING:
        mStatusBarLabel.setText(Tr.tr("Disconnecting..."));
        break;
      case DISCONNECTED:
        mChatView.setColor(Color.LIGHT_GRAY);
        mStatusBarLabel.setText(Tr.tr("Not connected"));
        // if (mTrayIcon != null)
        //    trayIcon.setImage(updatedImage);
        break;
      case SHUTTING_DOWN:
        mMainFrame.save();
        mChatListView.save();
        mTrayManager.removeTray();
        mMainFrame.setVisible(false);
        mMainFrame.dispose();
        break;
      case FAILED:
        mStatusBarLabel.setText(Tr.tr("Connecting failed"));
        break;
      case ERROR:
        mChatView.setColor(Color.lightGray);
        mStatusBarLabel.setText(Tr.tr("Connection error"));
        break;
    }

    mMainFrame.onStatusChanged(status);
  }
 private void selectChat(Chat chat) {
   mMainFrame.selectTab(MainFrame.Tab.CHATS);
   mChatListView.setSelectedItem(chat);
 }