|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.borland.primetime.node.Node | +--com.borland.primetime.node.UrlNode | +--com.borland.primetime.node.FileNode
FileNode instances represent nodes within a project that are associated with storage outside the project file. Each FileNode has a single associated Url that represents storage available to the node, and no two FileNode instances in the same project may be associated with the same Url.
LightweightNode
Fields inherited from class com.borland.primetime.node.Node |
EMPTY_ARRAY,
nodeListeners |
Constructor Summary | |
FileNode(Project project,
Node parent,
Url url)
All FileNode subtypes must expose this constructor signature. |
Method Summary | |
void |
check()
Performs any periodic task required to keep the node's state up to date. |
Buffer |
findBuffer()
|
static java.lang.Class |
findFileNodeClass(java.lang.String extension,
boolean includeBackups)
Searches the node class registry to attempt to match a file extension with a node type. |
static java.lang.Class |
findFileNodeClass(Url url)
Searches the node class registry to attempt to match a file extension with a node type assuming that backup files should be matched to the original file's node type. |
static java.lang.Class |
findFileNodeClass(Url url,
boolean includeBackups)
Searches the node class registry to attempt to match a file extension with a node type. |
Buffer |
getBuffer()
Provide lazy buffer loading by requesting a Buffer instance using the VFS the first time it is required and then caching the result. |
javax.swing.Icon |
getDisplayIcon()
Provides an image to be used for graphical representation of the node. |
java.lang.String |
getDisplayName()
Uses the the FileNode's underlying Url to derive a display name. |
int |
getDisplaySequence()
Describes the logical group the node belongs to for ordering purposes. |
java.io.InputStream |
getInputStream()
Create an input stream to read from the underlying Url. |
java.lang.String |
getLongDisplayName()
Use the Url's file component for display purposes except for the NewFilesystem where the full path is meaningless. |
java.io.OutputStream |
getOutputStream()
Create an output stream to write to the underlying Url. |
long |
getTimestamp()
|
Url |
getUrl()
Returns the node's associated Url. |
boolean |
isModified()
Describes the modified state of the node's underlying storage. |
boolean |
isNew()
BWS- |
boolean |
isPersistant()
Determines whether or not the node definition and its properties will be saved with in a project file. |
boolean |
isReadOnly()
|
static void |
registerFileNodeClass(java.lang.String extension,
java.lang.String description,
java.lang.Class nodeClass,
javax.swing.Icon icon)
Add a new node type to the registry of known types and their assocaited extensions. |
void |
rename(Url url)
rename cannot change the type of a FileNode. |
void |
revert()
|
void |
save()
|
void |
saveAs(Url url)
saveAs cannot change the type of a FileNode. |
protected void |
setUrl(Url url)
Changes the node's associated Url. |
Methods inherited from class com.borland.primetime.node.UrlNode |
getSuggestedUrl |
Methods inherited from class com.borland.primetime.node.Node |
addNodeListener,
compareTo,
dumpNodes,
dumpNodes,
dumpNodes,
equals,
fireNodeRenamed,
getChildren,
getDisplayChildren,
getNodeID,
getParent,
getProject,
getProperties,
getProperty,
getProperty,
getProperty,
hasChildren,
hasDisplayChildren,
hashCode,
removeNodeListener,
setParent,
setProperty,
setProperty,
setProperty,
toString |
Methods inherited from class java.lang.Object |
clone,
finalize,
getClass,
notify,
notifyAll,
wait,
wait,
wait |
Constructor Detail |
public FileNode(Project project, Node parent, Url url) throws DuplicateNodeException
project
- The project that the newly created node belongs to. This
value must not be null.parent
- The immediate parent of this node. If this value is not
null the parent node must belong to the same project.url
- The storage available to this node.Method Detail |
public Url getUrl()
protected void setUrl(Url url) throws DuplicateNodeException
rename
or saveAs
instead.url
- The new Url to associate with this FileNode.public static void registerFileNodeClass(java.lang.String extension, java.lang.String description, java.lang.Class nodeClass, javax.swing.Icon icon)
type
- The extension that this registration is associated with.
Extensions are case-insensitive and do not include the leading period
character.description
- A user-viewable description of the file type.bufferClass
- A subclass of Node that NodeSystem should instantiate
to represent files with the appropriate extension.public static java.lang.Class findFileNodeClass(Url url)
url
- The Url for which a suitable Node subclass should be found.public static java.lang.Class findFileNodeClass(Url url, boolean includeBackups)
url
- The Url for which a suitable Node subclass should be found.includeBackups
- True if VFS backup files should be matched to the
original file's node type.public static java.lang.Class findFileNodeClass(java.lang.String extension, boolean includeBackups)
extension
- The extension for which a suitable Node subclass should
be found.includeBackups
- True if VFS backup files should be matched to the
original file's node type.public Buffer getBuffer() throws java.io.IOException
public Buffer findBuffer()
public long getTimestamp()
public java.io.InputStream getInputStream() throws java.io.IOException
public java.io.OutputStream getOutputStream() throws java.io.IOException, VFSException
To modify the state of the in-memory buffer without immediately saving the results to disk use getBuffer().getOutputStream() instead.
public boolean isReadOnly()
public boolean isNew()
public boolean isModified()
public void revert() throws java.io.IOException
public void rename(Url url) throws java.io.IOException, InvalidUrlException, DuplicateNodeException, ReadOnlyException
public void saveAs(Url url) throws java.io.IOException, InvalidUrlException, DuplicateNodeException
public void save() throws java.io.IOException, InvalidUrlException
public boolean isPersistant()
public javax.swing.Icon getDisplayIcon()
public java.lang.String getDisplayName()
public java.lang.String getLongDisplayName()
public int getDisplaySequence()
public void check()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |