private void initComponentsCustom() {
    mnBizPartnerId = 0;
    msBizPartnerCatSng =
        SBpsUtils.getBizPartnerCategoryName(mnBizPartnerCategoryId, SUtilConsts.NUM_SNG);
    msBizPartnerCatPlr =
        SBpsUtils.getBizPartnerCategoryName(mnBizPartnerCategoryId, SUtilConsts.NUM_PLR);
    jlBizPartner.setText(msBizPartnerCatSng + ": *");
    jbPickBizPartner.setToolTipText(
        SUtilConsts.TXT_SELECT + " " + msBizPartnerCatSng.toLowerCase());
    setTitle("Movimientos contables de " + msBizPartnerCatPlr.toLowerCase() + " por documento");

    switch (mnBizPartnerCategoryId) {
      case SDataConstantsSys.BPSS_CT_BP_SUP:
        manSysMoveTypeKey = SDataConstantsSys.FINS_TP_SYS_MOV_BPS_SUP;
        SFormUtilities.populateComboBox(
            miClient, jcbBizPartner, mnOptionPickerId = SDataConstants.BPSX_BP_SUP);
        break;
      case SDataConstantsSys.BPSS_CT_BP_CUS:
        manSysMoveTypeKey = SDataConstantsSys.FINS_TP_SYS_MOV_BPS_CUS;
        SFormUtilities.populateComboBox(
            miClient, jcbBizPartner, mnOptionPickerId = SDataConstants.BPSX_BP_CUS);
        break;
      default:
        miClient.showMsgBoxWarning(SLibConstants.MSG_ERR_UTIL_UNKNOWN_OPTION);
    }

    moFieldYear = new SFormField(miClient, SLibConstants.DATA_TYPE_INTEGER, true, jtfYear, jlYear);
    moFieldYear.setIntegerMin(2000);
    moFieldYear.setIntegerMax(2100);
    moFieldYear.setMinInclusive(true);
    moFieldYear.setMaxInclusive(true);
    moFieldYear.setDecimalFormat(miClient.getSessionXXX().getFormatters().getYearFormat());
    moFieldBizPartner =
        new SFormField(miClient, SLibConstants.DATA_TYPE_KEY, true, jcbBizPartner, jlBizPartner);
    moFieldBizPartner.setPickerButton(jbPickBizPartner);
    moFieldDateRef =
        new SFormField(miClient, SLibConstants.DATA_TYPE_DATE, true, jftDateRef, jlDateRef);
    moFieldDateRef.setPickerButton(jbPickDateRef);

    mvFields = new Vector<SFormField>();
    mvFields.add(moFieldYear);
    mvFields.add(moFieldBizPartner);
    mvFields.add(moFieldDateRef);

    jbPickBizPartner.addActionListener(this);
    jbPickDateRef.addActionListener(this);
    jbPrint.addActionListener(this);
    jbClose.addActionListener(this);
    jckShowPayDays.addItemListener(this);
    jtfYear.addFocusListener(this);
    jftDateRef.addFocusListener(this);

    SFormUtilities.createActionMap(
        rootPane, this, "actionPrint", "print", KeyEvent.VK_ENTER, KeyEvent.CTRL_DOWN_MASK);
    SFormUtilities.createActionMap(rootPane, this, "actionClose", "close", KeyEvent.VK_ESCAPE, 0);
  }
示例#2
0
  private void initComponentsExtra() {
    mvFields = new Vector<SFormField>();

    moFieldPkCurrencyId =
        new SFormField(
            miClient, SLibConstants.DATA_TYPE_KEY, true, jcbPkCurrencyId, jlPkCurrencyId);
    moFieldPkCurrencyId.setPickerButton(jbPkCurrencyId);
    moFieldPkDateId =
        new SFormField(miClient, SLibConstants.DATA_TYPE_DATE, true, jftPkDateId, jlPkDateId);
    moFieldPkDateId.setPickerButton(jbPkDateId);
    moFieldExchangeRate =
        new SFormField(
            miClient, SLibConstants.DATA_TYPE_DOUBLE, true, jtfExchangeRate, jlExchangeRate);
    moFieldExchangeRate.setDecimalFormat(
        miClient.getSessionXXX().getFormatters().getDecimalsExchangeRateFormat());
    moFieldIsDeleted =
        new SFormField(miClient, SLibConstants.DATA_TYPE_BOOLEAN, true, jckIsDeleted);

    mvFields.add(moFieldPkCurrencyId);
    mvFields.add(moFieldPkDateId);
    mvFields.add(moFieldExchangeRate);
    mvFields.add(moFieldIsDeleted);

    jbOk.addActionListener(this);
    jbCancel.addActionListener(this);
    jbPkCurrencyId.addActionListener(this);
    jbPkDateId.addActionListener(this);

    AbstractAction actionOk =
        new AbstractAction() {
          @Override
          public void actionPerformed(ActionEvent e) {
            actionOk();
          }
        };

    SFormUtilities.putActionMap(
        getRootPane(), actionOk, "ok", KeyEvent.VK_ENTER, KeyEvent.CTRL_DOWN_MASK);

    AbstractAction actionCancel =
        new AbstractAction() {
          @Override
          public void actionPerformed(ActionEvent e) {
            actionCancel();
          }
        };

    SFormUtilities.putActionMap(getRootPane(), actionCancel, "cancel", KeyEvent.VK_ESCAPE, 0);
  }