예제 #1
0
 protected Comparator getComparator(int column) {
   Class columnType = tableModel.getColumnClass(column);
   Comparator comparator = (Comparator) columnComparators.get(columnType);
   if (comparator != null) {
     return comparator;
   }
   if (Comparable.class.isAssignableFrom(columnType)) {
     return COMPARABLE_COMAPRATOR;
   }
   return LEXICAL_COMPARATOR;
 }
예제 #2
0
  private Row[] getViewToModel() {
    if (viewToModel == null) {
      int tableModelRowCount = tableModel.getRowCount();
      viewToModel = new Row[tableModelRowCount];
      for (int row = 0; row < tableModelRowCount; row++) {
        viewToModel[row] = new Row(row);
      }

      if (isSorting()) {
        Arrays.sort(viewToModel);
      }
    }
    return viewToModel;
  }
예제 #3
0
 public void setValueAt(Object aValue, int row, int column) {
   tableModel.setValueAt(aValue, modelIndex(row), column);
 }
예제 #4
0
 public Object getValueAt(int row, int column) {
   return tableModel.getValueAt(modelIndex(row), column);
 }
예제 #5
0
 public boolean isCellEditable(int row, int column) {
   return tableModel.isCellEditable(modelIndex(row), column);
 }
예제 #6
0
 public Class getColumnClass(int column) {
   return tableModel.getColumnClass(column);
 }
예제 #7
0
 public String getColumnName(int column) {
   return tableModel.getColumnName(column);
 }
예제 #8
0
 public int getColumnCount() {
   return (tableModel == null) ? 0 : tableModel.getColumnCount();
 }
예제 #9
0
 public int getRowCount() {
   return (tableModel == null) ? 0 : tableModel.getRowCount();
 }