org.openide.loaders
Class FileEntry.Format

java.lang.Object
  |
  +--org.openide.loaders.MultiDataObject.Entry
        |
        +--org.openide.loaders.FileEntry
              |
              +--org.openide.loaders.FileEntry.Format
All Implemented Interfaces:
Serializable
Enclosing class:
FileEntry

public abstract static class FileEntry.Format
extends FileEntry

Specialized entry that simplifies substitution when a file entry is created from template. Subclasses must implement createFormat(org.openide.filesystems.FileObject, java.lang.String, java.lang.String) and return a valid text format that will be used for converting the lines of the original file to lines in the newly created one.

See Also:
Serialized Form

Inner classes inherited from class org.openide.loaders.FileEntry
FileEntry.Folder, FileEntry.Format, FileEntry.Numb
 
Constructor Summary
FileEntry.Format(MultiDataObject obj, FileObject fo)
          Create a new entry initially attached to a given file object.
 
Method Summary
protected abstract  Format createFormat(FileObject target, String n, String e)
          Provide a suitable format for substitution of lines.
 FileObject createFromTemplate(FileObject f, String name)
          Called when the entry is to be created from a template.
 
Methods inherited from class org.openide.loaders.FileEntry
copy, delete, move, rename
 
Methods inherited from class org.openide.loaders.MultiDataObject.Entry
equals, getDataObject, getFile, hashCode, isImportant, isLocked, takeLock, writeReplace
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FileEntry.Format

public FileEntry.Format(MultiDataObject obj,
                        FileObject fo)
Create a new entry initially attached to a given file object.
Parameters:
obj - the data object this entry belongs to
fo - the file object for the entry
Method Detail

createFromTemplate

public FileObject createFromTemplate(FileObject f,
                                     String name)
                              throws IOException
Description copied from class: MultiDataObject.Entry
Called when the entry is to be created from a template. Depending on the entry type, it should either copy the underlying FileObject, or do nothing (if it cannot be copied).
Overrides:
createFromTemplate in class FileEntry
Following copied from class: org.openide.loaders.MultiDataObject.Entry
Parameters:
f - the folder to create this entry in
name - the new name to use
Returns:
the copied FileObject or null if it cannot be copied
Throws:
IOException - when the operation fails

createFormat

protected abstract Format createFormat(FileObject target,
                                       String n,
                                       String e)
Provide a suitable format for substitution of lines.
Parameters:
target - the target folder of the installation
n - the name the file will have
e - the extension the file will have
Returns:
a format to use for formatting lines


Built on December 12 2001.  |  Portions Copyright 1997-2001 Sun Microsystems, Inc. All rights reserved.