ContentWelcomeProducts Abeona Gaia Hephaistos JavaGantt Features News Documentation Programming domain objects About JavaGantt model Undo / Redo support Localization support Building a treetable Painting a chart Working with the time scale JavaGantt actions License Download Purchase Services Promote your software Contact Us Links |
Localization (internationalization)The JavaGantt components (treetable columns and actions) intense use resource bundle technique. These methods of JavaGantt are about resource bundles:
But resource bundle may be accessed also if you don't set its name explicitly. So how does it work? The main class for these purposes is eu.beesoft.gaia.util.Language. In the Swing environment is a singleton (but it has a public constructor, so you can create as many instances as you need in server environment). The singleton is accessible via method Language.getInstance (); which returns last created instance of Language. Using Language has big advantage when you change application's Locale. Setting this into Language provides for all LanguageListeners notification to easy reloading texts from resource bundles. When you take a look at Language API documentation, you can see method getText() with first argument either a resource bundle name or some object. These methods are used from JavaGantt and its subcomponents.
So if you don't use method JavaGantt.setResourceBundleName(), you must create a properties file in the same package where your JavaGantt subclass is stored and with the same name as thas subclass has. In that case it will work without explicitly setting the resource bundle name and you can use the advantages of inheritance.
|