Author: adietish
Date: 2011-03-14 09:41:40 -0400 (Mon, 14 Mar 2011)
New Revision: 29760
Modified:
branches/jbosstools-3.2.x/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/cloud/CloudItem.java
branches/jbosstools-3.2.x/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/cloudelements/AbstractCloudElementTableView.java
Log:
[JBIDE-8584] ensured updates to widgets happens in display thread
Modified:
branches/jbosstools-3.2.x/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/cloud/CloudItem.java
===================================================================
---
branches/jbosstools-3.2.x/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/cloud/CloudItem.java 2011-03-14
13:38:01 UTC (rev 29759)
+++
branches/jbosstools-3.2.x/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/cloud/CloudItem.java 2011-03-14
13:41:40 UTC (rev 29760)
@@ -14,6 +14,7 @@
import java.beans.PropertyChangeListener;
import org.eclipse.jface.viewers.TreeViewer;
+import org.eclipse.swt.widgets.Display;
import org.eclipse.ui.views.properties.IPropertySource;
import org.jboss.tools.deltacloud.core.DeltaCloud;
import org.jboss.tools.deltacloud.ui.views.cloud.property.CloudPropertySource;
@@ -59,6 +60,12 @@
@Override
public void propertyChange(PropertyChangeEvent event) {
- viewer.update(this, new String[] { DeltaCloud.PROP_NAME });
+ Display.getDefault().syncExec(new Runnable() {
+
+ @Override
+ public void run() {
+ viewer.update(CloudItem.this, new String[] { DeltaCloud.PROP_NAME });
+ }
+ });
}
}
Modified:
branches/jbosstools-3.2.x/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/cloudelements/AbstractCloudElementTableView.java
===================================================================
---
branches/jbosstools-3.2.x/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/cloudelements/AbstractCloudElementTableView.java 2011-03-14
13:38:01 UTC (rev 29759)
+++
branches/jbosstools-3.2.x/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/cloudelements/AbstractCloudElementTableView.java 2011-03-14
13:41:40 UTC (rev 29760)
@@ -360,17 +360,24 @@
}
}
- private void updateCloudSelector(DeltaCloud cloud) {
+ private void updateCloudSelector(final DeltaCloud cloud) {
DeltaCloud[] clouds = getClouds();
- int index = getCloudIndex(cloud, clouds);
- if (index >= 0) {
- int selectionIndex = currentCloudSelector.getSelectionIndex();
- currentCloudSelector.removeModifyListener(currentCloudModifyListener);
- currentCloudSelector.setItem(index, cloud.getName());
- currentCloudSelector.select(selectionIndex);
- currentCloudSelector.addModifyListener(currentCloudModifyListener);
- }
- container.layout(true, true);
+ final int index = getCloudIndex(cloud, clouds);
+ Display.getDefault().syncExec(new Runnable() {
+
+ @Override
+ public void run() {
+ if (index >= 0) {
+ int selectionIndex = currentCloudSelector.getSelectionIndex();
+ currentCloudSelector.removeModifyListener(currentCloudModifyListener);
+ currentCloudSelector.setItem(index, cloud.getName());
+ currentCloudSelector.select(selectionIndex);
+ currentCloudSelector.addModifyListener(currentCloudModifyListener);
+ }
+ container.layout(true, true);
+
+ }
+ });
}
public void cloudsChanged(int type, DeltaCloud cloud) {
Show replies by date