private void setEnabled(MHandledMenuItem itemModel, MenuItem newItem) { ParameterizedCommand cmd = itemModel.getWbCommand(); if (cmd == null) { return; } final IEclipseContext lclContext = getContext(itemModel); EHandlerService service = lclContext.get(EHandlerService.class); final IEclipseContext staticContext = EclipseContextFactory .create(HMI_STATIC_CONTEXT); ContributionsAnalyzer.populateModelInterfaces(itemModel, staticContext, itemModel.getClass().getInterfaces()); try { itemModel.setEnabled(service.canExecute(cmd, staticContext)); } finally { staticContext.dispose(); } newItem.setEnabled(itemModel.isEnabled()); }
void setEnabled(MHandledMenuItem item) { if (!item.isToBeRendered() || !item.isVisible() || item.getWidget() == null) { return; } ParameterizedCommand cmd = item.getWbCommand(); if (cmd == null) { return; } final IEclipseContext lclContext = renderer.getContext(item); EHandlerService service = lclContext.get(EHandlerService.class); final IEclipseContext staticContext = EclipseContextFactory .create(MMRF_STATIC_CONTEXT); ContributionsAnalyzer.populateModelInterfaces(item, staticContext, item .getClass().getInterfaces()); try { item.setEnabled(service.canExecute(cmd, staticContext)); } finally { staticContext.dispose(); } }
void setEnabled(MHandledMenuItem item) { if (!item.isToBeRendered() || !item.isVisible() || item.getWidget() == null) { return; } ParameterizedCommand cmd = item.getWbCommand(); if (cmd == null) { return; } final IEclipseContext lclContext = renderer.getContext(item); EHandlerService service = lclContext.get(EHandlerService.class); final IEclipseContext staticContext = EclipseContextFactory .create(MMRF_STATIC_CONTEXT); ContributionsAnalyzer.populateModelInterfaces(item, staticContext, item .getClass().getInterfaces()); try { item.setEnabled(service.canExecute(cmd, staticContext)); } finally { staticContext.dispose(); } }
.getWbCommand(); EHandlerService handlerService = evalContext .get(EHandlerService.class);
if (i18nLabel != null) { text = i18nLabel; } else if (hmi.getWbCommand() != null) { try { text = hmi.getWbCommand().getName(); } catch (NotDefinedException e) {
.getWbCommand(); EHandlerService handlerService = evalContext .get(EHandlerService.class);
flags = SWT.RADIO; ParameterizedCommand cmd = itemModel.getWbCommand(); if (cmd == null) { IEclipseContext lclContext = getContext(itemModel);