use of com.revolsys.swing.map.layer.record.table.model.RecordLayerTableModel in project com.revolsys.open by revolsys.
the class RecordLayerTable method tableChangedDo.
@Override
protected void tableChangedDo(final TableModelEvent event) {
final RecordLayerTableModel model = getModel();
if (model.isSortable()) {
setSortable(true);
} else {
setSortable(false);
}
final RowFilter<RecordRowTableModel, Integer> rowFilter = model.getRowFilter();
final boolean filterChanged = getRowFilter() != rowFilter;
if (filterChanged) {
setRowFilter(null);
}
super.tableChangedDo(event);
if (filterChanged) {
setRowFilter(rowFilter);
}
repaint();
}
use of com.revolsys.swing.map.layer.record.table.model.RecordLayerTableModel in project com.revolsys.open by revolsys.
the class RecordLayerTableRowSorter method isSortable.
@Override
public boolean isSortable(final int columnIndex) {
final RecordLayerTableModel model = (RecordLayerTableModel) getModel();
final FieldDefinition fieldDefinition = model.getColumnFieldDefinition(columnIndex);
if (fieldDefinition == null) {
return true;
} else {
final Class<?> fieldClass = fieldDefinition.getTypeClass();
return !Geometry.class.isAssignableFrom(fieldClass);
}
}
use of com.revolsys.swing.map.layer.record.table.model.RecordLayerTableModel in project com.revolsys.open by revolsys.
the class RecordLayerTableRowSorter method getComparator.
@Override
public Comparator<?> getComparator(final int columnIndex) {
final RecordLayerTableModel model = (RecordLayerTableModel) getModel();
final String fieldName = model.getColumnFieldName(columnIndex);
final RecordDefinition recordDefinition = this.layer.getRecordDefinition();
final CodeTable codeTable = recordDefinition.getCodeTableByFieldName(fieldName);
if (codeTable == null) {
final Comparator<?> comparator = super.getComparator(columnIndex);
if (comparator == null) {
return this.layer.getComparator(fieldName);
} else {
return comparator;
}
} else {
return codeTable;
}
}
Aggregations