private void setAllBoxWith(int width) { /* Description field group */ patient.setBoxWidth(width); patientLie.setBoxWidth(width); typeRelation.setBoxWidth(width); }
private void setAllLabelWith(String width) { /* Description field group */ patient.setLabelWidth(width); patientLie.setLabelWidth(width); typeRelation.setLabelWidth(width); }
/** Sets the properties of the fields */ private void properties() { /* Description section widgets */ descriptionSection.setGroupTitle(NLS.constants().casIndex_group_description()); patient.setLabel(NLS.constants().casIndex_field_patient()); patientLie.setLabel(NLS.constants().casIndex_field_patientLie()); typeRelation.setLabel(NLS.constants().casIndex_field_typeRelation()); }
/** * Sets the edition mode * * @param isEdited true to enable the edition of the form */ public void setEdited(boolean isEdited) { if (isEdited) setFieldEditAccess(); else setFieldReadAccess(); /* Description section widgets */ patient.setEdited(isEdited); patientLie.setEdited(isEdited); typeRelation.setEdited(isEdited); }
/** Validate fields values */ public void validateFields() { // patient is a required field if (patient.getValue() == null) delegate.recordError(BaseNLS.messages().error_required(), null, "patient"); // patientLie is a required field if (patientLie.getValue() == null) delegate.recordError(BaseNLS.messages().error_required(), null, "patientLie"); // typeRelation is a required field if (typeRelation.getValue() == null) delegate.recordError(BaseNLS.messages().error_required(), null, "typeRelation"); }
@Override public void showErrors(List<EditorError> errors) { if (errors != null && errors.size() > 0) { List<EditorError> patientFieldErrors = new ArrayList<EditorError>(); List<EditorError> patientLieFieldErrors = new ArrayList<EditorError>(); List<EditorError> typeRelationFieldErrors = new ArrayList<EditorError>(); for (EditorError error : errors) { Object userData = error.getUserData(); if (userData != null && userData instanceof String) { String field = (String) userData; if (field.equals("patient")) patientFieldErrors.add(error); if (field.equals("patientLie")) patientLieFieldErrors.add(error); if (field.equals("typeRelation")) typeRelationFieldErrors.add(error); } } if (patientFieldErrors.size() > 0) patient.showErrors(patientFieldErrors); if (patientLieFieldErrors.size() > 0) patientLie.showErrors(patientLieFieldErrors); if (typeRelationFieldErrors.size() > 0) typeRelation.showErrors(typeRelationFieldErrors); } }