Java Doc for ResourceService.java in  » IDE-Netbeans » form » org » netbeans » modules » form » 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 » form » org.netbeans.modules.form 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


org.netbeans.modules.form.ResourceService

ResourceService
public interface ResourceService (Code)
Interface used by the form editor to manipulate resources (property values stored externally, represented by ResourceValue). Implementation is provided by the Swing App Framework module, storing the resources in properties files. Theoretically there could be other implementors, but practically there is no need for that.
See Also:   ResourceSupport
author:
   Tomas Pavek




Method Summary
 voidautoSave(FileObject srcFile)
     Saves properties files edited for given source object (form).
 ResourceValuechangeKey(ResourceValue resource, String newKey)
     Creates a new ResourceValue object with a new key.
 ResourceValuechangeValue(ResourceValue resource, Object newValue, String newStringValue)
     Creates new ResourceValue object with a changed value.
 voidclose(FileObject srcFile)
     Called when the source file (form) is closed without saving changes.
 ResourceValuecreate(String key, Class type, Object value, String stringValue, FileObject srcFile)
     Creates ResourceValue object for given key and value.
 ResourcePanelcreateResourcePanel(Class valueType, FileObject srcFile)
    
 Collection<String>findKeys(String keyRegex, FileObject srcFile)
     Collects all available keys matching given regular expression (via String.matches - i.e.
 ResourceValueget(String key, Class type, String localeSuffix, FileObject srcFile)
     Finds ResourceValue for given key, locale and source file.
 String[][]getAvailableLocales(FileObject srcFile)
     Obtains all currently available locales of properties files for given source file.
 java.awt.ComponentgetCreateLocaleComponent(PropertyEditor prEd, FileObject srcFile)
     Provides a visual component (modal dialog) usable as a property customizer that allows create a new locale file for default properties file belonging to given source file.
 StringgetInjectionCode(Object component, String variableName, FileObject srcFile)
    
 List<URL>getResourceFiles(FileObject srcFile)
     Returns the files that define resources for given source file. Practically this includes the properties file (resource map) and all its locale or OS variants.
 booleanisExcludedProperty(Class componentType, String propName)
    
 voidprepareNew(FileObject srcFile)
     Called when a new form is created and opened to do some preparation work.
 booleanprojectUsesResources(FileObject fileInProject)
     Returns whether the project represented by given file allows to use the resources infrastructure (corresponding libraries are available on projects classpath).
 booleanprojectWantsUseResources(FileObject fileInProject)
     Returns whether forms in the project represented by given file should actively be set to use the resources - i.e.
 ResourceValueswitchLocale(ResourceValue resource, String localeSuffix)
     Creates a new ResourceValue corresponding to given locale (so getValue will return the new locale specific value).
 voidupdate(ResourceValue oldValue, ResourceValue newValue, FileObject srcFile, String localeSuffix)
     Updates properties file according to given ResourceValue objects - oldValue is removed, newValue added.



Method Detail
autoSave
void autoSave(FileObject srcFile)(Code)
Saves properties files edited for given source object (form). This method is called when the source is being saved - so the corresponding properties files can be saved as well.
Parameters:
  srcFile - the source java file whose properties files should be saved



changeKey
ResourceValue changeKey(ResourceValue resource, String newKey)(Code)
Creates a new ResourceValue object with a new key. Does not save it to the file at this moment, just returns the changed object. (The 'update' method is called later.)
Parameters:
  resource - the ResourceValue to be changed
Parameters:
  newKey - the new key new ResourceValue instance with the new key (otherwise the same)



changeValue
ResourceValue changeValue(ResourceValue resource, Object newValue, String newStringValue)(Code)
Creates new ResourceValue object with a changed value. Does not save it to the file at this moment, just returns the changed object. (The 'update' method is called later.)
Parameters:
  resource - the ResourceValue to be changed
Parameters:
  newValue - the new value object; used as a fallback if the stringrepresentation is not usable for constructing the value
Parameters:
  newStringValue - textual representation of the value; needed if thevalue object itself can't be saved directly new ResourceValue instance with the new value (otherwise the same)



close
void close(FileObject srcFile)(Code)
Called when the source file (form) is closed without saving changes. The changes in corresponding properties file should be discarded as well.
Parameters:
  srcFile - the source java file whose properties files should be closed



create
ResourceValue create(String key, Class type, Object value, String stringValue, FileObject srcFile)(Code)
Creates ResourceValue object for given key and value. It is not saved to the file yet. (For that purpose 'update' method is called later.)
Parameters:
  key - the key (not checked for uniqueness - don't care if a valuealready exists)
Parameters:
  type - the type of the value (needed for the infrastructure todetermine the right converter from String)
Parameters:
  value - the value object to be stored as a resource; used as afallback if stringValue is not valid for constructing the value
Parameters:
  stringValue - textual representation of the value; needed if thevalue object itself can't be saved directly
Parameters:
  srcFile - the source java file for which the resource is created(used to determine where to store the resource) initialized but not saved ResourceValue object



createResourcePanel
ResourcePanel createResourcePanel(Class valueType, FileObject srcFile)(Code)



findKeys
Collection<String> findKeys(String keyRegex, FileObject srcFile)(Code)
Collects all available keys matching given regular expression (via String.matches - i.e. key.matches(keyRegex) must be true).
Parameters:
  keyRegex - the regular expression that the key should match
Parameters:
  srcFile - the source file whose resources are to be searched Collection of matching keys



get
ResourceValue get(String key, Class type, String localeSuffix, FileObject srcFile)(Code)
Finds ResourceValue for given key, locale and source file. If no data is available for given specific locale then a less specific or default locale data is returned.
Parameters:
  key - the key
Parameters:
  type - the type of the value (needed for the infrastructure todetermine the right converter from String)
Parameters:
  localeSuffix - the locale variant to be used (localization suffixincluding the initial underscore, e.g. _cs_CZ)
Parameters:
  srcFile - the source java file for which the resource is obtained ResourceValue object with found data, or null



getAvailableLocales
String[][] getAvailableLocales(FileObject srcFile)(Code)
Obtains all currently available locales of properties files for given source file. Returns two arrays of strings. The first one containes locale suffixes, the second one corresponding display names for the user (should be unique).
Parameters:
  srcFile - the source java file whose resources are in question array of available locales (locale suffixes and display names)



getCreateLocaleComponent
java.awt.Component getCreateLocaleComponent(PropertyEditor prEd, FileObject srcFile)(Code)
Provides a visual component (modal dialog) usable as a property customizer that allows create a new locale file for default properties file belonging to given source file. It writes the created locale as a string (locale suffix) to the given propery editor.
Parameters:
  prEd - a property editor where the component writes the createdlocale suffix
Parameters:
  srcFile - the source java file whose defining the resources scope(first suitable properties file will be used for creatingadditional locale variant) visual component of the customizer



getInjectionCode
String getInjectionCode(Object component, String variableName, FileObject srcFile)(Code)



getResourceFiles
List<URL> getResourceFiles(FileObject srcFile)(Code)
Returns the files that define resources for given source file. Practically this includes the properties file (resource map) and all its locale or OS variants. Other files referenced from the resource map (like icons) are not included. The returned files can be used e.g. for backup during a refactoring operation.
Parameters:
  srcFile - the source java file for which the resource files shouldbe returned list of properties files defining resources for given source file



isExcludedProperty
boolean isExcludedProperty(Class componentType, String propName)(Code)



prepareNew
void prepareNew(FileObject srcFile)(Code)
Called when a new form is created and opened to do some preparation work.
Parameters:
  srcFile - the source java file just created



projectUsesResources
boolean projectUsesResources(FileObject fileInProject)(Code)
Returns whether the project represented by given file allows to use the resources infrastructure (corresponding libraries are available on projects classpath). If this method returns true, form editor will allow forms in the project to use resources.
Parameters:
  fileInProject - a file representing the projevt (whatever sourcefile from the project) true if the given project uses the resources infrastracture(corresponding libraries are on the classpath)



projectWantsUseResources
boolean projectWantsUseResources(FileObject fileInProject)(Code)
Returns whether forms in the project represented by given file should actively be set to use the resources - i.e. not only the resources are allowed, but they should even be used by default.
Parameters:
  fileInProject - a file representing the projevt (whatever sourcefile from the project) true if the given project can use resources, false if theproject is not suitable for resources



switchLocale
ResourceValue switchLocale(ResourceValue resource, String localeSuffix)(Code)
Creates a new ResourceValue corresponding to given locale (so getValue will return the new locale specific value). If no data is available for this specific locale then a less specific or default locale data is provided.
Parameters:
  resource - the ResourceValue to be changed
Parameters:
  localeSuffix - the locale variant to be used (localization suffixincluding the initial underscore, e.g. _cs_CZ) new ResourceValue instance containing data for the given locale



update
void update(ResourceValue oldValue, ResourceValue newValue, FileObject srcFile, String localeSuffix) throws IOException(Code)
Updates properties file according to given ResourceValue objects - oldValue is removed, newValue added. Update goes into given locale - parent files are updated too if given key is not present in them. New properties file is created if needed.
Parameters:
  oldValue - the value to be removed or null
Parameters:
  newValue - the value to be added or null
Parameters:
  srcFile - the source java file whose properties files are going to bemodified
Parameters:
  localeSuffix - the locale variant to be updated (localization suffixincluding the initial underscore, e.g. _cs_CZ)
throws:
  java.io.IOException - when there is a problem with updating.



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