/** Create a new instance of LaboratoireReference */
  private void createNewLaboratoireReference() {

    request = requestFactory.laboratoireReferenceRequest();

    /* create a new intance of LaboratoireReference */
    LaboratoireReferenceProxy newLaboratoireReference =
        request.create(LaboratoireReferenceProxy.class);
    newLaboratoireReference.setId(ImogKeyGenerator.generateKeyId("LAB_REF"));
    LocalizedTextProxy newNom = request.create(LocalizedTextProxy.class);
    newLaboratoireReference.setNom(newNom);
    LocalizedTextProxy newDescription = request.create(LocalizedTextProxy.class);
    newLaboratoireReference.setDescription(newDescription);
    GeoFieldProxy newCoordonnees = request.create(GeoFieldProxy.class);
    newLaboratoireReference.setCoordonnees(newCoordonnees);

    /* push the instance to the editor */
    current = newLaboratoireReference;
    editorDriver.edit(current, request);

    /* set request context for list editor operations */
    editor.setRequestContextForListEditors(request);

    /* update field widgets in editor */
    editor.computeVisibility(null, true);
    // Field districtSante depends on the value of field region
    editor.getDistrictSanteFilteredByRegion(null);
    editor.setEdited(true);
  }
  /** Edit the current instance of LaboratoireReference in editor */
  @Override
  protected void edit() {

    /* set the instance in edit mode in the editor */
    editor.setEdited(true);

    /* update field widgets in editor */
    // Field districtSante depends on the value of field region
    editor.getDistrictSanteFilteredByRegion(current.getRegion());
  }
 @Override
 protected void cancel() {
   if (parent != null) parent.hide();
   else {
     if (isNew) requestFactory.getEventBus().fireEvent(closeEvent);
     else
       requestFactory
           .getEventBus()
           .fireEvent(new ViewLaboratoireReferenceEvent(current.getId(), closeEvent));
   }
 }
  /**
   * Display the current instance of LaboratoireReference in editor
   *
   * @param entity the LaboratoireReferenceProxy to be displayed
   */
  private void viewLaboratoireReference(LaboratoireReferenceProxy entity) {

    /* display instance information */
    setTitle(
        NLS.constants().laboratoireReference_name()
            + ": "
            + EpicamRenderer.get().getDisplayValue(entity));
    setMetaData((ImogBeanProxy) entity);

    /* push the instance to the editor in view mode */
    request = requestFactory.laboratoireReferenceRequest();
    current = request.edit(entity);
    if (current.getNom() == null) {
      LocalizedTextProxy newNom = request.create(LocalizedTextProxy.class);
      current.setNom(newNom);
    }
    if (current.getDescription() == null) {
      LocalizedTextProxy newDescription = request.create(LocalizedTextProxy.class);
      current.setDescription(newDescription);
    }
    if (current.getCoordonnees() == null) {
      GeoFieldProxy newCoordonnees = request.create(GeoFieldProxy.class);
      current.setCoordonnees(newCoordonnees);
    }

    editor.setEditedValue(current);

    /* set request context for list editor operations */
    editor.setRequestContextForListEditors(request);

    editorDriver.edit(current, request);
    editor.setEdited(false);

    /* update field widgets in editor */
    editor.computeVisibility(null, true);

    /* display edit button */
    if (AccessManager.canEditLaboratoireReference()) setModifiable(true);

    showGlassPanel = false;
    EpicamEntryPoint.GP.hide();
  }