package eu.mosaic.cloud.explorer;
import java.util.ArrayList;
import java.util.List;
import javax.swing.table.AbstractTableModel;
import eu.mosaic.cloud.driver.ObjectInfo;
public class FilesTableModel extends AbstractTableModel {
private List<ObjectInfo> objList = new ArrayList<ObjectInfo>();
public FilesTableModel(List<ObjectInfo> objects) {
this.objList = objects;
}
public int getColumnCount() {
// TODO Auto-generated method stub
return 3;
}
public int getRowCount() {
// TODO Auto-generated method stub
return objList.size();
}
public Object getValueAt(int row, int col) {
Object result = null;
ObjectInfo crtObject = (ObjectInfo) objList.toArray()[row];
switch (col) {
case (0):
result = crtObject.getName();
break;
case (1):
result = crtObject.getSize();
break;
case (2):
result = crtObject.getLastModif();
break;
}
return result;
}
}