EVALUATION
The demo propertis updating is covered by issue 7158926
The macosx properties updating is covered by the issue 7158928
Now all properties are generated with the following suffixes: xxx.textAndMnemonic and xxx.titleAndMnemonic
- patterns which are generated to properties with the xxx.textAndMnemonic suffix:
(xxxNameText, xxxNameMnemonic)
(xxxNameText, xxxMnemonic)
(xxx.nameText, xxx.mnemonic)
(xxxText, xxxMnemonic)
- pattern which is generated to properties with the xxx.titleAndMnemonic suffix:
(xxxTitle, xxxMnemonic)
After that the extended hashmap check a key suffix and generate a compositeKey which allows to get a property in a new format and extract a text, mnemonic or mnemonic index from it.
The attached SwingResourcesTest test gets a path to the old properties and L&F class. If L&F is not null than it is set. After that the test gets all properties and it's values and check that values are equal to the values which are got from the UIManager.get(key, locale).
|
EVALUATION
According to the bug pre-processing/post-processing property files is considered as unreliable and it is suggested to not do that for jdk8.
There is the following format in the swing *.properties files now:
-------------------------------------------------------
FileChooser.updateButtonText=Update
FileChooser.updateButtonMnemonic=85
-------------------------------------------------------
We can't change this property to FileChooser.updateButtonText=&Update because users are able to override this property by UIManager.put(key, value) method.
So it is a valid case to use the & in a text and it is expected that this symbol is shown. There will be a regression if we do not show this symbol.
So we need to introduce new properties like FileChooser.localized.updateButtonText and support both formats. If a user use the old format than we need to process it in other case we need to parse new format.
So it seems that there is big work that includes following changes:
- L&F UI for JLabel AbstractButton JColorChooser JFileChooser JTabbedPane components
- Basic and Metal L&Fs and synthetic property files
- property files for different localizations: default, de, es, fr, it, ja, ko, pt_BR, sv, zh_CN, zh_TW.
The second question is a public API to allow users to use & symbol for mnemonics.
It looks like we need to add method like setLocalizationText(String text) for components with the setDisplayedMnemonic() method (JLabel AbstractButton JColorChooser JFileChooser JTabbedPane components) .
There are some questions about it:
- How the text should look like if it needs to use & in the text?
- How do we want to process html text that can contain symbols like < ?
|