Customizing View Management's Show options (filtering)

The Show options on the View Management page of the Options dialogs surface configuration properties contained in the filters.config file. These properties control what kinds of things are elided (hidden) in diagrams. By default, nothing is elided.

At the properties level, Together essentially defines 'filters' that remove the defined elements from view when the option is activated (hence the filename filters.config). The default state of the filters is off, meaning that the defined elements are not filtered... that is, they are shown. At the UI level, when a filter in the properties file is off, then the option's value ("Show") is true and the option displays in the checked state in the Options dialog.

The Show options on the View Management page of the Options dialog are all fully user-definable, not just those labeled "User Defined". However, the pre-defined filtering plus your customization of the "user-defined" options are usually sufficient for most needs.

Changing the display text of a Show option

You might want to change the name of the options that appear in the Options dialog... to accommodate international users for example. By default, the names of the options are extracted from a resource file. Thus, in the following line from the filters.config file:

optionsEditor.item.View Management.item.Filters.item.A.item.shortName.name = ["filters/filter_shortName"]

...the text shown in blue is a reference to a string in a resource file. To change the name that displays in the Options dialog, you must either edit it the resource file, or replace the [reference] in the configuration file with a string literal in double-quotes.

To edit the resource file:

  1. Open the resource file $TOGETHER_HOME/lib/i18n/filters.properties in a text editor.

  2. Search for the name of the option... "All Packages" for example. The search should turn up a line similar to this: all_packages=All Packages.

  3. Edit the name (shown in blue above) as desired.

  4. Save and close the properties file.

The changes take effect the next time you start Together. Administrators with international users may want to make copies of the resource file for different language and replace the English default file in the installations of non-English speaking users.

Removing a Show option in the Options dialog

If you do not want to use one of the predefined options and do not want it to appear in the Options dialog, comment out all lines of the option's section (e.g. "All Classes") in the filters.config file. Update the sequential information (as described in the next section) to compensate for the removal of the commented section from the file's section sequence.

Adding a Show option in the Options dialog

Conversely, you can create a new option and display it in the Options dialog by copying any of the existing sections and modifying the lines as necessary to get the elision you want. Note that the sections in the properties file are arranged sequentially and contain sequential information imbedded in the lines. When you add a section, you must modify this information throughout the section so it is the last in the sequence.

For example, the section for the All Packages option is the first section and contains the following lines:

filter.a = hasProperty("$physicalPackage")
...
optionsEditor.item.View Management.item.Filters.item.A.order = 10

The file as shipped has 12 sections. So the above lines in the last section read as follows:

filter.l = hasProperty("$physicalPackage")
...
optionsEditor.item.View Management.item.Filters.item.L.order = 120

Suppose you copy the first section and paste it at the end of the file to create a 13th section.* You would need to modify the lines as follows:

filter.m = hasProperty("$physicalPackage")
...
optionsEditor.item.ViewManagement.item.Filters.item.M.order = 130

Then, in all other lines in the section you would need to replace occurrences of .a with .m and occurrences of .A with .M. Then the sequential information in the section will be the highest in the alpha and numeric sequence.

Next, you need to customize the filter definition in the first several lines of the section (filter.[seq]). The filter expression is contained in the first line of the section, e.g.:

filter.m = hasProperty("$physicalPackage")

Text in blue is the filter expression. This is usually a call to hasProperty() or hasPropertyValue. Study the other filter expressions and observe their construction before coding your own filter expression.

For the remaining lines in this section, you can either use a reference to a resource...

filter.m.name = ["filters/my_new_filter_options"]

...in which case you must add the property my_new_filter to the filters.properties file. Or you can use a literal instead:

filter.m.name = "My New Filter Options"]

Finally, you can update the other lines in the with references to resources or literals as required.