index > Visual Studio Team System - Domain-Specific Language Tools > Show or Hide icon decorator at runtime

Show or Hide icon decorator at runtime


Hi all,

I am looking for a way to show or hide at runtime an icon decorator on a shape depending on the state of the associated model element. 

It could also be interesting to be able to change the image display by the icon decorator to reflect the state of  the model element.

Is it possible??

Freddo

 

Freddo

Hi Freddo,

Let me try to answer your first question first. If you know beforehand on which states ( which I presume here you mean the value of a domain property) you want to show or hide the icon decorator, you can use the Visibility Filter of the decorator. You can find the fitler by selecting the shape in the language designer, then in the DSL Details toolbox, go to Mapping Details and select your icon decorator. There, you can enable Visuality Fitler and choose the property that you want the decorator's visibility depends on. The icon decorator will show when the domain property equals to any of those in Visilbity Entries.

If the visibility of the decorator depends on more than one domain properties, I suppose you can create a domain property like "ShowIcon" and do the above, then use a ChangeRule to listen to changes in domain properties and update ShowIcon as appropriated.

Regards,
Steven




DSL Tools - SDE Intern
Steven Tung

Hi Steven,

First, thank you for the help.

Second, do you know if I can hide the "ShowIcon" property (assuming i do has you suggested) in the Properties window since I don't want the user to be able to change this property.

Regards,

Freddo

Freddo
Hi Freddo,

You can hide the property by setting its IsBrowseable to false.

Regards,
Steven Tung



DSL Tools - SDE Intern
Steven Tung
reply 4

You can use google to search for other answers

 

More Articles

How to Add context menu to shapes
How do you Add F1 Help and ToolTips to a Modeler?
What to use instead of GetDisplayProperties
Text template load a file
Non string name domain properties
Deployment - template doesn't appear under project types
Model Query Capabilities
Custom Command improvements
ReportTemplate Folder
Keeping separate models in step
Welcome to Bokebb   New Update   Joins the collection  
 

New Articles

VS SDK March 2006/ DSL TOOLS - Problem t…
Migrating between languages
Tying domain classes to shape objects
How to integrate custom DSL with Class D…
Role Expressions
updated DSL Customization Samples and Gu…
Odd results experimenting with shapes an…
Cannot add DSL diagram into a Web Project
Workaround: Recovering invalid model fil…
How to make the connector text parallel …
I have a new article from the NOV CTP ba…
Designing ClassDesigner in DSL Tools?
Reminder Web Chat this Tuesday
How to Limit Number of Connectors Betwee…
t4 in a custom/stand alone tool

Hot Articles

new connectors
Extending right-click menu for DSL class
How to set custom properties at runtime?
reuse of model elements
Popup dialog in DSL
Documentation for Microsoft.VisualStudio…
Unable to Replace Old Files by New ones
Zoom feature
embedding relationship
Template transformation error in designe…
how can i use the DiagramView to develop…
cannot drag & drop shape from toolbox
What one-shot recipes would you add to D…
Are these known problems
How to generate Hashtable like collection?

Recommend Articles

No 'add new...' on Compartment
Custom type for property
How to manually process template in June…
Problems loading package
Role Expressions
Custom Modeler Code
Define a menu command
.tt files shouldn't be copyrighted
Multiple viewpoints/ zoom in, zoom out
DSL Designer architecture
Opening an existing DSL in a fresh insta…
Finding the associated presentation elem…
DSL interacting with VS project system.
Can we host DSL designer in a custom hos…
Two way synchronization