Search in sources :

Example 66 with CheckBoxComponent

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

the class OperationDurationDetailsInOrderListenersOFSPGOverrideAspect method aroundCopyRealizationTime.

@Around("copyRealizationTimeE(viewDefinitionState, state, args)")
public void aroundCopyRealizationTime(final ProceedingJoinPoint pjp, final ViewDefinitionState viewDefinitionState, final ComponentState state, final String[] args) throws Throwable {
    CheckBoxComponent component = (CheckBoxComponent) viewDefinitionState.getComponentByReference("includeOrdersForComponent");
    if (!component.isChecked()) {
        pjp.proceed();
        return;
    }
    FormComponent orderForm = (FormComponent) viewDefinitionState.getComponentByReference(QcadooViewConstants.L_FORM);
    Entity order = dataDefinitionService.get(OrdersConstants.PLUGIN_IDENTIFIER, OrdersConstants.MODEL_ORDER).get(orderForm.getEntity().getId());
    Date startTimeOrder = findCalculatedStartAllOrders(order);
    FieldComponent startTimeField = (FieldComponent) viewDefinitionState.getComponentByReference(L_START_TIME);
    FieldComponent generatedEndDateField = (FieldComponent) viewDefinitionState.getComponentByReference("calculatedFinishAllOrders");
    FieldComponent stopTimeField = (FieldComponent) viewDefinitionState.getComponentByReference(L_STOP_TIME);
    startTimeField.setFieldValue(orderRealizationTimeService.setDateToField(startTimeOrder));
    stopTimeField.setFieldValue(generatedEndDateField.getFieldValue());
    state.performEvent(viewDefinitionState, "save");
}
Also used : FormComponent(com.qcadoo.view.api.components.FormComponent) Entity(com.qcadoo.model.api.Entity) FieldComponent(com.qcadoo.view.api.components.FieldComponent) Date(java.util.Date) CheckBoxComponent(com.qcadoo.view.api.components.CheckBoxComponent) Around(org.aspectj.lang.annotation.Around)

Example 67 with CheckBoxComponent

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

the class CostCalculationDetailsHooksOFSPG method enableSaveNominalCostForComponentButton.

private void enableSaveNominalCostForComponentButton(final ViewDefinitionState view) {
    WindowComponent window = (WindowComponent) view.getComponentByReference(QcadooViewConstants.L_WINDOW);
    RibbonActionItem saveNominalCostsForComponent = window.getRibbon().getGroupByName(CostCalculationFieldsOFSPG.SAVE_COSTS_EXTENSION).getItemByName(CostCalculationFieldsOFSPG.NOMINAL_COSTS_FOR_COMPONENTS);
    CheckBoxComponent generatedField = (CheckBoxComponent) view.getComponentByReference(CostCalculationFields.GENERATED);
    CheckBoxComponent includeComponents = (CheckBoxComponent) view.getComponentByReference(CostCalculationFields.INCLUDE_COMPONENTS);
    includeComponents.setEnabled(!generatedField.isChecked());
    includeComponents.requestComponentUpdateState();
    boolean enable = false;
    if (generatedField.isChecked() && includeComponents.isChecked()) {
        enable = true;
    }
    saveNominalCostsForComponent.setEnabled(enable);
    saveNominalCostsForComponent.requestUpdate(true);
}
Also used : WindowComponent(com.qcadoo.view.api.components.WindowComponent) RibbonActionItem(com.qcadoo.view.api.ribbon.RibbonActionItem) CheckBoxComponent(com.qcadoo.view.api.components.CheckBoxComponent)

Example 68 with CheckBoxComponent

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

the class ParametersHooksOFSPG method onBeforeRender.

public final void onBeforeRender(final ViewDefinitionState view) {
    CheckBoxComponent automaticallyGenerateOrdersForComponents = (CheckBoxComponent) view.getComponentByReference("automaticallyGenerateOrdersForComponents");
    CheckBoxComponent ordersGeneratedByCoverage = (CheckBoxComponent) view.getComponentByReference("ordersGeneratedByCoverage");
    ordersGeneratedByCoverage.setEnabled(automaticallyGenerateOrdersForComponents.isChecked());
}
Also used : CheckBoxComponent(com.qcadoo.view.api.components.CheckBoxComponent)

Example 69 with CheckBoxComponent

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

the class ProductionLineAddMultiListeners method addProductionLines.

public void addProductionLines(final ViewDefinitionState view, final ComponentState state, final String[] args) throws JSONException {
    GridComponent productionLineGrid = (GridComponent) view.getComponentByReference("productionLineGrid");
    CheckBoxComponent generated = (CheckBoxComponent) view.getComponentByReference(L_GENERATED);
    Set<Long> selectedEntities = productionLineGrid.getSelectedEntitiesIds();
    if (selectedEntities.isEmpty()) {
        generated.setChecked(false);
        view.addMessage("productFlowThruDivision.productionLineAddMulti.noSelectedProductionLines", ComponentState.MessageType.INFO);
        return;
    }
    tryCreateProductionLines(view, selectedEntities);
    generated.setChecked(true);
}
Also used : GridComponent(com.qcadoo.view.api.components.GridComponent) CheckBoxComponent(com.qcadoo.view.api.components.CheckBoxComponent)

Example 70 with CheckBoxComponent

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

the class SupplyParametersListenersPFTD method lockDeliveriesComponents.

public void lockDeliveriesComponents(final ViewDefinitionState view, final ComponentState componentState, final String[] args) {
    CheckBoxComponent generateWarehouseIssues = (CheckBoxComponent) componentState;
    toggleDaysBeforeOrderStart(false, view);
    toggleIssueLocation(false, view);
}
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