Skip to content

Icons

The database objects tree, actions and object views show icons for the elements in a database profile. An icon is defined by mapping a logical name to an icon file.

These elements support the icon attribute:

  • GroupNode
  • DataNode
  • DataView
  • Action

The type attribute of GroupNode and DataNode elements connects the node to the other parts of the profile (commands, actions and views). For GroupNode and DataNode, the type is also used as the icon name when there is no icon attribute.

The following example shows the icon attribute of a DataNode element. A condition sets the icon based on the value of getCatalogs.TABLE_CAT:

<DataNode type="Catalog" label="${getCatalogs.TABLE_CAT}"
   icon="#dataMap.get('getCatalogs.TABLE_CAT').equals('sales') ? 'salesIcon' :
           (#dataMap.get('getCatalogs.TABLE_CAT').equals('support') ? 'supportIcon' : null)">
</DataNode>

The icons-db.prefs file

Icons are defined in a text file with one name=iconName entry per row. DbVisualizer includes the resources/profiles/icons-db.prefs file in the installation folder. It maps the icons used in the included database profiles, which are in the same folder. This is a sample of the file:

# Name                                      Lucide (SVG)
# ----------------------------------------- ---------------------------------------------------------------------
collection.size.small                      =16x16
collection.size.large                      =24x24
collection.size.small.folder               =/images/lucide/lucide;/images/lucide/lucide-fix
collection.size.large.folder               =/images/lucide/lucide;/images/lucide/lucide-fix
collection.size.overlay.scale              =0.7
collection.base.color.default              =
collection.badge.color.default             =ASIS

icon.db.ASM                                =database.svg
icon.db.ASMDisk                            =hard-drive.svg
...

The collection.* entries define settings for all icons in the file, such as the search path and scaling. The icon.db.<name>=<icon name>.svg entries map a logical name to an icon file. For GroupNode, DataNode and DataView elements, DbVisualizer adds the icon.db. prefix to the icon or type value to find the entry. DbVisualizer uses the Lucide icon collection, where all icons are SVG files, with support for coloring, scaling and overlays.

For an Action element, DbVisualizer adds the icon.dbvis. prefix to the icon value instead. These icons are the same as the ones used in the rest of DbVisualizer, for example add or remove.

The object type may refer to a group of objects (GroupNode), such as Tables, Views and Procedures, or to a single object (DataNode), such as Table, View and Procedure. Use the plural form for the type of a GroupNode and the singular form for a DataNode. The icon for, for example, Tables and Table is usually the same, but you still need one entry for each in the icons-db.prefs file.

Icons search path

DbVisualizer also reads your own icons-db.prefs files from the folders in the database profile search path, which you set in Tool Properties → General → Database Connection → Database Profile.

The default search path is:

${dbvis.prefsdir}/ext/profiles
${dbvis.home}/resources/profiles
  • ${dbvis.prefsdir} is the folder of the current workspace, by default the .dbvis folder in your home folder.
  • ${dbvis.home} is the DbVisualizer installation folder.

DbVisualizer reads an icons-db.prefs file from each of your own folders in the search path, if the file exists.

This is an example of a ${dbvis.prefsdir}/ext/profiles/icons-db.prefs file:

icon.db.Alert                    =megaphone.svg
icon.db.ASM                      =database.svg
icon.db.ASMDisk                  =hard-drive.svg

The icon for the icon.db.Alert entry, the Lucide icon megaphone.svg, is included in DbVisualizer.