Java Doc for MultiDataObject.java in  » IDE-Netbeans » openide » org » openide » loaders » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » IDE Netbeans » openide » org.openide.loaders 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


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
Inner Class :abstract public class Entry implements java.io.Serializable

Field Summary
final static  LoggerERR
    
 booleanchecked
    
final static  longserialVersionUID
    

Constructor Summary
public  MultiDataObject(FileObject fo, MultiFileLoader loader)
     Create a MultiFileObject.
 MultiDataObject(FileObject fo, DataLoader loader)
     This constructor is added for backward compatibility, MultiDataObject should be properly constructed using the MultiFileLoader.

Method Summary
final protected  voidaddSecondaryEntry(Entry fe)
     Add a new secondary entry to the list.
 voidcheckCookieSet(Class c)
    
protected  NodecreateNodeDelegate()
     Provides node that should represent this data object.
public  Set<FileObject>files()
    
final public  EntryfindSecondaryEntry(FileObject fo)
     For a given file, find the associated secondary entry.
final  voidfireCookieChange()
     Fires cookie change.
final  ChangeAndBeforegetChangeListener()
    
public  TgetCookie(Class<T> type)
     Look for a cookie in the current cookie set matching the requested class.
final protected  CookieSetgetCookieSet()
     Get the set of cookies. If the set had been previously set by MultiDataObject.setCookieSet , that set is returned.
public  HelpCtxgetHelpCtx()
    
final public  MultiFileLoadergetMultiFileLoader()
     Getter for the multi file loader that created this object.
final public  EntrygetPrimaryEntry()
     Get the primary entry.
 Map<FileObject, Entry>getSecondary()
    
protected  DataObjecthandleCopy(DataFolder df)
     Copies primary and secondary files to new folder.
protected  DataObjecthandleCopyRename(DataFolder df, String name, String ext)
    
protected  DataObjecthandleCreateFromTemplate(DataFolder df, String name)
    
protected  voidhandleDelete()
    
protected  FileObjecthandleMove(DataFolder df)
     Moves primary and secondary files to a new folder.
protected  FileObjecthandleRename(String name)
    
public  booleanisCopyAllowed()
    
public  booleanisDeleteAllowed()
    
 booleanisMergingFolders(FileObject who, FileObject targetFolder)
     Override to change default handling of name collisions detected during the copy, move operations.
public  booleanisMoveAllowed()
    
public  booleanisRenameAllowed()
    
final  voidmarkSecondaryEntriesRecognized(DataLoader.RecognizedFiles recognized)
     All secondary entries are recognized.
 voidnotifyFileDataCreated(FileEvent fe)
    
 voidnotifyFileDeleted(FileEvent fe)
    
final  voidrecognizedByFolder()
    
final protected  EntryregisterEntry(FileObject fo)
     Tests whether this file is between entries and if not, creates a secondary entry for it and adds it into set of secondary entries.
final  voidremoveFile(FileObject fo)
     Removes the entry from the set of secondary entries.
final protected  voidremoveSecondaryEntry(Entry fe)
     Remove a secondary entry from the list.
final  voidrestoreEntries(List<Pair> backup)
     Restore entries from the list.
final  List<Pair>saveEntries()
    
final public  Set<Entry>secondaryEntries()
     Get secondary entries.
final protected  voidsetCookieSet(CookieSet s)
     Set the set of cookies.
 ObjectsynchObjectSecondary()
     Provide object used for synchronization of methods working with Secondaries.
protected  FileLocktakePrimaryFileLock()
    
final  voidupdateFilesInCookieSet()
    

Field Detail
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




Constructor Detail
MultiDataObject
public MultiDataObject(FileObject fo, MultiFileLoader loader) throws DataObjectExistsException(Code)
Create a MultiFileObject.
See Also:   DataObject.DataObject(org.openide.filesystems.FileObjectorg.openide.loaders.DataLoader)
Parameters:
  fo - the primary file object
Parameters:
  loader - loader of this data object



MultiDataObject
MultiDataObject(FileObject fo, DataLoader loader) throws DataObjectExistsException(Code)
This constructor is added for backward compatibility, MultiDataObject should be properly constructed using the MultiFileLoader.
Parameters:
  fo - the primary file object
Parameters:
  loader - loader of this data objectMultiDataObject.DataShadowMultiDataObject.DataFolder
since:
   1.13




Method Detail
addSecondaryEntry
final protected void addSecondaryEntry(Entry fe)(Code)
Add a new secondary entry to the list.
Parameters:
  fe - the entry to add



checkCookieSet
void checkCookieSet(Class c)(Code)



createNodeDelegate
protected Node createNodeDelegate()(Code)
Provides node that should represent this data object. the node representation
See Also:   DataNode



files
public Set<FileObject> files()(Code)



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)



getHelpCtx
public HelpCtx getHelpCtx()(Code)



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



handleCopyRename
protected DataObject handleCopyRename(DataFolder df, String name, String ext) throws IOException(Code)



handleCreateFromTemplate
protected DataObject handleCreateFromTemplate(DataFolder df, String name) throws IOException(Code)



handleDelete
protected void handleDelete() throws IOException(Code)



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



handleRename
protected FileObject handleRename(String name) throws IOException(Code)



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



notifyFileDeleted
void notifyFileDeleted(FileEvent fe)(Code)



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.



takePrimaryFileLock
protected FileLock takePrimaryFileLock() throws IOException(Code)



updateFilesInCookieSet
final void updateFilesInCookieSet()(Code)



Fields inherited from org.openide.loaders.DataObject
final static String EA_ASSIGNED_LOADER(Code)(Java Doc)
final static String EA_ASSIGNED_LOADER_MODULE(Code)(Java Doc)
final static Logger LOG(Code)(Java Doc)
final public static String PROP_COOKIE(Code)(Java Doc)
final public static String PROP_FILES(Code)(Java Doc)
final public static String PROP_HELP(Code)(Java Doc)
final public static String PROP_MODIFIED(Code)(Java Doc)
final public static String PROP_NAME(Code)(Java Doc)
final public static String PROP_PRIMARY_FILE(Code)(Java Doc)
final public static String PROP_TEMPLATE(Code)(Java Doc)
final public static String PROP_VALID(Code)(Java Doc)
DataObjectPool.Item item(Code)(Java Doc)

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)

Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.