Пример #1
0
  /** Add all the screen listeners. */
  public void addListeners() {
    super.addListeners();

    this.getScreenRecord()
        .getField(McoScreenRecord.AIRLINE_ID)
        .addListener(
            new InitFieldHandler(
                this.getRecord(ArControl.AR_CONTROL_FILE).getField(ArControl.AIRLINE_ID)));

    TrxStatus recTrxStatus = (TrxStatus) this.getRecord(TrxStatus.TRX_STATUS_FILE);
    recTrxStatus.getTrxStatusID(TransactionType.ACCTREC, Mco.MCO_FILE, Mco.SUBMITTED);
    this.getMainRecord().addListener(new SubFileFilter(recTrxStatus));

    this.getMainRecord().addListener(new McoCollCalcNetBeh(null));

    this.getMainRecord()
        .addListener(
            new CompareFileFilter(
                Mco.AIRLINE_ID,
                this.getScreenRecord().getField(McoScreenRecord.AIRLINE_ID),
                "=",
                null,
                false));

    this.getMainRecord()
        .getField(Mco.PAID)
        .addListener(
            new MoveOnChangeHandler(
                this.getMainRecord().getField(Mco.AMOUNT_PAID),
                this.getScreenRecord().getField(McoScreenRecord.NET)));
    FieldListener fieldBehavior =
        new MoveOnChangeHandler(
            this.getMainRecord().getField(Mco.DATE_PAID),
            this.getScreenRecord().getField(McoScreenRecord.TODAY),
            false,
            true);
    fieldBehavior.setRespondsToMode(DBConstants.INIT_MOVE, false);
    fieldBehavior.setRespondsToMode(DBConstants.READ_MOVE, false);
    this.getMainRecord().getField(Mco.AMOUNT_PAID).addListener(fieldBehavior);

    this.setEnabled(false);
    this.getScreenRecord().getField(McoScreenRecord.AIRLINE_ID).setEnabled(true);
    this.getMainRecord().getField(Mco.DATE_PAID).setEnabled(true);
    this.getMainRecord().getField(Mco.AMOUNT_PAID).setEnabled(true);
    this.getMainRecord().getField(Mco.PAID).setEnabled(true);
  }