|
|
Custom Themes |
Instead of using the Included Themes, you may supply your own by providing a custom theme properties file (described below).
There are two ways to specify the use of a custom theme:
· Profile Themes
· User Themes
This option is provided for profile designers and has priority over any other mechanism. If the following property exists, then it is used instead of any included/user theme:
RhapsodyPowerPack.General.CustomProfileTheme
The property does not exist by default and should be added by the profile designer. The property should be specified on a new-term project level stereotype (so that the helpers may detect the location of the profile on the file system which allows relative paths). The property should contain the path to the theme properties file and may be an absolute path or relative to the profile (.sbsx) file. If you wish to provide your users with choices, then you can make the property conditional.
To specify a theme as a user, set the Theme property to Custom and then specify the path to the theme properties file in the following property:
RhapsodyPowerPack.General.CustomTheme
This may be an absolute path or relative to the project (.rpyx) file.
Both above mechanisms support relative paths to the theme properties file, for example
· MyTheme.properties (in same folder as project/profile unit)
· ../MyThemes/MyTheme.properties (look one level up then in a sub folder MyThemes)
· CustomFiles/Themes/MyTheme.properties (look for a CustomFiles folder in the same folder as the unit, then look for a Themes folder inside that)
· ./CustomFiles/Themes/MyTheme.properties (look for a Doc folder in the same folder as the unit, then look for a Help folder inside that)
If either of the above mechanisms fail (for example of the specified properties file does not exist) then the Default theme is applied (as if the Theme property was set to Default).
Themes are defined using an open-source framework called FlatLaf. There are many options for defining properties documented on the FlatLaf website (https://www.formdev.com/flatlaf/)
A sample model is provided in the Samples/CustomThemes folder that demonstrates both approaches and includes sample custom theme properties files in addition to useful hyperlinks to the FlatLaf documentation (and a very useful Theme Editor tool):
