Developer Discussions

Discuss topics with other Hexagon Geospatial Power Portfolio developers and experts to get the most out of our products.
Showing results for 
Search instead for 
Do you mean 
Occasional Contributor
Posts: 12
Registered: ‎10-14-2015

GMSC java Plugin - @Action icon can it only display for specific project?



I am try to have created a Action Java Plugin (e.g. Sample Below),  at the @Action parameter, how to set if only Specific Project being display instead of now it display for all project?  


Sample Below:

@Action(icon="expand-25.svg",actionLocation=ActionLocation.FAVORITES, activeRequired = true, minimumSelection = 1, maximumSelection = 1)
public void FitMe() {
// get selected elements
MapSelectionCurator mapSelectionCurator = ApplicationContext.getBrowser().getMapSelectionCurator();
//GMap map = ApplicationContext.getBrowser().getMap();

Object[] selectedElementIds = mapSelectionCurator.getSelectedElements();

if (selectedElementIds == null) return;
if (!ApplicationContext.getInstance().isOffline())




Thanks & Regards,


Frequent Contributor
Posts: 90
Registered: ‎10-13-2015

Re: GMSC java Plugin - @Action icon can it only display for specific project?

[ Edited ]

Hi Cath,


check this ..., whole solution is in repo.


But I am afraid in the actionLocation where you have your action, you can achieve just that the icon is grayed out, but always visible - I guess this is the default behavior and there is no easy way, how to hide the icon or label of the action. If you put the action to the actionLocation.LEGENDCONTEXT, actionLocation.MAPCONTEXT or actionLocation.ELEMENTCONTEXT, the icon will be hidden in case of actionCondition is false, but not in case if you put it somewhere else (here will be just grayed out). 


Hope this helps!