Search in sources :

Example 1 with IFormFieldContextMenu

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

the class AbstractGroupBox method initMenus.

private void initMenus() {
    List<Class<? extends IMenu>> declaredMenus = getDeclaredMenus();
    List<IMenu> contributedMenus = m_contributionHolder.getContributionsByClass(IMenu.class);
    OrderedCollection<IMenu> menus = new OrderedCollection<IMenu>();
    for (Class<? extends IMenu> menuClazz : declaredMenus) {
        menus.addOrdered(ConfigurationUtility.newInnerInstance(this, menuClazz));
    }
    menus.addAllOrdered(contributedMenus);
    injectMenusInternal(menus);
    new MoveActionNodesHandler<IMenu>(menus).moveModelObjects();
    // set container on menus
    IFormFieldContextMenu contextMenu = new FormFieldContextMenu<IGroupBox>(this, menus.getOrderedList());
    contextMenu.setContainerInternal(this);
    setContextMenu(contextMenu);
}
Also used : IMenu(org.eclipse.scout.rt.client.ui.action.menu.IMenu) FormFieldContextMenu(org.eclipse.scout.rt.client.ui.action.menu.root.internal.FormFieldContextMenu) IFormFieldContextMenu(org.eclipse.scout.rt.client.ui.action.menu.root.IFormFieldContextMenu) OrderedCollection(org.eclipse.scout.rt.platform.util.collection.OrderedCollection) IFormFieldContextMenu(org.eclipse.scout.rt.client.ui.action.menu.root.IFormFieldContextMenu)

Example 2 with IFormFieldContextMenu

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

the class AbstractPageWithNodes method enhanceDetailFormWithPageMenus.

protected void enhanceDetailFormWithPageMenus() {
    if (getOutline() == null) {
        return;
    }
    IForm form = getDetailForm();
    IFormFieldContextMenu mainBoxContextMenu = form.getRootGroupBox().getContextMenu();
    List<IMenu> menus = mainBoxContextMenu.getChildActions();
    for (IMenu menu : getOutline().getMenusForPage(this)) {
        // TODO [6.2] hmu, bsh: menues im ui sammeln anstelle in forms injecten
        if (menu.getMenuTypes().contains(TreeMenuType.Header) && menu.getMenuTypes().size() == 1) {
            // Don't show TreeMenuType.Header. These menus should only be shown on outline title
            continue;
        }
        menus.add(OutlineMenuWrapper.wrapMenu(menu));
    }
    if (!CollectionUtility.equalsCollection(menus, mainBoxContextMenu.getChildActions())) {
        mainBoxContextMenu.setChildActions(menus);
    }
}
Also used : IMenu(org.eclipse.scout.rt.client.ui.action.menu.IMenu) IFormFieldContextMenu(org.eclipse.scout.rt.client.ui.action.menu.root.IFormFieldContextMenu) IForm(org.eclipse.scout.rt.client.ui.form.IForm)

Example 3 with IFormFieldContextMenu

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

the class AbstractTabBox method initMenus.

private void initMenus() {
    List<Class<? extends IMenu>> declaredMenus = getDeclaredMenus();
    List<IMenu> contributedMenus = m_contributionHolder.getContributionsByClass(IMenu.class);
    OrderedCollection<IMenu> menus = new OrderedCollection<IMenu>();
    for (Class<? extends IMenu> menuClazz : declaredMenus) {
        try {
            menus.addOrdered(ConfigurationUtility.newInnerInstance(this, menuClazz));
        } catch (Exception e) {
            BEANS.get(ExceptionHandler.class).handle(new ProcessingException("error creating instance of class '" + menuClazz.getName() + "'.", e));
        }
    }
    menus.addAllOrdered(contributedMenus);
    try {
        injectMenusInternal(menus);
    } catch (Exception e) {
        LOG.error("error occured while dynamically contributing menus.", e);
    }
    new MoveActionNodesHandler<IMenu>(menus).moveModelObjects();
    // set container on menus
    IFormFieldContextMenu contextMenu = new FormFieldContextMenu<ITabBox>(this, menus.getOrderedList());
    contextMenu.setContainerInternal(this);
    setContextMenu(contextMenu);
}
Also used : IMenu(org.eclipse.scout.rt.client.ui.action.menu.IMenu) FormFieldContextMenu(org.eclipse.scout.rt.client.ui.action.menu.root.internal.FormFieldContextMenu) IFormFieldContextMenu(org.eclipse.scout.rt.client.ui.action.menu.root.IFormFieldContextMenu) OrderedCollection(org.eclipse.scout.rt.platform.util.collection.OrderedCollection) IFormFieldContextMenu(org.eclipse.scout.rt.client.ui.action.menu.root.IFormFieldContextMenu) ProcessingException(org.eclipse.scout.rt.platform.exception.ProcessingException) ProcessingException(org.eclipse.scout.rt.platform.exception.ProcessingException)

Aggregations

IMenu (org.eclipse.scout.rt.client.ui.action.menu.IMenu)3 IFormFieldContextMenu (org.eclipse.scout.rt.client.ui.action.menu.root.IFormFieldContextMenu)3 FormFieldContextMenu (org.eclipse.scout.rt.client.ui.action.menu.root.internal.FormFieldContextMenu)2 OrderedCollection (org.eclipse.scout.rt.platform.util.collection.OrderedCollection)2 IForm (org.eclipse.scout.rt.client.ui.form.IForm)1 ProcessingException (org.eclipse.scout.rt.platform.exception.ProcessingException)1