public void closing() { chatRoom.removeFileDropListener(this); chatRoom.getChatInputEditor().removeKeyListener(this); chatRoom.removeClosingListener(this); sendFileButton.removeActionListener(this); sendScreenShotButton.removeActionListener(this); } }
public void doRun() { try { //chatFrame.requestFocus(); ChatRoom chatRoom = getActiveChatRoom(); chatRoom.getChatInputEditor().requestFocusInWindow(); updateActiveTab(); } catch (ChatRoomNotFoundException e1) { // Ignore. There may legitamtly not be a chat room. } } };
public void mouseReleased(MouseEvent e) { mousePressed = false; if (transcriptWindow.getSelectedText() == null) { getChatInputEditor().requestFocus(); } }
/** * Activates the specified ChatRoom. * * @param room the ChatRoom to activate. */ public void activateChatRoom(ChatRoom room) { int tabLocation = indexOfComponent(room); setSelectedIndex(tabLocation); chatFrame.bringFrameIntoFocus(); focusChat(); }
/** * Override to save transcript in preferred room style. */ public void saveTranscript() { getTranscriptWindow().saveTranscript(getTabTitle() + ".html", getTranscripts(), null); }
public void actionPerformed(ActionEvent actionEvent) { chatFrame.setState(Frame.NORMAL); chatFrame.setVisible(true); int tabLocation = indexOfComponent(room); if (tabLocation != -1) { setSelectedIndex(tabLocation); } } });
/** * Prints the transcript of a given chat room. * * @param room the chat room that contains the transcript to print. */ public static void printChatRoomTranscript(ChatRoom room) { final ChatPrinter printer = new ChatPrinter(); final TranscriptWindow currentWindow = room.getTranscriptWindow(); if (currentWindow != null) { printer.print(currentWindow); } }
@Override public void doRun() { staticItem.updatePresenceIcon(staticItem.getPresence()); staticGroup.fireContactGroupUpdated(); } }, timeToRun);
/** * Returns the Active ChatRoom. * * @return the ChatRoom active in the tabbed pane. * @throws ChatRoomNotFoundException is thrown if no chat room is found. */ public ChatRoom getActiveChatRoom() throws ChatRoomNotFoundException { int location = getSelectedIndex(); if (location != -1) { return getChatRoom(location); } throw new ChatRoomNotFoundException(); }
private ContactGroup getSubContactGroup(ContactGroup group, JList list) { for (ContactGroup g : group.getContactGroups()) { if (g.getList() == list) { return g; } // Search subs ContactGroup g1 = getSubContactGroup(g, list); if (g1 != null) { return g1; } } return null; }
private void clearSelectionList(ContactItem selectedItem) { // Check for null. In certain cases the event triggering the model might // not find the selected object. if (selectedItem == null) { return; } final ContactGroup owner = getContactGroup(selectedItem.getGroupName()); for (ContactGroup contactGroup : new ArrayList<>( groupList )) { if (owner != contactGroup) { contactGroup.clearSelection(); } } }
private boolean isContactItemInGroup(Collection<ContactItem> contactItems, ContactGroup group) { boolean contactInGroup = false; for (ContactItem ci : contactItems) { if (group.getContactItemByJID(ci.getJid(), true) != null) { contactInGroup = true; break; } } return contactInGroup; }
public void tabRemoved(SparkTab tab, Component component, int index) { stateChanged(null); if (component instanceof ChatRoom) { cleanupChatRoom((ChatRoom)component); } else if (component instanceof ContainerComponent) { ((ContainerComponent)component).closing(); } }
public void actionPerformed(ActionEvent actionEvent) { Collection<ContactItem> contacts = contactList.getActiveGroup().getContactItems(); startConference(contacts); } };
public void finished() { if ((Boolean)get()) { // Now try and remove the group from the old one. removeContactItem(oldGroup, item); } }
public void insertHorizontalLine() { add( new HorizontalLineEntry() ); }
public void closing() { inviteButton.removeActionListener(this); chatRoom.removeClosingListener(this); }
/** * Shake it, come on now, shake that frame. */ public void buzz() { ShakeWindow d = new ShakeWindow(this); d.startShake(); }
/*** * * @param room * @param message */ public void messageSent(ChatRoom room, Message message) { fireChatRoomStateUpdated(room); }
/** * 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(); }