| java.lang.Object org.openide.loaders.DataObject org.openide.loaders.MultiDataObject
All known Subclasses: org.openide.loaders.XMLDataObject, org.openide.loaders.InstanceDataObject, org.openide.loaders.DefaultDataObject, org.openide.loaders.BrokenDataShadow, org.openide.loaders.FileEntry, org.openide.loaders.DataFolder, org.openide.loaders.DataShadow,
MultiDataObject | public class MultiDataObject extends DataObject (Code) | | Provides support for handling of data objects with multiple files.
One file is represented by one
Entry . Each handler
has one
MultiDataObject.getPrimaryEntry primary entry and zero or more secondary entries.
author: Ales Novak, Jaroslav Tulach, Ian Formanek |
Inner Class :final static class Pair | |
ERR | final static Logger ERR(Code) | | logging of operations in multidataobject
|
checked | boolean checked(Code) | | flag when to call checkFiles(this)
|
serialVersionUID | final static long serialVersionUID(Code) | | generated Serialized Version UID
|
addSecondaryEntry | final protected void addSecondaryEntry(Entry fe)(Code) | | Add a new secondary entry to the list.
Parameters: fe - the entry to add |
createNodeDelegate | protected Node createNodeDelegate()(Code) | | Provides node that should represent this data object.
the node representation See Also: DataNode |
findSecondaryEntry | final public Entry findSecondaryEntry(FileObject fo)(Code) | | For a given file, find the associated secondary entry.
Parameters: fo - file object the entry associated with the file object, or null if there is nosuch entry |
fireCookieChange | final void fireCookieChange()(Code) | | Fires cookie change.
|
getChangeListener | final ChangeAndBefore getChangeListener()(Code) | | |
getCookie | public T getCookie(Class<T> type)(Code) | | Look for a cookie in the current cookie set matching the requested class.
Parameters: type - the class to look for an instance of that class, or null if this class of cookieis not supported |
getCookieSet | final protected CookieSet getCookieSet()(Code) | | Get the set of cookies.
If the set had been
previously set by
MultiDataObject.setCookieSet , that set
is returned. Otherwise an empty set is
returned.
the cookie set (never null ) |
getMultiFileLoader | final public MultiFileLoader getMultiFileLoader()(Code) | | Getter for the multi file loader that created this
object.
the multi loader for the object |
getPrimaryEntry | final public Entry getPrimaryEntry()(Code) | | Get the primary entry.
the entry |
getSecondary | Map<FileObject, Entry> getSecondary()(Code) | | Lazy getter for secondary property
secondary object |
handleCopy | protected DataObject handleCopy(DataFolder df) throws IOException(Code) | | Copies primary and secondary files to new folder.
May ask for user confirmation before overwriting.
Parameters: df - the new folder data object for the new primary throws: IOException - if there was a problem copying throws: UserCancelException - if the user cancelled the copy |
handleMove | protected FileObject handleMove(DataFolder df) throws IOException(Code) | | Moves primary and secondary files to a new folder.
May ask for user confirmation before overwriting.
Parameters: df - the new folder the moved primary file object throws: IOException - if there was a problem moving throws: UserCancelException - if the user cancelled the move |
isCopyAllowed | public boolean isCopyAllowed()(Code) | | |
isDeleteAllowed | public boolean isDeleteAllowed()(Code) | | |
isMergingFolders | boolean isMergingFolders(FileObject who, FileObject targetFolder)(Code) | | Override to change default handling of name collisions detected during the
copy, move operations. Reasonable for MultiDataObjects having folder their
primary file (e.g. DataFolder, CompoundDataObject).
false means, that new folder name should be synthetized whenthe same folder already exists in the target location of copy, move operation, otherwiseexisting falder will be used. Default implementation returns false . |
isMoveAllowed | public boolean isMoveAllowed()(Code) | | |
isRenameAllowed | public boolean isRenameAllowed()(Code) | | |
markSecondaryEntriesRecognized | final void markSecondaryEntriesRecognized(DataLoader.RecognizedFiles recognized)(Code) | | All secondary entries are recognized. Called from multi file object.
Parameters: recognized - object to mark recognized file to |
notifyFileDataCreated | void notifyFileDataCreated(FileEvent fe)(Code) | | Fired when a file has been added to the same folder
Parameters: fe - the event describing context where action has taken place |
recognizedByFolder | final void recognizedByFolder()(Code) | | sets checked to true
|
registerEntry | final protected Entry registerEntry(FileObject fo)(Code) | | Tests whether this file is between entries and if not,
creates a secondary entry for it and adds it into set of
secondary entries.
This method should be used in constructor of MultiDataObject to
register all the important files, that could belong to this data object.
As example, our XMLDataObject, tries to locate its xmlinfo
file and then do register it
Parameters: fo - the file to register (can be null, then the action is ignored) the entry associated to this file object (returns primary entry if the fo is null) |
removeFile | final void removeFile(FileObject fo)(Code) | | Removes the entry from the set of secondary entries.
Called from the notifyFileDeleted
|
removeSecondaryEntry | final protected void removeSecondaryEntry(Entry fe)(Code) | | Remove a secondary entry from the list.
Parameters: fe - the entry to remove |
restoreEntries | final void restoreEntries(List<Pair> backup)(Code) | | Restore entries from the list. If Entry.getFile () has changed from
time when backup list was created, original file is restored and
Entry is re-assigned to it.
Parameters: backup - list obtained from MultiDataObject.saveEntries() function |
saveEntries | final List<Pair> saveEntries()(Code) | | Save pairs Entry <-> Entry.getFile () in the list
list of saved pairs |
secondaryEntries | final public Set<Entry> secondaryEntries()(Code) | | Get secondary entries.
immutable set of entries |
setCookieSet | final protected void setCookieSet(CookieSet s)(Code) | | Set the set of cookies.
To the provided cookie set a listener is attached,
and any change to the set is propagated by
firing a change on
MultiDataObject.PROP_COOKIE .
Parameters: s - the cookie set to use |
synchObjectSecondary | Object synchObjectSecondary()(Code) | | Provide object used for synchronization of methods working with
Secondaries.
The private field secondary . |
updateFilesInCookieSet | final void updateFilesInCookieSet()(Code) | | |
Methods inherited from org.openide.loaders.DataObject | public void addPropertyChangeListener(PropertyChangeListener l)(Code)(Java Doc) public void addVetoableChangeListener(VetoableChangeListener l)(Code)(Java Doc) final public DataObject copy(DataFolder f) throws IOException(Code)(Java Doc) final DataObject copyRename(DataFolder f, String name, String ext) throws IOException(Code)(Java Doc) final public DataObject createFromTemplate(DataFolder f) throws IOException(Code)(Java Doc) final public DataObject createFromTemplate(DataFolder f, String name) throws IOException(Code)(Java Doc) final public DataObject createFromTemplate(DataFolder f, String name, Map<String, ? extends Object> parameters) throws IOException(Code)(Java Doc) protected Node createNodeDelegate()(Code)(Java Doc) final public DataShadow createShadow(DataFolder f) throws IOException(Code)(Java Doc) final public void delete() throws IOException(Code)(Java Doc) protected void dispose()(Code)(Java Doc) public Set<FileObject> files()(Code)(Java Doc) public static DataObject find(FileObject fo) throws DataObjectNotFoundException(Code)(Java Doc) final protected void firePropertyChange(String name, Object oldValue, Object newValue)(Code)(Java Doc) final protected void fireVetoableChange(String name, Object oldValue, Object newValue) throws PropertyVetoException(Code)(Java Doc) Node getClonedNodeDelegate(DataFilter filter)(Code)(Java Doc) public T getCookie(Class<T> c)(Code)(Java Doc) protected T getCookie(DataShadow shadow, Class<T> clazz)(Code)(Java Doc) final public DataFolder getFolder()(Code)(Java Doc) abstract public HelpCtx getHelpCtx()(Code)(Java Doc) final public DataLoader getLoader()(Code)(Java Doc) public Lookup getLookup()(Code)(Java Doc) public String getName()(Code)(Java Doc) final public Node getNodeDelegate()(Code)(Java Doc) Node getNodeDelegateOrNull()(Code)(Java Doc) final public FileObject getPrimaryFile()(Code)(Java Doc) public static Registry getRegistry()(Code)(Java Doc) static String getString(String name)(Code)(Java Doc) abstract protected DataObject handleCopy(DataFolder f) throws IOException(Code)(Java Doc) protected DataObject handleCopyRename(DataFolder f, String name, String ext) throws IOException(Code)(Java Doc) abstract protected DataObject handleCreateFromTemplate(DataFolder df, String name) throws IOException(Code)(Java Doc) protected DataShadow handleCreateShadow(DataFolder f) throws IOException(Code)(Java Doc) abstract protected void handleDelete() throws IOException(Code)(Java Doc) abstract protected FileObject handleMove(DataFolder df) throws IOException(Code)(Java Doc) abstract protected FileObject handleRename(String name) throws IOException(Code)(Java Doc) abstract public boolean isCopyAllowed()(Code)(Java Doc) abstract public boolean isDeleteAllowed()(Code)(Java Doc) public boolean isModified()(Code)(Java Doc) abstract public boolean isMoveAllowed()(Code)(Java Doc) abstract public boolean isRenameAllowed()(Code)(Java Doc) public boolean isShadowAllowed()(Code)(Java Doc) final public boolean isTemplate()(Code)(Java Doc) final public boolean isValid()(Code)(Java Doc) final protected void markFiles() throws IOException(Code)(Java Doc) final void markInvalid0() throws PropertyVetoException(Code)(Java Doc) final public void move(DataFolder df) throws IOException(Code)(Java Doc) void notifyAttributeChanged(FileAttributeEvent fae)(Code)(Java Doc) void notifyFileChanged(FileEvent fe)(Code)(Java Doc) void notifyFileDataCreated(FileEvent fe)(Code)(Java Doc) void notifyFileDeleted(FileEvent fe)(Code)(Java Doc) void notifyFileRenamed(FileRenameEvent fe)(Code)(Java Doc) void recognizedByFolder()(Code)(Java Doc) public void removePropertyChangeListener(PropertyChangeListener l)(Code)(Java Doc) public void removeVetoableChangeListener(VetoableChangeListener l)(Code)(Java Doc) final public void rename(String name) throws IOException(Code)(Java Doc) public void setModified(boolean modif)(Code)(Java Doc) static boolean setTemplate(FileObject fo, boolean newTempl) throws IOException(Code)(Java Doc) final public void setTemplate(boolean newTempl) throws IOException(Code)(Java Doc) public void setValid(boolean valid) throws PropertyVetoException(Code)(Java Doc) Object synchObject()(Code)(Java Doc) protected FileLock takePrimaryFileLock() throws IOException(Code)(Java Doc) public String toString()(Code)(Java Doc) public Object writeReplace()(Code)(Java Doc)
|
|
|