Author: jjohnstn
Date: 2010-09-13 17:46:07 -0400 (Mon, 13 Sep 2010)
New Revision: 24903
Modified:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/ChangeLog
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/CVMessages.properties
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/DeltaCloudView.java
Log:
2010-09-13 Jeff Johnston <jjohnstn(a)redhat.com>
* src/org/jboss/tools/deltacloud/ui/views/CVMessages.properties: Add new messages
for disconnecting a cloud.
* src/org/jboss/tools/deltacloud/ui/views/DeltaCloudView.java (.run): Add confirmation
dialog when disconnecting a cloud.
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/ChangeLog
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/ChangeLog 2010-09-13 21:03:31
UTC (rev 24902)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/ChangeLog 2010-09-13 21:46:07
UTC (rev 24903)
@@ -1,3 +1,10 @@
+2010-09-13 Jeff Johnston <jjohnstn(a)redhat.com>
+
+ * src/org/jboss/tools/deltacloud/ui/views/CVMessages.properties: Add new messages
+ for disconnecting a cloud.
+ * src/org/jboss/tools/deltacloud/ui/views/DeltaCloudView.java (.run): Add confirmation
+ dialog when disconnecting a cloud.
+
2010-09-08 Jeff Johnston <jjohnstn(a)redhat.com>
* src/org/jboss/tools/internal/deltacloud/ui/wizards/NewInstancePage.java: Fix warning.
Modified:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/CVMessages.properties
===================================================================
---
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/CVMessages.properties 2010-09-13
21:03:31 UTC (rev 24902)
+++
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/CVMessages.properties 2010-09-13
21:46:07 UTC (rev 24903)
@@ -50,6 +50,8 @@
DestroyingInstance.title=Destroying Instance
DestroyingInstance.msg=Destroying Instance: {0}
ConnectingRSE.msg=Connecting instance as: {0}
+ConfirmCloudDelete.title=Confirm Cloud Disconnect
+ConfirmCloudDelete.msg=Confirm disconnecting cloud: {0}
NAME=Name
ID=ID
Modified:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/DeltaCloudView.java
===================================================================
---
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/DeltaCloudView.java 2010-09-13
21:03:31 UTC (rev 24902)
+++
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/DeltaCloudView.java 2010-09-13
21:46:07 UTC (rev 24903)
@@ -16,6 +16,7 @@
import org.eclipse.jface.action.IToolBarManager;
import org.eclipse.jface.action.MenuManager;
import org.eclipse.jface.action.Separator;
+import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.jface.viewers.DoubleClickEvent;
import org.eclipse.jface.viewers.IDoubleClickListener;
import org.eclipse.jface.viewers.ISelection;
@@ -56,6 +57,8 @@
private static final String REMOVE_CLOUD = "RemoveCloud.label"; //$NON-NLS-1$
private static final String REFRESH = "Refresh.label"; //$NON-NLS-1$
private static final String CREATE_INSTANCE = "CreateInstance.label";
//$NON-NLS-1$
+ private static final String CONFIRM_CLOUD_DELETE_TITLE =
"ConfirmCloudDelete.title"; //$NON-NLS-1$
+ private static final String CONFIRM_CLOUD_DELETE_MSG =
"ConfirmCloudDelete.msg"; //$NON-NLS-1$
public static final String COLLAPSE_ALL = "CollapseAll.label"; //$NON-NLS-1$
@@ -177,16 +180,22 @@
}
if (element != null) {
CVCloudElement cve = (CVCloudElement)element;
- DeltaCloudManager.getDefault().removeCloud((DeltaCloud)element.getElement());
- CloudViewContentProvider p = (CloudViewContentProvider)viewer.getContentProvider();
- Object[] elements = p.getElements(getViewSite());
- int index = -1;
- for (int i = 0; i < elements.length; ++i) {
- if (elements[i] == cve)
- index = i;
+ Shell shell = PlatformUI.getWorkbench().getDisplay().getActiveShell();
+ boolean confirmed = MessageDialog.openConfirm(shell,
+ CVMessages.getString(CONFIRM_CLOUD_DELETE_TITLE),
+ CVMessages.getFormattedString(CONFIRM_CLOUD_DELETE_MSG, cve.getName()));
+ if (confirmed) {
+ DeltaCloudManager.getDefault().removeCloud((DeltaCloud)element.getElement());
+ CloudViewContentProvider p =
(CloudViewContentProvider)viewer.getContentProvider();
+ Object[] elements = p.getElements(getViewSite());
+ int index = -1;
+ for (int i = 0; i < elements.length; ++i) {
+ if (elements[i] == cve)
+ index = i;
+ }
+ if (index >= 0)
+ ((TreeViewer)cve.getViewer()).remove(getViewSite(), index);
}
- if (index >= 0)
- ((TreeViewer)cve.getViewer()).remove(getViewSite(), index);
}
}
};
Show replies by date