Search in sources :

Example 1 with FormFieldContextMenu

use of org.eclipse.scout.rt.client.ui.action.menu.root.internal.FormFieldContextMenu 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 FormFieldContextMenu

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

the class AbstractButton method initConfig.

@Override
protected void initConfig() {
    super.initConfig();
    setSystemType(getConfiguredSystemType());
    setDisplayStyleInternal(getConfiguredDisplayStyle());
    setProcessButton(getConfiguredProcessButton());
    setDefaultButton(getConfiguredDefaultButton());
    setIconId(getConfiguredIconId());
    setKeyStroke(getConfiguredKeyStroke());
    setKeyStrokeScopeClass(getConfiguredKeyStrokeScopeClass());
    setPreventDoubleClick(getConfiguredPreventDoubleClick());
    // menus
    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) {
        IMenu menu;
        menu = ConfigurationUtility.newInnerInstance(this, menuClazz);
        menus.addOrdered(menu);
    }
    menus.addAllOrdered(contributedMenus);
    injectMenusInternal(menus);
    new MoveActionNodesHandler<IMenu>(menus).moveModelObjects();
    IContextMenu contextMenu = new FormFieldContextMenu<IButton>(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) IContextMenu(org.eclipse.scout.rt.client.ui.action.menu.root.IContextMenu) OrderedCollection(org.eclipse.scout.rt.platform.util.collection.OrderedCollection)

Example 3 with FormFieldContextMenu

use of org.eclipse.scout.rt.client.ui.action.menu.root.internal.FormFieldContextMenu 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 FormFieldContextMenu (org.eclipse.scout.rt.client.ui.action.menu.root.internal.FormFieldContextMenu)3 OrderedCollection (org.eclipse.scout.rt.platform.util.collection.OrderedCollection)3 IFormFieldContextMenu (org.eclipse.scout.rt.client.ui.action.menu.root.IFormFieldContextMenu)2 IContextMenu (org.eclipse.scout.rt.client.ui.action.menu.root.IContextMenu)1 ProcessingException (org.eclipse.scout.rt.platform.exception.ProcessingException)1