Java Doc for InstanceDataObject.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
         org.openide.loaders.InstanceDataObject

InstanceDataObject
public class InstanceDataObject extends MultiDataObject implements InstanceCookie.Of(Code)
A data object whose only purpose is to supply InstanceCookie. The instances are created by default instantiation; the name of the class to instantiate is stored on disk, typically right in the file name.

This data object is generally used to configure menus and toolbars, though it could be used in any situation requiring instances to be present in a folder; for example, anything using FolderInstance .

Typical instance classes are subclasses of SystemAction to make menu items or toolbar buttons; javax.swing.JSeparator for a menu separator; or javax.swing.JToolBar.Separator for a toolbar separator.

Use InstanceDataObject.create and InstanceDataObject.remove to make the objects. Better yet, use an XML filesystem to install them declaratively.

Instance data object by default recognizes all files with .instance suffix. Such file can have associated optional file attributes:

instanceCreate
instantionalized Object (e.g. created by methodvalue at XML filesystem)
instanceOf
String that is tokenized at ':', ',', ';' and whitespace boundaries. Resulting tokens represent class names that created instance is instanceof. Utilizing it may improve performance.
(optional file attributes documented since 3.34).
author:
   Ian Formanek


Field Summary
final static  StringEA_NAME
     data object name cached in the attribute to prevent instance creation when its InstanceNode is displayed.
final public static  StringINSTANCE
     File extension for instance data objects.
final static  StringSER_EXT
     File extension for serialized files.
final static  StringXML_EXT
     File extension for xml settings.
final static  longserialVersionUID
    

Constructor Summary
public  InstanceDataObject(FileObject pf, MultiFileLoader loader)
     Create a new instance.

Method Summary
public static  InstanceDataObjectcreate(DataFolder folder, String name, String className)
     Create a new InstanceDataObject in a given folder.
public static  InstanceDataObjectcreate(DataFolder folder, String name, Class clazz)
     Create a new InstanceDataObject in a given folder.
public static  InstanceDataObjectcreate(DataFolder folder, String name, Object instance, ModuleInfo info)
     Create a new InstanceDataObject containing settings in a given folder.
public static  InstanceDataObjectcreate(DataFolder folder, String name, Object instance, ModuleInfo info, boolean create)
     Create a new InstanceDataObject containing settings in a given folder.
protected  NodecreateNodeDelegate()
    
final  booleancreatorOf(Object inst)
     Checks whether the instance was created by this object.
protected  voiddispose()
    
static  Stringescape(String text)
     Hex-escapes anything potentially nasty in some text.
static  StringescapeAndCut(String name)
    
public static  InstanceDataObjectfind(DataFolder folder, String name, String className)
     Finds instance of specified name in a given folder.
public static  InstanceDataObjectfind(DataFolder folder, String name, Class clazz)
     Finds instance of specified name in a given folder.
public  TgetCookie(Class<T> clazz)
    
public  HelpCtxgetHelpCtx()
    
public  StringgetName()
    
protected  DataObjecthandleCopy(DataFolder df)
    
protected  DataObjecthandleCreateFromTemplate(DataFolder df, String name)
    
protected  voidhandleDelete()
    
protected  FileObjecthandleRename(String name)
    
public  ClassinstanceClass()
    
public  ObjectinstanceCreate()
    
public  StringinstanceName()
    
public  booleaninstanceOf(Class type)
     Query if this instance can create object of given type.
 voidnotifyAttributeChanged(org.openide.filesystems.FileAttributeEvent fae)
    
 voidnotifyFileChanged(FileEvent fe)
    
public static  booleanremove(DataFolder folder, String name, String className)
     Remove an existing instance data object.
public static  booleanremove(DataFolder folder, String name, Class clazz)
     Remove an existing instance data object.
final  voidscheduleSave()
    
final  voidsetCustomClassLoader(ClassLoader cl)
    
static  Stringunescape(String text)
     Removes hex escapes and regenerates displayable Unicode.

Field Detail
EA_NAME
final static String EA_NAME(Code)
data object name cached in the attribute to prevent instance creation when its InstanceNode is displayed.



INSTANCE
final public static String INSTANCE(Code)
File extension for instance data objects.



SER_EXT
final static String SER_EXT(Code)
File extension for serialized files.



XML_EXT
final static String XML_EXT(Code)
File extension for xml settings.



serialVersionUID
final static long serialVersionUID(Code)
generated Serialized Version UID




Constructor Detail
InstanceDataObject
public InstanceDataObject(FileObject pf, MultiFileLoader loader) throws DataObjectExistsException(Code)
Create a new instance. Do not use this to make instances; use InstanceDataObject.create .
Parameters:
  pf - primary file object for this data object
Parameters:
  loader - the loader
throws:
  DataObjectExistsException - if it already exists




Method Detail
create
public static InstanceDataObject create(DataFolder folder, String name, String className) throws IOException(Code)
Create a new InstanceDataObject in a given folder. If object with specified name already exists, it is returned. You should specify the name if there is a chance another file of the same instance class already exists in the folder; or just to provide a more descriptive name, which will appear in the Explorer for example.

Note: use of XML layers to install instances is generally preferred.
Parameters:
  folder - the folder to create the instance data object in
Parameters:
  name - the name to give to the object (can be null if no special name besides the class name is needed)but name cannot be empty
Parameters:
  className - the name of the class the new object should provide an instance of (see class header for details) the newly created or existing instance data object
exception:
  IOException - if the file cannot be created




create
public static InstanceDataObject create(DataFolder folder, String name, Class clazz) throws IOException(Code)
Create a new InstanceDataObject in a given folder. If object with specified name already exists, it is returned. You should specify the name if there is a chance another file of the same instance class already exists in the folder; or just to provide a more descriptive name, which will appear in the Explorer for example.

Note: use of XML layers to install instances is generally preferred.
Parameters:
  folder - the folder to create the instance data object in
Parameters:
  name - the name to give to the object (can be null if no special name besides the class name is needed)
Parameters:
  clazz - the class to create instance for (see class header for details) the newly created or existing instance data object
exception:
  IOException - if the file cannot be created




create
public static InstanceDataObject create(DataFolder folder, String name, Object instance, ModuleInfo info) throws IOException(Code)
Create a new InstanceDataObject containing settings in a given folder. If object with specified name already exists, it is returned. If the module info is null then the origin module info of an instance class is tried to find out.

Note: use of XML layers to install instances is generally preferred.
Parameters:
  folder - the folder to create the instance data object in
Parameters:
  name - the name to give to the object (can be null if no special name besides the class name is needed)but name cannot be empty
Parameters:
  instance - the serializable instance
Parameters:
  info - the module info describing the settings provenance (can be null) the newly created or existing instance data object
exception:
  IOException - if the file cannot be created
since:
   1.28




create
public static InstanceDataObject create(DataFolder folder, String name, Object instance, ModuleInfo info, boolean create) throws IOException(Code)
Create a new InstanceDataObject containing settings in a given folder. If the module info is null then the origin module info of an instance class is tried to find out.

Note: use of XML layers to install instances is generally preferred.
Parameters:
  folder - the folder to create the instance data object in
Parameters:
  name - the name to give to the object (can be null if no special name besides the class name is needed)but name cannot be empty
Parameters:
  instance - the serializable instance
Parameters:
  info - the module info describing the settings provenance (can be null)
Parameters:
  create - true - always create new file; false- store to existing file if exist the newly created or existing instance data object
exception:
  IOException - if the file cannot be created
since:
   2.9




createNodeDelegate
protected Node createNodeDelegate()(Code)



creatorOf
final boolean creatorOf(Object inst)(Code)
Checks whether the instance was created by this object.



dispose
protected void dispose()(Code)



escape
static String escape(String text)(Code)
Hex-escapes anything potentially nasty in some text. Package-private for the benefit of the test suite.



escapeAndCut
static String escapeAndCut(String name)(Code)
escape a filename and map it to the name with max length MAX_FILENAME_LENGTH
See Also:    issue #17186



find
public static InstanceDataObject find(DataFolder folder, String name, String className)(Code)
Finds instance of specified name in a given folder.
Parameters:
  folder - the folder to create the instance data object in
Parameters:
  name - the name to give to the object (can be null if no special name besides the class name is needed)
Parameters:
  className - the name of the class the new object should provide an instance of the found instance data object or null if it does not exist



find
public static InstanceDataObject find(DataFolder folder, String name, Class clazz)(Code)
Finds instance of specified name in a given folder.
Parameters:
  folder - the folder to create the instance data object in
Parameters:
  name - the name to give to the object (can be null if no special name besides the class name is needed)
Parameters:
  clazz - the class to create instance for (see class header for details) the found instance data object or null if it does not exist



getCookie
public T getCookie(Class<T> clazz)(Code)



getHelpCtx
public HelpCtx getHelpCtx()(Code)



getName
public String getName()(Code)



handleCopy
protected DataObject handleCopy(DataFolder df) throws IOException(Code)



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



handleDelete
protected void handleDelete() throws IOException(Code)



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



instanceClass
public Class instanceClass() throws IOException, ClassNotFoundException(Code)



instanceCreate
public Object instanceCreate() throws IOException, ClassNotFoundException(Code)



instanceName
public String instanceName()(Code)



instanceOf
public boolean instanceOf(Class type)(Code)
Query if this instance can create object of given type.
Parameters:
  type - the type to create true or false



notifyAttributeChanged
void notifyAttributeChanged(org.openide.filesystems.FileAttributeEvent fae)(Code)
Clear name cache



notifyFileChanged
void notifyFileChanged(FileEvent fe)(Code)



remove
public static boolean remove(DataFolder folder, String name, String className)(Code)
Remove an existing instance data object. If you have the exact file name, just call DataObject.delete ; this method lets you delete an instance you do not have an exact record of the file name for, based on the same information used to create it.

Note: use of XML layers to install instances is generally preferred.
Parameters:
  folder - the folder to remove the file from
Parameters:
  name - the name of the instance (can be null)
Parameters:
  className - the name of class the object referred to (see class header for details) true if the instance was succesfully removed, false if not




remove
public static boolean remove(DataFolder folder, String name, Class clazz)(Code)
Remove an existing instance data object. If you have the exact file name, just call DataObject.delete ; this method lets you delete an instance you do not have an exact record of the file name for, based on the same information used to create it.

Note: use of XML layers to install instances is generally preferred.
Parameters:
  folder - the folder to remove the file from
Parameters:
  name - the name of the instance (can be null)
Parameters:
  clazz - the class the object referred to (see class header for details) true if the instance was succesfully removed, false if not




scheduleSave
final void scheduleSave()(Code)
schedule task to save the instance



setCustomClassLoader
final void setCustomClassLoader(ClassLoader cl)(Code)



unescape
static String unescape(String text)(Code)
Removes hex escapes and regenerates displayable Unicode.



Fields inherited from org.openide.loaders.MultiDataObject
final static Logger ERR(Code)(Java Doc)
boolean checked(Code)(Java Doc)
final static long serialVersionUID(Code)(Java Doc)

Methods inherited from org.openide.loaders.MultiDataObject
final protected void addSecondaryEntry(Entry fe)(Code)(Java Doc)
void checkCookieSet(Class c)(Code)(Java Doc)
protected Node createNodeDelegate()(Code)(Java Doc)
public Set<FileObject> files()(Code)(Java Doc)
final public Entry findSecondaryEntry(FileObject fo)(Code)(Java Doc)
final void fireCookieChange()(Code)(Java Doc)
final ChangeAndBefore getChangeListener()(Code)(Java Doc)
public T getCookie(Class<T> type)(Code)(Java Doc)
final protected CookieSet getCookieSet()(Code)(Java Doc)
public HelpCtx getHelpCtx()(Code)(Java Doc)
final public MultiFileLoader getMultiFileLoader()(Code)(Java Doc)
final public Entry getPrimaryEntry()(Code)(Java Doc)
Map<FileObject, Entry> getSecondary()(Code)(Java Doc)
protected DataObject handleCopy(DataFolder df) throws IOException(Code)(Java Doc)
protected DataObject handleCopyRename(DataFolder df, String name, String ext) throws IOException(Code)(Java Doc)
protected DataObject handleCreateFromTemplate(DataFolder df, String name) throws IOException(Code)(Java Doc)
protected void handleDelete() throws IOException(Code)(Java Doc)
protected FileObject handleMove(DataFolder df) throws IOException(Code)(Java Doc)
protected FileObject handleRename(String name) throws IOException(Code)(Java Doc)
public boolean isCopyAllowed()(Code)(Java Doc)
public boolean isDeleteAllowed()(Code)(Java Doc)
boolean isMergingFolders(FileObject who, FileObject targetFolder)(Code)(Java Doc)
public boolean isMoveAllowed()(Code)(Java Doc)
public boolean isRenameAllowed()(Code)(Java Doc)
final void markSecondaryEntriesRecognized(DataLoader.RecognizedFiles recognized)(Code)(Java Doc)
void notifyFileDataCreated(FileEvent fe)(Code)(Java Doc)
void notifyFileDeleted(FileEvent fe)(Code)(Java Doc)
final void recognizedByFolder()(Code)(Java Doc)
final protected Entry registerEntry(FileObject fo)(Code)(Java Doc)
final void removeFile(FileObject fo)(Code)(Java Doc)
final protected void removeSecondaryEntry(Entry fe)(Code)(Java Doc)
final void restoreEntries(List<Pair> backup)(Code)(Java Doc)
final List<Pair> saveEntries()(Code)(Java Doc)
final public Set<Entry> secondaryEntries()(Code)(Java Doc)
final protected void setCookieSet(CookieSet s)(Code)(Java Doc)
Object synchObjectSecondary()(Code)(Java Doc)
protected FileLock takePrimaryFileLock() throws IOException(Code)(Java Doc)
final void updateFilesInCookieSet()(Code)(Java Doc)

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.