com.qcadoo.view.api.ribbon.Ribbon.getGroupByName()方法的使用及代码示例

x33g5p2x  于2022-01-29 转载在 其他  
字(10.1k)|赞(0)|评价(0)|浏览(161)

本文整理了Java中com.qcadoo.view.api.ribbon.Ribbon.getGroupByName方法的一些代码示例,展示了Ribbon.getGroupByName的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Ribbon.getGroupByName方法的具体详情如下:
包路径:com.qcadoo.view.api.ribbon.Ribbon
类名称:Ribbon
方法名:getGroupByName

Ribbon.getGroupByName介绍

暂无

代码示例

代码示例来源:origin: qcadoo/mes

private RibbonActionItem getRibbonItemByName(String itemName) {
  Ribbon ribbon = window.getRibbon();
  RibbonGroup generateGroup = ribbon.getGroupByName("generate");
  return generateGroup.getItemByName(itemName);
}

代码示例来源:origin: qcadoo/mes

private RibbonActionItem getFillPricesButton(final ViewDefinitionState view) {
  WindowComponent window = (WindowComponent) view.getComponentByReference("window");
  Ribbon ribbon = window.getRibbon();
  RibbonGroup ribbonGroup = ribbon.getGroupByName("offer");
  return ribbonGroup.getItemByName("fillPrices");
}

代码示例来源:origin: qcadoo/mes

private void changeAcceptButtonState(WindowComponent window, final boolean enable) {
  RibbonActionItem acceptRibbonActionItem = (RibbonActionItem) window.getRibbon().getGroupByName(L_STATE)
      .getItemByName(L_ACCEPT);
  acceptRibbonActionItem.setEnabled(enable);
  acceptRibbonActionItem.requestUpdate(true);
}

代码示例来源:origin: qcadoo/mes

private void changeaAdMultipleResourcesButtonState(WindowComponent window, final boolean enable) {
  RibbonActionItem addMultipleResources = (RibbonActionItem) window.getRibbon().getGroupByName("resources")
      .getItemByName("addMultipleResources");
  addMultipleResources.setEnabled(enable);
  addMultipleResources.requestUpdate(true);
}

代码示例来源:origin: qcadoo/mes

private void updateRibbonState(final ViewDefinitionState view) {
  FormComponent addressForm = (FormComponent) view.getComponentByReference(L_FORM);
  WindowComponent window = (WindowComponent) view.getComponentByReference(L_WINDOW);
  RibbonGroup ribbonGroup = window.getRibbon().getGroupByName(L_ACTIONS);
  boolean isEnabled = shouldBeEnabled(addressForm);
  ribbonGroup.getItems().stream().forEach(ribbonActionItem -> {
    ribbonActionItem.setEnabled(isEnabled);
    ribbonActionItem.requestUpdate(true);
  });
}

代码示例来源:origin: qcadoo/mes

private void changeCheckResourcesStockButtonState(WindowComponent window, final boolean enable) {
  RibbonActionItem checkResourcesStockItem = (RibbonActionItem) window.getRibbon().getGroupByName("resourcesStock")
      .getItemByName("checkResourcesStock");
  checkResourcesStockItem.setEnabled(enable);
  checkResourcesStockItem.requestUpdate(true);
}

代码示例来源:origin: qcadoo/mes

public void updateRibbonState(final ViewDefinitionState view) {
  FieldComponent generatedField = (FieldComponent) view
      .getComponentByReference(MaterialRequirementCoverageFields.GENERATED);
  boolean generated = "1".equals(generatedField.getFieldValue());
  WindowComponent window = (WindowComponent) view.getComponentByReference(L_WINDOW);
  RibbonGroup reports = (RibbonGroup) window.getRibbon().getGroupByName(L_NEGOTIATIONS);
  RibbonActionItem createNegotiation = (RibbonActionItem) reports.getItemByName(L_CREATE_NEGOTIATION);
  updateButtonState(createNegotiation, generated);
}

代码示例来源:origin: qcadoo/mes

private void toggleRibbonButton(final ViewDefinitionState view, String groupName, String itemName, boolean enabled) {
  WindowComponent window = (WindowComponent) view.getComponentByReference("window");
  Ribbon ribbon = window.getRibbon();
  RibbonGroup group = ribbon.getGroupByName(groupName);
  RibbonActionItem item = group.getItemByName(itemName);
  item.setEnabled(enabled);
  item.requestUpdate(true);
}

代码示例来源:origin: qcadoo/mes

private void enableRibbonItem(final ViewDefinitionState view, final boolean enable) {
    WindowComponent window = (WindowComponent) view.getComponentByReference("window");
    RibbonActionItem addUp = window.getRibbon().getGroupByName("workstations").getItemByName("addUpTheNumberOfWorktations");
    addUp.setEnabled(enable);
    addUp.requestUpdate(true);
  }
}

代码示例来源:origin: qcadoo/mes

public void updateButtonsState(final ViewDefinitionState view) {
  GridComponent productionTrackingsForProductGroupedGrid = (GridComponent) view.getComponentByReference(L_GRID);
  WindowComponent window = (WindowComponent) view.getComponentByReference(L_WINDOW);
  Ribbon ribbon = window.getRibbon();
  RibbonGroup showProductionTrackingsRibbonGroup = ribbon.getGroupByName(L_SHOW_PRODUCTION_TRACKINGS);
  RibbonActionItem showProductionTrackingsForProductRibbonActionItem = showProductionTrackingsRibbonGroup
      .getItemByName(L_SHOW_PRODUCTION_TRACKINGS_FOR_PRODUCT);
  boolean isSelected = !productionTrackingsForProductGroupedGrid.getSelectedEntities().isEmpty();
  showProductionTrackingsForProductRibbonActionItem.setEnabled(isSelected);
  showProductionTrackingsForProductRibbonActionItem.requestUpdate(true);
}

代码示例来源:origin: qcadoo/mes

private void enableRibbonItem(final ViewDefinitionState view, final boolean enable) {
  WindowComponent window = (WindowComponent) view.getComponentByReference("window");
  RibbonActionItem addUp = window.getRibbon().getGroupByName("workstations").getItemByName("addUpTheNumberOfWorktations");
  addUp.setEnabled(enable);
  addUp.requestUpdate(true);
}

代码示例来源:origin: qcadoo/mes

private void setEditButtonEnabled(final ViewDefinitionState view, final boolean isEnabled) {
  WindowComponent window = (WindowComponent) view.getComponentByReference("window");
  RibbonGroup edit = (RibbonGroup) window.getRibbon().getGroupByName("edit");
  RibbonActionItem editSelectedProductFromTree = edit.getItemByName("editSelectedProduct");
  editSelectedProductFromTree.setEnabled(isEnabled);
  editSelectedProductFromTree.requestUpdate(true);
}

代码示例来源:origin: qcadoo/mes

public void disableButtonsWhenNotSelected(final ViewDefinitionState view) {
  GridComponent palletNumbersGrid = (GridComponent) view.getComponentByReference(L_GRID);
  WindowComponent window = (WindowComponent) view.getComponentByReference(L_WINDOW);
  Ribbon ribbon = window.getRibbon();
  RibbonGroup printRibbonGroup = ribbon.getGroupByName(L_PRINT);
  RibbonActionItem printPalletNumbersReportRibbonActionItem = printRibbonGroup.getItemByName(L_PRINT_PALLET_NUMBERS_REPORT);
  boolean palletNumbersAreSelected = !palletNumbersGrid.getSelectedEntities().isEmpty();
  if (printPalletNumbersReportRibbonActionItem != null) {
    printPalletNumbersReportRibbonActionItem.setEnabled(palletNumbersAreSelected);
    printPalletNumbersReportRibbonActionItem.requestUpdate(true);
  }
}

代码示例来源:origin: qcadoo/mes

private void setEnableOfRibbonActions(ViewDefinitionState viewDefinitionState, boolean enabled) {
  WindowComponent window = (WindowComponent) viewDefinitionState.getComponentByReference("window");
  Ribbon ribbon = window.getRibbon();
  RibbonGroup customActions = ribbon.getGroupByName("customActions");
  if (customActions == null) {
    return;
  }
  for (RibbonActionItem ribbonActionItem : customActions.getItems()) {
    ribbonActionItem.setEnabled(enabled);
    ribbonActionItem.requestUpdate(true);
  }
}

代码示例来源:origin: qcadoo/mes

private void updateRibbonState(final ViewDefinitionState view) {
  FormComponent technologyOperationComponentForm = (FormComponent) view.getComponentByReference(L_FORM);
  boolean isEnabled = (technologyOperationComponentForm.getEntityId() != null);
  WindowComponent window = (WindowComponent) view.getComponentByReference(L_WINDOW);
  RibbonGroup importGroup = (RibbonGroup) window.getRibbon().getGroupByName(L_IMPORT);
  RibbonActionItem importOperationProductInComponentsActionItem = (RibbonActionItem) importGroup
      .getItemByName(L_IMPORT_OPERATION_PRODUCT_IN_COMPONENTS);
  updateButtonState(importOperationProductInComponentsActionItem, isEnabled);
}

代码示例来源:origin: qcadoo/mes

public void updateRibbonState(final ViewDefinitionState view) {
  LookupComponent productLookup = (LookupComponent) view.getComponentByReference("child");
  WindowComponent window = (WindowComponent) view.getComponentByReference("window");
  RibbonGroup add = (RibbonGroup) window.getRibbon().getGroupByName("add");
  RibbonActionItem addProduct = (RibbonActionItem) add.getItemByName("addProduct");
  updateButtonState(addProduct, productLookup.getFieldValue() != null);
}

代码示例来源:origin: qcadoo/mes

public void setupRibbonForAdmin(final ViewDefinitionState view) {
  WindowComponent window = (WindowComponent) view.getComponentByReference("window");
  if(!securityService.hasCurrentUserRole("ROLE_SUPERADMIN") && securityService.hasCurrentUserRole("ROLE_ADMIN")){
    RibbonActionItem saveActionItem = window.getRibbon().getGroupByName("actions").getItemByName("save");
    saveActionItem.setEnabled(true);
    saveActionItem.requestUpdate(true);
  }
}
public void setupUserLocationsSection(final ViewDefinitionState view) {

代码示例来源:origin: qcadoo/mes

public void updateRibbonState(final ViewDefinitionState view) {
  FormComponent operationGroupForm = (FormComponent) view.getComponentByReference(L_FORM);
  Entity operationGroup = operationGroupForm.getEntity();
  WindowComponent window = (WindowComponent) view.getComponentByReference("window");
  RibbonGroup operationGroups = (RibbonGroup) window.getRibbon().getGroupByName("conversions");
  RibbonActionItem getDefaultConversions = (RibbonActionItem) operationGroups.getItemByName("getDefaultConversions");
  updateButtonState(getDefaultConversions, operationGroup.getId() != null);
}

代码示例来源:origin: qcadoo/mes

private void changeRibbonState(final ViewDefinitionState view, final boolean generated) {
  WindowComponent window = (WindowComponent) view.getComponentByReference("window");
  RibbonGroup reportGroup = window.getRibbon().getGroupByName("report");
  RibbonActionItem generate = reportGroup.getItemByName("generate");
  RibbonActionItem print = reportGroup.getItemByName("print");
  generate.setEnabled(!generated);
  generate.requestUpdate(true);
  print.setEnabled(generated);
  print.requestUpdate(true);
}

代码示例来源:origin: qcadoo/mes

public void onBeforeRender(final ViewDefinitionState view) {
    LookupComponent location = (LookupComponent) view.getComponentByReference("location");
    location.setRequired(true);
    WindowComponent window = (WindowComponent) view.getComponentByReference(L_WINDOW);
    RibbonActionItem addMultiButton = window.getRibbon().getGroupByName("action").getItemByName("createMultiMinimalStates");
    addMultiButton.setMessage("warehouseMinimalState.warehouseMinimumStateAddMulti.createMultiMinimalStates.button.message");
    addMultiButton.requestUpdate(true);
    window.requestRibbonRender();
  }
}

相关文章