Ticket #27: rapla-1.3.2-table-end.diff
| File rapla-1.3.2-table-end.diff, 1.8 KB (added by Marc Donges <kosh@…>, 3 years ago) |
|---|
-
src/org/rapla/plugin/tableview/ReservationTableModel.java
old new 21 21 public ReservationTableModel(Locale locale, I18nBundle i18n) { 22 22 this.locale = locale; 23 23 this.i18n = i18n; 24 String[]columns = new String[] {i18n.getString("name"),i18n.getString("start_date"),i18n.getString(" last_changed")};24 String[]columns = new String[] {i18n.getString("name"),i18n.getString("start_date"),i18n.getString("end_date"),i18n.getString("last_changed")}; 25 25 this.setColumnIdentifiers( columns); 26 26 } 27 27 … … 57 57 return minimumDate; 58 58 } 59 59 60 public Date findEndDate(Reservation event) { 61 Appointment[] apps = event.getAppointments(); 62 Date maximumDate = null; 63 for (int i=0;i< apps.length;i++) { 64 Appointment app = apps[i]; 65 if ( maximumDate == null || app.getEnd().after( maximumDate)) { 66 maximumDate = app.getEnd(); 67 } 68 } 69 return maximumDate; 70 } 71 60 72 public Object getValueAt( int rowIndex, int columnIndex ) 61 73 { 62 74 Reservation event = reservations[rowIndex]; … … 64 76 { 65 77 case 0: return event.getName( locale); 66 78 case 1: return findStartDate( event ); 67 case 2: return event.getLastChangeTime(); 79 case 2: return findEndDate( event ); 80 case 3: return event.getLastChangeTime(); 68 81 } 69 82 return event; 70 83 } … … 75 88 case 0: return String.class; 76 89 case 1: return Date.class; 77 90 case 2: return Date.class; 91 case 3: return Date.class; 78 92 } 79 93 return super.getColumnClass( columnIndex ); 80 94 }
![(please configure the [header_logo] section in trac.ini)](/chrome/site/rapla.jpg)