com.qcadoo.view.api.ribbon.Ribbon类的使用及代码示例

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

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

Ribbon介绍

暂无

代码示例

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

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

代码示例来源: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 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 RibbonActionItem getRibbonItem(final ViewDefinitionState view, final String ribbonGroupName,
    final String ribbonItemName) {
  WindowComponent window = (WindowComponent) view.getComponentByReference("window");
  Ribbon ribbon = window.getRibbon();
  RibbonGroup ribbonGroup = ribbon.getGroupByName(ribbonGroupName);
  if (ribbonGroup == null) {
    return null;
  }
  return ribbonGroup.getItemByName(ribbonItemName);
}

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

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

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

private void enableRibbon(final WindowComponent window, final boolean enable) {
  for (String actionItem : RIBBON_ACTION_ITEM) {
    window.getRibbon().getGroupByName(RIBBON_GROUP).getItemByName(actionItem).setEnabled(enable);
    window.getRibbon().getGroupByName(RIBBON_GROUP).getItemByName(actionItem).requestUpdate(true);
  }
  window.requestRibbonRender();
}

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

private void disableRibbon(final WindowComponent window) {
  for (String actionItem : L_ACTIONS_ITEMS) {
    window.getRibbon().getGroupByName(L_ACTIONS).getItemByName(actionItem).setEnabled(false);
    window.getRibbon().getGroupByName(L_ACTIONS).getItemByName(actionItem).requestUpdate(true);
  }
  changeAcceptButtonState(window, false);
}

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

void changeButtonState(final ViewDefinitionState view, final ProgressType progressType, final OrderState orderState) {
  WindowComponent window = (WindowComponent) view.getComponentByReference(WINDOW_REF);
  RibbonGroup progressRibbonGroup = window.getRibbon().getGroupByName(PROGRESS_RIBBON_GROUP_NAME);
  boolean isInCorrectionMode = progressType == ProgressType.CORRECTED && !UNSUPPORTED_ORDER_STATES.contains(orderState);
  for (RibbonActionItem ribbonActionItem : progressRibbonGroup.getItems()) {
    ribbonActionItem.setEnabled(isInCorrectionMode);
    ribbonActionItem.requestUpdate(true);
  }
}

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

private void toggleAddMultipleActions(ViewDefinitionState view, FieldsForType fieldsForType, Entity plannedEvent) {
  WindowComponent window = (WindowComponent) view.getComponentByReference(L_WINDOW);
  Ribbon ribbon = window.getRibbon();
  RibbonGroup actionsGroup = ribbon.getGroupByName("actionsGroup");
  RibbonActionItem addActionsItem = actionsGroup.getItemByName("addActions");
  String state = plannedEvent.getStringField(PlannedEventFields.STATE);
  List<String> statesToDisable = Arrays.asList(PlannedEventStateStringValues.REALIZED, PlannedEventStateStringValues.CANCELED);
  boolean enableAddActions = plannedEvent.getId() != null && !statesToDisable.contains(state) && !fieldsForType.getHiddenTabs().contains(PlannedEventFields.ACTIONS_TAB);
  addActionsItem.setEnabled(enableAddActions);
  addActionsItem.requestUpdate(true);
}

代码示例来源: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 changeFillResourceButtonState(WindowComponent window, final boolean enable) {
  RibbonActionItem fillResourcesItem = (RibbonActionItem) window.getRibbon().getGroupByName("resources")
      .getItemByName("fillResources");
  fillResourcesItem.setEnabled(enable);
  fillResourcesItem.requestUpdate(true);
}

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

private void changePrintButtonState(WindowComponent window, final boolean enable) {
  RibbonActionItem printRibbonActionItem = (RibbonActionItem) window.getRibbon().getGroupByName(L_PRINT)
      .getItemByName(L_PRINT_PDF);
  printRibbonActionItem.setEnabled(enable);
  printRibbonActionItem.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

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

public void updateRibbonState(final ViewDefinitionState view) {
  FieldComponent generatedField = (FieldComponent) view
      .getComponentByReference(CoverageForOrderFields.GENERATED);
  boolean generated = "1".equals(generatedField.getFieldValue());
  WindowComponent window = (WindowComponent) view.getComponentByReference(L_WINDOW);
  RibbonGroup coverage = (RibbonGroup) window.getRibbon().getGroupByName(L_COVERAGE);
  RibbonActionItem printMaterialRequirementCoverage = (RibbonActionItem) coverage
      .getItemByName(L_PRINT_MATERIAL_REQUIREMENT_COVERAGE);
  updateButtonState(printMaterialRequirementCoverage, generated);
}

代码示例来源: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 coverage = (RibbonGroup) window.getRibbon().getGroupByName(L_COVERAGE);
  RibbonActionItem printMaterialRequirementCoverage = (RibbonActionItem) coverage
      .getItemByName(L_PRINT_MATERIAL_REQUIREMENT_COVERAGE);
  updateButtonState(printMaterialRequirementCoverage, generated);
}

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

private void lockView(final ViewDefinitionState view) {
  FormComponent plannedEventForm = (FormComponent) view.getComponentByReference(L_FORM);
  WindowComponent window = (WindowComponent) view.getComponentByReference(L_WINDOW);
  Ribbon ribbon = window.getRibbon();
  RibbonGroup actionsRibbonGroup = ribbon.getGroupByName(L_ACTIONS);
  RibbonGroup statusRibbonGroup = ribbon.getGroupByName(L_STATUS);
  List<RibbonActionItem> ribbonActionItems = actionsRibbonGroup.getItems();
  ribbonActionItems.addAll(statusRibbonGroup.getItems());
  for (RibbonActionItem ribbonActionItem : ribbonActionItems) {
    ribbonActionItem.setEnabled(false);
    ribbonActionItem.requestUpdate(true);
  }
  for (String referenceName : L_GRIDS) {
    lockGrid(view, referenceName);
  }
  plannedEventForm.setFormEnabled(false);
}

相关文章