From e197fb77e4a80fe68d852b049da34ac4ee784e7b Mon Sep 17 00:00:00 2001 From: Robert Gemmell Date: Mon, 3 Aug 2009 19:56:18 +0000 Subject: QPID-2014: prompt the user for confirmation before clearing all Notifications for the selected vhost/mbean git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@800519 13f79535-47bb-0310-9956-ffa450edef68 --- .../qpid/management/ui/views/NotificationsTabControl.java | 11 +++++++++++ .../qpid/management/ui/views/VHNotificationsTabControl.java | 11 +++++++++++ 2 files changed, 22 insertions(+) (limited to 'qpid/java/management/eclipse-plugin/src') diff --git a/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/NotificationsTabControl.java b/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/NotificationsTabControl.java index 926bfa2a48..ea49a5c006 100644 --- a/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/NotificationsTabControl.java +++ b/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/NotificationsTabControl.java @@ -186,10 +186,21 @@ public class NotificationsTabControl extends VHNotificationsTabControl IStructuredSelection ss = (IStructuredSelection)_tableViewer.getSelection(); if(!ss.isEmpty()) { + //clear selected Notifications serverRegistry.clearNotifications(_mbean, ss.toList()); } else if(_notifications != null) { + //clear all the notifications, if there are any + + //check the user is certain of this clear-all operation + int response = ViewUtility.popupOkCancelConfirmationMessage( + "Clear Notifications", "Clear all Notifications for this MBean?"); + if(response != SWT.OK) + { + return; + } + synchronized(this) { List newList = new ArrayList(); diff --git a/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/VHNotificationsTabControl.java b/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/VHNotificationsTabControl.java index 5ebe0013bf..4e21e9e865 100644 --- a/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/VHNotificationsTabControl.java +++ b/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/VHNotificationsTabControl.java @@ -136,10 +136,21 @@ public class VHNotificationsTabControl extends TabControl IStructuredSelection ss = (IStructuredSelection)_tableViewer.getSelection(); if(!ss.isEmpty()) { + //clear selected Notifications serverRegistry.clearNotifications(null, ss.toList()); } else if(_notifications != null) { + //clear all the notifications, if there are any + + //check the user is certain of this clear-all operation + int response = ViewUtility.popupOkCancelConfirmationMessage( + "Clear Notifications", "Clear all Notifications for this VirtualHost?"); + if(response != SWT.OK) + { + return; + } + synchronized(this) { serverRegistry.clearNotifications(null, _notifications); -- cgit v1.2.1