projectviewer.persist
Class ProjectPersistenceManager

java.lang.Object
  extended by projectviewer.persist.ProjectPersistenceManager

public final class ProjectPersistenceManager
extends java.lang.Object

This class takes care of each projects properties. Each project has its own config file, that is loaded when the project is activated.

Author:
Marcelo Vanzin

Nested Class Summary
static class ProjectPersistenceManager.ProjectHandler
          Handler to read project configuration files.
 
Method Summary
static java.lang.Runnable createSaveTask(VPTProject p, java.lang.String filename)
          Creates a runnable task that will save the project's data to the given config file.
static VPTProject load(VPTProject p, java.lang.String file)
          Loads a project from the given file name.
static void registerHandler(NodeHandler nh)
          Registers a node handler.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

registerHandler

public static void registerHandler(NodeHandler nh)
Registers a node handler. The same instance will be used at all times to process the data, so make sure this is not a problem with the handler's implementation.


load

public static VPTProject load(VPTProject p,
                              java.lang.String file)
Loads a project from the given file name.


createSaveTask

public static java.lang.Runnable createSaveTask(VPTProject p,
                                                java.lang.String filename)
Creates a runnable task that will save the project's data to the given config file.

Parameters:
p - The project to save.
filename - The project config file name.
Returns:
A runnable that can be used to execute the task.
Since:
PV 3.0.0