package net.java.sip.communicator.impl.osdependent.macosx;

import net.java.sip.communicator.impl.osdependent.*;

import com.apple.eawt.*;

/**
 * MacOSX specific dock icon, which will add a dock icon listener in order to
 * show the application each time user clicks on the dock icon.
 *
 * @author Yana Stamcheva
 */
@SuppressWarnings("deprecation")
public class MacOSXDockIcon
{
    /**
     * Adds a dock icon listener in order to show the application each time user
     * clicks on the dock icon.
     */
    public static void addDockIconListener()
    {
        Application application = Application.getApplication();
        if (application != null)
        {
            application.addApplicationListener(new ApplicationAdapter()
            {
                /**
                 * Handles re-open application event. Shows the contact list
                 * window.
                 */
                public void handleReOpenApplication(
                    ApplicationEvent applicationevent)
                {
                    OsDependentActivator.getUIService().setVisible(true);
                }
            });
        }
    }
}

@@ -105,16 +105,64 @@
 ndent.*;
+%0Aimport net.java.sip.communicator.service.gui.*;
 %0A%0Aimport
@@ -1085,16 +1085,38 @@
         
+ UIService uiService =
  OsDepen
@@ -1143,16 +1143,121 @@
 ervice()
+;%0A%0A                    if (uiService != null && !uiService.isVisible())%0A                        uiService
 .setVisi

Check if the UIService is already visible before setting it to visible.