With 2026 R1 we added a new experimental feature requested by the scripting community, namely a "scripted decorator". Its basically a dedicated additional decorator that must be enabled first (opt-in) in the preferences and that is solely defined by a script.
The Enablement
The decorator can be enabled and disabled as all model browser decorators in the user preferences. Open the preferences, type "Decorations" in the filter box to quickly find the entry page. Enable the decorator.

The Behavior
The decoration script can be set in the Scripting preferences at the bottom of the page. It is by default empty which means the decorator does nothing. There are 2 different modes the script can be written which are explained hereafter separately. The first on is the simplest one: just write a normal script and expect that the element to decorate is passed as "self" into the script. The second much more performant solution is to script an object that implements a Java interface named ILightweightLabelDecorator.

The Simple Script
Lets have a look at this small self-explanatory script: :-)
if (self instanceof Metamodel.sysml.SysMLElement && self["stereotype"]) {
" [" + self.stereotype + "]";
}This will only decorate system elements with a stereotype set. The returned string will be shown as grayed suffix by default. You can copy and paste the script into the preferences to see the result. You can change the preference at runtime and the decorator will reload and adapt automatically.
While this comes handy, it has its limits:
- Its rather costly to execute a script for each object in the browser tree, even though the results is cached
This way the decorator can only add a grayed suffix, nothing more - To overcome these limitations a more sophisticated, though more complex solution is implemented as well.
The Lightweight Decorator Interface
Now look at this bit different version of the same decoration:
new ILightweightLabelDecorator({
decorate: function(element, decoration) {
if (element instanceof Metamodel.sysml.SysMLElement && element["stereotype"]) {
decoration.addSuffix(" [" + self.stereotype + "]");
decoration.addPrefix("[Stereoyped] ");
}
}
});In contrast to the above script this one is parsed only once to become a "Java Object" which is much faster. In addition is has more capabilities to decorate the element, as made visible by adding a suffix and a prefix. There are more options, for example to set an icon or font or text color. For the full details check the Eclipse interface definition for ILightweightLabelDecorator.
Happy Decorating
Jan