Package eu.mosaic.cloud.explorer

Source Code of eu.mosaic.cloud.explorer.FilesTableModel

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;
  }

}
TOP

Related Classes of eu.mosaic.cloud.explorer.FilesTableModel

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.