[sip-comm-cvs] CVS update: /sip-communicator/src/net/java/sip/communicator/service/gui/, /sip-communicator/src/net/java/sip/communicator/impl/gui/, /sip-communica...

yanas at dev.java.net yanas at dev.java.net
Mon May 21 14:11:56 CEST 2007


User: yanas   
Date: 2007-05-21 12:11:56+0000
Modified:
   sip-communicator/src/net/java/sip/communicator/service/gui/UIService.java
   sip-communicator/src/net/java/sip/communicator/impl/gui/UIServiceImpl.java
   sip-communicator/src/net/java/sip/communicator/impl/gui/main/call/CallListPanel.java

Log:
 implement PluginComponentListener in the Call history panel, in order to activate plugin components add

File Changes:

Directory: /sip-communicator/src/net/java/sip/communicator/service/gui/
=======================================================================

File [changed]: UIService.java
Url: https://sip-communicator.dev.java.net/source/browse/sip-communicator/src/net/java/sip/communicator/service/gui/UIService.java?r1=1.17&r2=1.18
Delta lines:  +7 -1
-------------------
--- UIService.java	2007-04-11 14:10:32+0000	1.17
+++ UIService.java	2007-05-21 12:11:53+0000	1.18
@@ -118,6 +118,12 @@
     public static final ContainerID CONTAINER_CHAT_HELP_MENU 
         = new ContainerID("ChatHelpMenu");
         
+    /**
+     * Call history panel container.
+     */
+    public static final ContainerID CONTAINER_CALL_HISTORY
+        = new ContainerID("CallHistoryPanel");
+    
     /*
      * Constraints
      */

Directory: /sip-communicator/src/net/java/sip/communicator/impl/gui/
====================================================================

File [changed]: UIServiceImpl.java
Url: https://sip-communicator.dev.java.net/source/browse/sip-communicator/src/net/java/sip/communicator/impl/gui/UIServiceImpl.java?r1=1.34&r2=1.35
Delta lines:  +8 -15
--------------------
--- UIServiceImpl.java	2007-05-03 16:08:49+0000	1.34
+++ UIServiceImpl.java	2007-05-21 12:11:53+0000	1.35
@@ -6,34 +6,26 @@
  */
 package net.java.sip.communicator.impl.gui;
 
-import java.awt.Component;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.Hashtable;
-import java.util.Iterator;
+import java.awt.*;
+import java.util.*;
 import java.util.List;
-import java.util.Map;
-import java.util.Vector;
 
 import javax.swing.*;
-import javax.swing.JFrame;
 
-import net.java.sip.communicator.impl.gui.GuiActivator.*;
 import net.java.sip.communicator.impl.gui.lookandfeel.*;
 import net.java.sip.communicator.impl.gui.main.*;
-import net.java.sip.communicator.impl.gui.main.account.AccountRegWizardContainerImpl;
+import net.java.sip.communicator.impl.gui.main.account.*;
 import net.java.sip.communicator.impl.gui.main.chat.*;
-import net.java.sip.communicator.impl.gui.main.configforms.ConfigurationFrame;
-import net.java.sip.communicator.impl.gui.main.contactlist.ContactListPanel;
+import net.java.sip.communicator.impl.gui.main.configforms.*;
+import net.java.sip.communicator.impl.gui.main.contactlist.*;
 import net.java.sip.communicator.impl.gui.main.contactlist.addcontact.*;
 import net.java.sip.communicator.impl.gui.main.login.*;
 import net.java.sip.communicator.impl.gui.utils.*;
 import net.java.sip.communicator.service.contactlist.*;
 import net.java.sip.communicator.service.gui.*;
-import net.java.sip.communicator.service.gui.event.PluginComponentEvent;
-import net.java.sip.communicator.service.gui.event.PluginComponentListener;
+import net.java.sip.communicator.service.gui.event.*;
 import net.java.sip.communicator.service.protocol.*;
-import net.java.sip.communicator.util.Logger;
+import net.java.sip.communicator.util.*;
 
 /**
  * An implementation of the <tt>UIService</tt> that gives access to other
@@ -62,6 +54,7 @@
         supportedContainers.add(UIService.CONTAINER_GROUP_RIGHT_BUTTON_MENU);
         supportedContainers.add(UIService.CONTAINER_TOOLS_MENU);
         supportedContainers.add(UIService.CONTAINER_CHAT_TOOL_BAR);
+        supportedContainers.add(UIService.CONTAINER_CALL_HISTORY);
     }
 
     private static final Hashtable exportedWindows = new Hashtable();

Directory: /sip-communicator/src/net/java/sip/communicator/impl/gui/main/call/
==============================================================================

File [changed]: CallListPanel.java
Url: https://sip-communicator.dev.java.net/source/browse/sip-communicator/src/net/java/sip/communicator/impl/gui/main/call/CallListPanel.java?r1=1.7&r2=1.8
Delta lines:  +58 -2
--------------------
--- CallListPanel.java	2006-12-05 13:02:44+0000	1.7
+++ CallListPanel.java	2007-05-21 12:11:53+0000	1.8
@@ -19,6 +19,8 @@
 import net.java.sip.communicator.impl.gui.main.*;
 import net.java.sip.communicator.impl.gui.utils.*;
 import net.java.sip.communicator.service.callhistory.*;
+import net.java.sip.communicator.service.gui.*;
+import net.java.sip.communicator.service.gui.event.*;
 
 /**
  * The <tt>CallListPanel</tt> is the panel that contains the call list.
@@ -27,9 +29,10 @@
  */
 public class CallListPanel
     extends JPanel
-    implements ActionListener
+    implements  ActionListener,
+                PluginComponentListener
 {
-    private JPanel searchPanel = new JPanel(new BorderLayout());
+    private JPanel searchPanel = new JPanel(new BorderLayout(5, 5));
     
     private JLabel searchLabel = new JLabel(
         Messages.getI18NString("search").getText() + ": ");
@@ -40,6 +43,8 @@
     
     private JScrollPane scrollPane = new JScrollPane();
     
+    private JPanel pluginPanel = new JPanel(new FlowLayout(FlowLayout.CENTER));
+    
     private CallHistoryService callHistory;
     
     private Date lastDateFromHistory;
@@ -66,6 +71,8 @@
         new LoadLastCallsFromHistory().start();
         
         this.initPanels();
+        
+        this.initPluginComponents();
     }
     
     /**
@@ -78,12 +85,32 @@
         this.searchPanel.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));
         this.searchPanel.add(searchLabel, BorderLayout.WEST);
         this.searchPanel.add(searchComboBox, BorderLayout.CENTER);
+        this.searchPanel.add(pluginPanel, BorderLayout.NORTH);
         
         this.add(searchPanel, BorderLayout.NORTH);
         this.add(scrollPane, BorderLayout.CENTER);
     }
 
     /**
+     * Initiates plugin components.
+     */
+    private void initPluginComponents()
+    {
+        Iterator pluginComponents = GuiActivator.getUIService()
+            .getComponentsForContainer(
+                UIService.CONTAINER_CALL_HISTORY);
+        
+        while (pluginComponents.hasNext())
+        {
+            Component o = (Component)pluginComponents.next();
+            
+            this.pluginPanel.add((Component)o);
+        }
+        
+        GuiActivator.getUIService().addPluginComponentListener(this);
+    }
+    
+    /**
      * Loads last n (NUMBER_OF_CALLS) number of calls from history and initiates
      * the call list and the combo box.    
      */
@@ -324,4 +351,33 @@
         this.addToCallComboBox(participantName);
         this.addToSearchComboBox(participantName);
     }
+
+    public void pluginComponentAdded(PluginComponentEvent event)
+    {
+        Component c = (Component) event.getSource();
+        
+        // If the container id doesn't correspond to the id of the plugin
+        // container we're not interested.
+        if(!event.getContainerID()
+                .equals(UIService.CONTAINER_CALL_HISTORY))
+            return;
+        
+        this.pluginPanel.add(c);
+ 
+        this.revalidate();
+        this.repaint();
+    }
+
+    public void pluginComponentRemoved(PluginComponentEvent event)
+    {
+        Component c = (Component) event.getSource();
+        
+        // If the container id doesn't correspond to the id of the plugin
+        // container we're not interested.
+        if(!event.getContainerID()
+                .equals(UIService.CONTAINER_CALL_HISTORY))
+            return;
+        
+        this.pluginPanel.remove(c);
+    }
 }




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





More information about the commits mailing list