[growl integration] New methods for the systray service:

- getPreferenceIndex() which indicates how many features the handler implements
- selectBestPopupMessageHandler() which selects the best message popup handler according to the one available

Updated the unit tests accordingly.
cusax-fix
Romain Kuntz 16 years ago
parent eb37605512
commit 503135a31b

@ -43,6 +43,20 @@ public interface PopupMessageHandler
* @param popupMessage the message to show
*/
public void showPopupMessage(PopupMessage popupMessage);
/**
* Returns a preference index, which indicates how many features the handler
* implements. Implementer should calculate preference index by adding "1"
* for each of the the following features that the implementation supports:
*
* 1) showing images
* 2) detecting clicks
* 3) being able to match a click to a message
* 4) using a native popup mechanism
*
* @returns an integer representing preference index of this popup handler
*/
public int getPreferenceIndex();
/**
* Returns a readable description of this popup handler. It is expected

@ -103,4 +103,9 @@ public PopupMessageHandler setActivePopupMessageHandler(
* @param imageType the type of the image to set
*/
public void setSystrayIcon(int imageType);
/**
* Selects the best available popup message handler
*/
public void selectBestPopupMessageHandler();
}

@ -161,5 +161,13 @@ public void showPopupMessage(PopupMessage popupMsg)
// is it the expected handler which is handling it ?
assertEquals(handler2, this);
}
/**
* implements <tt>getPreferenceIndex</tt> from <tt>PopupMessageHandler</tt>
*/
public int getPreferenceIndex()
{
return 0;
}
}
}

Loading…
Cancel
Save