As much as I think having this logic in the view is a bad idea, the only way would be to test for the name of the node on the <li> element in the code I posted.Best thing to do in my opinion would be to add code to your OSGI bundle to handle this, since it'll be re-usable across multiple components ...