| 
 | org.openide.loaders 5.9.22 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.openide.loaders.DataObject
org.openide.loaders.MultiDataObject
org.openide.loaders.DataFolder
public class DataFolder
A folder containing data objects. Is actually itself a data object, whose primary (and only) file object is a file folder.
Has special support for determining the sorting of the folder, or even explicit ordering of the children.
| Nested Class Summary | |
|---|---|
|  class | DataFolder.FolderNodeNode for a folder. | 
| static class | DataFolder.IndexSupport for index cookie for folder nodes. | 
| static class | DataFolder.SortModeType-safe enumeration of sort modes for data folders. | 
| Nested classes/interfaces inherited from class org.openide.loaders.MultiDataObject | 
|---|
| MultiDataObject.Entry | 
| Nested classes/interfaces inherited from class org.openide.loaders.DataObject | 
|---|
| DataObject.Container, DataObject.Registry | 
| Field Summary | |
|---|---|
| static String | PROP_CHILDRENName of property that holds children of this node. | 
| static String | PROP_ORDERName of property for order of children. | 
| static String | PROP_SORT_MODEName of property which decides sorting mode. | 
| static String | SET_SORTINGName of set with sorting options. | 
| Fields inherited from class org.openide.loaders.DataObject | 
|---|
| PROP_COOKIE, PROP_FILES, PROP_HELP, PROP_MODIFIED, PROP_NAME, PROP_PRIMARY_FILE, PROP_TEMPLATE, PROP_VALID | 
| Constructor Summary | |
|---|---|
|   | DataFolder(FileObject fo)Deprecated. This method should not be used in client code. If you are searching for a DataFolderfor
 a FileObject usefindFolder(org.openide.filesystems.FileObject)factory method. | 
| protected  | DataFolder(FileObject fo,
           DataLoader loader)Deprecated. Since 1.13 do not use this constructor, it is for backward compatibility only. | 
| protected  | DataFolder(FileObject fo,
           MultiFileLoader loader)Create a data folder from a folder file object. | 
| Method Summary | |
|---|---|
|  Enumeration | children()Get enumeration of children of this folder. | 
|  Enumeration | children(boolean rec)Enumerate all children of this folder. | 
| static DataFolder | create(DataFolder folder,
       String name)Helper method to find or create a folder of a given path. | 
|  Children | createNodeChildren(DataFilter filter)Support method to obtain a children object that can be added to any Node. | 
| protected  Node | createNodeDelegate()Create node representative for this folder. | 
| static DataObject.Container | findContainer(FileObject fo)Finds a DataObject.Container representing given folder. | 
| static DataFolder | findFolder(FileObject fo)Create a folder for a specified file object. | 
|  DataObject[] | getChildren()Get the children of this folder. | 
|  HelpCtx | getHelpCtx()Get help context for this object. | 
|  String | getName()Get the name of the data folder. | 
|  DataFolder.SortMode | getSortMode()Get the sort mode of the folder. | 
| protected  DataObject | handleCopy(DataFolder f)Copies primary and secondary files to new folder. | 
| protected  DataObject | handleCreateFromTemplate(DataFolder f,
                         String name)Create a new data object from template (implemented in subclasses). | 
| protected  DataShadow | handleCreateShadow(DataFolder f)Creates shadow for this object in specified folder (overridable in subclasses). | 
| protected  void | handleDelete()Delete this object (implemented by subclasses). | 
| protected  FileObject | handleMove(DataFolder df)Moves primary and secondary files to a new folder. | 
| protected  FileObject | handleRename(String name)Rename this object (implemented in subclasses). | 
|  boolean | isCopyAllowed()Test whether the object may be copied. | 
|  boolean | isDeleteAllowed()Test whether the object may be deleted. | 
|  boolean | isMoveAllowed()Test whether the object may be moved. | 
|  boolean | isRenameAllowed()Test whether the object may be renamed. | 
|  void | setOrder(DataObject[] arr)Set the order of the children. | 
|  void | setSortMode(DataFolder.SortMode mode)Set the sort mode for the folder. | 
| Methods inherited from class org.openide.loaders.MultiDataObject | 
|---|
| addSecondaryEntry, files, findSecondaryEntry, getCookie, getCookieSet, getMultiFileLoader, getPrimaryEntry, registerEntry, removeSecondaryEntry, secondaryEntries, setCookieSet, takePrimaryFileLock | 
| Methods inherited from class org.openide.loaders.DataObject | 
|---|
| addPropertyChangeListener, addVetoableChangeListener, copy, createFromTemplate, createFromTemplate, createShadow, delete, dispose, find, firePropertyChange, fireVetoableChange, getCookie, getFolder, getLoader, getNodeDelegate, getPrimaryFile, getRegistry, isModified, isShadowAllowed, isTemplate, isValid, markFiles, move, removePropertyChangeListener, removeVetoableChangeListener, rename, setModified, setTemplate, setValid, toString, writeReplace | 
| Methods inherited from class java.lang.Object | 
|---|
| clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait | 
| Methods inherited from interface org.openide.loaders.DataObject.Container | 
|---|
| addPropertyChangeListener, removePropertyChangeListener | 
| Field Detail | 
|---|
public static final String PROP_CHILDREN
public static final String PROP_SORT_MODE
public static final String PROP_ORDER
public static final String SET_SORTING
| Constructor Detail | 
|---|
public DataFolder(FileObject fo) throws DataObjectExistsException, IllegalArgumentException
DataFolder for
 a FileObject use findFolder(org.openide.filesystems.FileObject) factory method.
fo - file folder to work on
DataObjectExistsException - if there is one already
IllegalArgumentException - if fo is not folderprotected DataFolder(FileObject fo, MultiFileLoader loader) throws DataObjectExistsException, IllegalArgumentException
fo - file folder to work onloader - data loader for this data object
DataObjectExistsException - if there is one already
IllegalArgumentException - if fo is not folderprotected DataFolder(FileObject fo, DataLoader loader) throws DataObjectExistsException, IllegalArgumentException
fo - file folder to work onloader - data loader for this data object
DataObjectExistsException - if there is one already
IllegalArgumentException - if fo is not folder| Method Detail | 
|---|
public static DataFolder create(DataFolder folder, String name) throws IOException
folder - the folder to start inname - a subfolder path (e.g. com/mycom/testfolder)
IOException - if the I/O failspublic final void setSortMode(DataFolder.SortMode mode) throws IOException
mode - an constant from DataFolder.SortMode
IOException - if the mode cannot be setpublic final DataFolder.SortMode getSortMode()
public final void setOrder(DataObject[] arr) throws IOException
getChildren(). If there are any other children, they
 will be appended to the array.
arr - array of data objects (children of this
   folder) to define the order; or null if any particular ordering should
   be cancelled
IOException - if the order cannot be setpublic String getName()
This implementation uses the name and extension of the primary file.
getName in class DataObjectpublic DataObject[] getChildren()
getChildren in interface DataObject.Containerpublic Enumeration children()
DataObjectspublic Enumeration children(boolean rec)
rec - whether to enumerate recursively
DataObjectprotected Node createNodeDelegate()
createNodeDelegate in class MultiDataObjectDataNodepublic Children createNodeChildren(DataFilter filter)
Node. The provided filter can be
 used to exclude some objects from the list.
 Overriding this method is deprecated!
filter - filter of data objects
public boolean isDeleteAllowed()
DataObject
isDeleteAllowed in class MultiDataObjecttrue if it maypublic boolean isCopyAllowed()
DataObject
isCopyAllowed in class MultiDataObjecttrue if it maypublic boolean isMoveAllowed()
DataObject
isMoveAllowed in class MultiDataObjecttrue if it maypublic boolean isRenameAllowed()
DataObject
isRenameAllowed in class MultiDataObjecttrue if it maypublic HelpCtx getHelpCtx()
DataObject
getHelpCtx in interface HelpCtx.ProvidergetHelpCtx in class MultiDataObjectpublic static DataFolder findFolder(FileObject fo)
fo - file object
IllegalArgumentException - if the file object is not folderpublic static DataObject.Container findContainer(FileObject fo)
fo - file object (must be folder)
IllegalArgumentException - if the file object is not folderprotected DataObject handleCopy(DataFolder f) throws IOException
MultiDataObject
handleCopy in class MultiDataObjectf - the new folder
IOException - if there was a problem copying
protected void handleDelete()
                     throws IOException
DataObject
handleDelete in class MultiDataObjectIOException - if an error occuresprotected FileObject handleRename(String name) throws IOException
DataObject
handleRename in class MultiDataObjectname - name to rename the object to
IOException - if an error occuresprotected FileObject handleMove(DataFolder df) throws IOException
MultiDataObject
handleMove in class MultiDataObjectdf - the new folder
IOException - if there was a problem movingprotected DataObject handleCreateFromTemplate(DataFolder f, String name) throws IOException
DataObject
handleCreateFromTemplate in class MultiDataObjectf - data folder to create object inname - name to give to the new object (or null
    if the name should be chosen according to the template)
IOException - if an error occuredprotected DataShadow handleCreateShadow(DataFolder f) throws IOException
The default implementation creates a reference data shadow and pastes it into the specified folder.
handleCreateShadow in class DataObjectf - the folder to create a shortcut in
IOException| 
 | org.openide.loaders 5.9.22 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||