/** * Constructor. * @param fldDest The destination field. * @param stringValue The string to set the destination field to. * @param convconvCheckMark If this evaluates to false, don't do the move. */ public CopyStringHandler(BaseField fldDest, String stringValue, Converter convCheckMark) { this(); this.init(null, fldDest, stringValue, convCheckMark); } /**
/** * Free the resources. */ public void free() { if (m_recArTrx != null) m_recArTrx.free(); m_recArTrx = null; super.free(); } /**
recBookingDetail.getField(BookingDetail.INFO_MESSAGE_TRANSPORT_ID).addListener(new CopyStringHandler(recBookingDetail.getField(BookingDetail.INFO_STATUS_ID), Integer.toString(BaseStatus.VALID), convCheckMark)); recBookingDetail.getField(BookingDetail.INFO_MESSAGE_TRANSPORT_ID).addListener(new CopyStringHandler(recBookingDetail.getField(BookingDetail.INVENTORY_MESSAGE_TRANSPORT_ID), strManualTransportID, convCheckMark)); recBookingDetail.getField(BookingDetail.INFO_MESSAGE_TRANSPORT_ID).addListener(new CopyStringHandler(recBookingDetail.getField(BookingDetail.COST_MESSAGE_TRANSPORT_ID), strManualTransportID, convCheckMark)); recBookingDetail.getField(BookingDetail.INFO_MESSAGE_TRANSPORT_ID).addListener(new CopyStringHandler(recBookingDetail.getField(BookingDetail.PRODUCT_MESSAGE_TRANSPORT_ID), strManualTransportID, convCheckMark)); recBookingDetail.getField(BookingDetail.INVENTORY_MESSAGE_TRANSPORT_ID).addListener(new CopyStringHandler(recBookingDetail.getField(BookingDetail.INVENTORY_STATUS_ID), Integer.toString(BaseStatus.VALID), convCheckMark)); convCheckMark = new CheckConverter(recBookingDetail.getField(BookingDetail.COST_MESSAGE_TRANSPORT_ID), strManualTransportID, null, true); recBookingDetail.getField(BookingDetail.COST_MESSAGE_TRANSPORT_ID).addListener(new RemoveConverterOnFreeHandler(convCheckMark)); recBookingDetail.getField(BookingDetail.COST_MESSAGE_TRANSPORT_ID).addListener(new CopyStringHandler(recBookingDetail.getField(BookingDetail.COST_STATUS_ID), Integer.toString(BaseStatus.VALID), convCheckMark)); convCheckMark = new CheckConverter(recBookingDetail.getField(BookingDetail.PRODUCT_MESSAGE_TRANSPORT_ID), strManualTransportID, null, true); recBookingDetail.getField(BookingDetail.PRODUCT_MESSAGE_TRANSPORT_ID).addListener(new RemoveConverterOnFreeHandler(convCheckMark)); recBookingDetail.getField(BookingDetail.PRODUCT_MESSAGE_TRANSPORT_ID).addListener(new CopyStringHandler(recBookingDetail.getField(BookingDetail.PRODUCT_STATUS_ID), Integer.toString(BaseStatus.NO_STATUS), convCheckMark));
this.getMainRecord().getField(TourEventSchedule.TOUR_EVENT_ID).addListener(new CopyStringHandler(this.getMainRecord().getField(TourEventSchedule.BOOKING_STATUS_ID), null, null)); this.getMainRecord().getField(TourEventSchedule.TOUR_ACTION_TYPE).addListener(new CopyStringHandler(this.getMainRecord().getField(TourEventSchedule.ACTION_TOUR_EVENT_ID), null, null)); this.getMainRecord().getField(TourEventSchedule.TOUR_ACTION_TYPE).addListener(new DisableOnFieldHandler(this.getMainRecord().getField(TourEventSchedule.ACTION_MESSAGE_PROCESS_INFO_ID), TourActionTypeField.CREATE_DOCUMENT, false)); this.getMainRecord().getField(TourEventSchedule.TOUR_ACTION_TYPE).addListener(new CopyStringHandler(this.getMainRecord().getField(TourEventSchedule.ACTION_MESSAGE_PROCESS_INFO_ID), null, null)); this.getMainRecord().getField(TourEventSchedule.ACTION_TOUR_EVENT_ID).addListener(new DisableOnFieldHandler(this.getMainRecord().getField(TourEventSchedule.ACTION_BOOKING_STATUS_ID), Integer.toString(TourEvent.BOOKING_STATUS), false)); this.getMainRecord().getField(TourEventSchedule.ACTION_TOUR_EVENT_ID).addListener(new CopyStringHandler(this.getMainRecord().getField(TourEventSchedule.ACTION_BOOKING_STATUS_ID), null, null)); this.getMainRecord().getField(TourEventSchedule.TOUR_ACTION_TYPE).addListener(new DisableOnFieldHandler(this.getMainRecord().getField(TourEventSchedule.ACTION_MESSAGE_TRANSPORT_ID), TourActionTypeField.CREATE_DOCUMENT, false)); this.getMainRecord().getField(TourEventSchedule.TOUR_ACTION_TYPE).addListener(new CopyStringHandler(this.getMainRecord().getField(TourEventSchedule.ACTION_MESSAGE_TRANSPORT_ID), null, null)); this.getMainRecord().getField(TourEventSchedule.TOUR_ACTION_TYPE).addListener(new DisableOnFieldHandler(this.getMainRecord().getField(TourEventSchedule.ACTION_DOCUMENT_NAME), TourActionTypeField.CREATE_DOCUMENT, false)); this.getMainRecord().getField(TourEventSchedule.TOUR_ACTION_TYPE).addListener(new CopyStringHandler(this.getMainRecord().getField(TourEventSchedule.ACTION_DOCUMENT_NAME), null, null)); this.getMainRecord().getField(TourEventSchedule.TOUR_ACTION_TYPE).addListener(new DisableOnFieldHandler(this.getMainRecord().getField(TourEventSchedule.ACTION_PROPERTIES), TourActionTypeField.CREATE_DOCUMENT, false)); this.getMainRecord().getField(TourEventSchedule.TOUR_ACTION_TYPE).addListener(new CopyStringHandler(this.getMainRecord().getField(TourEventSchedule.ACTION_PROPERTIES), null, null)); this.getMainRecord().getField(TourEventSchedule.TOUR_ACTION_TYPE).addListener(new DisableOnFieldHandler(this.getMainRecord().getField(TourEventSchedule.ACTION_DOCUMENT_TEXT), TourActionTypeField.CREATE_DOCUMENT, false));
this.getMainRecord().getField(TourEventSchedule.TOUR_EVENT_ID).addListener(new CopyStringHandler(this.getMainRecord().getField(TourEventSchedule.BOOKING_STATUS_ID), null, null)); this.getMainRecord().getField(TourEventSchedule.TOUR_ACTION_TYPE).addListener(new CopyStringHandler(this.getMainRecord().getField(TourEventSchedule.ACTION_TOUR_EVENT_ID), null, null)); this.getMainRecord().getField(TourEventSchedule.TOUR_ACTION_TYPE).addListener(new DisableOnFieldHandler(this.getMainRecord().getField(TourEventSchedule.ACTION_MESSAGE_PROCESS_INFO_ID), TourActionTypeField.CREATE_DOCUMENT, false)); this.getMainRecord().getField(TourEventSchedule.TOUR_ACTION_TYPE).addListener(new CopyStringHandler(this.getMainRecord().getField(TourEventSchedule.ACTION_MESSAGE_PROCESS_INFO_ID), null, null)); this.getMainRecord().getField(TourEventSchedule.ACTION_TOUR_EVENT_ID).addListener(new DisableOnFieldHandler(this.getMainRecord().getField(TourEventSchedule.ACTION_BOOKING_STATUS_ID), Integer.toString(TourEvent.BOOKING_STATUS), false)); this.getMainRecord().getField(TourEventSchedule.ACTION_TOUR_EVENT_ID).addListener(new CopyStringHandler(this.getMainRecord().getField(TourEventSchedule.ACTION_BOOKING_STATUS_ID), null, null)); this.getMainRecord().getField(TourEventSchedule.TOUR_ACTION_TYPE).addListener(new DisableOnFieldHandler(this.getMainRecord().getField(TourEventSchedule.ACTION_MESSAGE_TRANSPORT_ID), TourActionTypeField.CREATE_DOCUMENT, false)); this.getMainRecord().getField(TourEventSchedule.TOUR_ACTION_TYPE).addListener(new CopyStringHandler(this.getMainRecord().getField(TourEventSchedule.ACTION_MESSAGE_TRANSPORT_ID), null, null)); this.getMainRecord().getField(TourEventSchedule.TOUR_ACTION_TYPE).addListener(new DisableOnFieldHandler(this.getMainRecord().getField(TourEventSchedule.ACTION_DOCUMENT_NAME), TourActionTypeField.CREATE_DOCUMENT, false)); this.getMainRecord().getField(TourEventSchedule.TOUR_ACTION_TYPE).addListener(new CopyStringHandler(this.getMainRecord().getField(TourEventSchedule.ACTION_DOCUMENT_NAME), null, null)); this.getMainRecord().getField(TourEventSchedule.TOUR_ACTION_TYPE).addListener(new DisableOnFieldHandler(this.getMainRecord().getField(TourEventSchedule.ACTION_PROPERTIES), TourActionTypeField.CREATE_DOCUMENT, false)); this.getMainRecord().getField(TourEventSchedule.TOUR_ACTION_TYPE).addListener(new CopyStringHandler(this.getMainRecord().getField(TourEventSchedule.ACTION_PROPERTIES), null, null)); this.getMainRecord().getField(TourEventSchedule.TOUR_ACTION_TYPE).addListener(new DisableOnFieldHandler(this.getMainRecord().getField(TourEventSchedule.ACTION_DOCUMENT_TEXT), TourActionTypeField.CREATE_DOCUMENT, false));
/** * Constructor. * @param fldDest The destination field. * @param stringValue The string to set the destination field to. * @param convconvCheckMark If this evaluates to false, don't do the move. */ public CopyStringHandler(BaseField fldDest, String stringValue, Converter convCheckMark) { this(); this.init(null, fldDest, stringValue, convCheckMark); } /**
/** * Add all the screen listeners. */ public void addListeners() { super.addListeners(); TrxStatus recTrxStatus = (TrxStatus)this.getRecord(TrxStatus.TRX_STATUS_FILE); int iTrxStatusID = recTrxStatus.getTrxStatusID(TransactionType.ACCTREC, CreditCard.CREDIT_CARD_FILE, CreditCard.SUBMITTED); String strTrxClass = Integer.toString(iTrxStatusID); this.getMainRecord().getField(CreditCard.PAID).addListener(new MoveOnChangeHandler(this.getMainRecord().getField(CreditCard.DATE_SUBMITTED), this.getScreenRecord().getField(McoScreenRecord.TODAY))); this.getMainRecord().getField(CreditCard.PAID).addListener(new CopyStringHandler(this.getMainRecord().getField(CreditCard.TRX_STATUS_ID), strTrxClass, null)); this.getMainRecord().getField(CreditCard.PAID).addListener(new InitOnChangeHandler(this.getScreenRecord().getField(McoScreenRecord.FLAG))); // Wierd, but since this is a screen field, it would be set the first time and never change again this.getMainRecord().setKeyArea(CreditCard.TRX_STATUS_ID_KEY); recTrxStatus.getTrxStatusID(TransactionType.ACCTREC, CreditCard.CREDIT_CARD_FILE, CreditCard.ENTERED); this.getMainRecord().addListener(new SubFileFilter(recTrxStatus)); this.getMainRecord().addListener(new SyncArTrxStatusHandler(null)); } /**
/** * Initialize class fields. */ public void init(BaseField field) { m_recArTrx = null; super.init(field, (BaseField)null, (String)null, (Converter)null); } /**
/** * Add all the screen listeners. */ public void addListeners() { super.addListeners(); TrxStatus recTrxStatus = (TrxStatus)this.getRecord(TrxStatus.TRX_STATUS_FILE); int iTrxStatusID = recTrxStatus.getTrxStatusID(TransactionType.ACCTREC, CreditCard.CREDIT_CARD_FILE, CreditCard.APPROVED); String strTrxClass = Integer.toString(iTrxStatusID); this.getMainRecord().getField(CreditCard.PAID).addListener(new MoveOnChangeHandler(this.getMainRecord().getField(CreditCard.DATE_APPROVED), this.getScreenRecord().getField(McoScreenRecord.TODAY))); this.getMainRecord().getField(CreditCard.PAID).addListener(new CopyStringHandler(this.getMainRecord().getField(CreditCard.TRX_STATUS_ID), strTrxClass, null)); this.getMainRecord().getField(CreditCard.PAID).addListener(new InitOnChangeHandler(this.getScreenRecord().getField(McoScreenRecord.FLAG))); // Wierd, but since this is a screen field, it would be set the first time and never change again this.getMainRecord().setKeyArea(CreditCard.TRX_STATUS_ID_KEY); recTrxStatus.getTrxStatusID(TransactionType.ACCTREC, CreditCard.CREDIT_CARD_FILE, CreditCard.SUBMITTED); this.getMainRecord().addListener(new SubFileFilter(recTrxStatus)); this.getMainRecord().addListener(new SyncArTrxStatusHandler(null)); } /**
/** * Constructor. * @param fldDest The destination field. * @param stringValue The string to set the destination field to. * @param convconvCheckMark If this evaluates to false, don't do the move. */ public CopyStringHandler(BaseField fldDest, String stringValue, Converter convCheckMark) { this(); this.init(null, fldDest, stringValue, convCheckMark); } /**
/** * Add all the screen listeners. */ public void addListeners() { super.addListeners(); this.getScreenRecord().getField(AcctBatchScreenRecord.USER_ID).moveFieldToThis(this.getMainRecord().getField(AcctBatch.USER_ID)); this.getScreenRecord().getField(AcctBatchScreenRecord.RECURRING).moveFieldToThis(this.getMainRecord().getField(AcctBatch.RECURRING)); this.getMainRecord().getField(AcctBatch.RECURRING).addListener(new DisableOnFieldHandler(this.getMainRecord().getField(AcctBatch.TRX_DATE), BooleanField.YES, true)); FieldListener listener = new CopyStringHandler(this.getMainRecord().getField(AcctBatch.TRX_DATE), DBConstants.BLANK, this.getMainRecord().getField(AcctBatch.RECURRING)); listener.setRespondsToMode(DBConstants.INIT_MOVE, true); this.getMainRecord().getField(AcctBatch.TRX_DATE).addListener(listener); this.getMainRecord().setKeyArea(AcctBatch.USER_ID_KEY); this.getMainRecord().addListener(new SubFileFilter(this.getScreenRecord().getField(AcctBatchScreenRecord.USER_ID), AcctBatch.USER_ID, this.getScreenRecord().getField(AcctBatchScreenRecord.RECURRING), AcctBatch.RECURRING, null, null)); } /**
/** * Add all the screen listeners. */ public void addListeners() { super.addListeners(); this.getMainRecord().setKeyArea(AcctBatch.USER_ID_KEY); this.getMainRecord().addListener(new SubFileFilter(this.getScreenRecord().getField(AcctBatchScreenRecord.USER_ID), AcctBatch.USER_ID, this.getScreenRecord().getField(AcctBatchScreenRecord.RECURRING), AcctBatch.RECURRING, null, null)); this.getScreenRecord().getField(AcctBatchScreenRecord.USER_ID).addListener(new FieldReSelectHandler(this)); this.getScreenRecord().getField(AcctBatchScreenRecord.RECURRING).addListener(new FieldReSelectHandler(this)); this.getMainRecord().getField(AcctBatch.RECURRING).addListener(new DisableOnFieldHandler(this.getMainRecord().getField(AcctBatch.TRX_DATE), BooleanField.YES, true)); FieldListener listener = new CopyStringHandler(this.getMainRecord().getField(AcctBatch.TRX_DATE), DBConstants.BLANK, this.getMainRecord().getField(AcctBatch.RECURRING)); listener.setRespondsToMode(DBConstants.INIT_MOVE, true); this.getMainRecord().getField(AcctBatch.TRX_DATE).addListener(listener); this.getScreenRecord().getField(AcctBatchScreenRecord.RECURRING).addListener(new StickyValueHandler(null)); } /**