|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectde.kleopatra.view.presentation.DefaultBundleHandler
Default implementation of localization support.
Nested Class Summary | |
static class |
DefaultBundleHandler.DescriptionComparator
|
Constructor Summary | |
DefaultBundleHandler()
|
Method Summary | |
java.lang.String |
createMarker(java.lang.Object formID,
boolean startBlock)
|
protected java.lang.String |
getResourceBundleName(Presentation presentation)
encapsulates strategy to find an appropriate resourceBundle name. |
void |
localize(Presentation presentation,
java.lang.Class targetClass)
Find a resourceBundle in the default locale and apply to all presentation attributes of the given presentation. |
void |
updateBundle(Presentation presentation,
java.net.URL bundle)
Merge the presentation attributes of the presentation into the properties found at the file location bundle. |
void |
updatePresentation(java.util.ResourceBundle bundle,
Presentation presentation)
Apply the resourceBundle to all presentation attributes of the presentation. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public DefaultBundleHandler()
Method Detail |
public void updateBundle(Presentation presentation, java.net.URL bundle)
BundleHandler
If there the file does not yet exist, it will be created. If the file already exists it should be encoded like Properties (that is ISO 8859-1 with escaped unicode chars). A block representing the attributes should be written (replacing a possible existing block for this presentation), unrelated content is preserved as is.
updateBundle
in interface BundleHandler
presentation
- bundle
-
Here: synch is "all-or-nothing" on a presentation basis -
if the bundle contains a block of entries for the given
presentation the complete block will be overwritten.
public void updatePresentation(java.util.ResourceBundle bundle, Presentation presentation)
BundleHandler
updatePresentation
in interface BundleHandler
bundle
- presentation
-
Here: Synch is "all-or-nothing" on a presentationDescription basis -
if the resourceBundle contains any key for a component, all
existing attributes are cleared and the keys as contained in the
bundle are set.
public void localize(Presentation presentation, java.lang.Class targetClass)
BundleHandler
localize
in interface BundleHandler
presentation
- targetClass
- protected java.lang.String getResourceBundleName(Presentation presentation)
Here: first check the Presentation, if it does not carry a resourceBundle, check the UIManager for a shared bundle. The result may be null. Subclasses may override for a different strategy.
public java.lang.String createMarker(java.lang.Object formID, boolean startBlock)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |