Fixed bugs
This commit is contained in:
1 parent
8134d11a8c
commit
47289d240e
2 files changed
+26
-2
No files matched your search
@@ -30,6 +30,14 @@ public class MRowModel {
|
||||
return row;
|
||||
}
|
||||
|
||||
public Object getItem(int index) {
|
||||
try {
|
||||
return row.get(index);
|
||||
} catch (Exception e) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return row.toString();
|
||||
|
||||
@@ -14,7 +14,7 @@ import java.util.List;
|
||||
public class MTableModel {
|
||||
private List<String> column;
|
||||
private MRowsModel rows;
|
||||
|
||||
private String tableName;
|
||||
|
||||
|
||||
public MTableModel() {
|
||||
@@ -22,6 +22,12 @@ public class MTableModel {
|
||||
this.rows = new MRowsModel();
|
||||
}
|
||||
|
||||
public MTableModel(String tableName) {
|
||||
this.column = new LinkedList<>();
|
||||
this.rows = new MRowsModel();
|
||||
this.tableName = tableName;
|
||||
}
|
||||
|
||||
public MTableModel(String... columns) {
|
||||
this.column = new LinkedList<>();
|
||||
this.rows = new MRowsModel();
|
||||
@@ -44,7 +50,17 @@ public class MTableModel {
|
||||
}
|
||||
|
||||
public List<Object> getRow(int index) {
|
||||
return rows.getRowModel(index).getRow();
|
||||
if (getNbRows() != 0)
|
||||
return rows.getRowModel(index).getRow();
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public MRowModel getRowModel(int rowIndex) {
|
||||
if (getNbRows() != 0)
|
||||
return rows.getRowModel(rowIndex);
|
||||
|
||||
return new MRowModel();
|
||||
}
|
||||
|
||||
public List<String> getColumns() {
|
||||
|
||||
Reference in new issue
Block a user