private void addNotification(TrayPopupEntry entry, boolean showNotification)
{
trayPopup.addEntry(entry);
// Icona al tray
TrayNotificationWidget trayLabel;
if(trayZoneElements.containsKey(entry.getNotificationId())){
trayLabel = trayZoneElements.get(entry.getNotificationId());
}
else{
trayLabel = new TrayNotificationWidget(entry.getIcon());
trayZone.add(trayLabel.getWidget());
trayZoneElements.put(entry.getNotificationId(), trayLabel);
trayLabel.addMouseListener(new MouseInputAdapter()
{
@Override
public void mouseClicked(MouseEvent event)
{
showMessagesPopup();
}
});
}
trayLabel.incrementNotificationCount();
trayZone.revalidate();
// Necessari per reflectir els canvis del contador
trayZone.repaint();
// Si la finestra principal de l'aplicació es visible es motrarà la notificació
if(showNotification){