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();
}
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:
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;