From: Mathieu Baudier Date: Mon, 20 Sep 2010 08:57:15 +0000 (+0000) Subject: Use input object X-Git-Tag: argeo-slc-2.1.7~1180 X-Git-Url: http://git.argeo.org/?a=commitdiff_plain;h=159701bbb818c393fe4ce6499ff6ba84eb3befb8;p=gpl%2Fargeo-slc.git Use input object git-svn-id: https://svn.argeo.org/slc/trunk@3775 4cfe0d0a-d680-48aa-b62c-e0a02a3f76cc --- 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();