org.openide.loaders 5.9.22

Class FileEntry.Format

  extended by org.openide.loaders.MultiDataObject.Entry
      extended by org.openide.loaders.FileEntry
          extended by org.openide.loaders.FileEntry.Format
All Implemented Interfaces:
Enclosing class:

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

Nested Class Summary
Nested classes/interfaces 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


public FileEntry.Format(MultiDataObject obj,
                        FileObject fo)
Create a new entry initially attached to a given file object.

obj - the data object this entry belongs to
fo - the file object for the entry
Method Detail


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).

createFromTemplate in class FileEntry
f - the folder to create this entry in
name - the new name to use
the copied FileObject or null if it cannot be copied
IOException - when the operation fails


protected abstract Format createFormat(FileObject target,
                                       String n,
                                       String e)
Provide a suitable format for substitution of lines.

target - the target folder of the installation
n - the name the file will have
e - the extension the file will have
a format to use for formatting lines

org.openide.loaders 5.9.22

Built on July 11 2007.  |  Portions Copyright 1997-2005 Sun Microsystems, Inc. All rights reserved.