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");
}
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);
}
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());
}
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);
}
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);
}
Aggregations