String s = ((JMenuItem)c).getActionCommand(); ((JMenuItem)c).setEnabled(ActionUtil.isActionAllowed(s, organizer, true));
Action action = ((JMenuItem)c).getAction();  if (action != null) ActionUtil.setActionAllowed(action, organizer);
  private void configureMenu(JPopupMenu menu) {    int n = menu.getComponentCount();    for (int i = 0; i < n; i++) {      Component c = menu.getComponent(i);      if (c != null && c instanceof JMenuItem) {        String s = ((JMenuItem)c).getActionCommand();        ((JMenuItem)c).setEnabled(ActionUtil.isActionAllowed(s, organizer, true));      }    }  }