Search in sources :

Example 1 with TableContextMenu

use of org.eclipse.scout.rt.client.ui.action.menu.root.internal.TableContextMenu in project scout.rt by eclipse.

the class AbstractTable method initMenus.

protected void initMenus() {
    List<Class<? extends IMenu>> ma = getDeclaredMenus();
    OrderedCollection<IMenu> menus = new OrderedCollection<IMenu>();
    Map<Class<?>, Class<? extends IMenu>> replacements = ConfigurationUtility.getReplacementMapping(ma);
    if (!replacements.isEmpty()) {
        m_menuReplacementMapping = replacements;
    }
    for (Class<? extends IMenu> clazz : ma) {
        IMenu menu = ConfigurationUtility.newInnerInstance(this, clazz);
        menus.addOrdered(menu);
    }
    List<IMenu> contributedMenus = m_contributionHolder.getContributionsByClass(IMenu.class);
    menus.addAllOrdered(contributedMenus);
    injectMenusInternal(menus);
    addHeaderMenus(menus);
    // set container on menus
    for (IMenu menu : menus) {
        menu.setContainerInternal(this);
    }
    new MoveActionNodesHandler<IMenu>(menus).moveModelObjects();
    ITableContextMenu contextMenu = new TableContextMenu(this, menus.getOrderedList());
    setContextMenu(contextMenu);
}
Also used : ITableContextMenu(org.eclipse.scout.rt.client.ui.action.menu.root.ITableContextMenu) IMenu(org.eclipse.scout.rt.client.ui.action.menu.IMenu) OrderedCollection(org.eclipse.scout.rt.platform.util.collection.OrderedCollection) ITableContextMenu(org.eclipse.scout.rt.client.ui.action.menu.root.ITableContextMenu) TableContextMenu(org.eclipse.scout.rt.client.ui.action.menu.root.internal.TableContextMenu)

Aggregations

IMenu (org.eclipse.scout.rt.client.ui.action.menu.IMenu)1 ITableContextMenu (org.eclipse.scout.rt.client.ui.action.menu.root.ITableContextMenu)1 TableContextMenu (org.eclipse.scout.rt.client.ui.action.menu.root.internal.TableContextMenu)1 OrderedCollection (org.eclipse.scout.rt.platform.util.collection.OrderedCollection)1