ICON FOR A MENU

ICON SETUP FOR A MENU

Problem:

How to set an icon for a menu like this 

Solution:

Create a transformation menu and create a action item for <select enum>

There is a additional option called 'icon'. It needs to return a 'IconResource' object. That can be created using the inbuilt 'IconResourceUtil' class.

Now you should be able to see a icon for that menu action.

But sometimes, after this configuration also menu icons might not appear. You might wonder why?
So, what happens is, this 'getIconResourceForNode' method fetches the icons configured for the node object passed as argument. That is, the concept being passed as argument should have a icon definition. That can be configured here in the concept's structure aspect. Below is the inspector view where we can set a icon. 

There are multiple icon configurations available. It can be a text, it can be a icon or a solid shape.

Example: 

I am trying to set a text 'i' of color black like below.


Thus, we get to see the menu now with icons!! 






Multiple Cardinality Error