Author: adietish
Date: 2010-12-09 12:51:02 -0500 (Thu, 09 Dec 2010)
New Revision: 27286
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/cloudelements/AbstractCloudElementViewLabelAndContentProvider.java
Log:
[JBIDE-7848] refreshing viewer before adding new items
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/ChangeLog
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/ChangeLog 2010-12-09 17:34:28
UTC (rev 27285)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/ChangeLog 2010-12-09 17:51:02
UTC (rev 27286)
@@ -1,5 +1,7 @@
2010-12-09 André Dietisheim <adietish(a)redhat.com>
+ *
src/org/jboss/tools/deltacloud/ui/views/cloudelements/AbstractCloudElementViewLabelAndContentProvider.java
(inputChanged):
+ [JBIDE-7848] refreshing viewer before adding new items
* src/org/jboss/tools/internal/deltacloud/ui/wizards/FindImagePage.java
(.modifyText):
(asyncSetImagesToViewer):
Modified:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/cloudelements/AbstractCloudElementViewLabelAndContentProvider.java
===================================================================
---
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/cloudelements/AbstractCloudElementViewLabelAndContentProvider.java 2010-12-09
17:34:28 UTC (rev 27285)
+++
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/cloudelements/AbstractCloudElementViewLabelAndContentProvider.java 2010-12-09
17:51:02 UTC (rev 27286)
@@ -34,10 +34,16 @@
private DeltaCloud currentCloud;
private ICloudElementFilter<CLOUDELEMENT> localFilter;
private TableViewer viewer;
-
+
@Override
public Object[] getElements(Object input) {
- return new Object[] {};
+ /*
+ * items are added in asynchronous manner.
+ *
+ * @see #inputChanged
+ * @see #asyncAddCloudElements
+ */
+ return new Object[]{};
}
public void setFilter(ICloudElementFilter<CLOUDELEMENT> filter) {
@@ -49,7 +55,7 @@
if (!(newInput instanceof DeltaCloud)) {
return;
}
- Assert.isTrue(viewer instanceof TableViewer);
+ Assert.isLegal(viewer instanceof TableViewer);
this.viewer = (TableViewer) viewer;
removeListener(currentCloud);
this.currentCloud = (DeltaCloud) newInput;
@@ -75,13 +81,13 @@
@Override
public void run() {
try {
+ viewer.refresh();
Object[] elements = filter(getFilter(currentCloud), cloudElements);
viewer.add(elements);
} catch (DeltaCloudException e) {
// TODO: internationalize strings
ErrorUtils.handleError(
- "Error",
- "Could not get elements of clouds " + currentCloud.getName(),
+ "Error", "Could not filter the elements for cloud " +
currentCloud.getName(),
e, Display.getDefault().getActiveShell());
}