本文整理了Java中com.qcadoo.view.api.ribbon.Ribbon.getGroups
方法的一些代码示例,展示了Ribbon.getGroups
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Ribbon.getGroups
方法的具体详情如下:
包路径:com.qcadoo.view.api.ribbon.Ribbon
类名称:Ribbon
方法名:getGroups
暂无
代码示例来源:origin: qcadoo/mes
public void onDeleteRow(final ViewDefinitionState view, final ComponentState componentState, final String[] args) {
AwesomeDynamicListComponent adl = (AwesomeDynamicListComponent) view.getComponentByReference("issues");
if (adl.getFormComponents().isEmpty()) {
WindowComponent window = (WindowComponent) view.getComponentByReference("window");
window.getRibbon().getGroups().stream().filter(g -> !g.getName().equals("navigation"))
.flatMap(g -> g.getItems().stream()).forEach(i -> {
i.setEnabled(false);
i.requestUpdate(true);
});
}
}
}
代码示例来源:origin: qcadoo/mes
private void disableViewForState(final ViewDefinitionState view) {
FormComponent form = (FormComponent) view.getComponentByReference(L_FORM);
Entity toc = form.getEntity();
if (toc.getId() == null) {
return;
}
toc = dataDefinitionService.get(TechnologiesConstants.PLUGIN_IDENTIFIER,
TechnologiesConstants.MODEL_TECHNOLOGY_OPERATION_COMPONENT).get(toc.getId());
Entity technology = toc.getBelongsToField(TechnologyOperationComponentFields.TECHNOLOGY);
if (!TechnologyState.DRAFT.getStringValue().equals(technology.getStringField(TechnologyFields.STATE))) {
WindowComponent windowComponent = (WindowComponent) view.getComponentByReference(L_WINDOW);
Ribbon ribbon = windowComponent.getRibbon();
ribbon.getGroups().stream().filter(group -> !group.getName().equals("navigation"))
.forEach(group -> group.getItems().forEach(item -> {
item.setEnabled(false);
item.requestUpdate(true);
}));
form.setFormEnabled(false);
}
}
代码示例来源:origin: qcadoo/mes
public void disabledRibbonWhenOrderIsSynchronized(final ViewDefinitionState view) {
FormComponent orderForm = (FormComponent) view.getComponentByReference(L_FORM);
WindowComponent window = (WindowComponent) view.getComponentByReference(L_WINDOW);
Ribbon ribbon = window.getRibbon();
List<RibbonGroup> ribbonGroups = ribbon.getGroups();
Long orderId = orderForm.getEntityId();
if (orderId == null) {
return;
}
Entity order = orderService.getOrder(orderId);
if (orderStateService.isSynchronized(order)) {
return;
}
for (RibbonGroup ribbonGroup : ribbonGroups) {
for (RibbonActionItem ribbonActionItem : ribbonGroup.getItems()) {
ribbonActionItem.setEnabled(false);
ribbonActionItem.requestUpdate(true);
}
}
RibbonActionItem refreshRibbonActionItem = ribbon.getGroupByName("actions").getItemByName("refresh");
RibbonActionItem backRibbonActionItem = ribbon.getGroupByName("navigation").getItemByName("back");
refreshRibbonActionItem.setEnabled(true);
backRibbonActionItem.setEnabled(true);
refreshRibbonActionItem.requestUpdate(true);
backRibbonActionItem.requestUpdate(true);
orderForm.setFormEnabled(false);
}
内容来源于网络,如有侵权,请联系作者删除!