1 package com.opensymphony.workflow.designer.model; 2 3 import com.opensymphony.workflow.loader.ResultDescriptor; 4 import com.opensymphony.workflow.designer.ResourceManager; 5 6 11 public class ResultsTableModel extends ListTableModel 12 { 13 private String [] header = new String []{ResourceManager.getString("id"), ResourceManager.getString("owner"), 14 ResourceManager.getString("status"), ResourceManager.getString("status.old"), 15 ResourceManager.getString("step")}; 16 17 public int getColumnCount() 18 { 19 return header.length; 20 } 21 22 public String getColumnName(int column) 23 { 24 return header[column]; 25 } 26 27 public Class getColumnClass(int columnIndex) 28 { 29 switch(columnIndex) 30 { 31 case 0: 32 case 4: 33 return Integer .class; 34 case 1: 35 case 2: 36 case 3: 37 return String .class; 38 default: 39 return String .class; 40 } 41 } 42 43 public Object getValueAt(int rowIndex, int columnIndex) 44 { 45 ResultDescriptor result = (ResultDescriptor)list.get(rowIndex); 46 switch(columnIndex) 47 { 48 case 0: 49 return result.hasId() ? new Integer (result.getId()) : null; 50 case 1: 51 return result.getOwner()!=null ? result.getOwner() : ""; 52 case 2: 53 return result.getStatus()!=null ? result.getStatus() : ""; 54 case 3: 55 return result.getOldStatus()!=null ? result.getOldStatus() : ""; 56 case 4: 57 return new Integer (result.getStep()); 58 default: 59 return ""; 60 } 61 } 62 } 63 | Popular Tags |