}
protected void constructViewMenu(AbstractMenuBuilder menu) {
AbstractMenuBuilder originsAndTerminations = menu.addSubMenu("Origins and terminations");
/*
* Build the "show origins" menu
*/
Origin[] origins = getModel().getOrigins();
if (origins.length > 0) {
AbstractMenuBuilder originsMenu = originsAndTerminations.addSubMenu("Show origin");
for (Origin element : origins) {
originsMenu.addAction(new ShowOriginAction(element.getName()));
}
}
/*
* Build the "show origins" menu
*/
Termination[] terminations = getModel().getTerminations();
if (terminations.length > 0) {
AbstractMenuBuilder terminationsMenu = originsAndTerminations.addSubMenu("Show termination");
for (Termination element : terminations) {
terminationsMenu.addAction(new ShowTerminationAction(element.getName()));
}
}
originsAndTerminations.addAction(new ShowAllOandTAction("Show all"));
originsAndTerminations.addAction(new HideAllOandTAction("Hide all"));