Workbench themes options allow you to customize the appearance of the Workbench display. Generally speaking, a theme is a predefined collection of design elements that determine the way an application appears to the user. Within the Niagara Framework, a theme is a module that controls the appearance of Workbench on the local computer by defining fonts and colors, as well as the icons, used in the Workbench display. Choosing a different theme affects only the Workbench appearance, there is no other impact.
You can customize your Workbench display by selecting the theme that you prefer. In addition to permitting you to customize your Workbench display, themes can also be used to give Workbench a “branded” appearance.
Within Workbench, there are standard “built-in” themes that you can use. You can also create and use custom themes. The built-in themes are installed as part of the Workbench application. Starting in AX-3.7, there are three built-in themes available for use, as shown below in Figure 78:
Frost
Displays a medium-blue color scheme with many custom icons.
Lucid
Displays a blue and gray color scheme. This is the theme applied to Workbench by default.
Palladium
Displays a gray color scheme.
To change the Workbench theme, click -> to see the active theme in the General tab. Click the Active theme drop-down arrow and click on a different theme option to select it, as shown in Figure 79. In order for the theme change to take effect, you must exit Workbench and restart it.
To save changes made in Workbench Options, such as a theme change, you must close/exit Workbench using menu options or click the window’s close box (
). Closing Workbench in the console will not cause those changes to be saved.
You can do this by creating a new custom theme module that specifies colors (such as, corporate colors), fonts, and icons to be used in the Workbench display and designating this as the default theme. Workbench automatically selects this theme if the user does not make another selection. You can also “force” the use of the default theme, effectively locking Workbench into using the default theme.
Designate a default theme
This procedure explains how to designate a default theme and lock it.
Open the brand.properties file in the /lib folder and add the following two lines of text, replacing “themeName” with your custom theme name, as shown in Figure 80:
workbench.theme.default=themeName
workbench.theme.locked=true
Click -> to save your changes in the brand.properties file.
Restart Workbench for this change to take affect.
Locking the theme hides the Active theme drop-down, normally visible in Workbench so that no other theme can be selected.
As with all Workbench modules, a theme module contains the build.xml and module-include.xml files. A module is identified as a theme module by adding a <defs> tag with a themeName definition within module-include.xml, as shown below:
Also required in a theme module, is at least one text file with the extension .nss located in /src/nss. A Niagara Style Sheets (NSS) file is used to enable styling of fonts, colors, and other attributes of the Workbench display
using syntax and keywords similar to those used in HTML Cascading Style Sheets (CSS).
Although NSS shares some syntax and keywords with CSS, the languages are not the same. NSS performs cascading like CSS, however
the syntax is different. Also, NSS has no positioning selectors while CSS has many. Refer to the “NiagaraAX Developers Guide” for more details.
All of the resources files (NSS files, .PNG, etc.) for you theme module must be located under the /src folder and must be specified within build.xml with the standard <resources> tag:
<resources name="nss/*.*" />
With all resources tags, you must omit the “/src” directory from the value provided for the “name” attribute.
You can override any Workbench icons with custom icons in your theme module. Your custom icon image files (*.PNG) must be located in the /src/imageOverrides folder within your theme module. Subfolders within /imageOverrides correspond to the name of the module containing the icons
you wish to override. For example, to override a Workbench icon located in the icons module your .PNG file must be located
in /imageOverrides/icons/x16 in your theme module and that exact path must be
specified in a resources tag within the build.xml file for your theme module:
<resources name="imageOverrides/icons/x16/*.*" />
When overriding icons your must duplicate the original filenames and folder structure exactly. Otherwise, the path to the
icons will be incorrect and the custom icons will not display. You can determine the correct path and filenames to use by
examining the feature whose icons you want to override and look inside the corresponding module for the path to those icon
files.
For example, if overriding the alarm icon in the alarm module, first examine the contents of the alarm module and note the
filename and path to that icon (alarm/com/tridium/alarm/icons/alarm.png), as shown in Figure 82. Next, duplicate that path under the /imageOverrides folder in your theme module, placing your image file named alarm.png in: /imageOverrides/alarm/com/tridium/alarm/icons. Next, specify the exact path in a resources tag within the build.xml file for your theme module:
<resources name="imageOverrides/alarm/com/tridium/alarm/icons/alarm.png" />
Also, you can have several themes sharing the same set of custom icons by placing multiple NSS files inside the /src/nss folder. Each of the NSS files will be individually selectable as a separate theme in the drop-down. Doing this eliminates the need to have duplicate sets of icons in separate theme modules.
The following procedures describe how to:
Create a new theme module
This procedure describes the steps used to create a new theme module.
In the Workbench Nav pane, under My File System, navigate to Niagara 3.7.x and expand it. Create a new /themes subfolder there to store your custom themes. This is where the new theme module that you create will be located.
Click -> and fill-in the fields in the New Module dialog box, as shown in Figure 83.
Enter the path to the /themes folder created above (for example: C:/niagara/Niagara-3.7.x/themes).
Enter a name for the theme using this naming convention, themeName (for example: themeCitrus).
Enter a Preferred Symbol (four-letter abbreviation) for the new theme name (for example: thci).
Enter a Description (for example: Niagara Workbench theme module).
Enter a Vendor (for example: Tridium).
Clear the checked check box for Create Lexicon and click the button to advance to the next screen.
Remove any Dependencies listed in the dialog box and click the button.
No Packages are required. Click the button to create the new module.
The new module contains the two required XML files: build.xml and module-include.xml, as shown in Figure 84.
Using a text editor, open module-include.xml and add the <defs> tag to identify this module as a theme module, as shown in Figure 85:
Copy resources from a built-in theme module
This procedure describes how to obtain resources from another theme module and add appropriate resources tags to the build.xml file in the new theme module.
In addition to the .xml files mentioned earlier, the theme module requires that at least one Niagara Style Sheet (NSS) file
be located in: /src/nss. Copying an existing NSS file, along with other resources, from one of the built-in themes will save time and reduce the
chance of introducing errors.
In the Nav pane under My File System, navigate to your new theme module in the /themes folder. Create a new subfolder there named /src (for example: /themes/themeCitrus/src). This is where all resources must be located.
In the Nav pane under My Modules, scroll down to locate the built-in theme modules (themeFrost.jar, themeLucid.jar, themePalladium.jar).
Double-click themeLucid.jar to display its resources. Select all the resource folders and copy them.
Under My File System, navigate to your new theme module in the /themes folder, and paste the copied resource folders into the /src subfolder.
Using a text editor, open the build.xml file in your theme module and add a <resources> tag for each folder copied from the built-in theme module , as shown in Figure 86:
At this point, your new theme module has everything needed to build a .jar file. However, since the NSS file was copied from another theme, your new theme will have an identical appearance. To make
your new theme distinguishable from the other, you must change design elements within the NSS file.
Modify design elements in the NSS file
This procedure briefly describes an approach to modifying design elements in an NSS file to give Workbench a unique appearance.
In the Nav pane under My File System, navigate to your theme module and expand it to access the NSS file in /src/nss. Using a text editor, open the NSS file and scroll to the Define statements (#define...) located at the top of the NSS file.
These statements define certain font and color styles that typically are applied repeatedly throughout the NSS file. Modifying
a few color definitions in the #define statements will have the most noticeable impact on the Workbench display.
Colors may be specified as RGB colors in hexadecimal format (for example: #000, #ffffff ); or in many cases, colors may be specified according to their common English names, such as gray, white, blue, etc.
Refer to the NiagaraAX Developer Guide section on HX Theming for more information on NSS file properties. Also, an Internet search for “html color codes” will result in many color code
examples.
After completing modifications, save the NSS file.
Build a.jar file for the theme module
This procedure describes building a .jar file for a new theme module so that the module can be deployed in Workbench.
Open the Niagara Console and run the following build command, as shown in Figure 87:
build -p [path to build.xml file] jar
Confirm that the .jar file (for example: themeCitrus.jar) was created in the /modules folder.
Exit and restart Workbench to load the .jar file.
Activate the new theme module
This procedure covers activating a new theme module.
Select the new theme module in -> under the Active Theme drop-down, as shown in Figure 88.
Click -> and restart Workbench, the new theme will be active, as shown in Figure 89.
To save changes made in Workbench Options, such as a theme change, you must close/exit Workbench using menu options or click the window’s close box (
). Closing Workbench in the console will not cause those changes to be saved.
Copyright © 2000-2014 Tridium Inc. All rights reserved.