промежуточный. упорядочил код отображения дат в таблицах

This commit is contained in:
2024-10-30 19:33:52 +03:00
parent 2712b904b1
commit 62e734f725
11 changed files with 28 additions and 24 deletions

View File

@@ -4,15 +4,14 @@ import Common.Utils.Utils_;
import javax.swing.*;
import java.util.Date;
//название пересекается с встроенным классом поэтому подчеркивание.
public class RendererDate extends RendererCell<Date> {
private static final Date zero = new Date(0);
public class RendererDate extends RendererCell<Long> {
@Override
public Date Init(JTable table, Object value, int row, int column) {
return (Date) value;
public Long Init(JTable table, Object value, int row, int column) {
return (Long) value;
}
@Override
public void Display() {
if (value != null)
setText(value.equals(zero) ? "нет" : Utils_.print_date(value));
setText((value == 0) ? "" : Utils_.print_date(new Date(value)));
}
}