diff options
author | Robert Gemmell <robbie@apache.org> | 2009-08-03 19:56:18 +0000 |
---|---|---|
committer | Robert Gemmell <robbie@apache.org> | 2009-08-03 19:56:18 +0000 |
commit | 58114a5d6cae91a58238aa996e18f9d932420579 (patch) | |
tree | a8771015bcfca135b276336db13448ee7f03c9eb | |
parent | cc5f05e595cad01086dca1e1a617a2e71940e633 (diff) | |
download | qpid-python-58114a5d6cae91a58238aa996e18f9d932420579.tar.gz |
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/qpid@800519 13f79535-47bb-0310-9956-ffa450edef68
2 files changed, 22 insertions, 0 deletions
diff --git a/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/NotificationsTabControl.java b/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/NotificationsTabControl.java index 926bfa2a48..ea49a5c006 100644 --- a/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/NotificationsTabControl.java +++ b/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<NotificationObject> newList = new ArrayList<NotificationObject>(); diff --git a/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/VHNotificationsTabControl.java b/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/VHNotificationsTabControl.java index 5ebe0013bf..4e21e9e865 100644 --- a/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/VHNotificationsTabControl.java +++ b/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); |