Esempio n. 1
0
 public String getColumnName(int columnIndex) {
   String answer = null;
   if (columnIndex < 0 || columnIndex >= columnModel.getColumnCount()) {
     return answer;
   }
   Object value = columnModel.getColumn(columnIndex).getHeaderValue();
   if (value != null) {
     return value.toString();
   }
   return answer;
 }
Esempio n. 2
0
 public void setValueAt(Object value, int rowIndex, int columnIndex) {
   List rows = getRows();
   if (rowIndex < 0 || rowIndex >= rows.size()) {
     return;
   }
   if (columnIndex < 0 || columnIndex >= columnModel.getColumnCount()) {
     return;
   }
   Object row = getRows().get(rowIndex);
   rowModel.setValue(row);
   DefaultTableColumn column = (DefaultTableColumn) columnModel.getColumn(columnIndex);
   if (row == null || column == null) {
     return;
   }
   column.setValue(row, value, rowIndex, columnIndex);
 }
Esempio n. 3
0
 public Object getValueAt(int rowIndex, int columnIndex) {
   List rows = getRows();
   Object answer = null;
   if (rowIndex < 0 || rowIndex >= rows.size()) {
     return answer;
   }
   if (columnIndex < 0 || columnIndex >= columnModel.getColumnCount()) {
     return answer;
   }
   Object row = getRows().get(rowIndex);
   rowModel.setValue(row);
   DefaultTableColumn column = (DefaultTableColumn) columnModel.getColumn(columnIndex);
   if (row == null || column == null) {
     return answer;
   }
   return column.getValue(row, rowIndex, columnIndex);
 }
Esempio n. 4
0
 /** Adds a new column definition to the table */
 public void addColumn(DefaultTableColumn column) {
   column.setModelIndex(columnModel.getColumnCount());
   columnModel.addColumn(column);
 }
Esempio n. 5
0
 public int getColumnCount() {
   return columnModel.getColumnCount();
 }