svn commit: r3325 - trunk/src/net/java/sip/communicator: impl/gui impl/gui/main impl/gui/main/chat service/gui

yanas at dev.java.net yanas at dev.java.net
Thu Dec 20 16:10:16 CET 2007


Author: yanas
Date: 2007-12-20 15:10:14+0000
New Revision: 3325

Modified:
   trunk/src/net/java/sip/communicator/impl/gui/UIServiceImpl.java
   trunk/src/net/java/sip/communicator/impl/gui/main/MainFrame.java
   trunk/src/net/java/sip/communicator/impl/gui/main/chat/ChatWindow.java
   trunk/src/net/java/sip/communicator/service/gui/UIService.java

Log:
Some new gui plug-in containers.

Modified: trunk/src/net/java/sip/communicator/impl/gui/UIServiceImpl.java
Url: https://sip-communicator.dev.java.net/source/browse/sip-communicator/trunk/src/net/java/sip/communicator/impl/gui/UIServiceImpl.java?view=diff&rev=3325&p1=trunk/src/net/java/sip/communicator/impl/gui/UIServiceImpl.java&p2=trunk/src/net/java/sip/communicator/impl/gui/UIServiceImpl.java&r1=3324&r2=3325
==============================================================================
--- trunk/src/net/java/sip/communicator/impl/gui/UIServiceImpl.java	(original)
+++ trunk/src/net/java/sip/communicator/impl/gui/UIServiceImpl.java	2007-12-20 15:10:14+0000
@@ -61,6 +61,11 @@
         supportedContainers.add(UIService.CONTAINER_CALL_HISTORY);
         supportedContainers.add(UIService.CONTAINER_MAIN_TABBED_PANE);
         supportedContainers.add(UIService.CONTAINER_CHAT_HELP_MENU);
+        supportedContainers.add(UIService.CONTAINER_CHAT_WINDOW_SOUTH);
+        supportedContainers.add(UIService.CONTAINER_CONTACT_LIST_EAST);
+        supportedContainers.add(UIService.CONTAINER_CONTACT_LIST_WEST);
+        supportedContainers.add(UIService.CONTAINER_CONTACT_LIST_SOUTH);
+        supportedContainers.add(UIService.CONTAINER_CONTACT_LIST_NORTH);
     }
 
     private static final Hashtable<WindowID, ExportedWindow> exportedWindows

Modified: trunk/src/net/java/sip/communicator/impl/gui/main/MainFrame.java
Url: https://sip-communicator.dev.java.net/source/browse/sip-communicator/trunk/src/net/java/sip/communicator/impl/gui/main/MainFrame.java?view=diff&rev=3325&p1=trunk/src/net/java/sip/communicator/impl/gui/main/MainFrame.java&p2=trunk/src/net/java/sip/communicator/impl/gui/main/MainFrame.java&r1=3324&r2=3325
==============================================================================
--- trunk/src/net/java/sip/communicator/impl/gui/main/MainFrame.java	(original)
+++ trunk/src/net/java/sip/communicator/impl/gui/main/MainFrame.java	2007-12-20 15:10:14+0000
@@ -32,6 +32,7 @@
 import net.java.sip.communicator.service.contacteventhandler.*;
 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.protocol.*;
 import net.java.sip.communicator.service.protocol.event.*;
 import net.java.sip.communicator.util.*;
@@ -49,6 +50,7 @@
  */
 public class MainFrame
     extends SIPCommFrame
+    implements PluginComponentListener
 {
     private Logger logger = Logger.getLogger(MainFrame.class.getName());
 
@@ -105,6 +107,8 @@
         this.setTitle(Messages.getI18NString("sipCommunicator").getText());
 
         this.init();
+
+        this.initPluginComponents();
     }
 
     /**
@@ -128,7 +132,7 @@
         this.mainPanel.add(contactListPanel, BorderLayout.CENTER);
         this.mainPanel.add(statusPanel, BorderLayout.SOUTH);
 
-        this.getContentPane().add(mainPanel);
+        this.getContentPane().add(mainPanel, BorderLayout.CENTER);
     }
     
     /**
@@ -1178,4 +1182,107 @@
         return (ContactEventHandler) GuiActivator.bundleContext
             .getService(serRefs[0]);
     }
+
+    /**
+     * Initialize plugin components already registered for this container.
+     */
+    private void initPluginComponents()
+    {
+        Iterator pluginComponents = GuiActivator.getUIService()
+                .getComponentsForContainer(
+                    UIService.CONTAINER_CONTACT_LIST_SOUTH);
+
+        while (pluginComponents.hasNext())
+        {
+            Component o = (Component) pluginComponents.next();
+
+            this.getContentPane().add(o, BorderLayout.SOUTH);
+        }
+
+        pluginComponents = GuiActivator.getUIService()
+                .getComponentsForContainer(
+                    UIService.CONTAINER_CONTACT_LIST_NORTH);
+
+        while (pluginComponents.hasNext())
+        {
+            Component o = (Component) pluginComponents.next();
+
+            this.getContentPane().add(o, BorderLayout.NORTH);
+        }
+
+        pluginComponents = GuiActivator.getUIService()
+                .getComponentsForContainer(
+                    UIService.CONTAINER_CONTACT_LIST_EAST);
+
+        while (pluginComponents.hasNext())
+        {
+            Component o = (Component) pluginComponents.next();
+
+            this.getContentPane().add(o, BorderLayout.EAST);
+        }
+
+        pluginComponents = GuiActivator.getUIService()
+                .getComponentsForContainer(
+                    UIService.CONTAINER_CONTACT_LIST_WEST);
+
+        while (pluginComponents.hasNext())
+        {
+            Component o = (Component) pluginComponents.next();
+
+            this.getContentPane().add(o, BorderLayout.WEST);
+        }
+
+        GuiActivator.getUIService().addPluginComponentListener(this);
+    }
+
+    /**
+     * Adds the associated with this <tt>PluginComponentEvent</tt> component
+     * to the appropriate container.
+     */
+    public void pluginComponentAdded(PluginComponentEvent event)
+    {
+        Component c = (Component) event.getSource();
+
+        if (event.getContainerID().equals(
+            UIService.CONTAINER_CONTACT_LIST_SOUTH))
+        {
+            this.getContentPane().add(c, BorderLayout.SOUTH);
+        }
+        else if (event.getContainerID().equals(
+            UIService.CONTAINER_CONTACT_LIST_NORTH))
+        {
+            this.getContentPane().add(c, BorderLayout.NORTH);
+        }
+        else if (event.getContainerID().equals(
+            UIService.CONTAINER_CONTACT_LIST_EAST))
+        {
+            this.getContentPane().add(c, BorderLayout.EAST);
+        }
+        else if (event.getContainerID().equals(
+            UIService.CONTAINER_CONTACT_LIST_WEST))
+        {
+            this.getContentPane().add(c, BorderLayout.WEST);
+        }
+
+        this.pack();
+    }
+
+    /**
+     * Removes the associated with this <tt>PluginComponentEvent</tt> component
+     * from this container.
+     */
+    public void pluginComponentRemoved(PluginComponentEvent event)
+    {
+        Component c = (Component) event.getSource();
+
+        ContainerID containerID = event.getContainerID();
+
+        if (containerID.equals(UIService.CONTAINER_CONTACT_LIST_SOUTH)
+            || containerID.equals(UIService.CONTAINER_CONTACT_LIST_NORTH)
+            || containerID.equals(UIService.CONTAINER_CONTACT_LIST_EAST)
+            || containerID.equals(UIService.CONTAINER_CONTACT_LIST_WEST))
+        {
+            this.getContentPane().remove(c);
+        }
+    }
 }

Modified: trunk/src/net/java/sip/communicator/impl/gui/main/chat/ChatWindow.java
Url: https://sip-communicator.dev.java.net/source/browse/sip-communicator/trunk/src/net/java/sip/communicator/impl/gui/main/chat/ChatWindow.java?view=diff&rev=3325&p1=trunk/src/net/java/sip/communicator/impl/gui/main/chat/ChatWindow.java&p2=trunk/src/net/java/sip/communicator/impl/gui/main/chat/ChatWindow.java&r1=3324&r2=3325
==============================================================================
--- trunk/src/net/java/sip/communicator/impl/gui/main/chat/ChatWindow.java	(original)
+++ trunk/src/net/java/sip/communicator/impl/gui/main/chat/ChatWindow.java	2007-12-20 15:10:14+0000
@@ -13,6 +13,7 @@
 
 import javax.swing.*;
 
+import net.java.sip.communicator.impl.gui.*;
 import net.java.sip.communicator.impl.gui.customcontrols.*;
 import net.java.sip.communicator.impl.gui.customcontrols.events.*;
 import net.java.sip.communicator.impl.gui.main.*;
@@ -20,6 +21,7 @@
 import net.java.sip.communicator.impl.gui.main.chat.toolBars.*;
 import net.java.sip.communicator.impl.gui.utils.*;
 import net.java.sip.communicator.service.gui.*;
+import net.java.sip.communicator.service.gui.event.*;
 import net.java.sip.communicator.util.*;
 
 /**
@@ -37,7 +39,8 @@
  */
 public class ChatWindow
     extends SIPCommFrame
-    implements ExportedWindow
+    implements  ExportedWindow,
+                PluginComponentListener
 {
     private Logger logger = Logger.getLogger(ChatWindow.class.getName());
 
@@ -85,6 +88,8 @@
 
         this.getContentPane().add(menusPanel, BorderLayout.NORTH);
 
+        this.initPluginComponents();
+
         this.addKeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_RIGHT,
             KeyEvent.ALT_DOWN_MASK), new ForwordTabAction());
         this.addKeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_LEFT,
@@ -625,4 +630,45 @@
         
         this.toFront();
     }
+
+    /**
+     * Initialize plugin components already registered for this container.
+     */
+    private void initPluginComponents()
+    {
+        Iterator pluginComponents = GuiActivator.getUIService()
+                .getComponentsForContainer(UIService.CONTAINER_CHAT_WINDOW_SOUTH);
+
+        while (pluginComponents.hasNext())
+        {
+            Component o = (Component) pluginComponents.next();
+
+            this.add(o, BorderLayout.SOUTH);
+        }
+
+        GuiActivator.getUIService().addPluginComponentListener(this);
+    }
+
+    public void pluginComponentAdded(PluginComponentEvent event)
+    {
+        Component c = (Component) event.getSource();
+
+        if (event.getContainerID().equals(UIService.CONTAINER_CHAT_WINDOW_SOUTH))
+        {
+            this.getContentPane().add(c, BorderLayout.SOUTH);
+
+            this.pack();
+        }
+    }
+
+    public void pluginComponentRemoved(PluginComponentEvent event)
+    {
+        Component c = (Component) event.getSource();
+
+        if (event.getContainerID().equals(UIService.CONTAINER_CHAT_WINDOW_SOUTH))
+        {
+            this.getContentPane().remove(c);
+        }
+    }
+
 }

Modified: trunk/src/net/java/sip/communicator/service/gui/UIService.java
Url: https://sip-communicator.dev.java.net/source/browse/sip-communicator/trunk/src/net/java/sip/communicator/service/gui/UIService.java?view=diff&rev=3325&p1=trunk/src/net/java/sip/communicator/service/gui/UIService.java&p2=trunk/src/net/java/sip/communicator/service/gui/UIService.java&r1=3324&r2=3325
==============================================================================
--- trunk/src/net/java/sip/communicator/service/gui/UIService.java	(original)
+++ trunk/src/net/java/sip/communicator/service/gui/UIService.java	2007-12-20 15:10:14+0000
@@ -117,12 +117,43 @@
      */
     public static final ContainerID CONTAINER_CHAT_SETTINGS_MENU 
         = new ContainerID("ChatSettingsMenu");
+
     /**
      * Chat window "help menu" container.
      */
     public static final ContainerID CONTAINER_CHAT_HELP_MENU 
         = new ContainerID("ChatHelpMenu");
-      
+
+    /**
+     * Chat window "south area" container.
+     */
+    public static final ContainerID CONTAINER_CHAT_WINDOW_SOUTH
+        = new ContainerID("ChatWindowSouth");
+
+    /**
+     * Indicates the west area on the left of the contact list.
+     */
+    public static final ContainerID CONTAINER_CONTACT_LIST_WEST
+        = new ContainerID("ContactListWest");
+
+    /**
+     * Indicates the east area on the right of the contact list.
+     */
+    public static final ContainerID CONTAINER_CONTACT_LIST_EAST
+        = new ContainerID("ContactListEast");
+
+    /**
+     * Indicates the north area on the top of the contact list.
+     */
+    public static final ContainerID CONTAINER_CONTACT_LIST_NORTH
+        = new ContainerID("ContactListNorth");
+
+    /**
+     * Indicates the south area on the bottom of the contact list.
+     */
+    public static final ContainerID CONTAINER_CONTACT_LIST_SOUTH
+        = new ContainerID("ContactListSouth");
+
     /**
      * Call history panel container.
      */

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe at sip-communicator.dev.java.net
For additional commands, e-mail: commits-help at sip-communicator.dev.java.net





More information about the commits mailing list