public void componentResized(ComponentEvent e) { try { ChatRoom chatRoom = SparkManager.getChatManager().getChatContainer().getActiveChatRoom(); chatRoom.getVerticalSlipPane().setDividerLocation(-1); } catch (ChatRoomNotFoundException e1) { // Ignore, because I don't care if it's not a chat room. } } });
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 actionPerformed( ActionEvent actionEvent ) { String user = null; try { ChatManager manager = SparkManager.getChatManager(); ChatRoom room = manager.getChatContainer().getActiveChatRoom(); user = room.getRoomname().toString(); int ok = JOptionPane.showConfirmDialog( (TranscriptWindow) object, Res.getString( "delete.permanently" ), Res.getString( "delete.log.permanently" ), JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE ); if ( ok == JOptionPane.YES_OPTION ) { // This actions must be move into Transcript Plugin! File transcriptDir = new File( SparkManager.getUserDirectory(), "transcripts" ); File transcriptFile = new File( transcriptDir, user + ".xml" ); transcriptFile.delete(); transcriptFile = new File( transcriptDir, user + "_current.xml" ); transcriptFile.delete(); clear(); } } catch ( Exception ex ) { Log.error( "An exception occurred while trying to clear history for a chat room " + user, ex ); } } } );
@Override public void actionPerformed( ActionEvent e ) { ChatRoom room = null; try { room = SparkManager.getChatManager().getChatContainer().getActiveChatRoom(); HistoryWindow hw = new HistoryWindow( SparkManager.getUserDirectory(), room.getRoomname().toString() ); hw.showWindow(); } catch ( Exception ex ) { Log.error( "An exception occurred while trying to open history window for room " + room, ex ); } } } );
if ( SparkManager.getChatManager().getChatContainer().getActiveChatRoom() instanceof GroupChatRoom ) final GroupChatRoom activeChatRoom = (GroupChatRoom) SparkManager.getChatManager().getChatContainer().getActiveChatRoom(); for ( EntityFullJid participant : activeChatRoom.getParticipants() )
public void closeActiveRoom() { ChatRoom room; try { room = getActiveChatRoom(); } catch (ChatRoomNotFoundException e1) { Component comp = getActiveRoom(); if (comp != null) { boolean canClose = ((ContainerComponent)comp).closing(); if (canClose) { closeTab(comp); } } return; } // Confirm end session boolean isGroupChat = room.getChatType() == Message.Type.groupchat; if (isGroupChat) { final int ok = JOptionPane.showConfirmDialog(chatFrame, Res.getString("message.end.conversation"), Res.getString("title.confirmation"), JOptionPane.YES_NO_OPTION); if (ok == JOptionPane.OK_OPTION) { room.closeChatRoom(); } } else { room.closeChatRoom(); } }
boolean groupMessageChecked = false; try { activeChatRoom = getActiveChatRoom();