コード例 #1
0
 /** Initialize class fields. */
 public void init(
     ScreenLocation itsLocation,
     BasePanel parentScreen,
     Converter fieldConverter,
     int iDisplayFieldDesc,
     Map<String, Object> properties) {
   super.init(itsLocation, parentScreen, fieldConverter, iDisplayFieldDesc, properties);
 }
コード例 #2
0
 /** Add all the screen listeners. */
 public void addListeners() {
   super.addListeners();
   this.getScreenRecord().getField(AcctDetailScreenRecord.ACCOUNT_ID).setEnabled(true);
   this.getRecord(Account.ACCOUNT_FILE)
       .getField(Account.ACCOUNT_NO)
       .setEnabled(true); // Enable Key Field
   this.getScreenRecord()
       .getField(AcctDetailScreenRecord.START_DATE)
       .addListener(new RegisterValueHandler(null));
   this.getScreenRecord()
       .getField(AcctDetailScreenRecord.END_DATE)
       .addListener(new RegisterValueHandler(null));
   this.getScreenRecord()
       .getField(AcctDetailScreenRecord.CALC_START)
       .addListener(new RegisterValueHandler(null));
   if ((this.getScreenRecord().getField(AcctDetailScreenRecord.START_DATE).isNull())
       || (this.getScreenRecord()
           .getField(AcctDetailScreenRecord.END_DATE)
           .isNull())) { // If the starting and ending date haven't been set yet, set them to the
                         // current period start and end.
     Date date = new Date(); // Now
     Period recPeriod =
         new Period(
             (RecordOwner)
                 this
                     .getParentScreen()); // Note: I Use READ_MOVE, because RegisterBehavior
                                          // doesn't respond to it.
     if (this.getScreenRecord().getField(AcctDetailScreenRecord.START_DATE).isNull())
       ((DateTimeField) this.getScreenRecord().getField(AcctDetailScreenRecord.START_DATE))
           .setDate(
               recPeriod.getPeriodStartDate(date), DBConstants.DISPLAY, DBConstants.READ_MOVE);
     if (this.getScreenRecord().getField(AcctDetailScreenRecord.END_DATE).isNull())
       ((DateTimeField) this.getScreenRecord().getField(AcctDetailScreenRecord.END_DATE))
           .setDate(recPeriod.getPeriodEndDate(date), DBConstants.DISPLAY, DBConstants.READ_MOVE);
     recPeriod.free();
     recPeriod = null;
   }
   this.getScreenRecord().getField(AcctDetailScreenRecord.START_DATE).setEnabled(true);
   this.getScreenRecord().getField(AcctDetailScreenRecord.END_DATE).setEnabled(true);
   this.getScreenRecord().getField(AcctDetailScreenRecord.CALC_START).setEnabled(true);
 }