Java Doc for ResourceBundleSupport.java in  » Graphic-Library » jcommon-components » org » jfree » util » 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 » Graphic Library » jcommon components » org.jfree.util 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.jfree.util.ResourceBundleSupport

ResourceBundleSupport
public class ResourceBundleSupport (Code)
An utility class to ease up using property-file resource bundles.

The class support references within the resource bundle set to minimize the occurence of duplicate keys. References are given in the format:

 a.key.name=@referenced.key
 

A lookup to a key in an other resource bundle should be written by

 a.key.name=@@resourcebundle_name@referenced.key
 

author:
   Thomas Morgner



Constructor Summary
public  ResourceBundleSupport(Locale locale, String baseName)
     Creates a new instance.
protected  ResourceBundleSupport(Locale locale, ResourceBundle resourceBundle, String baseName)
     Creates a new instance.
public  ResourceBundleSupport(Locale locale, ResourceBundle resourceBundle)
     Creates a new instance.
public  ResourceBundleSupport(String baseName)
     Creates a new instance.
protected  ResourceBundleSupport(ResourceBundle resourceBundle, String baseName)
     Creates a new instance.
public  ResourceBundleSupport(ResourceBundle resourceBundle)
     Creates a new instance.

Method Summary
public  JMenucreateMenu(String keyPrefix)
     Returns a JMenu created from a resource bundle definition.

The menu definition consists of two keys, the name of the menu and the mnemonic for that menu.

public  IconcreateTransparentIcon(int width, int height)
     Creates a transparent icon.
public  StringformatMessage(String key, Object parameter)
     Formats the message stored in the resource bundle (using a MessageFormat).
public  StringformatMessage(String key, Object par1, Object par2)
     Formats the message stored in the resource bundle (using a MessageFormat).
public  StringformatMessage(String key, Object[] parameters)
     Formats the message stored in the resource bundle (using a MessageFormat).
public  IcongetIcon(String key, boolean large)
     Returns an scaled icon suitable for buttons or menus.
public  IcongetIcon(String key)
     Returns an unscaled icon.
public  KeyStrokegetKeyStroke(String key)
     Returns the keystroke stored at the given resourcebundle key.
public  KeyStrokegetKeyStroke(String key, int mask)
     Returns the keystroke stored at the given resourcebundle key.

The keystroke will be composed of a simple key press and the given KeyMask.

public  LocalegetLocale()
     Returns the current locale for this resource bundle.
public  IntegergetMnemonic(String key)
     Returns the mnemonic stored at the given resourcebundle key.
public  KeyStrokegetOptionalKeyStroke(String key)
    
public  KeyStrokegetOptionalKeyStroke(String key, int mask)
    
public  IntegergetOptionalMnemonic(String key)
    
final protected  StringgetResourceBase()
     The base name of the resource bundle.
public  URLgetResourceURL(String key)
     Returns a URL pointing to a resource located in the classpath.
public synchronized  StringgetString(String key)
     Gets a string for the given key from this resource bundle or one of its parents.
protected  StringinternalGetString(String key)
     Performs the lookup for the given key.


Constructor Detail
ResourceBundleSupport
public ResourceBundleSupport(Locale locale, String baseName)(Code)
Creates a new instance.
Parameters:
  baseName - the base name of the resource bundle, a fully qualifiedclass name



ResourceBundleSupport
protected ResourceBundleSupport(Locale locale, ResourceBundle resourceBundle, String baseName)(Code)
Creates a new instance.
Parameters:
  locale - the locale for which this resource bundle iscreated.
Parameters:
  resourceBundle - the resourcebundle
Parameters:
  baseName - the base name of the resource bundle, a fullyqualified class name



ResourceBundleSupport
public ResourceBundleSupport(Locale locale, ResourceBundle resourceBundle)(Code)
Creates a new instance.
Parameters:
  locale - the locale for which the resource bundle iscreated.
Parameters:
  resourceBundle - the resourcebundle



ResourceBundleSupport
public ResourceBundleSupport(String baseName)(Code)
Creates a new instance.
Parameters:
  baseName - the base name of the resource bundle, a fully qualifiedclass name



ResourceBundleSupport
protected ResourceBundleSupport(ResourceBundle resourceBundle, String baseName)(Code)
Creates a new instance.
Parameters:
  resourceBundle - the resourcebundle
Parameters:
  baseName - the base name of the resource bundle, a fullyqualified class name



ResourceBundleSupport
public ResourceBundleSupport(ResourceBundle resourceBundle)(Code)
Creates a new instance.
Parameters:
  resourceBundle - the resourcebundle




Method Detail
createMenu
public JMenu createMenu(String keyPrefix)(Code)
Returns a JMenu created from a resource bundle definition.

The menu definition consists of two keys, the name of the menu and the mnemonic for that menu. Both keys share a common prefix, which is extended by ".name" for the name of the menu and ".mnemonic" for the mnemonic.

 # define the file menu
 menu.file.name=File
 menu.file.mnemonic=F
 
The menu definition above can be used to create the menu by calling createMenu ("menu.file").
Parameters:
  keyPrefix - the common prefix for that menu the created menu



createTransparentIcon
public Icon createTransparentIcon(int width, int height)(Code)
Creates a transparent icon. The Icon can be used for aligning menu items.
Parameters:
  width - the width of the new icon
Parameters:
  height - the height of the new icon the created transparent icon.



formatMessage
public String formatMessage(String key, Object parameter)(Code)
Formats the message stored in the resource bundle (using a MessageFormat).
Parameters:
  key - the resourcebundle key
Parameters:
  parameter - the parameter for the message the formated string



formatMessage
public String formatMessage(String key, Object par1, Object par2)(Code)
Formats the message stored in the resource bundle (using a MessageFormat).
Parameters:
  key - the resourcebundle key
Parameters:
  par1 - the first parameter for the message
Parameters:
  par2 - the second parameter for the message the formated string



formatMessage
public String formatMessage(String key, Object[] parameters)(Code)
Formats the message stored in the resource bundle (using a MessageFormat).
Parameters:
  key - the resourcebundle key
Parameters:
  parameters - the parameter collection for the message the formated string



getIcon
public Icon getIcon(String key, boolean large)(Code)
Returns an scaled icon suitable for buttons or menus.
Parameters:
  key - the name of the resource bundle key
Parameters:
  large - true, if the image should be scaled to 24x24, or false for16x16 the icon.



getIcon
public Icon getIcon(String key)(Code)
Returns an unscaled icon.
Parameters:
  key - the name of the resource bundle key the icon.



getKeyStroke
public KeyStroke getKeyStroke(String key)(Code)
Returns the keystroke stored at the given resourcebundle key.

The keystroke will be composed of a simple key press and the plattform's MenuKeyMask.

The keystrokes character key should be either the symbolic name of one of the KeyEvent.VK_* constants or the character for that key.

For the 'A' key, the resource bundle would therefore either contain "VK_A" or "a".

 a.resourcebundle.key=VK_A
 an.other.resourcebundle.key=a
 

Parameters:
  key - the resourcebundle key the mnemonic
See Also:   Toolkit.getMenuShortcutKeyMask



getKeyStroke
public KeyStroke getKeyStroke(String key, int mask)(Code)
Returns the keystroke stored at the given resourcebundle key.

The keystroke will be composed of a simple key press and the given KeyMask. If the KeyMask is zero, a plain Keystroke is returned.

The keystrokes character key should be either the symbolic name of one of the KeyEvent.VK_* constants or the character for that key.

For the 'A' key, the resource bundle would therefore either contain "VK_A" or "a".

 a.resourcebundle.key=VK_A
 an.other.resourcebundle.key=a
 

Parameters:
  key - the resourcebundle key the mnemonic
See Also:   Toolkit.getMenuShortcutKeyMask



getLocale
public Locale getLocale()(Code)
Returns the current locale for this resource bundle. the locale.



getMnemonic
public Integer getMnemonic(String key)(Code)
Returns the mnemonic stored at the given resourcebundle key. The mnemonic should be either the symbolic name of one of the KeyEvent.VK_* constants (without the 'VK_') or the character for that key.

For the enter key, the resource bundle would therefore either contain "ENTER" or "\n".

 a.resourcebundle.key=ENTER
 an.other.resourcebundle.key=\n
 

Parameters:
  key - the resourcebundle key the mnemonic



getOptionalKeyStroke
public KeyStroke getOptionalKeyStroke(String key)(Code)



getOptionalKeyStroke
public KeyStroke getOptionalKeyStroke(String key, int mask)(Code)



getOptionalMnemonic
public Integer getOptionalMnemonic(String key)(Code)



getResourceBase
final protected String getResourceBase()(Code)
The base name of the resource bundle. the resource bundle's name.



getResourceURL
public URL getResourceURL(String key)(Code)
Returns a URL pointing to a resource located in the classpath. The resource is looked up using the given key.

Example: The load a file named 'logo.gif' which is stored in a java package named 'org.jfree.resources':

 mainmenu.logo=org/jfree/resources/logo.gif
 
The URL for that file can be queried with: getResource("mainmenu.logo");.
Parameters:
  key - the key for the resource the resource URL



getString
public synchronized String getString(String key)(Code)
Gets a string for the given key from this resource bundle or one of its parents. If the key is a link, the link is resolved and the referenced string is returned instead.
Parameters:
  key - the key for the desired string the string for the given key
throws:
  NullPointerException - if key is null
throws:
  MissingResourceException - if no object for the given key can befound
throws:
  ClassCastException - if the object found for the given key isnot a string



internalGetString
protected String internalGetString(String key)(Code)
Performs the lookup for the given key. If the key points to a link the link is resolved and that key is looked up instead.
Parameters:
  key - the key for the string the string for the given key



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.