public class ProjectsAndTasksModel extends org.jdesktop.swingx.treetable.AbstractTreeTableModel implements DataEventListener
Modifier and Type | Field and Description |
---|---|
protected List<String> |
columnIdentifiers
Tree column identifiers.
|
protected TimerDataManager |
dataManager
Data.
|
static int |
OPERATION_ADD
Add node operation.
|
static int |
OPERATION_DELETE
Delete Node operation.
|
static int |
OPERATION_MODIFY
Modify node operation.
|
protected ProjectsAndTasksTable |
projectsAndTaskTable
Tree managed by this model.
|
protected boolean |
showClosedTask
Show closed task property.
|
protected Map<Object,List<TimerTask>> |
subTasksCache |
protected Map<TimerTask,String> |
taskNameCache |
Constructor and Description |
---|
ProjectsAndTasksModel(ProjectsAndTasksTable projectsAndTaskTable,
TimerCore core,
List<String> columnIdentifiers)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
addProject(TimerProject project)
Add project event.
|
void |
addTask(TimerTask task)
Add task event.
|
void |
changeClosedState(TimerTask task)
Change task state.
|
void |
dataLoaded(Collection<TimerProject> projects)
All data loaded.
|
void |
deleteProject(TimerProject project)
Delete project.
|
void |
deleteTask(TimerTask task)
Delete task.
|
Object |
getChild(Object parent,
int index) |
int |
getChildCount(Object parent) |
int |
getColumnCount() |
String |
getColumnName(int column) |
protected List<TimerTask> |
getFiteredSubListFor(Object parent)
Recupere la sous liste: data.getProjectsList() si parent = root
getSubTasks() sinon (cache results).
|
protected List<TimerTask> |
getFiteredSubListFor(Object parent,
boolean noCache)
Recupere la sous liste: data.getProjectsList() si parent = root
getSubTasks() sinon.
|
int |
getIndexOfChild(Object parent,
Object child) |
Object |
getValueAt(Object object,
int column) |
boolean |
isCellEditable(Object object,
int column) |
boolean |
isLeaf(Object node) |
void |
modifyProject(TimerProject project)
Modify project.
|
void |
modifyTask(TimerTask task)
Modify task.
|
void |
moveTask(TimerTask task)
Post move task.
|
protected void |
notifyTaskChanged(TimerTask task,
int operation)
Notification de changement de donnees.
|
void |
postMergeTasks(TimerTask destinationTask,
List<TimerTask> otherTasks)
Post merge task.
|
void |
preMergeTasks(TimerTask destinationTask,
List<TimerTask> otherTasks)
Pre merge task.
|
void |
preMoveTask(TimerTask task)
Pre move task.
|
void |
setAnnotation(TimerTask task,
Date date,
String annotation)
Add annotation.
|
void |
setShowClosed(boolean showClosedTask)
Change closed task property.
|
void |
setTaskTime(TimerTask task,
Date date,
Long time)
Set task time.
|
void |
startTask(TimerTask task)
Start task.
|
void |
stopTask(TimerTask task)
Stop task.
|
protected boolean |
updateChildren(TimerTask task,
TreePath path,
int operation)
Recursively try to update node.
|
public static final int OPERATION_ADD
public static final int OPERATION_MODIFY
public static final int OPERATION_DELETE
protected ProjectsAndTasksTable projectsAndTaskTable
protected TimerDataManager dataManager
protected boolean showClosedTask
public ProjectsAndTasksModel(ProjectsAndTasksTable projectsAndTaskTable, TimerCore core, List<String> columnIdentifiers)
projectsAndTaskTable
- tablecore
- timer corecolumnIdentifiers
- column identifierspublic int getColumnCount()
getColumnCount
in interface org.jdesktop.swingx.treetable.TreeTableModel
public String getColumnName(int column)
getColumnName
in interface org.jdesktop.swingx.treetable.TreeTableModel
getColumnName
in class org.jdesktop.swingx.treetable.AbstractTreeTableModel
public Object getValueAt(Object object, int column)
getValueAt
in interface org.jdesktop.swingx.treetable.TreeTableModel
public boolean isCellEditable(Object object, int column)
isCellEditable
in interface org.jdesktop.swingx.treetable.TreeTableModel
isCellEditable
in class org.jdesktop.swingx.treetable.AbstractTreeTableModel
public int getChildCount(Object parent)
getChildCount
in interface TreeModel
protected List<TimerTask> getFiteredSubListFor(Object parent)
parent
- parent to task sublistprotected List<TimerTask> getFiteredSubListFor(Object parent, boolean noCache)
parent
- parent to task sublistnoCache
- disable use of cached result and result cachingpublic int getIndexOfChild(Object parent, Object child)
getIndexOfChild
in interface TreeModel
public boolean isLeaf(Object node)
protected void notifyTaskChanged(TimerTask task, int operation)
task
- task to updateoperation
- operationprotected boolean updateChildren(TimerTask task, TreePath path, int operation)
task
- the task to updatepath
- current pathoperation
- operation (add, modify, delete)public void addProject(TimerProject project)
DataEventListener
addProject
in interface DataEventListener
project
- project to addpublic void addTask(TimerTask task)
DataEventListener
addTask
in interface DataEventListener
task
- task to addpublic void dataLoaded(Collection<TimerProject> projects)
DataEventListener
dataLoaded
in interface DataEventListener
projects
- projects collectionpublic void deleteProject(TimerProject project)
DataEventListener
deleteProject
in interface DataEventListener
project
- deleted projectpublic void deleteTask(TimerTask task)
DataEventListener
deleteTask
in interface DataEventListener
task
- deleted taskpublic void modifyProject(TimerProject project)
DataEventListener
modifyProject
in interface DataEventListener
project
- modified projectpublic void modifyTask(TimerTask task)
DataEventListener
modifyTask
in interface DataEventListener
task
- modified taskpublic void setAnnotation(TimerTask task, Date date, String annotation)
DataEventListener
setAnnotation
in interface DataEventListener
task
- task where annotation is changeddate
- dateannotation
- new annotation valuepublic void setTaskTime(TimerTask task, Date date, Long time)
DataEventListener
setTaskTime
in interface DataEventListener
task
- task where time is changeddate
- datetime
- task timepublic void changeClosedState(TimerTask task)
DataEventListener
changeClosedState
in interface DataEventListener
task
- taskpublic void startTask(TimerTask task)
DataEventListener
startTask
in interface DataEventListener
task
- started taskpublic void stopTask(TimerTask task)
DataEventListener
stopTask
in interface DataEventListener
task
- stoped taskpublic void setShowClosed(boolean showClosedTask)
showClosedTask
- closed task propertypublic void moveTask(TimerTask task)
DataEventListener
moveTask
in interface DataEventListener
task
- taskpublic void preMoveTask(TimerTask task)
DataEventListener
preMoveTask
in interface DataEventListener
task
- taskpublic void postMergeTasks(TimerTask destinationTask, List<TimerTask> otherTasks)
DataEventListener
postMergeTasks
in interface DataEventListener
destinationTask
- task where all other task will be mergedotherTasks
- other tasks to mergepublic void preMergeTasks(TimerTask destinationTask, List<TimerTask> otherTasks)
DataEventListener
preMergeTasks
in interface DataEventListener
destinationTask
- task where all other task will be mergedotherTasks
- other tasks to mergeCopyright © 2007–2013 CodeLutin. All rights reserved.