~ubuntu-branches/ubuntu/quantal/netbeans/quantal

« back to all changes in this revision

Viewing changes to java/helpset/javahelp/org/netbeans/modules/java/helpset/docs/propfiles/about_resourcebundles.html

  • Committer: Bazaar Package Importer
  • Author(s): Marek Slama
  • Date: 2008-01-29 14:11:22 UTC
  • Revision ID: james.westby@ubuntu.com-20080129141122-fnzjbo11ntghxfu7
Tags: upstream-6.0.1
ImportĀ upstreamĀ versionĀ 6.0.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
 
2
<!--       
 
3
*     Copyright (c) 2007 Sun Microsystems, Inc. All rights reserved.
 
4
*     Use is subject to license terms.
 
5
-->
 
6
<html>
 
7
<head>
 
8
<title>About Resource Bundles</title>
 
9
<link rel="StyleSheet" href="nbdocs://org.netbeans.modules.usersguide/org/netbeans/modules/usersguide/ide.css" type="text/css">
 
10
</head>
 
11
<body>
 
12
 
 
13
<h2>About Resource Bundles</h2>
 
14
<p><small><a href="#seealso">See Also</a>&nbsp;</small> 
 
15
<p> Resource bundles store selected characteristics of an object as key and value
 
16
  pairs in a set of <tt>.properties</tt> files. You can store a variety of characteristics
 
17
  in resource bundles, like localized strings used to internationalize your code
 
18
  or properties for an Ant script. The IDE displays resource bundles as properties
 
19
  object nodes (<img src="./images/propertiesObject.gif" alt="Properties Object Node">)
 
20
  that contain nodes for each of its locales (<img src="./images/propertiesLocale.gif" alt="Properties locale node icon">)
 
21
  and keys (<img src="./images/propertiesKey.gif" alt="Properties key node icon">).
 
22
  <!--PENDING : this info would be helpful in the Internationalization section-->
 
23
</p>
 
24
<h3>Editing Resource Bundles</h3>
 
25
<p>The IDE enables you to manage an object's properties that are stored  in resource
 
26
        bundles. </p>
 
27
<p>There are two primary ways of editing the properties files stored in resource
 
28
        bundles in the IDE.</p>
 
29
<ul>
 
30
        <li><b>In the Source Editor.</b> You can edit properties files in the Source
 
31
                Editor as standard text files. Initially, the default locale opens in the
 
32
                enabling you to edit existing keys and their values. 
 
33
        <li><b>In the Properties Editor.</b> You can edit the key and value pairs for
 
34
                        all locales of a resource bundle in table layout. You can also add a new property
 
35
                        to all of the locales in your resource bundle. 
 
36
</ul>
 
37
<ul class="note">
 
38
        <li>You can also manage a resource bundle's contents through the pop-up
 
39
                menu available on its Files window nodes.</li>
 
40
</ul>
 
41
<h3>Resource Bundles and Internationalization</h3>
 
42
<p>When used for internationalizing source code, the IDE stores each locale's
 
43
        characteristics in a<tt> .properties</tt> file which is contained within the
 
44
        resource bundle. Each key corresponds to the name of a property and
 
45
        must be the same for each locale. The key value is the localized string displayed
 
46
        by the object at runtime and can vary for each locale.
 
47
<ul class="note">
 
48
                <li>Though  resource bundles and locales are both <tt>.properties</tt> files, the
 
49
                        IDE displays   
 
50
   resource bundles and the locales they contain using different icons
 
51
 in the Files window to avoid confusion.
 
52
</ul>
 
53
<p>The IDE also enables you to automate the process of internationalizing your
 
54
        source code. You can use the IDE's internationalization features to:
 
55
<ul>
 
56
        <li>Automatically replace hard-coded strings with internationalized ones</li>
 
57
        <li>Insert new internationalized strings as you write code</li>
 
58
        <li>Check your resource bundles to ensure they contain all of the necessary
 
59
                keys</li>
 
60
</ul>
 
61
 
 
62
<dl>
 
63
    <dt><a name="seealso">See Also</a></dt>
 
64
    <dd><a href="creating_resourcebundles.html">Creating a Resource Bundle</a></dd>
 
65
    <dd><a href="addingprops.html">Adding and Removing a Property</a></dd>
 
66
    <dd><a href="addinglocale.html">Adding and Removing a Locale</a></dd>
 
67
</dl>
 
68
 
 
69
<hr><small><a href="../credits.html">Legal Notices</a></small> 
 
70
 
 
71
<table border="0" cellpadding="50">
 
72
<tr><td>&nbsp;</td></tr>
 
73
</table>
 
74
</body>
 
75
</html>