修改数据集结果的demo
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

45 lines
1.1 KiB

4 years ago
package com.tptj.demo.hg.ds.modify;
import com.fr.data.AbstractDataModel;
import com.fr.general.data.DataModel;
import com.fr.general.data.TableDataException;
/**
* @author 秃破天际
* @version 10.0
* Created by 秃破天际 on 2021-04-03
**/
public class ModifyModel extends AbstractDataModel {
private DataModel dm;
private int pwdIdx;
public ModifyModel(DataModel dm, int pwdIdx) {
this.dm = dm;
this.pwdIdx = pwdIdx;
}
@Override
public int getColumnCount() throws TableDataException {
return dm.getColumnCount();
}
@Override
public String getColumnName(int i) throws TableDataException {
return dm.getColumnName(i);
}
@Override
public int getRowCount() throws TableDataException {
return dm.getRowCount();
}
@Override
public Object getValueAt(int r, int c) throws TableDataException {
//实际上这种修改是没有意义的,这里只是为了说明接口的使用方法
if( c == pwdIdx ){
return "******";
}
return dm.getValueAt(r,c);
}
}