Author: adietish
Date: 2010-12-02 09:37:26 -0500 (Thu, 02 Dec 2010)
New Revision: 27099
Modified:
branches/jbosstools-3.2.0.Beta2/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/CVImagesCategoryElement.java
branches/jbosstools-3.2.0.Beta2/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/CVInstancesCategoryElement.java
Log:
[JBIDE-7693] remove listner to model before loading images from server. images would get
added twice otherwise
Modified:
branches/jbosstools-3.2.0.Beta2/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/CVImagesCategoryElement.java
===================================================================
---
branches/jbosstools-3.2.0.Beta2/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/CVImagesCategoryElement.java 2010-12-02
14:33:09 UTC (rev 27098)
+++
branches/jbosstools-3.2.0.Beta2/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/CVImagesCategoryElement.java 2010-12-02
14:37:26 UTC (rev 27099)
@@ -70,16 +70,18 @@
if (!initialized) {
DeltaCloud cloud = (DeltaCloud)getElement();
try {
+ // do not listen to model when loading. we would add images twice otherwise.
+ cloud.removeImageListListener(this);
DeltaCloudImage[] images = filter(cloud.getImages());
- cloud.removeImageListListener(this);
addImages(images);
initialized = true;
- cloud.addImageListListener(this);
} catch (Exception e) {
ErrorUtils.handleError(
"Error",
"Colud not get images from cloud " + cloud.getName(),
e, Display.getDefault().getActiveShell());
+ } finally {
+ cloud.addImageListListener(this);
}
}
return super.getChildren();
Modified:
branches/jbosstools-3.2.0.Beta2/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/CVInstancesCategoryElement.java
===================================================================
---
branches/jbosstools-3.2.0.Beta2/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/CVInstancesCategoryElement.java 2010-12-02
14:33:09 UTC (rev 27098)
+++
branches/jbosstools-3.2.0.Beta2/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/CVInstancesCategoryElement.java 2010-12-02
14:37:26 UTC (rev 27099)
@@ -78,13 +78,14 @@
DeltaCloudInstance[] instances = filter(cloud.getInstances());
addInstances(instances);
initialized = true;
- cloud.addInstanceListListener(this);
} catch (Exception e) {
// TODO: internationalize strings
ErrorUtils.handleError(
"Error",
"Colud not get instances from cloud " + cloud.getName(),
e, Display.getDefault().getActiveShell());
+ } finally {
+ cloud.addInstanceListListener(this);
}
}
return super.getChildren();
Show replies by date