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(); }
void showChat(Chat chat) { if (mMainFrame.getCurrentTab() != MainFrame.Tab.CHATS) return; mContent.showChat(chat); }