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);
}
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);
}
}
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);
}
Aggregations