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 | e197fb77e4a80fe68d852b049da34ac4ee784e7b (patch) | |
| tree | f2d6744b2d2982cdf105b27bc4af603cf79b95bb /qpid/java | |
| parent | d1371e78c12ae59263be5c7c66c7fdbfcec9c53b (diff) | |
| download | qpid-python-e197fb77e4a80fe68d852b049da34ac4ee784e7b.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@800519 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/java')
2 files changed, 22 insertions, 0 deletions
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<NotificationObject> newList = new ArrayList<NotificationObject>(); 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); |
