Author: adietish
Date: 2010-10-13 07:56:09 -0400 (Wed, 13 Oct 2010)
New Revision: 25782
Modified:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/DeltaCloudView.java
Log:
[JBIDE-7326] added cloud removal (was missing in new code)
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-10-13
11:38:50 UTC (rev 25781)
+++
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/DeltaCloudView.java 2010-10-13
11:56:09 UTC (rev 25782)
@@ -14,6 +14,7 @@
import java.util.List;
import java.util.Map;
+import org.eclipse.core.runtime.Assert;
import org.eclipse.jface.action.Action;
import org.eclipse.jface.action.IMenuListener;
import org.eclipse.jface.action.IMenuManager;
@@ -523,9 +524,18 @@
PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell()
, ((IStructuredSelection) viewer.getSelection()).toList());
if (Dialog.OK == dialog.open()) {
- viewer.remove(dialog.getResult());
+ removeCloudViewElements(dialog.getResult());
}
}
+
+ private void removeCloudViewElements(Object[] cloudViewerElements) {
+ viewer.remove(cloudViewerElements);
+ for (Object cloudViewElement : cloudViewerElements) {
+ Assert.isTrue(cloudViewElement instanceof CloudViewElement);
+ DeltaCloud deltaCloud = (DeltaCloud) ((CloudViewElement)
cloudViewElement).getElement();
+ DeltaCloudManager.getDefault().removeCloud(deltaCloud);
+ }
+ }
};
removeCloud.setText(CVMessages.getString(REMOVE_CLOUD));
removeCloud.setToolTipText(CVMessages.getString(REMOVE_CLOUD));
Show replies by date