|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.openide.loaders.DataObject org.openide.loaders.MultiDataObject org.openide.loaders.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.FolderNode
Node for a folder. |
static class |
DataFolder.Index
Support for index cookie for folder nodes. |
static class |
DataFolder.SortMode
Type-safe enumeration of sort modes for data folders. |
Nested classes inherited from class org.openide.loaders.MultiDataObject |
MultiDataObject.Entry |
Nested classes inherited from class org.openide.loaders.DataObject |
DataObject.Container, DataObject.Registry |
Field Summary | |
static String |
PROP_CHILDREN
Name of property that holds children of this node. |
static String |
PROP_ORDER
Name of property for order of children. |
static String |
PROP_SORT_MODE
Name of property which decides sorting mode. |
static String |
SET_SORTING
Name 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 DataFolder for
a FileObject use findFolder(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 folderMethod 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 DataObject
public DataObject[] getChildren()
getChildren
in interface DataObject.Container
public Enumeration children()
DataObject
spublic Enumeration children(boolean rec)
rec
- whether to enumerate recursively
DataObject
protected Node createNodeDelegate()
createNodeDelegate
in class MultiDataObject
DataNode
public 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 MultiDataObject
public boolean isCopyAllowed()
DataObject
isCopyAllowed
in class MultiDataObject
public boolean isMoveAllowed()
DataObject
isMoveAllowed
in class MultiDataObject
public boolean isRenameAllowed()
DataObject
isRenameAllowed
in class MultiDataObject
public HelpCtx getHelpCtx()
DataObject
getHelpCtx
in interface HelpCtx.Provider
getHelpCtx
in class MultiDataObject
public 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 MultiDataObject
f
- the new folder
IOException
- if there was a problem copyingprotected void handleDelete() throws IOException
DataObject
handleDelete
in class MultiDataObject
IOException
protected FileObject handleRename(String name) throws IOException
DataObject
handleRename
in class MultiDataObject
IOException
protected FileObject handleMove(DataFolder df) throws IOException
MultiDataObject
handleMove
in class MultiDataObject
df
- the new folder
IOException
- if there was a problem movingprotected DataObject handleCreateFromTemplate(DataFolder f, String name) throws IOException
DataObject
handleCreateFromTemplate
in class MultiDataObject
IOException
protected DataShadow handleCreateShadow(DataFolder f) throws IOException
The default implementation creates a reference data shadow and pastes it into the specified folder.
handleCreateShadow
in class DataObject
f
- the folder to create a shortcut in
IOException
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |