From 159701bbb818c393fe4ce6499ff6ba84eb3befb8 Mon Sep 17 00:00:00 2001 From: Mathieu Baudier Date: Mon, 20 Sep 2010 08:57:15 +0000 Subject: [PATCH] Use input object git-svn-id: https://svn.argeo.org/slc/trunk@3775 4cfe0d0a-d680-48aa-b62c-e0a02a3f76cc --- .../slc/client/ui/views/ResultListView.java | 24 +++++++++++++------ 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/eclipse/plugins/org.argeo.slc.client.ui/src/org/argeo/slc/client/ui/views/ResultListView.java b/eclipse/plugins/org.argeo.slc.client.ui/src/org/argeo/slc/client/ui/views/ResultListView.java index b4c0f04b9..e86459ebc 100644 --- a/eclipse/plugins/org.argeo.slc.client.ui/src/org/argeo/slc/client/ui/views/ResultListView.java +++ b/eclipse/plugins/org.argeo.slc.client.ui/src/org/argeo/slc/client/ui/views/ResultListView.java @@ -1,5 +1,7 @@ package org.argeo.slc.client.ui.views; +import java.util.List; + import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.argeo.slc.core.test.tree.ResultAttributes; @@ -61,7 +63,7 @@ public class ResultListView extends ViewPart { return table; } - protected class ViewContentProvider implements IStructuredContentProvider { + protected static class ViewContentProvider implements IStructuredContentProvider { // private List lst; public void inputChanged(Viewer arg0, Object arg1, Object arg2) { @@ -74,12 +76,19 @@ public class ResultListView extends ViewPart { public void dispose() { } + @SuppressWarnings("unchecked") public Object[] getElements(Object obj) { // if (lst == null) // return new Object[0]; // else // return lst.toArray(); - return testResultCollectionDao.listResultAttributes(null).toArray(); + if (obj instanceof List) { + return ((List) obj).toArray(); + } else { + return new Object[0]; + } + // return + // testResultCollectionDao.listResultAttributes(null).toArray(); } } @@ -108,11 +117,12 @@ public class ResultListView extends ViewPart { public void retrieveResults() { try { - // List lst = testResultCollectionDao - // .listResultAttributes(null); - // log.info("result count: " + lst.size()); - // viewer.setInput(lst); - viewer.refresh(); + List lst = testResultCollectionDao + .listResultAttributes(null); + if (log.isTraceEnabled()) + log.trace("Result attributes count: " + lst.size()); + viewer.setInput(lst); + // viewer.refresh(); } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); -- 2.39.5