/** * Create a new instance of ChatManager. */ private ChatManager() { chatContainer = UIComponentRegistry.createChatContainer(); // Add Default Chat Room Decorator addSparkTabHandler(new DefaultTabHandler()); // Add a Message Handler ChatStateManager chatStateManager = ChatStateManager.getInstance(SparkManager.getConnection()); chatStateManager.addChatStateListener(smackChatStateListener); }
public void finished() { if (chatRoom == null) { chatRoom = UIComponentRegistry.createChatRoom(jid, nickname, nickname); chatManager.getChatContainer().addChatRoom(chatRoom); } chatManager.getChatContainer().activateChatRoom(chatRoom); } };
public StatusBar(boolean doLayout) { commandPanel = UIComponentRegistry.createCommandPanel();
/** * Builds the Workspace layout. */ public void buildLayout() { // Moved this to LoginDialog class // new Enterprise(); // Initialize Contact List contactList = UIComponentRegistry.createContactList(); conferences = UIComponentRegistry.createConferenceServices(); // Init contact list. contactList.initialize(); // Load VCard information for status box statusBox.loadVCard(); // Initialise TransferManager SparkTransferManager.getInstance(); }
Presence presence = PresenceManager.getPresence(entry.getJid()); if (presence.isAvailable()) { ContactItem item = UIComponentRegistry.createContactItem(entry.getName(), null, entry.getJid()); item.setPresence(presence); userList.add(item);
room = UIComponentRegistry.createGroupChatRoom( groupChat ); ((GroupChatRoom) room).setPassword( password ); ((GroupChatRoom) room).setTabTitle( tabTitle );
roomInfo = UIComponentRegistry.createGroupChatParticipantList(); getSplitPane().setRightComponent( roomInfo.getGUI() ); getSplitPane().setResizeWeight( 0.8 ); settings = UIComponentRegistry.getButtonFactory().createSettingsButton(); settings.setVisible( false ); final RolloverButton thema = UIComponentRegistry.getButtonFactory().createTemaButton(); final RolloverButton register = UIComponentRegistry.getButtonFactory().createRegisterButton();
private ContactGroup getUnfiledGroup() { if (unfiledGroup == null) { // Add Unfiled Group if(EventQueue.isDispatchThread()) { unfiledGroup = UIComponentRegistry.createContactGroup(Res.getString("unfiled")); // Only show the "Unfiled" group if it is not empty if (unfiledGroup.hasAvailableContacts()) addContactGroup(unfiledGroup); } else { try { EventQueue.invokeAndWait( () -> { unfiledGroup = UIComponentRegistry.createContactGroup(Res.getString("unfiled")); addContactGroup(unfiledGroup); } ); }catch(Exception ex) { ex.printStackTrace(); } } } return unfiledGroup; }
final LoginDialog dialog = UIComponentRegistry.createLoginDialog(); dialog.invoke(new JFrame()); } );
if(EventQueue.isDispatchThread()) { final ContactItem offlineItem = UIComponentRegistry.createContactItem(alias, nickname, jid); offlineItem.setGroupName(getGroupName()); final ContactItem offlineItem = UIComponentRegistry.createContactItem(alias, nickname, jid); offlineItem.setGroupName(getGroupName());
/** * Creates a new public Conference Room. * * @param roomName the name of the room. * @param serviceName the service name to use (ex.conference.jivesoftware.com) * @return the new ChatRoom created. If an error occured, null will be returned. */ public ChatRoom createConferenceRoom(Localpart roomName, DomainBareJid serviceName) { EntityBareJid roomAddress = JidCreate.entityBareFrom(roomName, serviceName); final MultiUserChat chatRoom = MultiUserChatManager.getInstanceFor( SparkManager.getConnection()).getMultiUserChat( roomAddress); final GroupChatRoom room = UIComponentRegistry.createGroupChatRoom(chatRoom); try { LocalPreferences pref = SettingsManager.getLocalPreferences(); Resourcepart nickname = pref.getNickname(); chatRoom.create(nickname); // Send an empty room configuration form which indicates that we want // an instant room chatRoom.sendConfigurationForm(new Form( DataForm.Type.submit )); } catch (XMPPException | SmackException | InterruptedException e1) { Log.error("Unable to send conference room chat configuration form.", e1); return null; } getChatContainer().addChatRoom(room); return room; }
newContactGroup = UIComponentRegistry.createContactGroup(group);
for(RosterEntry entry : group.getEntries()){ ContactItem buildContactItem = UIComponentRegistry.createContactItem(entry.getName(), null, entry.getJid()); moveToOffline(buildContactItem); contactItem = UIComponentRegistry.createContactItem(entry.getName(), null, entry.getJid()); EventQueue.invokeAndWait( () -> contactItem = UIComponentRegistry.createContactItem(name, null, user) ); } catch(Exception ex) { ex.printStackTrace(); ContactItem moveToOfflineContactItem = UIComponentRegistry.createContactItem(entry.getName(), null, entry.getJid()); moveToOffline(moveToOfflineContactItem); EventQueue.invokeAndWait( () -> { for (RosterEntry entry : roster.getUnfiledEntries()) { ContactItem moveToOfflineContactItem = UIComponentRegistry.createContactItem(entry.getName(), null, entry.getJid()); moveToOffline(moveToOfflineContactItem);
GroupChatRoom room = UIComponentRegistry.createGroupChatRoom(groupChat);
/** * Creates and/or opens a chat room with the specified user. * * @param userJID the jid of the user to chat with. * @param nicknameCs the nickname to use for the user. * @param title the title to use for the room. * @return the newly created <code>ChatRoom</code>. */ public ChatRoom createChatRoom(EntityJid userJID, CharSequence nicknameCs, CharSequence title) { Resourcepart nickname = Resourcepart.fromOrThrowUnchecked(nicknameCs); ChatRoom chatRoom; try { chatRoom = getChatContainer().getChatRoom(userJID); } catch (ChatRoomNotFoundException e) { chatRoom = UIComponentRegistry.createChatRoom(userJID, nickname, title); getChatContainer().addChatRoom(chatRoom); } return chatRoom; }
offlineGroup = UIComponentRegistry.createContactGroup(Res.getString("group.offline"));
private void addContactItem(final ContactGroup contactGroup, final ContactItem item) { ContactItem newContact = UIComponentRegistry.createContactItem(Res.getString("group.empty"), null, null); newContact.setPresence(item.getPresence()); newContact.setIcon(item.getIcon());
final GroupChatRoom room = UIComponentRegistry.createGroupChatRoom(multiUserChat); try {
String nicknameString = item.getDisplayName(); Resourcepart nickname = Resourcepart.fromOrThrowUnchecked(nicknameString); chatRoom = UIComponentRegistry.createChatRoom(jid, nickname, nickname); chatRoom = UIComponentRegistry.createChatRoom(jid, nickname, jid);
changeContactItem = UIComponentRegistry.createContactItem(entry.getName(), null, entry.getJid()); contactGroup.addContactItem(changeContactItem); changeContactItem.setAvailable(true); final ContactItem changeContact = UIComponentRegistry.createContactItem(entry.getName(), null, entry.getJid()); staticContactGroup.addContactItem(changeContact); changeContact.setPresence(staticItemPrecense); contactItem = UIComponentRegistry.createContactItem(entry.getName(), null, entry.getJid()); ContactGroup unfiledGrp = getUnfiledGroup(); unfiledGrp.addContactItem(contactItem); final Presence staticItemPrecense = presence; EventQueue.invokeLater( () -> { contactItem = UIComponentRegistry.createContactItem(entry.getName(), null, entry.getJid()); ContactGroup unfiledGrp = getUnfiledGroup();