Search in sources :

Example 1 with MenuItemManager

use of com.biglybt.ui.common.util.MenuItemManager in project BiglyBT by BiglySoftware.

the class PluginsMenuHelper method buildToolsMenu.

public static boolean buildToolsMenu(Menu toolsMenu) {
    MenuItemManager menuItemManager = MenuItemManager.getInstance();
    com.biglybt.pif.ui.menus.MenuItem[] plugin_items = menuItemManager.getAllAsArray(MenuManager.MENU_MENUBAR_TOOLS);
    if (plugin_items.length > 0) {
        sort(plugin_items);
        MenuBuildUtils.addPluginMenuItems(plugin_items, toolsMenu, true, true, MenuBuildUtils.BASIC_MENU_ITEM_CONTROLLER);
    }
    return false;
}
Also used : MenuItemManager(com.biglybt.ui.common.util.MenuItemManager) MenuItem(org.eclipse.swt.widgets.MenuItem)

Example 2 with MenuItemManager

use of com.biglybt.ui.common.util.MenuItemManager in project BiglyBT by BiglySoftware.

the class PluginsMenuHelper method buildViewMenu.

public static boolean buildViewMenu(Menu viewMenu) {
    int itemCount = viewMenu.getItemCount();
    MenuItemManager menuItemManager = MenuItemManager.getInstance();
    com.biglybt.pif.ui.menus.MenuItem[] plugin_items = menuItemManager.getAllAsArray(MenuManager.MENU_MENUBAR);
    if (plugin_items.length > 0) {
        sort(plugin_items);
        MenuBuildUtils.addPluginMenuItems(plugin_items, viewMenu, true, true, MenuBuildUtils.BASIC_MENU_ITEM_CONTROLLER);
    }
    List<UISWTViewBuilderCore> mainViewBuilders = getMainViewBuilder(ViewManagerSWT.getInstance());
    if (plugin_items.length > 0 && mainViewBuilders.size() > 0) {
        new MenuItem(viewMenu, SWT.SEPARATOR);
    }
    createViewInfoMenuItems(viewMenu, mainViewBuilders);
    if (viewMenu.getItemCount() > itemCount) {
        MenuFactory.addSeparatorMenuItem(viewMenu);
    }
    MenuItem menu_plugin_logViews = MenuFactory.addLogsViewMenuItem(viewMenu);
    ViewManagerSWT vi = ViewManagerSWT.getInstance();
    List<UISWTViewBuilderCore> logViewBuilders = getLogViewBuilders(vi);
    createViewInfoMenuItems(menu_plugin_logViews.getMenu(), logViewBuilders);
    return viewMenu.getItemCount() > itemCount;
}
Also used : MenuItemManager(com.biglybt.ui.common.util.MenuItemManager) UISWTViewBuilderCore(com.biglybt.ui.swt.pifimpl.UISWTViewBuilderCore) ViewManagerSWT(com.biglybt.ui.swt.views.ViewManagerSWT) MenuItem(org.eclipse.swt.widgets.MenuItem)

Aggregations

MenuItemManager (com.biglybt.ui.common.util.MenuItemManager)2 MenuItem (org.eclipse.swt.widgets.MenuItem)2 UISWTViewBuilderCore (com.biglybt.ui.swt.pifimpl.UISWTViewBuilderCore)1 ViewManagerSWT (com.biglybt.ui.swt.views.ViewManagerSWT)1