站内搜索: 请输入搜索关键词
当前页面: 在线文档首页 > NetBeans API Javadoc 5.0.0

FileEntry.Format (NetBeans Loaders API) - NetBeans API Javadoc 5.0.0

 

org.openide.loaders
Class FileEntry.Format

java.lang.Object
  extended byorg.openide.loaders.MultiDataObject.Entry
      extended byorg.openide.loaders.FileEntry
          extended byorg.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

Nested Class Summary
 
Nested 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
Throws:
IOException

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 May 3 2007.  |  Portions Copyright 1997-2005 Sun Microsystems, Inc. All rights reserved.