public void windowGainedFocus(WindowEvent e) { focused = true; if(this instanceof MainWindow){ return; } SparkManager.getChatManager().getChatContainer().focusChat(); }
/** * Activates the specified ChatRoom. * * @param room the ChatRoom to activate. */ public void activateChatRoom(ChatRoom room) { int tabLocation = indexOfComponent(room); setSelectedIndex(tabLocation); chatFrame.bringFrameIntoFocus(); focusChat(); }
/** * Activates the component in tabbed pane. * * @param component the component contained within the tab to activate. */ public void activateComponent(Component component) { int tabLocation = indexOfComponent(component); if (tabLocation != -1) { setSelectedIndex(tabLocation); } chatFrame.bringFrameIntoFocus(); focusChat(); }
public void windowActivated(WindowEvent windowEvent) { stopFlashing(); int sel = getSelectedIndex(); if (sel == -1) { return; } final ChatRoom room; try { room = getChatRoom(sel); focusChat(); // Set the title of the room. chatFrame.setTitle(room.getRoomTitle()); } catch (ChatRoomNotFoundException e1) { // Nothing to do } }
/** * Notification that the tab pane has been modified. Generally by changing of the tabs. * * @param e the ChangeEvent. */ public void stateChanged(ChangeEvent e) { // Stop the flashing only if the chat frame is in focus. if (chatFrame.isInFocus()) { stopFlashing(); } final Object o = getSelectedComponent(); if (o instanceof ChatRoom) { final ChatRoom room = (ChatRoom)o; focusChat(); // Set the title of the room. chatFrame.setTitle(room.getRoomTitle()); chatFrame.setIconImage(SparkManager.getMainWindow().getIconImage()); } else if (o instanceof ContainerComponent) { final ContainerComponent comp = (ContainerComponent)o; chatFrame.setTitle(comp.getFrameTitle()); chatFrame.setIconImage(comp.getTabIcon().getImage()); SparkManager.getChatManager().notifySparkTabHandlers(comp.getGUI()); } }