are we not able to access the onlick for each individual men

The common approach is to use single event handler for all menu bar.

menu.setOnClickHandler(function(id){
    alert(id+" was clicked");
});

The component has a way to assign specific event handlers for each item as well

menu.getItem(“ID”).setSecondAction(function(){
    //personal event handler
});