@Override public void load() { desktop.setWaitCursor(); clear(); Vector<ScheduleRangeObject> v = null; try { v = memberService.findFollowUp( personFile.getId(), new DateRange(dates.getStartFr(), dates.getEndFr())); } catch (SQLException ex) { GemLogger.logException(ex); } int min = 0; if (v != null) { for (int i = 0; i < v.size(); i++) { ScheduleRangeObject r = v.elementAt(i); Hour hd = r.getStart(); Hour hf = r.getEnd(); min += hd.getLength(hf); tableModel.addItem(r); } totalTime.setText(Hour.format(min)); } loaded = true; desktop.setDefaultCursor(); }
void suppression(int n) throws SQLException { setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR)); ScheduleRangeObject p = (ScheduleRangeObject) tableModel.getItem(n); try { dc.setAutoCommit(false); planningService.deleteFollowUp(p); p.setNote(0); p.setFollowUp(null); tableModel.modItem(n, p); dc.commit(); } catch (SQLException e1) { dc.rollback(); GemLogger.logException("transaction update", e1); } finally { dc.setAutoCommit(true); setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR)); } }
void modification(int n) throws PlanningException, SQLException { setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR)); ScheduleRangeObject sro = (ScheduleRangeObject) tableModel.getItem(n); Course c = sro.getCourse(); int col = table.getSelectedColumn(); FollowUpDlg dlg = new FollowUpDlg(desktop, sro, c.getTitle(), (col == 8)); try { dlg.entry(); if (!dlg.isValidation()) { return; } if (col != 8) { planningService.updateFollowUp(sro, dlg.getFollowUp()); sro.setFollowUp(dlg.getFollowUp()); tableModel.modItem(n, sro); } } finally { setCursor(Cursor.getDefaultCursor()); } }