* @param span
* @return
*/
protected boolean showSpanDetails(TimeSpanWork span) {
try {
SheduleIndividualData job = span.getWork();
GregorianCalendar gc = (GregorianCalendar) GregorianCalendar.getInstance();
gc.setTimeInMillis(job.getBegin().getTime());
int begin = gc.get(GregorianCalendar.HOUR_OF_DAY)*60 + gc.get(GregorianCalendar.MINUTE);
int end = begin + job.getWorkDuration();
IndividualTimeSpanDialog dlg = new IndividualTimeSpanDialog(MainWindow.mainWindow, begin, end,
span.canBeResized(), span.canBeMoved(), span.canBeDeleted(),
5, span.getMinimalTime()/(60*1000), job.getType(), sil.getCollaborator(), job.getCabinet(), am);
dlg.setVisible(true);
if (dlg.getDlgResult() == IndividualTimeSpanDialog.DLG_DELETED) {
removeSpanWithConformation(span);
return true;
} else if (dlg.getDlgResult() == IndividualTimeSpanDialog.DLG_OK) {
SheduleIndividualData saved = (SheduleIndividualData) job.clone();
gc.set(GregorianCalendar.HOUR_OF_DAY, dlg.getTimeBegin()/60);
gc.set(GregorianCalendar.MINUTE, dlg.getTimeBegin()%60);
job.setBegin(gc.getTime());
job.setWorkDuration(dlg.getTimeEnd() - dlg.getTimeBegin());
job.setType(dlg.getWorkType());
job.setCabinet(dlg.getCabinet());
try {
span.updateSpan();
} catch (SpanException ex) {
MessageBox.showException(ex);
job.setBegin(saved.getBegin());
job.setWorkDuration(saved.getWorkDuration());
job.setType(saved.getType());
job.setCabinet(saved.getCabinet());
}
return true;
}
} catch (ClipsException ex) {
MessageBox.showException(ex);