Skip to content

Commit

Permalink
Adds new MUC bundle to handle the chat rooms. Moves ChatRoomWrapper,
Browse files Browse the repository at this point in the history
ChatRoomList and ChatRoomProviderWrapper classes from GUI to the MUC
bundle. Moves most of ConferenceChatManager methods in  MUCService.
  • Loading branch information
hristoterezov committed Nov 7, 2013
1 parent 100ffdd commit be3bcff
Show file tree
Hide file tree
Showing 59 changed files with 2,394 additions and 1,691 deletions.
2 changes: 2 additions & 0 deletions build.xml
Expand Up @@ -2927,6 +2927,8 @@ javax.swing.event, javax.swing.border"/>
manifest="${src}/net/java/sip/communicator/impl/muc/muc.manifest.mf">
<zipfileset dir="${dest}/net/java/sip/communicator/impl/muc"
prefix="net/java/sip/communicator/impl/muc"/>
<zipfileset dir="${dest}/net/java/sip/communicator/service/muc"
prefix="net/java/sip/communicator/service/muc" />
</jar>
</target>

Expand Down
4 changes: 2 additions & 2 deletions lib/felix.client.run.properties
Expand Up @@ -126,7 +126,8 @@ felix.auto.start.60= \
reference:file:sc-bundles/keybindings.jar \
reference:file:sc-bundles/contactsource.jar \
reference:file:sc-bundles/customcontactactions.jar \
reference:file:sc-bundles/globaldisplaydetails.jar
reference:file:sc-bundles/globaldisplaydetails.jar \
reference:file:sc-bundles/muc.jar

felix.auto.start.66= \
reference:file:sc-bundles/swing-ui.jar \
Expand Down Expand Up @@ -185,7 +186,6 @@ felix.auto.start.67= \
reference:file:sc-bundles/plugin-certconfig.jar \
reference:file:sc-bundles/phonenumbercontactsource.jar \
reference:file:sc-bundles/demuxcontactsource.jar \
reference:file:sc-bundles/muc.jar \
reference:file:sc-bundles/propertieseditor.jar

# Level 68 is for profiler4j. Either don't use it or change the build.xml file
Expand Down
60 changes: 55 additions & 5 deletions src/net/java/sip/communicator/impl/gui/AlertUIServiceImpl.java
Expand Up @@ -6,6 +6,8 @@
*/
package net.java.sip.communicator.impl.gui;

import javax.swing.*;

import net.java.sip.communicator.plugin.desktoputil.*;
import net.java.sip.communicator.service.gui.*;
import net.java.sip.communicator.service.systray.*;
Expand Down Expand Up @@ -40,8 +42,19 @@ public class AlertUIServiceImpl
* @param title the title of the dialog
* @param message the message to be displayed
*/
public void showAlertDialog(String title, String message)
public void showAlertDialog(final String title, final String message)
{
if(!SwingUtilities.isEventDispatchThread())
{
SwingUtilities.invokeLater(new Runnable()
{
public void run()
{
showAlertDialog(title, message);
}
});
return;
}
new ErrorDialog(GuiActivator.getUIService().getMainFrame(),
title,
message).showDialog();
Expand All @@ -55,8 +68,20 @@ public void showAlertDialog(String title, String message)
* @param message the message to be displayed
* @param e the exception corresponding to the error
*/
public void showAlertDialog(String title, String message, Throwable e)
public void showAlertDialog(final String title, final String message,
final Throwable e)
{
if(!SwingUtilities.isEventDispatchThread())
{
SwingUtilities.invokeLater(new Runnable()
{
public void run()
{
showAlertDialog(title, message, e);
}
});
return;
}
new ErrorDialog(GuiActivator.getUIService().getMainFrame(),
title,
message,
Expand All @@ -70,8 +95,20 @@ public void showAlertDialog(String title, String message, Throwable e)
* @param message the message to be displayed
* @param type the dialog type (warning or error)
*/
public void showAlertDialog(String title, String message, int type)
public void showAlertDialog(final String title, final String message,
final int type)
{
if(!SwingUtilities.isEventDispatchThread())
{
SwingUtilities.invokeLater(new Runnable()
{
public void run()
{
showAlertDialog(title, message, type);
}
});
return;
}
new ErrorDialog(GuiActivator.getUIService().getMainFrame(),
title,
message,
Expand Down Expand Up @@ -131,9 +168,22 @@ public void showAlertPopup(String title, String message,
* @param errorDialogMessage the message of the error dialog
* @param e the exception that can be shown in the error dialog
*/
public void showAlertPopup(String title, String message,
String errorDialogTitle, String errorDialogMessage, Throwable e)
public void showAlertPopup(final String title, final String message,
final String errorDialogTitle, final String errorDialogMessage,
final Throwable e)
{
if(!SwingUtilities.isEventDispatchThread())
{
SwingUtilities.invokeLater(new Runnable()
{
public void run()
{
showAlertPopup(title, message, errorDialogTitle,
errorDialogMessage, e);
}
});
return;
}
SystrayService systray = GuiActivator.getSystrayService();
if(systray == null)
{
Expand Down
23 changes: 23 additions & 0 deletions src/net/java/sip/communicator/impl/gui/GuiActivator.java
Expand Up @@ -24,6 +24,7 @@
import net.java.sip.communicator.service.gui.*;
import net.java.sip.communicator.service.keybindings.*;
import net.java.sip.communicator.service.metahistory.*;
import net.java.sip.communicator.service.muc.*;
import net.java.sip.communicator.service.notification.*;
import net.java.sip.communicator.service.protocol.*;
import net.java.sip.communicator.service.protocol.globalstatus.*;
Expand Down Expand Up @@ -108,6 +109,8 @@ public class GuiActivator implements BundleActivator
private static AlertUIService alertUIService;

private static CredentialsStorageService credentialsService;

private static MUCService mucService;

private static final Map<Object, ProtocolProviderFactory>
providerFactoriesMap = new Hashtable<Object, ProtocolProviderFactory>();
Expand Down Expand Up @@ -872,4 +875,24 @@ public static CredentialsStorageService getCredentialsStorageService()
}
return credentialsService;
}

/**
* Returns a reference to a MUCService implementation
* currently registered in the bundle context or null if no such
* implementation was found.
*
* @return a currently valid implementation of the
* MUCService.
*/
public static MUCService getMUCService()
{
if (mucService == null)
{
ServiceReference mucServiceReference
= bundleContext.getServiceReference(MUCService.class.getName());
mucService
= (MUCService) bundleContext.getService(mucServiceReference);
}
return mucService;
}
}
Expand Up @@ -11,9 +11,9 @@
import javax.swing.*;
import javax.swing.table.*;

import net.java.sip.communicator.impl.gui.main.chat.conference.*;
import net.java.sip.communicator.impl.gui.utils.*;
import net.java.sip.communicator.service.contactlist.*;
import net.java.sip.communicator.service.muc.*;
import net.java.sip.communicator.service.protocol.*;

/**
Expand Down
Expand Up @@ -13,9 +13,9 @@

import net.java.sip.communicator.impl.gui.*;
import net.java.sip.communicator.impl.gui.customcontrols.*;
import net.java.sip.communicator.impl.gui.main.chat.conference.*;
import net.java.sip.communicator.impl.gui.utils.*;
import net.java.sip.communicator.plugin.desktoputil.*;
import net.java.sip.communicator.service.muc.*;
import net.java.sip.communicator.service.protocol.*;
import net.java.sip.communicator.util.*;
import net.java.sip.communicator.util.skin.*;
Expand Down
Expand Up @@ -30,6 +30,7 @@
import net.java.sip.communicator.service.gui.*;
import net.java.sip.communicator.service.gui.event.*;
import net.java.sip.communicator.service.metahistory.*;
import net.java.sip.communicator.service.muc.*;
import net.java.sip.communicator.service.protocol.*;
import net.java.sip.communicator.service.protocol.event.*;
import net.java.sip.communicator.util.*;
Expand All @@ -50,6 +51,7 @@
* @author Yana Stamcheva
* @author Lyubomir Marinov
* @author Adam Netocny
* @author Hristo Terezov
*/
@SuppressWarnings("serial")
public class ChatPanel
Expand Down Expand Up @@ -2650,7 +2652,7 @@ public void inviteContacts( ChatTransport inviteChatTransport,
getOperationSet(OperationSetMultiUserChat.class) != null)
{
ChatRoomWrapper chatRoomWrapper
= conferenceChatManager.createPrivateChatRoom(
= GuiActivator.getMUCService().createPrivateChatRoom(
inviteChatTransport.getProtocolProvider(),
chatContacts,
reason,
Expand Down
Expand Up @@ -19,6 +19,7 @@
import net.java.sip.communicator.service.contactlist.*;
import net.java.sip.communicator.service.gui.*;
import net.java.sip.communicator.service.gui.event.*;
import net.java.sip.communicator.service.muc.*;
import net.java.sip.communicator.service.protocol.*;
import net.java.sip.communicator.util.*;
import net.java.sip.communicator.util.Logger;
Expand All @@ -32,6 +33,7 @@
* @author Yana Stamcheva
* @author Valentin Martinet
* @author Lyubomir Marinov
* @author Hristo Terezov
*/
public class ChatWindowManager
{
Expand Down Expand Up @@ -756,8 +758,7 @@ private ChatPanel getMultiChatInternal(ChatRoom chatRoom,
{
ChatRoomList chatRoomList
= GuiActivator
.getUIService()
.getConferenceChatManager().getChatRoomList();
.getMUCService().getChatRoomList();

// Search in the chat room's list for a chat room that correspond
// to the given one.
Expand All @@ -770,7 +771,9 @@ private ChatPanel getMultiChatInternal(ChatRoom chatRoom,
= chatRoomList.findServerWrapperFromProvider(
chatRoom.getParentProvider());

chatRoomWrapper = new ChatRoomWrapper(parentProvider, chatRoom);
chatRoomWrapper
= GuiActivator.getMUCService().createChatRoomWrapper(
parentProvider, chatRoom);

chatRoomList.addChatRoom(chatRoomWrapper);
}
Expand Down
Expand Up @@ -15,6 +15,7 @@
import net.java.sip.communicator.impl.gui.main.call.*;
import net.java.sip.communicator.impl.gui.main.chat.*;
import net.java.sip.communicator.plugin.desktoputil.*;
import net.java.sip.communicator.service.muc.*;
import net.java.sip.communicator.service.protocol.*;
import net.java.sip.communicator.util.skin.*;

Expand Down
Expand Up @@ -11,6 +11,7 @@
import javax.swing.*;

import net.java.sip.communicator.impl.gui.main.chat.*;
import net.java.sip.communicator.service.muc.*;
import net.java.sip.communicator.service.protocol.*;

/**
Expand Down
Expand Up @@ -11,6 +11,7 @@
import javax.swing.*;

import net.java.sip.communicator.impl.gui.main.chat.*;
import net.java.sip.communicator.service.muc.*;
import net.java.sip.communicator.service.protocol.event.*;

/**
Expand Down
Expand Up @@ -15,6 +15,7 @@
import net.java.sip.communicator.impl.gui.main.chat.*;
import net.java.sip.communicator.impl.gui.main.contactlist.*;
import net.java.sip.communicator.plugin.desktoputil.*;
import net.java.sip.communicator.service.muc.*;
import net.java.sip.communicator.service.protocol.*;
import net.java.sip.communicator.util.skin.*;

Expand Down
Expand Up @@ -14,6 +14,7 @@
import net.java.sip.communicator.impl.gui.*;
import net.java.sip.communicator.impl.gui.utils.*;
import net.java.sip.communicator.plugin.desktoputil.*;
import net.java.sip.communicator.service.muc.*;
import net.java.sip.communicator.service.protocol.*;
import net.java.sip.communicator.service.protocol.event.*;
import net.java.sip.communicator.util.*;
Expand Down

0 comments on commit be3bcff

Please sign in to comment.