Jitsi: the OpenSource Java VoIP and Instant Messaging client.

net.java.sip.communicator.impl.growlnotification
Class GrowlNotificationServiceImpl

java.lang.Object
  extended by net.java.sip.communicator.service.systray.AbstractPopupMessageHandler
      extended by net.java.sip.communicator.impl.growlnotification.GrowlNotificationServiceImpl
All Implemented Interfaces:
PopupMessageHandler, org.growl4j.GrowlCallbacksListener

public class GrowlNotificationServiceImpl
extends AbstractPopupMessageHandler
implements org.growl4j.GrowlCallbacksListener

The Growl Notification Service displays on-screen information such as messages or call received, etc.

Author:
Romain Kuntz, Egidijus Jankauskas

Constructor Summary
GrowlNotificationServiceImpl()
           
 
Method Summary
 int getPreferenceIndex()
          Implements getPreferenceIndex from PopupMessageHandler.
 void growlNotificationTimedOut(Object context)
          This method is called by Growl when the Growl notification is not clicked
 void growlNotificationWasClicked(Object context)
          This method is called by Growl when the Growl notification is clicked
 boolean isGrowlInstalled()
          Checks if Growl is present on the system
 boolean isGrowlRunning()
          Checks if Growl is running
 void showPopupMessage(PopupMessage popupMessage)
          Implements PopupMessageHandler#showPopupMessage()
 void start(org.osgi.framework.BundleContext bc)
          Starts the service.
 void stop(org.osgi.framework.BundleContext bc)
          Stops the service.
 String toString()
          Implements toString from PopupMessageHandler.
 
Methods inherited from class net.java.sip.communicator.service.systray.AbstractPopupMessageHandler
addPopupMessageListener, firePopupMessageClicked, removePopupMessageListener
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

GrowlNotificationServiceImpl

public GrowlNotificationServiceImpl()
Method Detail

start

public void start(org.osgi.framework.BundleContext bc)
Starts the service. Creates a Growl notifier, and check the current registered protocol providers which supports BasicIM and adds message listener to them.

Parameters:
bc - a currently valid bundle context

stop

public void stop(org.osgi.framework.BundleContext bc)
Stops the service.

Parameters:
bc - BundleContext

isGrowlInstalled

public boolean isGrowlInstalled()
Checks if Growl is present on the system

Returns:
true if Growl is installed and falseotherwise

isGrowlRunning

public boolean isGrowlRunning()
Checks if Growl is running

Returns:
true if Growl is running and false otherwise

showPopupMessage

public void showPopupMessage(PopupMessage popupMessage)
Implements PopupMessageHandler#showPopupMessage()

Specified by:
showPopupMessage in interface PopupMessageHandler
Parameters:
popupMessage - the message we will show

growlNotificationTimedOut

public void growlNotificationTimedOut(Object context)
This method is called by Growl when the Growl notification is not clicked

Specified by:
growlNotificationTimedOut in interface org.growl4j.GrowlCallbacksListener
Parameters:
context - is an object that is used to identify sent notification

growlNotificationWasClicked

public void growlNotificationWasClicked(Object context)
This method is called by Growl when the Growl notification is clicked

Specified by:
growlNotificationWasClicked in interface org.growl4j.GrowlCallbacksListener
Parameters:
context - is an object that is used to identify sent notification

toString

public String toString()
Implements toString from PopupMessageHandler.

Specified by:
toString in interface PopupMessageHandler
Overrides:
toString in class Object
Returns:
a description of this handler

getPreferenceIndex

public int getPreferenceIndex()
Implements getPreferenceIndex from PopupMessageHandler. This handler is able to show images, detect clicks, match a click to a message, and use a native popup mechanism, thus the index is 4.

Specified by:
getPreferenceIndex in interface PopupMessageHandler
Returns:
a preference index

Jitsi: the OpenSource Java VoIP and Instant Messaging client.

Jitsi, the OpenSource Java VoIP and Instant Messaging client.
Distributable under LGPL license.