org.eclipse.mylar.internal.tasks.ui.util
Class TaskListSaveManager

java.lang.Object
  extended by org.eclipse.mylar.internal.tasks.ui.util.TaskListSaveManager
All Implemented Interfaces:
IBackgroundSaveListener, ITaskListChangeListener

public class TaskListSaveManager
extends java.lang.Object
implements ITaskListChangeListener, IBackgroundSaveListener

Author:
Mik Kersten

Field Summary
private static int DEFAULT_SAVE_INTERVAL
           
private  boolean forceBackgroundSave
          Fort testing.
private  boolean initializationWarningDialogShow
           
private  BackgroundSaveTimer saveTimer
           
 
Constructor Summary
TaskListSaveManager()
           
 
Method Summary
 void containerAdded(AbstractTaskContainer container)
           
 void containerDeleted(AbstractTaskContainer container)
           
 void containerInfoChanged(AbstractTaskContainer container)
           
private  boolean copy(java.io.File src, java.io.File dst)
           
 void copyDataDirContentsTo(java.lang.String targetFolderPath)
          Copies all files in the current data directory to the specified folder.
 BackgroundSaveTimer getSaveTimer()
          For testing only *
 void localInfoChanged(ITask task)
           
 void repositoryInfoChanged(ITask task)
           
 void saveRequested()
          Called periodically by the save timer
 void saveTaskList(boolean saveContext)
           
 void setForceBackgroundSave(boolean on)
          For testing.
 void synchronizationCompleted()
           
 void taskActivated(ITask task)
           
 void taskAdded(ITask task)
           
 void taskDeactivated(ITask task)
           
 void taskDeleted(ITask task)
           
 void tasklistRead()
           
 void taskMoved(ITask task, AbstractTaskContainer fromContainer, AbstractTaskContainer toContainer)
           
 void tasksActivated(java.util.List<ITask> tasks)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_SAVE_INTERVAL

private static final int DEFAULT_SAVE_INTERVAL
See Also:
Constant Field Values

saveTimer

private BackgroundSaveTimer saveTimer

initializationWarningDialogShow

private boolean initializationWarningDialogShow

forceBackgroundSave

private boolean forceBackgroundSave
Fort testing.

Constructor Detail

TaskListSaveManager

public TaskListSaveManager()
Method Detail

saveRequested

public void saveRequested()
Called periodically by the save timer

Specified by:
saveRequested in interface IBackgroundSaveListener

saveTaskList

public void saveTaskList(boolean saveContext)

copyDataDirContentsTo

public void copyDataDirContentsTo(java.lang.String targetFolderPath)
Copies all files in the current data directory to the specified folder. Will overwrite.


copy

private boolean copy(java.io.File src,
                     java.io.File dst)

taskActivated

public void taskActivated(ITask task)

tasksActivated

public void tasksActivated(java.util.List<ITask> tasks)

taskDeactivated

public void taskDeactivated(ITask task)

localInfoChanged

public void localInfoChanged(ITask task)
Specified by:
localInfoChanged in interface ITaskListChangeListener

repositoryInfoChanged

public void repositoryInfoChanged(ITask task)
Specified by:
repositoryInfoChanged in interface ITaskListChangeListener

tasklistRead

public void tasklistRead()

setForceBackgroundSave

public void setForceBackgroundSave(boolean on)
For testing.


taskMoved

public void taskMoved(ITask task,
                      AbstractTaskContainer fromContainer,
                      AbstractTaskContainer toContainer)
Specified by:
taskMoved in interface ITaskListChangeListener
fromContainer - can be null
toContainer - can be null

taskDeleted

public void taskDeleted(ITask task)
Specified by:
taskDeleted in interface ITaskListChangeListener

containerAdded

public void containerAdded(AbstractTaskContainer container)
Specified by:
containerAdded in interface ITaskListChangeListener

containerDeleted

public void containerDeleted(AbstractTaskContainer container)
Specified by:
containerDeleted in interface ITaskListChangeListener

taskAdded

public void taskAdded(ITask task)
Specified by:
taskAdded in interface ITaskListChangeListener

getSaveTimer

public BackgroundSaveTimer getSaveTimer()
For testing only *


containerInfoChanged

public void containerInfoChanged(AbstractTaskContainer container)
Specified by:
containerInfoChanged in interface ITaskListChangeListener

synchronizationCompleted

public void synchronizationCompleted()