private void addActions(Menu menu) { // add repository action
   Presentation selectedPresentation = view.getContentProvider().getPresentation();
   for (final Presentation presentation : Presentation.values()) {
     Action action =
         new Action() {
           @Override
           public void run() {
             view.getContentProvider().setPresentation(presentation);
           }
         };
     action.setText(presentation.toString());
     action.setChecked(presentation == selectedPresentation);
     ActionContributionItem item = new ActionContributionItem(action);
     item.fill(menu, -1);
   }
 }