Java Doc for ResourceManager.java in  » Installer » IzPack » com » izforge » izpack » installer » 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 » Installer » IzPack » com.izforge.izpack.installer 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   com.izforge.izpack.installer.ResourceManager

ResourceManager
public class ResourceManager (Code)
With this ResourceManager you are able to get resources from the jar file. All resources are loaded language dependent as it's done in java.util.ResourceBundle. To set a language dependent resource just append '_' and the locale to the end of the Resourcename

Example:
  • InfoPanel.info - for default value
  • InfoPanel.info_deu - for german value
  • InfoPanel.info_eng - for english value

  • This class is almost a singleton. It is created once using create by the installer and later, the instance is retrieved using getInstance.
    author:
       Marcus Stursberg


    Field Summary
    final protected  StringresourceBasePath
        

    Constructor Summary
    protected  ResourceManager(AutomatedInstallData data)
         Constructor.

    Method Summary
    public static  ResourceManagercreate(AutomatedInstallData data)
         Create the resource manager. This method should be called only once.
    public  ImageIcongetImageIconResource(String resource)
        
    public  InputStreamgetInputStream(String resource)
         Returns an InputStream contains the given Resource The Resource is loaded language dependen by the informations from this.locale If there is no Resource for the current language found, the default Resource is given.
    public static  ResourceManagergetInstance()
         Return the resource manager.
    public  StringgetLocale()
         Returns the locale for the resourcefiles.
    public  StringgetTextResource(String resource, String encoding)
         Returns a text resource from the jar file.
    public  StringgetTextResource(String resource)
         Returns a text resource from the jar file.
    public  URLgetURL(String resource)
        
    public  voidsetLocale(String locale)
         Sets the locale for the resourcefiles.

    Field Detail
    resourceBasePath
    final protected String resourceBasePath(Code)
    The base path where to find the resources




    Constructor Detail
    ResourceManager
    protected ResourceManager(AutomatedInstallData data)(Code)
    Constructor. Protected because this is a singleton.
    Parameters:
      data - - the current installData




    Method Detail
    create
    public static ResourceManager create(AutomatedInstallData data)(Code)
    Create the resource manager. This method should be called only once. If it is called a second time, the already existing instance is returned. The resource manager should be called after the language has been set in AutomatedInstallData.localeISO3
    Parameters:
      data - the installation information the created instance



    getImageIconResource
    public ImageIcon getImageIconResource(String resource) throws ResourceNotFoundException, IOException(Code)
    Returns a laguage dependent ImageIcon for the given Resource
    Parameters:
      resource - resrouce of the Icon a ImageIcon loaded from the given Resource
    throws:
      ResourceNotFoundException - thrown when the resource can not be found
    throws:
      IOException - if the resource can not be loaded



    getInputStream
    public InputStream getInputStream(String resource) throws ResourceNotFoundException(Code)
    Returns an InputStream contains the given Resource The Resource is loaded language dependen by the informations from this.locale If there is no Resource for the current language found, the default Resource is given.
    Parameters:
      resource - The resource to load an InputStream contains the requested resource
    exception:
      ResourceNotFoundException - Description of the Exception
    throws:
      ResourceNotFoundException - thrown if there is no resource found



    getInstance
    public static ResourceManager getInstance()(Code)
    Return the resource manager. the resource manager instance, null if no instance has been created



    getLocale
    public String getLocale()(Code)
    Returns the locale for the resourcefiles. The locale is taken from InstallData#installData#getAttribute("langpack") If there is no language set, the default language is english. the current language



    getTextResource
    public String getTextResource(String resource, String encoding) throws ResourceNotFoundException, IOException(Code)
    Returns a text resource from the jar file. The resource is loaded by ResourceManager#getResource and then converted into text.
    Parameters:
      resource - - a text resource to load
    Parameters:
      encoding - - the encoding, which should be used to read the resource a String contains the text of the resource
    throws:
      ResourceNotFoundException - if the resource can not be found
    throws:
      IOException - if the resource can not be loaded



    getTextResource
    public String getTextResource(String resource) throws ResourceNotFoundException, IOException(Code)
    Returns a text resource from the jar file. The resource is loaded by ResourceManager#getResource and then converted into text.
    Parameters:
      resource - - a text resource to load a String contains the text of the resource
    throws:
      ResourceNotFoundException - if the resource can not be found
    throws:
      IOException - if the resource can not be loaded



    getURL
    public URL getURL(String resource) throws ResourceNotFoundException(Code)
    Returns a URL refers to the given Resource
    Parameters:
      resource - the resource to load A languagedependen URL spezifies the requested resource
    exception:
      ResourceNotFoundException - Description of the Exception
    throws:
      ResourceNotFoundException - thrown if there is no resource found



    setLocale
    public void setLocale(String locale)(Code)
    Sets the locale for the resourcefiles. The locale is taken from InstallData#installData#getAttribute("langpack") If there is no language set, the default language is english.
    Parameters:
      locale - of the resourcefile



    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.