Author: adietish
Date: 2010-11-11 12:38:06 -0500 (Thu, 11 Nov 2010)
New Revision: 26463
Modified:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/commands/RefreshCloudHandler.java
Log:
removed duplicate code
Modified:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/commands/RefreshCloudHandler.java
===================================================================
---
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/commands/RefreshCloudHandler.java 2010-11-11
17:38:03 UTC (rev 26462)
+++
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/commands/RefreshCloudHandler.java 2010-11-11
17:38:06 UTC (rev 26463)
@@ -18,8 +18,9 @@
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.ui.handlers.HandlerUtil;
-import org.jboss.tools.deltacloud.ui.views.CVCloudElement;
+import org.jboss.tools.deltacloud.core.DeltaCloud;
import org.jboss.tools.deltacloud.ui.views.CloudViewElement;
+import org.jboss.tools.deltacloud.ui.views.CloudViewElementUtils;
import org.jboss.tools.internal.deltacloud.ui.utils.UIUtils;
/**
@@ -40,10 +41,10 @@
private void refresh(CloudViewElement cloudViewElement) {
if (cloudViewElement != null) {
- while (!(cloudViewElement instanceof CVCloudElement))
- cloudViewElement = (CloudViewElement) cloudViewElement.getParent();
- CVCloudElement cloud = (CVCloudElement) cloudViewElement;
- cloud.loadChildren();
+ DeltaCloud cloud = CloudViewElementUtils.getCloud(cloudViewElement);
+ if (cloud != null) {
+ cloud.loadChildren();
+ }
}
}
}