/**
   * Constructor
   *
   * @param requestFactory the application requestFactory
   * @param entityId the id of the entity to be managed by the workflow. null if an entity is being
   *     created
   * @param parent parent composite if the panel is contained in a RelationPopupPanel
   * @param initField the field that initiated the display in a RelationPopupPanel
   * @param returnToList true if after closing the wokflow, the application shall display the list
   *     of entities, false otherwise
   */
  public DetailInventaireFormPanel(
      EpicamRequestFactory requestFactory,
      String entityId,
      RelationPopupPanel parent,
      String initField) {

    wrapperPanel = new WrapperPanel();
    wrapperPanel.setWidth("90%");
    Label titleContainer = wrapperPanel.getTitleLabel();

    if (entityId != null) {
      if (parent == null)
        editorWorkflow =
            new DetailInventaireEditorWorkflow(requestFactory, entityId, titleContainer);
      else {
        editorWorkflow =
            new DetailInventaireEditorWorkflow(
                requestFactory, entityId, titleContainer, parent, initField);
      }
    } else {
      if (parent == null) {
        editorWorkflow = new DetailInventaireEditorWorkflow(requestFactory, titleContainer);
      } else {
        editorWorkflow =
            new DetailInventaireEditorWorkflow(requestFactory, titleContainer, parent, initField);
      }
    }

    if (EpicamIconConstants.DETAILINVENTAIRE_ICON != null)
      wrapperPanel.setIcon(EpicamIconConstants.DETAILINVENTAIRE_ICON);

    if (editorWorkflow.getEditButton() != null)
      wrapperPanel.addHeaderWidget(editorWorkflow.getEditButton());
    if (editorWorkflow.getCloseButton() != null)
      wrapperPanel.addHeaderWidget(editorWorkflow.getCloseButton());
    if (editorWorkflow.getSaveButton() != null)
      wrapperPanel.addHeaderWidget(editorWorkflow.getSaveButton());
    if (editorWorkflow.getCancelButton() != null)
      wrapperPanel.addHeaderWidget(editorWorkflow.getCancelButton());

    initWidget(uiBinder.createAndBindUi(this));
  }
 /**
  * Setter to inject a Lot value into the workflow and the editor
  *
  * @param value the value to be injected
  * @param isLocked true if relation field shall be locked (non editable)
  */
 public void setLot(LotProxy value, boolean isLocked) {
   editorWorkflow.setLot(value, isLocked);
 }
 /**
  * Setter to inject a Inventaire value into the workflow and the editor
  *
  * @param value the value to be injected
  * @param isLocked true if relation field shall be locked (non editable)
  */
 public void setInventaire(InventaireProxy value, boolean isLocked) {
   editorWorkflow.setInventaire(value, isLocked);
 }
 /**
  * Setter to inject a CentreDiagTrait value into the workflow and the editor
  *
  * @param value the value to be injected
  * @param isLocked true if relation field shall be locked (non editable)
  */
 public void setCDT(CentreDiagTraitProxy value, boolean isLocked) {
   editorWorkflow.setCDT(value, isLocked);
 }
 public void setCloseEvent(GwtEvent<?> closeEvent) {
   editorWorkflow.setCloseEvent(closeEvent);
 }