Java 类org.eclipse.jface.action.ContributionManager 实例源码

项目:swt-widgets    文件:ActionUtils.java   
public static void addActions(ContributionManager cm, IActionManager am,
    String[] actionIds) {
  for (final String id : actionIds) {
    if ((id == null) || (id.length() == 0)) {
      continue;
    }
    if (Separator.ID.equals(id)) {
      cm.add(new Separator());
    } else if (Fill.ID.equals(id)) {
      cm.add(new Fill());
    } else {
      final IAction action = am.get(id);
      if (action == null) {
        LOGGER.error("Unknown action: {}", id);
      } else {
        cm.add(action);
      }
    }
  }
}
项目:avro-schema-editor    文件:SchemaPopupMenuConfigurationImpl.java   
@Override
public void fillPopupMenu(IMenuManager manager, SchemaViewer viewer) {
    for (String section : ORDERED_SECTIONS) {
           manager.add(new Separator(section));
       }
    IMenuService service = serviceProvider.getMenuService();
       service.populateContributionManager((ContributionManager) manager, getPopupMenuId());
}
项目:avro-schema-editor    文件:SchemaRegistryView.java   
protected void fillPopupMenu(IMenuManager manager) {
    IMenuService service = (IMenuService) editor.getServiceProvider().getMenuService();
       service.populateContributionManager((ContributionManager) manager, POPUP_MENU_ID);
}