Fixes an issue with notification sounds which could prevent their entire or partial playback. Sorts the table depicting the notification configuration by description by default (and allows sorting by column in general).

cusax-fix 4792
Lyubomir Marinov 12 years ago
parent 58444fe1e5
commit c49ea38860

@ -672,16 +672,13 @@ public static SecurityAuthority getSecurityAuthority()
*/
public static NotificationService getNotificationService()
{
if(notificationService == null)
if (notificationService == null)
{
// Get the notification service implementation
ServiceReference notifReference = bundleContext
.getServiceReference(NotificationService.class.getName());
notificationService = (NotificationService) bundleContext
.getService(notifReference);
notificationService
= ServiceUtils.getService(
bundleContext,
NotificationService.class);
}
return notificationService;
}

@ -32,49 +32,70 @@ public class DTMFHandler
Runnable
{
/**
* The <tt>Logger</tt> used by the <tt>DTMFHandler</tt> class and its
* instances for logging output.
* DTMF extended information.
*/
private static final Logger logger = Logger.getLogger(DTMFHandler.class);
public static class DTMFToneInfo
{
/**
* The image to display in buttons sending DTMFs.
*/
public final ImageID imageID;
/**
* The call dialog, where this handler is registered.
*/
private final CallPanel callContainer;
/**
* The char associated with this DTMF tone.
*/
public final char keyChar;
/**
* The <tt>KeyboadFocusManager</tt> to which this instance is added as a
* <tt>KeyEventDispatcher</tt>.
*/
private KeyboardFocusManager keyboardFocusManager;
/**
* The key code when entered from keyboard.
*/
public final int keyCode;
/**
* The <tt>Window</tt>s which this instance listens to for key presses and
* releases.
*/
private final List<Window> parents = new ArrayList<Window>();
/**
* The image to display on Mac buttons.
*/
public final ImageID macImageID;
/**
* If we are currently playing an audio for a DTMF tone. Used
* to play in Loop and stop it if forced to do or new tone has come.
*/
NotificationData currentlyPlayingTone;
/**
* The id of the image to display on Mac buttons on rollover.
*/
public final ImageID macImageRolloverID;
/**
* Default event type for DTMF tone.
*/
public static final String DTMF_TONE_PREFIX = "DTMFTone.";
/**
* The sound to play during send of this tone.
*/
public final String sound;
/**
* The list of audio DTMF tones to play.
*/
private Vector<DTMFToneInfo> dmtfToneNotifications
= new Vector<DTMFToneInfo>(1, 1);
/**
* The tone itself
*/
public final DTMFTone tone;
/**
* The thread which plays the audio DTMF notifications.
*/
private Thread dtmfToneNotificationThread;
/**
* Creates DTMF extended info.
* @param tone the tone.
* @param keyCode its key code.
* @param keyChar the char associated with the DTMF
* @param imageID the image if any.
* @param macImageID the Mac OS X-specific image if any.
* @param macImageRolloverID the Mac OS X-specific rollover image if any
* @param sound the sound if any.
*/
public DTMFToneInfo(
DTMFTone tone,
int keyCode, char keyChar,
ImageID imageID, ImageID macImageID, ImageID macImageRolloverID,
String sound)
{
this.tone = tone;
this.keyCode = keyCode;
this.keyChar = keyChar;
this.imageID = imageID;
this.macImageID = macImageID;
this.macImageRolloverID = macImageRolloverID;
this.sound = sound;
}
}
/**
* All available tones and its properties like images for buttons, and
@ -218,6 +239,66 @@ public class DTMFHandler
*/
private static Boolean defaultsLoaded = false;
/**
* Default event type for DTMF tone.
*/
public static final String DTMF_TONE_PREFIX = "DTMFTone.";
/**
* The <tt>Logger</tt> used by the <tt>DTMFHandler</tt> class and its
* instances for logging output.
*/
private static final Logger logger = Logger.getLogger(DTMFHandler.class);
/**
* Load the defaults for dtmf tones.
*/
public static void loadDefaults()
{
synchronized(defaultsLoaded)
{
if(defaultsLoaded)
return;
// init the
NotificationService notificationService =
GuiActivator.getNotificationService();
for(DTMFToneInfo info : AVAILABLE_TONES)
{
notificationService.registerDefaultNotificationForEvent(
DTMF_TONE_PREFIX + info.tone.getValue(),
new SoundNotificationAction(
info.sound, 0, false, true, false));
}
defaultsLoaded = true;
}
}
/**
* The call dialog, where this handler is registered.
*/
private final CallPanel callContainer;
/**
* The list of audio DTMF tones to play.
*/
private Vector<DTMFToneInfo> dtmfToneNotifications
= new Vector<DTMFToneInfo>(1, 1);
/**
* The <tt>KeyboadFocusManager</tt> to which this instance is added as a
* <tt>KeyEventDispatcher</tt>.
*/
private KeyboardFocusManager keyboardFocusManager;
/**
* The <tt>Window</tt>s which this instance listens to for key presses and
* releases.
*/
private final List<Window> parents = new ArrayList<Window>();
/**
* Creates DTMF handler for a call.
*/
@ -263,32 +344,6 @@ public void windowOpened(WindowEvent e)
}
}
/**
* Load the defaults for dtmf tones.
*/
public static void loadDefaults()
{
synchronized(defaultsLoaded)
{
if(defaultsLoaded)
return;
// init the
NotificationService notificationService =
GuiActivator.getNotificationService();
for(DTMFToneInfo info : AVAILABLE_TONES)
{
notificationService.registerDefaultNotificationForEvent(
DTMF_TONE_PREFIX + info.tone.getValue(),
new SoundNotificationAction(
info.sound, 0, false, true, false));
}
defaultsLoaded = true;
}
}
/**
* Adds a <tt>Window</tt> on which key presses and releases are to be
* monitored for the purposes of this <tt>DTMFHandler</tt>.
@ -311,27 +366,6 @@ public void addParent(Window parent)
}
}
/**
* Removes a <tt>Window</tt> on which key presses and releases are to no
* longer be monitored for the purposes of this <tt>DTMFHandler</tt>.
*
* @param parent the <tt>Window</tt> on which key presses and releases are
* to no longer be monitored for the purposes of this <tt>DTMFHandler</tt>
*/
public void removeParent(Window parent)
{
synchronized (parents)
{
if (parents.remove(parent)
&& parents.isEmpty()
&& (keyboardFocusManager != null))
{
keyboardFocusManager.removeKeyEventDispatcher(this);
keyboardFocusManager = null;
}
}
}
/**
* Dispatches a specific <tt>KeyEvent</tt>. If one of the <tt>parents</tt>
* registered with this <tt>DTMFHandler</tt> is focused, starts or stops
@ -396,64 +430,82 @@ public boolean dispatchKeyEvent(KeyEvent e)
}
/**
* Sends a DTMF tone to the current DTMF operation set.
* Removes a <tt>Window</tt> on which key presses and releases are to no
* longer be monitored for the purposes of this <tt>DTMFHandler</tt>.
*
* @param toneValue the value of the DTMF tone to send.
* @param parent the <tt>Window</tt> on which key presses and releases are
* to no longer be monitored for the purposes of this <tt>DTMFHandler</tt>
*/
public void startSendingDtmfTone(String toneValue)
public void removeParent(Window parent)
{
for (int i = 0; i < AVAILABLE_TONES.length; i++)
synchronized (parents)
{
DTMFToneInfo info = AVAILABLE_TONES[i];
if (info.tone.getValue().equals(toneValue))
if (parents.remove(parent)
&& parents.isEmpty()
&& (keyboardFocusManager != null))
{
startSendingDtmfTone(info);
return;
keyboardFocusManager.removeKeyEventDispatcher(this);
keyboardFocusManager = null;
}
}
}
/**
* Sends a DTMF tone to the current DTMF operation set.
*
* @param info The DTMF tone to send.
* Runs in a background/daemon thread and consecutively plays each of the
* {@link #dtmfToneNotifications} through the current
* {@link NotificationService}.
*/
private synchronized void startSendingDtmfTone(DTMFToneInfo info)
public void run()
{
if(info.sound != null)
do
{
synchronized(dmtfToneNotifications)
DTMFToneInfo toneToPlay;
synchronized (dtmfToneNotifications)
{
boolean startThread = (dmtfToneNotifications.size() == 0);
dmtfToneNotifications.add(info);
if(startThread)
if (dtmfToneNotifications.size() != 0)
{
dtmfToneNotificationThread
= new Thread(
this,
"DTMFHandler: DTMF tone notification player");
dtmfToneNotificationThread.start();
/*
* XXX We will purposefully remove the toneToPlay once it
* has been played in order to reduce the risk of
* simultaneously playing one and the same tone multiple
* times.
*/
toneToPlay = dtmfToneNotifications.get(0);
}
else
break;
}
}
if (callContainer != null)
{
startSendingDtmfTone(
callContainer.getCurrentCallRenderer().getCall(),
info);
}
else
{
Collection<Call> activeCalls = CallManager.getInProgressCalls();
if (activeCalls != null)
try
{
for (Call activeCall : activeCalls)
startSendingDtmfTone(activeCall, info);
if (toneToPlay.sound != null)
{
NotificationService notificationService
= GuiActivator.getNotificationService();
// Plays the next DTMF sound notification.
NotificationData currentlyPlayingTone
= notificationService.fireNotification(
DTMF_TONE_PREFIX + toneToPlay.tone.getValue());
// Waits for the current notification to end.
while (notificationService.isPlayingNotification(
currentlyPlayingTone))
{
Thread.yield();
}
// Removes the ended notification from the DTMF list.
notificationService.stopNotification(currentlyPlayingTone);
}
}
finally
{
synchronized (dtmfToneNotifications)
{
dtmfToneNotifications.remove(0);
}
}
}
while (true);
}
/**
@ -495,6 +547,69 @@ private void startSendingDtmfTone(Call call, DTMFToneInfo info)
}
}
/**
* Sends a DTMF tone to the current DTMF operation set.
*
* @param info The DTMF tone to send.
*/
private synchronized void startSendingDtmfTone(DTMFToneInfo info)
{
if(info.sound != null)
{
synchronized(dtmfToneNotifications)
{
boolean startThread = (dtmfToneNotifications.size() == 0);
dtmfToneNotifications.add(info);
if(startThread)
{
Thread dtmfToneNotificationThread = new Thread(this);
dtmfToneNotificationThread.setDaemon(true);
dtmfToneNotificationThread.setName(
"DTMFHandler: DTMF tone notification player");
dtmfToneNotificationThread.start();
}
}
}
if (callContainer != null)
{
startSendingDtmfTone(
callContainer.getCurrentCallRenderer().getCall(),
info);
}
else
{
Collection<Call> activeCalls = CallManager.getInProgressCalls();
if (activeCalls != null)
{
for (Call activeCall : activeCalls)
startSendingDtmfTone(activeCall, info);
}
}
}
/**
* Sends a DTMF tone to the current DTMF operation set.
*
* @param toneValue the value of the DTMF tone to send.
*/
public void startSendingDtmfTone(String toneValue)
{
for (int i = 0; i < AVAILABLE_TONES.length; i++)
{
DTMFToneInfo info = AVAILABLE_TONES[i];
if (info.tone.getValue().equals(toneValue))
{
startSendingDtmfTone(info);
return;
}
}
}
/**
* Stop sending DTMF tone.
*/
@ -544,105 +659,4 @@ private void stopSendingDtmfTone(Call call)
logger.error("Failed to send a DTMF tone.", t);
}
}
/**
* DTMF extended information.
*/
public static class DTMFToneInfo
{
/**
* The tone itself
*/
public final DTMFTone tone;
/**
* The key code when entered from keyboard.
*/
public final int keyCode;
/**
* The char associated with this DTMF tone.
*/
public final char keyChar;
/**
* The image to display in buttons sending DTMFs.
*/
public final ImageID imageID;
/**
* The image to display on Mac buttons.
*/
public final ImageID macImageID;
/**
* The id of the image to display on Mac buttons on rollover.
*/
public final ImageID macImageRolloverID;
/**
* The sound to play during send of this tone.
*/
public final String sound;
/**
* Creates DTMF extended info.
* @param tone the tone.
* @param keyCode its key code.
* @param keyChar the char associated with the DTMF
* @param imageID the image if any.
* @param macImageID the Mac OS X-specific image if any.
* @param macImageRolloverID the Mac OS X-specific rollover image if any
* @param sound the sound if any.
*/
public DTMFToneInfo(
DTMFTone tone,
int keyCode, char keyChar,
ImageID imageID, ImageID macImageID, ImageID macImageRolloverID,
String sound)
{
this.tone = tone;
this.keyCode = keyCode;
this.keyChar = keyChar;
this.imageID = imageID;
this.macImageID = macImageID;
this.macImageRolloverID = macImageRolloverID;
this.sound = sound;
}
}
/**
* Runnable used to read all waiting DTMF tone notification.
*/
public void run()
{
boolean moreToPlay = (dmtfToneNotifications.size() > 0);
DTMFToneInfo toneToPlay = null;
while(moreToPlay)
{
toneToPlay = dmtfToneNotifications.get(0);
if(toneToPlay.sound != null)
{
// Plays the next DTMF sond notification.
currentlyPlayingTone
= GuiActivator.getNotificationService().fireNotification(
DTMF_TONE_PREFIX + toneToPlay.tone.getValue());
// Waits for the current notification to end.
while(GuiActivator.getNotificationService()
.isPlayingNotification(currentlyPlayingTone))
{
Thread.yield();
}
// Removes the ended notification from the DTMF list.
GuiActivator.getNotificationService()
.stopNotification(currentlyPlayingTone);
synchronized(dmtfToneNotifications)
{
dmtfToneNotifications.remove(0);
moreToPlay = (dmtfToneNotifications.size() > 0);
}
}
}
}
}

@ -18,32 +18,30 @@
import net.java.sip.communicator.service.resources.*;
import net.java.sip.communicator.util.skin.*;
import org.jitsi.service.resources.*;
/**
* The <tt>DialPanel</tt> is the panel that contains the buttons to dial a
* phone number.
*
* @author Yana Stamcheva
* @author Adam Netocny
* @author Lyubomir Marinov
*/
public class DialPanel
extends JPanel
implements MouseListener,
Skinnable
implements MouseListener,
Skinnable
{
/**
* The dial panel.
*/
private final JPanel dialPadPanel =
new JPanel(new GridLayout(4, 3,
GuiActivator.getResources()
.getSettingsInt("impl.gui.DIAL_PAD_HORIZONTAL_GAP"),
GuiActivator.getResources()
.getSettingsInt("impl.gui.DIAL_PAD_VERTICAL_GAP")));
private final JPanel dialPadPanel;
/**
* Handles DTMFs.
*/
private DTMFHandler dtmfHandler;
private final DTMFHandler dtmfHandler;
/**
* Creates an instance of <tt>DialPanel</tt> for a specific call, by
@ -56,29 +54,21 @@ public DialPanel(DTMFHandler dtmfHandler)
{
this.dtmfHandler = dtmfHandler;
this.init();
}
// Initialize this panel by adding all dial buttons to it.
ResourceManagementService r = GuiActivator.getResources();
int hgap = r.getSettingsInt("impl.gui.DIAL_PAD_HORIZONTAL_GAP");
int vgap = r.getSettingsInt("impl.gui.DIAL_PAD_VERTICAL_GAP");
int width = r.getSettingsInt("impl.gui.DIAL_PAD_WIDTH");
int height = r.getSettingsInt("impl.gui.DIAL_PAD_HEIGHT");
/**
* Initializes this panel by adding all dial buttons to it.
*/
public void init()
{
this.dialPadPanel.setOpaque(false);
dialPadPanel = new JPanel(new GridLayout(4, 3, hgap, vgap));
dialPadPanel.setOpaque(false);
dialPadPanel.setPreferredSize(new Dimension(width, height));
this.setBorder(BorderFactory.createEmptyBorder(10, 0, 10, 0));
int width = GuiActivator.getResources()
.getSettingsInt("impl.gui.DIAL_PAD_WIDTH");
int height = GuiActivator.getResources()
.getSettingsInt("impl.gui.DIAL_PAD_HEIGHT");
this.dialPadPanel.setPreferredSize(new Dimension(width, height));
setBorder(BorderFactory.createEmptyBorder(10, 0, 10, 0));
add(dialPadPanel, BorderLayout.CENTER);
loadSkin();
this.add(dialPadPanel, BorderLayout.CENTER);
}
/**
@ -89,11 +79,13 @@ public void init()
* @param name
* @return the created dial button
*/
private JButton createDialButton(Image bgImage, ImageID iconImage,
String name)
private JButton createDialButton(
Image bgImage,
ImageID iconImage,
String name)
{
JButton button =
new SIPCommButton(bgImage, ImageLoader.getImage(iconImage));
JButton button
= new SIPCommButton(bgImage, ImageLoader.getImage(iconImage));
button.setAlignmentY(JButton.LEFT_ALIGNMENT);
button.setName(name);
@ -102,29 +94,56 @@ private JButton createDialButton(Image bgImage, ImageID iconImage,
return button;
}
public void mouseClicked(MouseEvent e) {}
/**
* Reloads dial buttons.
*/
public void loadSkin()
{
dialPadPanel.removeAll();
Image bgImage = ImageLoader.getImage(ImageLoader.DIAL_BUTTON_BG);
DTMFHandler.DTMFToneInfo[] availableTones = DTMFHandler.AVAILABLE_TONES;
for (int i = 0; i < availableTones.length; i++)
{
DTMFHandler.DTMFToneInfo info = availableTones[i];
// we add only buttons having image
if (info.imageID != null)
{
dialPadPanel.add(
createDialButton(
bgImage,
info.imageID,
info.tone.getValue()));
}
}
}
public void mouseClicked(MouseEvent ev) {}
public void mouseEntered(MouseEvent e) {}
public void mouseEntered(MouseEvent ev) {}
public void mouseExited(MouseEvent e) {}
public void mouseExited(MouseEvent ev) {}
/**
* Handles the <tt>MouseEvent</tt> triggered when user presses one of the
* dial buttons.
* @param e the event
*
* @param ev the event
*/
public void mousePressed(MouseEvent e)
public void mousePressed(MouseEvent ev)
{
JButton button = (JButton) e.getSource();
dtmfHandler.startSendingDtmfTone(button.getName());
dtmfHandler.startSendingDtmfTone(ev.getComponent().getName());
}
/**
* Handles the <tt>MouseEvent</tt> triggered when user releases one of the
* dial buttons.
* @param e the event
*
* @param ev the event
*/
public void mouseReleased(MouseEvent e)
public void mouseReleased(MouseEvent ev)
{
dtmfHandler.stopSendingDtmfTone();
}
@ -141,70 +160,43 @@ public void paintComponent(Graphics g)
super.paintComponent(g);
Graphics2D g2 = (Graphics2D) g;
boolean isTextureBackground
= Boolean.parseBoolean(GuiActivator.getResources()
.getSettingsString("impl.gui.IS_CONTACT_LIST_TEXTURE_BG_ENABLED"));
BufferedImage bgImage
= ImageLoader.getImage(ImageLoader.MAIN_WINDOW_BACKGROUND);
// paint the image
if (bgImage != null)
{
ResourceManagementService r = GuiActivator.getResources();
boolean isTextureBackground
= Boolean.parseBoolean(
r.getSettingsString(
"impl.gui.IS_CONTACT_LIST_TEXTURE_BG_ENABLED"));
int width = getWidth(), height = getHeight();
if (isTextureBackground)
{
Rectangle rect
= new Rectangle(0, 0,
= new Rectangle(
0,
0,
bgImage.getWidth(null),
bgImage.getHeight(null));
TexturePaint texture = new TexturePaint(bgImage, rect);
g2.setPaint(texture);
g2.fillRect(0, 0, this.getWidth(), this.getHeight());
g2.fillRect(0, 0, width, height);
}
else
{
g.setColor(new Color(
GuiActivator.getResources()
.getColor("contactListBackground")));
// paint the background with the choosen color
g.fillRect(0, 0, getWidth(), getHeight());
g2.drawImage(bgImage,
this.getWidth() - bgImage.getWidth(),
this.getHeight() - bgImage.getHeight(),
g.setColor(new Color(r.getColor("contactListBackground")));
// paint the background with the chosen color
g.fillRect(0, 0, width, height);
g2.drawImage(
bgImage,
width - bgImage.getWidth(),
height - bgImage.getHeight(),
this);
}
}
}
/**
* Reloads dial buttons.
*/
public void loadSkin()
{
dialPadPanel.removeAll();
Image bgImage = ImageLoader.getImage(ImageLoader.DIAL_BUTTON_BG);
DTMFHandler.DTMFToneInfo[] availableTones = DTMFHandler.AVAILABLE_TONES;
for (int i = 0; i < availableTones.length; i++)
{
DTMFHandler.DTMFToneInfo info = availableTones[i];
// we add only buttons having image
if (info.imageID != null)
{
dialPadPanel.add(
createDialButton(
bgImage,
info.imageID,
info.tone.getValue()));
}
}
}
}

@ -8,6 +8,7 @@
import java.awt.*;
import java.awt.event.*;
import java.util.*;
import javax.swing.*;
import javax.swing.event.*;
@ -94,20 +95,61 @@ public class NotificationsTable
{
public void valueChanged(ListSelectionEvent e)
{
if (e.getValueIsAdjusting())
return;
int row = notifTable.getSelectedRow();
if (row > -1)
configPanel.setNotificationEntry(
getNotificationEntry(row));
if (!e.getValueIsAdjusting())
{
int row = notifTable.getSelectedRow();
if (row > -1)
{
configPanel.setNotificationEntry(
getNotificationEntry(row));
}
}
}
});
initTableData();
for(int i = 0; i< columns.length; i ++)
// Sort the table by description; otherwise, it looks chaotic.
if (columns.length != 0)
{
TableRowSorter<NotificationsTableModel> sorter
= new TableRowSorter<NotificationsTableModel>(model);
int column = columns.length - 1;
java.util.List<RowSorter.SortKey> sortKeys
= Arrays.asList(
new RowSorter.SortKey(
column,
SortOrder.ASCENDING));
sorter.setComparator(
column,
new Comparator<NotificationEntry>()
{
public int compare(
NotificationEntry ne1,
NotificationEntry ne2)
{
String s1
= Resources.getString(
"plugin.notificationconfig.event."
+ ne1.getEvent());
String s2
= Resources.getString(
"plugin.notificationconfig.event."
+ ne2.getEvent());
if (s1 == null)
return (s2 == null) ? 0 : -1;
else
return (s2 == null) ? 1 : s1.compareTo(s2);
}
});
sorter.setSortKeys(sortKeys);
notifTable.setRowSorter(sorter);
}
for(int i = 0; i < columns.length; i++)
{
TableColumn tmp = notifTable.getColumnModel().getColumn(i);
if(columns[i].getClass() != strTmp.getClass())
@ -187,7 +229,7 @@ private void addEntry(NotificationEntry entry)
{
Object row[] = new Object[7];
row[0] = new Boolean(entry.getEnabled());
row[0] = Boolean.valueOf(entry.getEnabled());
row[1] = (entry.getProgram()) ? ENABLED : DISABLED;
row[2] = entry.getPopup() ? ENABLED : DISABLED;
row[3] = (entry.getSoundNotification()) ? ENABLED : DISABLED;
@ -234,11 +276,8 @@ private void removeEntry(NotificationEntry entry)
*/
private void addLine(Object data[])
{
if(data.length != model.getColumnCount())
{
return;
}
model.addRow(data);
if(data.length == model.getColumnCount())
model.addRow(data);
}
/**
@ -767,10 +806,7 @@ public void eventTypeRemoved(NotificationEventTypeEvent event)
*/
public void clear()
{
int numrows = model.getRowCount();
for(int i = numrows - 1; i >=0; i--)
{
for(int numrows = model.getRowCount(), i = numrows - 1; i >=0; i--)
model.removeRow(i);
}
}
}

@ -211,6 +211,7 @@ public void addNotificationChangeListener(
/**
* Executes a notification data object on the handlers.
*
* @param data The notification data to act upon.
*/
private void fireNotification(NotificationData data)
@ -290,11 +291,10 @@ else if(actionType.equals(ACTION_VIBRATE))
* go through the list of registered actions and execute them.
*
* @param eventType the type of the event that we'd like to fire a
* notification for.
*
* notification for.
* @return An object referencing the notification. It may be used to stop a
* still running notification. Can be null if the eventType is
* unknown or the notification is not active.
* still running notification. Can be null if the eventType is unknown or
* the notification is not active.
*/
public NotificationData fireNotification(String eventType)
{
@ -307,22 +307,21 @@ public NotificationData fireNotification(String eventType)
* list of registered actions is executed.
*
* @param eventType the type of the event that we'd like to fire a
* notification for.
* notification for.
* @param title the title of the given message
* @param message the message to use if and where appropriate (e.g. with
* systray or log notification.)
* systray or log notification.)
* @param icon the icon to show in the notification if and where appropriate
* @param tag additional info to be used by the notification handler
*
* @return An object referencing the notification. It may be used to stop a
* still running notification. Can be null if the eventType is
* unknown or the notification is not active.
* still running notification. Can be null if the eventType is unknown or
* the notification is not active.
*/
public NotificationData fireNotification(
String eventType,
String title,
String message,
byte[] icon)
String eventType,
String title,
String message,
byte[] icon)
{
return fireNotification(eventType, title, message, icon, null);
}
@ -333,19 +332,18 @@ public NotificationData fireNotification(
* list of registered actions is executed.
*
* @param eventType the type of the event that we'd like to fire a
* notification for.
* notification for.
* @param title the title of the given message
* @param message the message to use if and where appropriate (e.g. with
* systray or log notification.)
* systray or log notification.)
* @param icon the icon to show in the notification if and where appropriate
* @param extras additiona/extra {@link NotificationHandler}-specific data
* to be provided to the firing of the specified notification(s). The
* well-known keys are defined by the <tt>NotificationData</tt>
* <tt>XXX_EXTRA</tt> constants.
*
* @return An object referencing the notification. It may be used to stop a
* still running notification. Can be null if the eventType is
* unknown or the notification is not active.
* still running notification. Can be null if the eventType is unknown or
* the notification is not active.
*/
public NotificationData fireNotification(
String eventType,
@ -356,7 +354,7 @@ public NotificationData fireNotification(
{
Notification notification = notifications.get(eventType);
if((notification == null) || !notification.isActive())
if ((notification == null) || !notification.isActive())
return null;
NotificationData data

Loading…
Cancel
Save