Search in sources :

Example 31 with CheckBoxComponent

use of com.qcadoo.view.api.components.CheckBoxComponent in project mes by qcadoo.

the class MasterOrdersMaterialRequirementDetailsHooks method setFormEnabled.

private void setFormEnabled(final ViewDefinitionState view) {
    FormComponent masterOrdersMaterialRequirementForm = (FormComponent) view.getComponentByReference(QcadooViewConstants.L_FORM);
    GridComponent masterOrdersGrid = (GridComponent) view.getComponentByReference(MasterOrdersMaterialRequirementFields.MASTER_ORDERS);
    CheckBoxComponent generatedCheckBox = (CheckBoxComponent) view.getComponentByReference(MasterOrdersMaterialRequirementFields.GENERATED);
    Long masterOrdersMaterialRequirementId = masterOrdersMaterialRequirementForm.getEntityId();
    boolean isEnabled = Objects.isNull(masterOrdersMaterialRequirementId);
    boolean isGenerated = generatedCheckBox.isChecked();
    masterOrdersMaterialRequirementForm.setFormEnabled(isEnabled || !isGenerated);
    masterOrdersGrid.setEnabled(isEnabled || !isGenerated);
}
Also used : FormComponent(com.qcadoo.view.api.components.FormComponent) GridComponent(com.qcadoo.view.api.components.GridComponent) CheckBoxComponent(com.qcadoo.view.api.components.CheckBoxComponent)

Example 32 with CheckBoxComponent

use of com.qcadoo.view.api.components.CheckBoxComponent in project mes by qcadoo.

the class MasterOrdersMaterialRequirementDetailsHooks method setRibbonEnabled.

private void setRibbonEnabled(final ViewDefinitionState view) {
    FormComponent masterOrdersMaterialRequirementForm = (FormComponent) view.getComponentByReference(QcadooViewConstants.L_FORM);
    CheckBoxComponent generatedCheckBox = (CheckBoxComponent) view.getComponentByReference(MasterOrdersMaterialRequirementFields.GENERATED);
    WindowComponent window = (WindowComponent) view.getComponentByReference(QcadooViewConstants.L_WINDOW);
    Ribbon ribbon = window.getRibbon();
    RibbonGroup generateRibbonGroup = ribbon.getGroupByName(L_GENERATE);
    RibbonActionItem generateRibbonActionItem = generateRibbonGroup.getItemByName(L_GENERATE_MASTER_ORDERS_MATERIAL_REQUIREMENT);
    Long masterOrdersMaterialRequirementId = masterOrdersMaterialRequirementForm.getEntityId();
    boolean isEnabled = Objects.nonNull(masterOrdersMaterialRequirementId);
    boolean isGenerated = generatedCheckBox.isChecked();
    generateRibbonActionItem.setEnabled(isEnabled && !isGenerated);
    generateRibbonActionItem.requestUpdate(true);
}
Also used : FormComponent(com.qcadoo.view.api.components.FormComponent) RibbonGroup(com.qcadoo.view.api.ribbon.RibbonGroup) WindowComponent(com.qcadoo.view.api.components.WindowComponent) Ribbon(com.qcadoo.view.api.ribbon.Ribbon) RibbonActionItem(com.qcadoo.view.api.ribbon.RibbonActionItem) CheckBoxComponent(com.qcadoo.view.api.components.CheckBoxComponent)

Example 33 with CheckBoxComponent

use of com.qcadoo.view.api.components.CheckBoxComponent in project mes by qcadoo.

the class SalesPlanMaterialRequirementDetailsHooks method setRibbonEnabled.

private void setRibbonEnabled(final ViewDefinitionState view) {
    FormComponent salesPlanMaterialRequirementForm = (FormComponent) view.getComponentByReference(QcadooViewConstants.L_FORM);
    GridComponent salesPlanMaterialRequirementProductsGrid = (GridComponent) view.getComponentByReference(QcadooViewConstants.L_GRID);
    CheckBoxComponent generatedCheckBox = (CheckBoxComponent) view.getComponentByReference(SalesPlanMaterialRequirementFields.GENERATED);
    WindowComponent window = (WindowComponent) view.getComponentByReference(QcadooViewConstants.L_WINDOW);
    Ribbon ribbon = window.getRibbon();
    RibbonGroup generateRibbonGroup = ribbon.getGroupByName(L_GENERATE);
    RibbonGroup deliveriesRibbonGroup = ribbon.getGroupByName(L_DELIVERIES);
    RibbonGroup technologiesRibbonGroup = ribbon.getGroupByName(TECHNOLOGIES);
    RibbonActionItem generateRibbonActionItem = generateRibbonGroup.getItemByName(L_GENERATE_SALES_PLAN_MATERIAL_REQUIREMENT);
    RibbonActionItem createDeliveryRibbonActionItem = deliveriesRibbonGroup.getItemByName(L_CREATE_DELIVERY);
    RibbonActionItem showSalesPlanDeliveriesRibbonActionItem = deliveriesRibbonGroup.getItemByName(SHOW_SALES_PLAN_DELIVERIES);
    RibbonActionItem showTechnologiesWithUsingProductRibbonActionItem = technologiesRibbonGroup.getItemByName(SHOW_TECHNOLOGIES_WITH_USING_PRODUCT);
    Long salesPlanMaterialRequirementId = salesPlanMaterialRequirementForm.getEntityId();
    boolean isEnabled = Objects.nonNull(salesPlanMaterialRequirementId);
    boolean isGenerated = generatedCheckBox.isChecked();
    boolean isSalesPlanMaterialRequirementProductsSelected = !salesPlanMaterialRequirementProductsGrid.getSelectedEntities().isEmpty();
    generateRibbonActionItem.setEnabled(isEnabled && !isGenerated);
    generateRibbonActionItem.requestUpdate(true);
    createDeliveryRibbonActionItem.setEnabled(isEnabled && isGenerated && isSalesPlanMaterialRequirementProductsSelected);
    createDeliveryRibbonActionItem.requestUpdate(true);
    showTechnologiesWithUsingProductRibbonActionItem.setEnabled(salesPlanMaterialRequirementProductsGrid.getSelectedEntities().size() == 1);
    showTechnologiesWithUsingProductRibbonActionItem.requestUpdate(true);
    showSalesPlanDeliveriesRibbonActionItem.setEnabled(isEnabled);
    showSalesPlanDeliveriesRibbonActionItem.requestUpdate(true);
}
Also used : FormComponent(com.qcadoo.view.api.components.FormComponent) RibbonGroup(com.qcadoo.view.api.ribbon.RibbonGroup) WindowComponent(com.qcadoo.view.api.components.WindowComponent) Ribbon(com.qcadoo.view.api.ribbon.Ribbon) GridComponent(com.qcadoo.view.api.components.GridComponent) RibbonActionItem(com.qcadoo.view.api.ribbon.RibbonActionItem) CheckBoxComponent(com.qcadoo.view.api.components.CheckBoxComponent)

Example 34 with CheckBoxComponent

use of com.qcadoo.view.api.components.CheckBoxComponent in project mes by qcadoo.

the class SalesPlanMaterialRequirementDetailsHooks method setFormEnabled.

private void setFormEnabled(final ViewDefinitionState view) {
    FormComponent salesPlanMaterialRequirementForm = (FormComponent) view.getComponentByReference(QcadooViewConstants.L_FORM);
    CheckBoxComponent generatedCheckBox = (CheckBoxComponent) view.getComponentByReference(SalesPlanMaterialRequirementFields.GENERATED);
    Long salesPlanMaterialRequirementId = salesPlanMaterialRequirementForm.getEntityId();
    boolean isEnabled = Objects.isNull(salesPlanMaterialRequirementId);
    boolean isGenerated = generatedCheckBox.isChecked();
    salesPlanMaterialRequirementForm.setFormEnabled(isEnabled || !isGenerated);
}
Also used : FormComponent(com.qcadoo.view.api.components.FormComponent) CheckBoxComponent(com.qcadoo.view.api.components.CheckBoxComponent)

Example 35 with CheckBoxComponent

use of com.qcadoo.view.api.components.CheckBoxComponent in project mes by qcadoo.

the class ResourceAttributeValueDetailsHooks method fillFromDefinition.

private void fillFromDefinition(final ViewDefinitionState view) {
    CheckBoxComponent fromDefinition = (CheckBoxComponent) view.getComponentByReference(ResourceAttributeValueFields.FROM_DEFINITION);
    fromDefinition.setChecked(true);
    fromDefinition.requestComponentUpdateState();
}
Also used : CheckBoxComponent(com.qcadoo.view.api.components.CheckBoxComponent)

Aggregations

CheckBoxComponent (com.qcadoo.view.api.components.CheckBoxComponent)100 FormComponent (com.qcadoo.view.api.components.FormComponent)38 Entity (com.qcadoo.model.api.Entity)33 FieldComponent (com.qcadoo.view.api.components.FieldComponent)30 GridComponent (com.qcadoo.view.api.components.GridComponent)19 LookupComponent (com.qcadoo.view.api.components.LookupComponent)11 Date (java.util.Date)7 JSONObject (org.json.JSONObject)7 BigDecimal (java.math.BigDecimal)6 ComponentState (com.qcadoo.view.api.ComponentState)4 WindowComponent (com.qcadoo.view.api.components.WindowComponent)4 RibbonActionItem (com.qcadoo.view.api.ribbon.RibbonActionItem)4 IOException (java.io.IOException)4 MaterialFlowResourcesConstants (com.qcadoo.mes.materialFlowResources.constants.MaterialFlowResourcesConstants)2 DataDefinition (com.qcadoo.model.api.DataDefinition)2 DataDefinitionService (com.qcadoo.model.api.DataDefinitionService)2 SearchRestrictions (com.qcadoo.model.api.search.SearchRestrictions)2 ViewDefinitionState (com.qcadoo.view.api.ViewDefinitionState)2 AwesomeDynamicListComponent (com.qcadoo.view.api.components.AwesomeDynamicListComponent)2 Ribbon (com.qcadoo.view.api.ribbon.Ribbon)2