svn commit: r3318 - trunk/src/net/java/sip/communicator/plugin/branding/BrandingActivator.java

yanas at dev.java.net yanas at dev.java.net
Tue Dec 18 15:13:04 CET 2007


Author: yanas
Date: 2007-12-18 14:13:03+0000
New Revision: 3318

Modified:
   trunk/src/net/java/sip/communicator/plugin/branding/BrandingActivator.java

Log:
Fixed disappearing about menu item.

Modified: trunk/src/net/java/sip/communicator/plugin/branding/BrandingActivator.java
Url: https://sip-communicator.dev.java.net/source/browse/sip-communicator/trunk/src/net/java/sip/communicator/plugin/branding/BrandingActivator.java?view=diff&rev=3318&p1=trunk/src/net/java/sip/communicator/plugin/branding/BrandingActivator.java&p2=trunk/src/net/java/sip/communicator/plugin/branding/BrandingActivator.java&r1=3317&r2=3318
==============================================================================
--- trunk/src/net/java/sip/communicator/plugin/branding/BrandingActivator.java	(original)
+++ trunk/src/net/java/sip/communicator/plugin/branding/BrandingActivator.java	2007-12-18 14:13:03+0000
@@ -18,8 +18,11 @@
 {
     private WelcomeWindow welcomeWindow;
     private static BundleContext bundleContext;
+
     private JMenuItem aboutEntry;
 
+    private JMenuItem chatAboutEntry;
+
     public void start(BundleContext bc) throws Exception
     {
         bundleContext = bc;
@@ -76,29 +79,42 @@
 
         // add menu entry to file menu
         // Add your menu item to the help menu
-        if (aboutEntry == null)
+
+        aboutEntry
+            = new JMenuItem(Resources.getString("aboutMenuEntry"));
+
+        aboutEntry.addActionListener(new ActionListener()
         {
-            aboutEntry = new JMenuItem(Resources.getString("aboutMenuEntry"));
-            aboutEntry.addActionListener(new ActionListener()
+            public void actionPerformed(ActionEvent e)
             {
-                public void actionPerformed(ActionEvent e)
-                {
+                AboutWindow aboutWindow = new AboutWindow(null);
+                aboutWindow.setVisible(true);
+            }
+        });
+
+        chatAboutEntry
+            = new JMenuItem(Resources.getString("aboutMenuEntry"));
+
+        chatAboutEntry.addActionListener(new ActionListener()
+        {
+            public void actionPerformed(ActionEvent e)
+            {
+                AboutWindow aboutWindow = new AboutWindow(null);
+                aboutWindow.setVisible(true);
+            }
+        });
 
-                    AboutWindow aboutWindow = new AboutWindow(null);
-                    aboutWindow.setVisible(true);
-                }
-            });
-        }
         // Check if the help menu is a supported container.
         if (uiService.isContainerSupported(UIService.CONTAINER_HELP_MENU))
         {
             uiService.addComponent(UIService.CONTAINER_HELP_MENU, aboutEntry);
         }
+
         // Check if the help menu is a supported container.
         if (uiService.isContainerSupported(UIService.CONTAINER_CHAT_HELP_MENU))
         {
             uiService.addComponent(UIService.CONTAINER_CHAT_HELP_MENU,
-                    aboutEntry);
+                    chatAboutEntry);
         }
     }
 
@@ -117,16 +133,24 @@
         UIService uiService = (UIService) bundleContext
                 .getService(uiServiceRef);
 
-        // Check if the tools menu is a supported container.
-        boolean isContainerSupported = uiService
-                .isContainerSupported(UIService.CONTAINER_HELP_MENU);
+        // Check if the tools menu is a supported container and remove the about
+        // entry added before.
+        if (uiService.isContainerSupported(UIService.CONTAINER_HELP_MENU))
+        {
+            // add menu entry to file menu
+            // Add your menu item to the help menu
+            uiService.removeComponent(
+                UIService.CONTAINER_HELP_MENU, aboutEntry);
+        }
 
-        if (isContainerSupported)
+        // Check if the chat menu is a supported container and remove the about
+        // entry added before.
+        if (uiService.isContainerSupported(UIService.CONTAINER_CHAT_HELP_MENU))
         {
             // add menu entry to file menu
             // Add your menu item to the help menu
-            uiService
-                    .removeComponent(UIService.CONTAINER_HELP_MENU, aboutEntry);
+            uiService.removeComponent(
+                UIService.CONTAINER_CHAT_HELP_MENU, chatAboutEntry);
         }
     }
 

---------------------------------------------------------------------
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