]> git.argeo.org Git - gpl/argeo-slc.git/blobdiff - eclipse/plugins/org.argeo.slc.client.ui/src/org/argeo/slc/client/ui/views/ResultListView.java
git-svn-id: https://svn.argeo.org/slc/trunk@3795 4cfe0d0a-d680-48aa-b62c-e0a02a3f76cc
[gpl/argeo-slc.git] / eclipse / plugins / org.argeo.slc.client.ui / src / org / argeo / slc / client / ui / views / ResultListView.java
index 4566ee0c2dc56465758dd01a38538c0a3c593366..1ca5909a5e053790c12d3729c4281b72e83b4105 100644 (file)
@@ -63,25 +63,31 @@ public class ResultListView extends ViewPart {
                return table;
        }
 
-       protected class ViewContentProvider implements IStructuredContentProvider {
-               private List<ResultAttributes> lst;
+       protected static class ViewContentProvider implements
+                       IStructuredContentProvider {
+               // private List<ResultAttributes> lst;
 
-               @SuppressWarnings("unchecked")
                public void inputChanged(Viewer arg0, Object arg1, Object arg2) {
-                       if (arg2 instanceof List) {
-                               lst = (List<ResultAttributes>) arg2;
-                               log.trace("result count: " + lst.size());
-                       }
+                       // if (arg2 instanceof List) {
+                       // lst = (List<ResultAttributes>) arg2;
+                       // log.trace("result count: " + lst.size());
+                       // }
                }
 
                public void dispose() {
                }
 
+               @SuppressWarnings("unchecked")
                public Object[] getElements(Object obj) {
-                       if (lst == null)
+                       // if (lst == null)
+                       // return new Object[0];
+                       // else
+                       // return lst.toArray();
+                       if (obj instanceof List) {
+                               return ((List<ResultAttributes>) obj).toArray();
+                       } else {
                                return new Object[0];
-                       else
-                               return lst.toArray();
+                       }
                        // return
                        // testResultCollectionDao.listResultAttributes(null).toArray();
                }
@@ -90,8 +96,8 @@ public class ResultListView extends ViewPart {
        protected class ViewLabelProvider extends LabelProvider implements
                        ITableLabelProvider {
                public String getColumnText(Object obj, int index) {
-                       ResultAttributes ra = (ResultAttributes)obj;
-                       switch(index){
+                       ResultAttributes ra = (ResultAttributes) obj;
+                       switch (index) {
                        case 0:
                                return getText(ra.getCloseDate());
                        case 1:
@@ -114,14 +120,17 @@ public class ResultListView extends ViewPart {
                try {
                        List<ResultAttributes> lst = testResultCollectionDao
                                        .listResultAttributes(null);
-                       log.info("result count: " + lst.size());
+                       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();
                }
        }
 
+       // Ioc
        public void setTestResultCollectionDao(
                        TreeTestResultCollectionDao testResultCollectionDao) {
                this.testResultCollectionDao = testResultCollectionDao;