HTMLLicencePanel
Usage
A panel to show the HTML-formatted licence of the installed application.
Adding images to HTMLLicencePanel works exactly the same way as with HTMLInfoPanel.
These panels can prompt the user to acknowledge a license agreement. They block unless the user selects the 'agree' option. By default, to specify the license agreement text you have to use the HtmlLicencePanel.licence
resource.
Anyway, there can be defined multiple instances of HTMLLicencePanel. For this case, the license text resource has no longer the default name, but is to be assembled from HtmlLicencePanel.<panel id>
.
Example:
<resources> <res id="HTMLLicencePanel.GNU" src="iz/GNU-License.html"/> <res id="HTMLLicencePanel.MyLicense" src="iz/My-License.html"/> </resources> <panels> <panel classname="HTMLLicencePanel" id="GNU" /> <panel classname="HTMLLicencePanel" id="MyLicense" /> </panels>
If the id
parameter is left off of the panel
then the old default resource of the HTMLLicencePanel.licence
resource is read.
For the console mode, all HTML tags are stripped off the text before showing it.
Since 5.0.7:
For the console installation mode, the license text can be preformatted for displaying using the following features:
- Word wrap
If there are long lines in the text containing more characters than the real terminal width, the text is not broken accidentally at the terminal border, but it is wrapped by words.
Exception: Single words which are longer than the terminal width are broken at the terminal line end. Paging
If the license text results in more lines (after the word wrapping mentioned above) than the real terminal height, the text is paged, e.g. there is displayed one page fitting the terminal dimensions and below there is shown a===More===
line indicating there are more pages of text available. The next page is shown when pressing the SPACE (or any other key) here.
Configuration
The word wrap and paging feature described above must be activated depending on the format of the license text, they are deactivated by default.
Panel configuration parameter | Possible values | Default | Description |
---|---|---|---|
console-text-wordwrap | true | false | false | Set "true" in order to activate word wrapping for the displayed text in console installation mode. Since: 5.0.7 |
console-text-paging | true | false | false | Set "true" in order to activate paging for the displayed text in console installation mode. Since: 5.0.7 |
Example:
<panels> <panel classname="LicencePanel" id="panel.license"> <configuration> <param name="console-text-paging" value="true" /> <param name="console-text-wordwrap" value="false" /> </configuration> </panel> ... </panels>
The two options work independently on each other. If there are both activated, word wrapping is done before calculating the page size for paging.
Labels/Messages
id | Description |
---|---|
LicencePanel.info | The label text to be shown as panel label above the contents. |
Resources
id | Description |
---|---|
HTMLLicencePanel.<panel id> | The name of the file that contains the license agreement text to show on the panel. If you don't specify the panel id then pane id is assumed to be licence (i.e. the resource id will be HTMLLicencePanel.licence). |
Localization
The HTMLLicencePanel
is fully localized.
The title and button elements are translated from the built-in langpack files in the installer according to the chosen installer language.
In order to automatically choose translated license documents follow these steps:
Specify the available languages the installer should support:
install.xml<locale> <langpack iso3="eng"/> <langpack iso3="fra"/> <langpack iso3="deu"/> </locale>
The above example adds translations for english, french and german language to the installer, which can be chosen in the initial language dialog (GUI mode) or automatically according to the system settings (console mode).
For each translated license document, add a resource ending on '_' followed by the 3-letter ISO code of the according language.
If you don't have at least one of the translated documents available, offer the default resource which is the fallback for missing resources in the above format if that language is chosen:install.xml<resources> <res id="HTMLLicencePanel.licence_eng" src="@{izpack.build.directory}/resources/License_eng.html" /> <res id="HTMLLicencePanel.licence_fra" src="@{izpack.build.directory}/resources/License_fra.html" /> <res id="HTMLLicencePanel.licence" src="@{izpack.build.directory}/License_eng.html"/> </resources>
The above example adds an english and french translation of the license document, furthermore it uses the english translation as fallback for the german translation.
See Internationalizing resources for more information on automatic localization of resources in IzPack.
Limitations
The panel name & panel id are not taken into account for the panel label, the key is always taken as LicencePanel.info. The label LicencePanel.info is shared with LicencePanel & PDFLicencePanel as well.