@Override public void run() { notification.clear(); } }, 5000);
void disposeNotification() { if (notification!=null) { notification.clear(); } } }
@Override public void run() { bubbleNotification.clear(); } });
/** * @param name user short name */ public synchronized void removePrivate(final String name) { Utilities.assertJid(name); Notification n = privateNotifications.get(name); if (n != null) { n.clear(); privateNotifications.remove(name); privateMessagesCounter.remove(name); } }
private void timeout() { synchronized (ExceptionFlasher.class) { assert EventQueue.isDispatchThread(); if( null != INSTANCE ) { return; } if( null != exceptions ) { exceptions.clear(); } exceptions = null; flash = null; timer.stop(); if( null != note ) note.clear(); } } }
/** * A message has been read and the notification belonging to that message can be cleared and removed. * If the event contains a message for which there is no notifier nothing will happen. * * @param event Event fired by the GuiEventBus containing the message */ void removeNotifier(GuiEvent<Message> event) { final Message message = event.getContent(); //Log StringBuilder logSb = new StringBuilder(); logSb.append("Message with id "); logSb.append(message.getId()); logSb.append(" has been read. Removing notification from list."); LOG.info(logSb.toString()); Notification notificationToDisable = activeNotifications.get(message); if (notificationToDisable != null) { notificationToDisable.clear(); activeNotifications.remove(message); } else { // Log error StringBuilder logErrorSb = new StringBuilder(); logErrorSb.append("This message ("); logErrorSb.append(message.getId()); logErrorSb.append(") has no notifier or a null notifier object."); LOG.error(logErrorSb.toString()); } }
synchronized void addPrivateMessage(final Message msg) { assert SwingUtilities.isEventDispatchThread(); final String name = StringUtils.parseBareAddress(msg.getFrom()); Notification n = privateNotifications.get(name); if (n != null) { n.clear(); privateNotifications.remove(name); } increasePrivateMessagesCount(name); String title; int count = getPrivateMessagesCount(name); if (count==1) { title = NbBundle.getMessage(ChatTopComponent.class, "LBL_ChatNotification", new Object[]{name, count}); // NOI18N } else { title = NbBundle.getMessage(ChatTopComponent.class, "LBL_ChatNotifications", new Object[]{name, count}); // NOI18N } String description = NbBundle.getMessage(ChatTopComponent.class, "LBL_ReadIt"); // NOI18N n = NotificationDisplayer.getDefault().notify(title, getIcon(), description, new ActionListener() { public void actionPerformed(ActionEvent e) { ChatTopComponent tc = ChatTopComponent.findInstance(); tc.open(); tc.setActivePrivate(name); } }, Priority.NORMAL); privateNotifications.put(name, n); ChatTopComponent.refreshContactList(); DashboardImpl.getInstance().getComponent().repaint(); }
@Override protected void projectClosed() { if(isFXProject(eval)) { JFXProjectGenerator.logUsage(JFXProjectGenerator.Action.CLOSE); if(chl != null) { ProjectConfigurationProvider<?> pcp = prj.getLookup().lookup(ProjectConfigurationProvider.class); assert pcp != null; pcp.removePropertyChangeListener(chl); chl = null; } } final String path = prj.getProjectDirectory().getPath(); List<Notification> notifications; synchronized(projectNotifications) { notifications = projectNotifications.get(path); projectNotifications.remove(path); } if(notifications != null) { for(Notification n : notifications) { n.clear(); } } final JFXPlatformUpdater updater = prj.getLookup().lookup(JFXPlatformUpdater.class); if(updater != null) { updater.resetUpdated(); } }
private void createScheduleNotification() { if (scheduleNotification != null) { scheduleNotification.clear(); } removeListener(); IssueScheduleInfo todayInfo = DashboardUtils.getToday(); IssueImpl[] scheduledTasks = schedulingManager.getScheduledTasks(todayInfo, dashboardViewer.getRepositories(true).toArray(new RepositoryImpl[0])); addListener(); List<IssueImpl> tasks = Arrays.asList(scheduledTasks); if (!scheduleChanged(oldTasks, tasks) && isNotFirstToday() || tasks.isEmpty()) { return; } NotificationDisplayer.Priority priority = NotificationDisplayer.Priority.NORMAL; if (isNotFirstToday()) { priority = NotificationDisplayer.Priority.SILENT; } oldTasks = tasks; lastNotification = Calendar.getInstance(); TaskNotificationPanel bubblePanel = new TaskNotificationPanel(tasks, new SelectTodayCategory()); TaskNotificationPanel notificationPanel = new TaskNotificationPanel(tasks, new SelectTodayCategory()); String title = NbBundle.getMessage(NotificationManager.class, "LBL_ScheduleTitle", tasks.size()); scheduleNotification = NotificationDisplayer.getDefault().notify( title, DASHBOARD_ICON, bubblePanel, notificationPanel, priority, NotificationDisplayer.Category.INFO ); updateSchedule.schedule(DashboardUtils.getMillisToTomorrow()); }