Ejemplo n.º 1
0
  private void updateControlsState() {
    form.btnNew().setVisible(FormMode.VIEW.equals(form.getMode()));

    form.btnNew()
        .setEnabled(
            FormMode.VIEW.equals(form.getMode())
                && domain.isMostRecentRecordReturned(
                    form.getGlobalContext().Core.getCurrentCareContext()));

    form.btnEdit()
        .setVisible(
            FormMode.VIEW.equals(form.getMode()) && form.recbrSentToXRay().getValue() != null);

    form.ccAllocatedBy().isRequired(FormMode.EDIT.equals(form.getMode()));

    // state for Returned DateTime and SetCurrentStatus combo
    form.chkReturned().setVisible(form.recbrSentToXRay().getValue() != null);
    form.chkReturned()
        .setEnabled(
            FormMode.EDIT.equals(form.getMode()) && form.recbrSentToXRay().getValue() != null);

    form.lblReturnedDateTime().setVisible(form.chkReturned().getValue());
    form.dtimReturned().setVisible(form.chkReturned().getValue());
    form.lblSetCurrent().setVisible(form.chkReturned().getValue());
    form.lblStatusTo().setVisible(form.chkReturned().getValue());
    form.cmbSetCurrentStatus().setVisible(form.chkReturned().getValue());
    form.cmbSetCurrentStatus().setVisible(form.chkReturned().getValue());

    form.dtimReturned()
        .setEnabled(
            FormMode.EDIT.equals(form.getMode()) && form.recbrSentToXRay().getValue() != null);
    form.lblSetCurrent()
        .setEnabled(
            FormMode.EDIT.equals(form.getMode()) && form.recbrSentToXRay().getValue() != null);
    form.lblStatusTo()
        .setEnabled(
            FormMode.EDIT.equals(form.getMode()) && form.recbrSentToXRay().getValue() != null);
    form.cmbSetCurrentStatus()
        .setEnabled(
            FormMode.EDIT.equals(form.getMode()) && form.recbrSentToXRay().getValue() != null);

    form.dtimReturned().setRequired(form.chkReturned().getValue());

    // in view mode Label for statusCombo should be : "Current Status:", In Edit Mode it should be
    // "Set Current Status To:"
    form.lblSetCurrent()
        .setValue(FormMode.EDIT.equals(form.getMode()) ? "Set Current" : "     Current");
    form.lblStatusTo()
        .setValue(FormMode.EDIT.equals(form.getMode()) ? "Status to:" : "     Status:");

    // in edit mode it should not be a value for statusCombo
    if (FormMode.EDIT.equals(form.getMode())) {
      form.cmbSetCurrentStatus().setValue(null);
    }
  }
Ejemplo n.º 2
0
  private void updateControlsState() {
    form.getContextMenus()
        .Emergency
        .getAreaWorkspaceConfigEditColumnsItem()
        .setVisible(FormMode.EDIT.equals(form.getMode()));
    form.getContextMenus()
        .Emergency
        .getAreaWorkspaceConfigPreviewItem()
        .setVisible(form.cmbArea().getValue() != null);
    form.getContextMenus()
        .Emergency
        .getAreaWorkspaceConfigMoveUpItem()
        .setVisible(
            FormMode.EDIT.equals(form.getMode())
                && form.grdAreaWorkspace().canMoveCurrentUp()); // latest changes 06.04.2012
    form.getContextMenus()
        .Emergency
        .getAreaWorkspaceConfigMoveDownItem()
        .setVisible(
            FormMode.EDIT.equals(form.getMode())
                && form.grdAreaWorkspace().canMoveCurrentDown()); // latest changes 06.04.2012

    // WDEV-14896
    form.getContextMenus()
        .Emergency
        .getAreaWorkspaceConfigCopyItem()
        .setVisible(FormMode.VIEW.equals(form.getMode()) && form.cmbArea().getValue() == null);
  }