package de.walbusch.wis.client.modul.verantwortlicher;
import java.awt.List;
import java.util.ArrayList;
import javax.swing.table.AbstractTableModel;
import de.walbusch.wis.client.business.stammdaten.StammdatenDelegate;
import de.walbusch.wis.server.ejb.entity.VerantwortlicherEntity;
/**
*
* @author AKruse
*/
public class VerantwortlicherTableModel extends AbstractTableModel {
Object[][] objects = new Object[1][3];
private StammdatenDelegate delegate = StammdatenDelegate.getInstance();
ArrayList<String> list = new ArrayList<String>();
public void holeDaten(){
list = (ArrayList<String>) delegate.suchenVerantwortlicher();
System.out.println( delegate.suchenVerantwortlicher());
}
private Object[][] data = new Object[][]{
{"test", "0", "50"},
{"test", "1", "60"},
{"test", "1", "110"},
{null, null, null}
};
private void schreibedaten( ArrayList<String> list){
for(int i=0; i<list.size();i++){
data. /////////////////////////////////////////////////////////////////////////////// Ab hier weis ich nicht weiter, ich will jetzt //////////////////////////////////////////////////////////////////////////////////////meine ArrrayWerte in die verschiedenen data´s reintun:)
}
}
public String getColumnName(int pos) {
String[] cols = new String[]{
"Name", "Aktiv", "Sotierung"
};
return cols[pos];
}
public Object getValueAt(int row, int column) {
return data[row][column];
}
public int getRowCount() {
return data.length;
}
public int getColumnCount() {
return 3;
}
public boolean isCellEditable(int row, int column) {
return true ;
}
public void addRow(int position) {
position = Math.max(0, Math.min(data.length, position));
Object[][] newObjects = new Object[data.length + 1][];
System.arraycopy(data, 0, newObjects, 0, position);
System.arraycopy(data, position, newObjects, position + 1,
data.length - position);
newObjects[position] = new Object[getColumnCount()];
data = newObjects;
fireTableRowsInserted(position, position);
}
public void setValueAt(Object value, int row, int col) {
data[row][col] = value;
fireTableCellUpdated(row, col);
}
public void deleteRow(int position) {
// TODO Auto-generated method stub
}
}