|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.openide.loaders.DataObject | +--org.openide.loaders.DataShadow
Default implementation of a shortcut to another data object.
Inner Class Summary | |
protected static class |
DataShadow.ShadowNode
Node for a shadow object. |
Inner classes inherited from class org.openide.loaders.DataObject |
DataObject.Registry |
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 | |
protected |
DataShadow(FileObject fo,
DataObject original,
DataLoader loader)
Constructs new data shadow for given primary file and referenced original. |
Method Summary | |
static DataShadow |
create(DataFolder folder,
DataObject original)
Method that creates new data shadow in a folder. |
static DataShadow |
create(DataFolder folder,
String name,
DataObject original)
Method that creates new data shadow in a folder. |
static DataShadow |
create(DataFolder folder,
String name,
DataObject original,
String ext)
Method that creates new data shadow in a folder. |
protected Node |
createNodeDelegate()
Provides node that should represent this data object. |
protected static DataObject |
deserialize(FileObject fileObject)
Loads proper dataShadow from the file fileObject. |
Node.Cookie |
getCookie(Class c)
Obtain a cookie from the data object. |
HelpCtx |
getHelpCtx()
Get help context for this object. |
DataObject |
getOriginal()
Return the original shadowed object. |
protected DataObject |
handleCopy(DataFolder f)
Copy this object to a folder (implemented by subclasses). |
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 f)
Move this object to another folder (implemented in subclasses). |
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 |
refresh()
|
Methods inherited from class org.openide.loaders.DataObject |
addPropertyChangeListener, addVetoableChangeListener, copy, createFromTemplate, createFromTemplate, createShadow, delete, dispose, files, find, firePropertyChange, fireVetoableChange, getFolder, getLoader, getName, getNodeDelegate, getPrimaryFile, getRegistry, isModified, isShadowAllowed, isTemplate, isValid, markFiles, move, removePropertyChangeListener, removeVetoableChangeListener, rename, setModified, setTemplate, setValid, takePrimaryFileLock, toString, writeReplace |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
protected DataShadow(FileObject fo, DataObject original, DataLoader loader) throws DataObjectExistsException
fo
- the primary fileoriginal
- original data objectloader
- the loader that created the objectMethod Detail |
public static DataShadow create(DataFolder folder, DataObject original) throws IOException
folder
- target folder to create data inoriginal
- orignal object that should be represented by the shadowpublic static DataShadow create(DataFolder folder, String name, DataObject original) throws IOException
folder
- target folder to create data inname
- name to give to the shadoworiginal
- object that should be represented by the shadowpublic static DataShadow create(DataFolder folder, String name, DataObject original, String ext) throws IOException
FileSystem.runAtomicAction(org.openide.filesystems.FileSystem.AtomicAction)
.folder
- target folder to create data inname
- name to give to the shadoworiginal
- orignal object that should be represented by the shadowprotected static DataObject deserialize(FileObject fileObject) throws IOException
FileObject
- fileObject
The file to deserialize shadow from.DataLoader
- loader
DataObject
referenced by the shadowIOException
- error during loadpublic DataObject getOriginal()
protected Node createNodeDelegate()
DataObject
The default implementation creates an instance of DataNode
.
This method is called only once per data object.
createNodeDelegate
in class DataObject
org.openide.loaders.DataObject
public boolean isDeleteAllowed()
DataObject
isDeleteAllowed
in class DataObject
org.openide.loaders.DataObject
true
if it maypublic boolean isCopyAllowed()
DataObject
isCopyAllowed
in class DataObject
org.openide.loaders.DataObject
true
if it maypublic boolean isMoveAllowed()
DataObject
isMoveAllowed
in class DataObject
org.openide.loaders.DataObject
true
if it maypublic boolean isRenameAllowed()
DataObject
isRenameAllowed
in class DataObject
org.openide.loaders.DataObject
true
if it maypublic HelpCtx getHelpCtx()
DataObject
getHelpCtx
in class DataObject
org.openide.loaders.DataObject
protected DataObject handleCopy(DataFolder f) throws IOException
DataObject
handleCopy
in class DataObject
org.openide.loaders.DataObject
f
- target folderIOException
- if an error occuresprotected void handleDelete() throws IOException
DataObject
handleDelete
in class DataObject
org.openide.loaders.DataObject
IOException
- if an error occuresprotected FileObject handleRename(String name) throws IOException
DataObject
handleRename
in class DataObject
org.openide.loaders.DataObject
name
- name to rename the object toIOException
- if an error occuresprotected FileObject handleMove(DataFolder f) throws IOException
DataObject
handleMove
in class DataObject
org.openide.loaders.DataObject
df
- target data folderIOException
- if an error occuresprotected DataShadow handleCreateShadow(DataFolder f) throws IOException
DataObject
The default implementation creates a reference data shadow and pastes it into the specified folder.
handleCreateShadow
in class DataObject
org.openide.loaders.DataObject
f
- the folder to create a shortcut inprotected DataObject handleCreateFromTemplate(DataFolder f, String name) throws IOException
DataObject
handleCreateFromTemplate
in class DataObject
org.openide.loaders.DataObject
df
- 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 occuredpublic Node.Cookie getCookie(Class c)
DataObject
The default implementation tests if this object is of the requested class and if so, returns it.
getCookie
in class DataObject
org.openide.loaders.DataObject
c
- class of requested cookienull
if such cookies are not supportedpublic void refresh()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |