org.chorem.jtimer.data
Class CommonVetoable

java.lang.Object
  extended by org.chorem.jtimer.data.CommonVetoable
All Implemented Interfaces:
EventListener, VetoableDataEventListener

public class CommonVetoable
extends Object
implements VetoableDataEventListener

Common jtimer vetoable politics. Check that: - a task name doesn't appears twice in the same level. - creation - modification - move

Version:
$Revision: 2778 $ Last update : $Date: 2011-09-05 10:12:54 +0200 (Mon, 05 Sep 2011) $ By : $Author: echatellier $
Author:
chatellier

Field Summary
protected static String DUPLICATED_PROJECT_VIOLATION
          Duplicated project violation key.
protected static String DUPLICATED_TASK_VIOLATION
          Duplicated task violation key.
protected  TimerDataManager manager
          Data manager
protected static String MERGE_INVALID_TYPES_VIOLATION
          Violation if try to merge task and project.
protected static String MOVE_INVALID_TYPES_VIOLATION
          Violation if try to move project into task.
 
Constructor Summary
CommonVetoable(TimerDataManager manager)
          Constructor.
 
Method Summary
 void checkAddProject(TimerProject project)
          Check add project.
 void checkAddTask(TimerTask parent, TimerTask task)
          Check add task.
 void checkChangeClosedState(TimerTask task)
          Check change task state.
 void checkDeleteProject(TimerProject project)
          Check delete project.
 void checkDeleteTask(TimerTask task)
          Check delete task.
 void checkMergeTasks(TimerTask destinationTask, List<TimerTask> otherTasks)
          Check merge task.
 void checkModifyProject(TimerProject project)
          Check modify project.
 void checkModifyTask(TimerTask task)
          Check modify task.
 void checkMoveTask(TimerTask destination, Collection<TimerTask> tasksToMove)
          Check move task.
 void checkSetAnnotation(TimerTask task, Date date, String value)
          Check update task annotation.
 void checkSetTaskTime(TimerTask task, Date date, Long value)
          Check update task time.
protected  boolean isSameTaskName(TimerTask task, List<? extends TimerTask> tasks)
          Test if task name is found is tasks list.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DUPLICATED_PROJECT_VIOLATION

protected static final String DUPLICATED_PROJECT_VIOLATION
Duplicated project violation key.

See Also:
Constant Field Values

DUPLICATED_TASK_VIOLATION

protected static final String DUPLICATED_TASK_VIOLATION
Duplicated task violation key.

See Also:
Constant Field Values

MOVE_INVALID_TYPES_VIOLATION

protected static final String MOVE_INVALID_TYPES_VIOLATION
Violation if try to move project into task.

See Also:
Constant Field Values

MERGE_INVALID_TYPES_VIOLATION

protected static final String MERGE_INVALID_TYPES_VIOLATION
Violation if try to merge task and project.

See Also:
Constant Field Values

manager

protected TimerDataManager manager
Data manager

Constructor Detail

CommonVetoable

public CommonVetoable(TimerDataManager manager)
Constructor.

Parameters:
manager - data manager
Method Detail

isSameTaskName

protected boolean isSameTaskName(TimerTask task,
                                 List<? extends TimerTask> tasks)
Test if task name is found is tasks list.

Parameters:
task - task to check
tasks - tasks list to search into
Returns:
founded

checkAddProject

public void checkAddProject(TimerProject project)
Description copied from interface: VetoableDataEventListener
Check add project.

Specified by:
checkAddProject in interface VetoableDataEventListener
Parameters:
project - project to add

checkAddTask

public void checkAddTask(TimerTask parent,
                         TimerTask task)
Description copied from interface: VetoableDataEventListener
Check add task.

Specified by:
checkAddTask in interface VetoableDataEventListener
Parameters:
parent - parent task
task - task to add

checkChangeClosedState

public void checkChangeClosedState(TimerTask task)
Description copied from interface: VetoableDataEventListener
Check change task state.

Specified by:
checkChangeClosedState in interface VetoableDataEventListener
Parameters:
task - task

checkDeleteProject

public void checkDeleteProject(TimerProject project)
Description copied from interface: VetoableDataEventListener
Check delete project.

Specified by:
checkDeleteProject in interface VetoableDataEventListener
Parameters:
project - deleted project

checkDeleteTask

public void checkDeleteTask(TimerTask task)
Description copied from interface: VetoableDataEventListener
Check delete task.

Specified by:
checkDeleteTask in interface VetoableDataEventListener
Parameters:
task - deleted task

checkModifyProject

public void checkModifyProject(TimerProject project)
Description copied from interface: VetoableDataEventListener
Check modify project.

Specified by:
checkModifyProject in interface VetoableDataEventListener
Parameters:
project - modified project

checkModifyTask

public void checkModifyTask(TimerTask task)
Description copied from interface: VetoableDataEventListener
Check modify task.

Specified by:
checkModifyTask in interface VetoableDataEventListener
Parameters:
task - modified task

checkMoveTask

public void checkMoveTask(TimerTask destination,
                          Collection<TimerTask> tasksToMove)
Description copied from interface: VetoableDataEventListener
Check move task.

Specified by:
checkMoveTask in interface VetoableDataEventListener
Parameters:
destination - task to move to
tasksToMove - tasks to move

checkSetAnnotation

public void checkSetAnnotation(TimerTask task,
                               Date date,
                               String value)
Description copied from interface: VetoableDataEventListener
Check update task annotation.

Specified by:
checkSetAnnotation in interface VetoableDataEventListener
Parameters:
task - task to update
date - day of change
value - new annotation

checkSetTaskTime

public void checkSetTaskTime(TimerTask task,
                             Date date,
                             Long value)
Description copied from interface: VetoableDataEventListener
Check update task time.

Specified by:
checkSetTaskTime in interface VetoableDataEventListener
Parameters:
task - task to update
date - day of change
value - new time in seconds

checkMergeTasks

public void checkMergeTasks(TimerTask destinationTask,
                            List<TimerTask> otherTasks)
Description copied from interface: VetoableDataEventListener
Check merge task.

Specified by:
checkMergeTasks in interface VetoableDataEventListener
Parameters:
destinationTask - task result of merge
otherTasks - other task to merge


Copyright © 2007-2012 CodeLutin. All Rights Reserved.