Exemplo n.º 1
0
 public void start() throws TaskException {
   if (getChildCount() > 0)
     throw new TaskException("If a task has subtasks you can only report on subtasks");
   if (currentPeriod == null || currentPeriod.getEndTime() < System.currentTimeMillis()) {
     currentPeriod = new Period();
     currentPeriod.setTask(this);
     addPeriod(currentPeriod);
     ApplicationEventDispatcher.fireEvent(new TaskStartedEvent(this));
   }
 }
Exemplo n.º 2
0
 public void removePeriod(Period aPeriod) {
   aPeriod.setTask(null);
   periods.remove(aPeriod);
   if (aPeriod == currentPeriod) currentPeriod = null;
 }
Exemplo n.º 3
0
 public void addPeriod(Period aPeriod) throws TaskException {
   if (getChildCount() > 0)
     throw new TaskException("If a task has subtasks you can only report on subtasks");
   periods.add(aPeriod);
   aPeriod.setTask(this);
 }