|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.borland.primetime.node.ProjectStorage
Provides standard interface and support for implementations which know how to read/write each of the registered project types. There is one instance for each project which has been opened.
Field Summary | |
protected Project |
project
Project instance whose storage is being managed by this object. |
Constructor Summary | |
ProjectStorage(Project project)
ProjectStorage instances all have an associated project that they read / write. |
Method Summary | |
boolean |
canWriteProject()
Describes whether or not a ProjectStorage is capable of writing a project file. |
protected FileNode |
createParentedFileNode(Project project,
Node parent,
Url url)
Creates a FileNode for this project using the given parent. |
byte[] |
getBufferContent()
Returns current content of the project. |
static Url |
getDefaultProjectUrl()
Returns a reference to the default project to be used if need to create project. |
void |
initializeProject()
Initializes project by either reading it from a previously saved version if that exists, or else by reading the default project. |
protected abstract void |
readProject(java.io.InputStream inputStream,
Url rootUrl)
Hook for reading project. |
static void |
registerStorageClass(java.lang.String extension,
java.lang.String description,
java.lang.Class storageClass)
Add a new storage type to the registry of known types and their associated extensions. |
static void |
setDefaultProjectUrl(Url defaultProjectUrl)
Saves a reference to the default project to be used if need to create project. |
protected void |
writeProject(java.io.OutputStream outputStream,
Url rootUrl,
java.util.List nodes)
Hook for writing project. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected Project project
Constructor Detail |
public ProjectStorage(Project project)
project
- Project this object is to be associated with.Method Detail |
public static void setDefaultProjectUrl(Url defaultProjectUrl)
defaultProjectUrl
- Url of the default project.public static Url getDefaultProjectUrl()
protected FileNode createParentedFileNode(Project project, Node parent, Url url) throws DuplicateNodeException
project
- Project to contain node.parent
- Parent for node, may be null.url
- Url of file.DuplicateNodeException
- protected abstract void readProject(java.io.InputStream inputStream, Url rootUrl) throws java.lang.Exception
inputStream
- Content of a previously saved project.rootUrl
- Location of the project.java.lang.Exception
- public void initializeProject()
AssertionException
- if an error occurspublic boolean canWriteProject()
Describes whether or not a ProjectStorage is capable of writing a project file. This method is primarily intended for use by ProjectStorage subclasses that provide read-only access to a particular project file format.
The basic ProjectStorage implementation for this method returns false.
protected void writeProject(java.io.OutputStream outputStream, Url rootUrl, java.util.List nodes) throws java.io.IOException
outputStream
- Where to write.rootUrl
- Location of the project.nodes
- List of nodes that are members of the project.java.io.IOException
- ReadOnlyException
- public byte[] getBufferContent()
AssertionException
- if an error occurspublic static void registerStorageClass(java.lang.String extension, java.lang.String description, java.lang.Class storageClass)
extension
- The extension that this registration is associated with.
Extensions are case-insensitive and do not include the leading period
character.description
- Not used.storageClass
- A subclass of ProjectStorage that should be
instantiated to load and save projects with the matching extension.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |