/** * AddSecondProfile Method. */ public void addSecondProfile(Record recProfile) { ReadSecondaryHandler behavior = new ReadSecondaryHandler(recProfile, Profile.PROFILE_CODE_KEY); behavior.setRespondsToMode(DBConstants.READ_MOVE, false); this.getField(Booking.PROFILE_CODE).addListener(behavior); behavior.addFieldSeqPair(Booking.PROFILE_ID, Profile.ID, DBConstants.MOVE_TO_DEPENDENT, DBConstants.DONT_MOVE_DEPENDENT_BACK); behavior.addFieldSeqPair(Booking.PROFILE_CODE, Profile.PROFILE_CODE, DBConstants.MOVE_TO_DEPENDENT, DBConstants.DONT_MOVE_DEPENDENT_BACK); behavior.addFieldSeqPair(Booking.GENERIC_NAME, Profile.GENERIC_NAME, DBConstants.MOVE_TO_DEPENDENT, DBConstants.MOVE_DEPENDENT_BACK); behavior.addFieldSeqPair(Booking.ADDRESS_LINE_1, Profile.ADDRESS_LINE_1, DBConstants.MOVE_TO_DEPENDENT, DBConstants.MOVE_DEPENDENT_BACK); behavior.addFieldSeqPair(Booking.ADDRESS_LINE_2, Profile.ADDRESS_LINE_2, DBConstants.MOVE_TO_DEPENDENT, DBConstants.MOVE_DEPENDENT_BACK); behavior.addFieldSeqPair(Booking.CITY_OR_TOWN, Profile.CITY_OR_TOWN, DBConstants.MOVE_TO_DEPENDENT, DBConstants.MOVE_DEPENDENT_BACK); behavior.addFieldSeqPair(Booking.COUNTRY, Profile.COUNTRY, DBConstants.MOVE_TO_DEPENDENT, DBConstants.MOVE_DEPENDENT_BACK); behavior.addFieldSeqPair(Booking.STATE_OR_REGION, Profile.STATE_OR_REGION, DBConstants.MOVE_TO_DEPENDENT, DBConstants.MOVE_DEPENDENT_BACK); behavior.addFieldSeqPair(Booking.POSTAL_CODE, Profile.POSTAL_CODE, DBConstants.MOVE_TO_DEPENDENT, DBConstants.MOVE_DEPENDENT_BACK); behavior.addFieldSeqPair(Booking.TEL, Profile.TEL, DBConstants.MOVE_TO_DEPENDENT, DBConstants.MOVE_DEPENDENT_BACK); behavior.addFieldSeqPair(Booking.FAX, Profile.FAX, DBConstants.MOVE_TO_DEPENDENT, DBConstants.MOVE_DEPENDENT_BACK); behavior.addFieldSeqPair(Booking.EMAIL, Profile.EMAIL, DBConstants.MOVE_TO_DEPENDENT, DBConstants.MOVE_DEPENDENT_BACK); behavior.addFieldSeqPair(Booking.LANGUAGE_ID, Profile.PRIMARY_LANGUAGE_ID, DBConstants.MOVE_TO_DEPENDENT, DBConstants.MOVE_DEPENDENT_BACK); behavior.addFieldSeqPair(Booking.CURRENCYS_ID, Profile.CURRENCYS_ID, DBConstants.MOVE_TO_DEPENDENT, DBConstants.MOVE_DEPENDENT_BACK); // Only move contact if not blank Converter convTrueIfContactNotBlank = new RadioConverter(this.getField(Booking.CONTACT), DBConstants.BLANK, true); recProfile.addListener(new RemoveConverterOnCloseHandler(convTrueIfContactNotBlank)); MoveOnValidHandler moveHandler = behavior.addFieldSeqPair(Booking.CONTACT, Profile.CONTACT, DBConstants.MOVE_TO_DEPENDENT, DBConstants.DONT_MOVE_DEPENDENT_BACK, convTrueIfContactNotBlank, null); moveHandler.setDisableOnMove(false); } /**
/** * AddSecondProfile Method. */ public void addSecondProfile(Record recProfile) { ReadSecondaryHandler behavior = new ReadSecondaryHandler(recProfile, Profile.PROFILE_CODE_KEY); behavior.setRespondsToMode(DBConstants.READ_MOVE, false); this.getField(Booking.PROFILE_CODE).addListener(behavior); behavior.addFieldSeqPair(Booking.PROFILE_ID, Profile.ID, DBConstants.MOVE_TO_DEPENDENT, DBConstants.DONT_MOVE_DEPENDENT_BACK); behavior.addFieldSeqPair(Booking.PROFILE_CODE, Profile.PROFILE_CODE, DBConstants.MOVE_TO_DEPENDENT, DBConstants.DONT_MOVE_DEPENDENT_BACK); behavior.addFieldSeqPair(Booking.GENERIC_NAME, Profile.GENERIC_NAME, DBConstants.MOVE_TO_DEPENDENT, DBConstants.MOVE_DEPENDENT_BACK); behavior.addFieldSeqPair(Booking.ADDRESS_LINE_1, Profile.ADDRESS_LINE_1, DBConstants.MOVE_TO_DEPENDENT, DBConstants.MOVE_DEPENDENT_BACK); behavior.addFieldSeqPair(Booking.ADDRESS_LINE_2, Profile.ADDRESS_LINE_2, DBConstants.MOVE_TO_DEPENDENT, DBConstants.MOVE_DEPENDENT_BACK); behavior.addFieldSeqPair(Booking.CITY_OR_TOWN, Profile.CITY_OR_TOWN, DBConstants.MOVE_TO_DEPENDENT, DBConstants.MOVE_DEPENDENT_BACK); behavior.addFieldSeqPair(Booking.COUNTRY, Profile.COUNTRY, DBConstants.MOVE_TO_DEPENDENT, DBConstants.MOVE_DEPENDENT_BACK); behavior.addFieldSeqPair(Booking.STATE_OR_REGION, Profile.STATE_OR_REGION, DBConstants.MOVE_TO_DEPENDENT, DBConstants.MOVE_DEPENDENT_BACK); behavior.addFieldSeqPair(Booking.POSTAL_CODE, Profile.POSTAL_CODE, DBConstants.MOVE_TO_DEPENDENT, DBConstants.MOVE_DEPENDENT_BACK); behavior.addFieldSeqPair(Booking.TEL, Profile.TEL, DBConstants.MOVE_TO_DEPENDENT, DBConstants.MOVE_DEPENDENT_BACK); behavior.addFieldSeqPair(Booking.FAX, Profile.FAX, DBConstants.MOVE_TO_DEPENDENT, DBConstants.MOVE_DEPENDENT_BACK); behavior.addFieldSeqPair(Booking.EMAIL, Profile.EMAIL, DBConstants.MOVE_TO_DEPENDENT, DBConstants.MOVE_DEPENDENT_BACK); behavior.addFieldSeqPair(Booking.LANGUAGE_ID, Profile.PRIMARY_LANGUAGE_ID, DBConstants.MOVE_TO_DEPENDENT, DBConstants.MOVE_DEPENDENT_BACK); behavior.addFieldSeqPair(Booking.CURRENCYS_ID, Profile.CURRENCYS_ID, DBConstants.MOVE_TO_DEPENDENT, DBConstants.MOVE_DEPENDENT_BACK); // Only move contact if not blank Converter convTrueIfContactNotBlank = new RadioConverter(this.getField(Booking.CONTACT), DBConstants.BLANK, true); recProfile.addListener(new RemoveConverterOnCloseHandler(convTrueIfContactNotBlank)); MoveOnValidHandler moveHandler = behavior.addFieldSeqPair(Booking.CONTACT, Profile.CONTACT, DBConstants.MOVE_TO_DEPENDENT, DBConstants.DONT_MOVE_DEPENDENT_BACK, convTrueIfContactNotBlank, null); moveHandler.setDisableOnMove(false); } /**
/** * Add all the screen listeners. */ public void addListeners() { super.addListeners(); this.addMainKeyBehavior(); Hotel bkHotel = (Hotel)this.getMainRecord(); Vendor apVendor = (Vendor)this.getRecord(Vendor.VENDOR_FILE); ReadSecondaryHandler secondaryStuff = new ReadSecondaryHandler(apVendor, Vendor.ID_KEY); bkHotel.getField(Hotel.VENDOR_ID).addListener(secondaryStuff); ReadSecondaryHandler currSecond = new ReadSecondaryHandler(this.getRecord(Currencys.CURRENCYS_FILE), Currencys.CURRENCY_CODE_KEY); apVendor.getField(Vendor.CURRENCYS_ID).addListener(currSecond); BaseField checkMark = bkHotel.getField(Hotel.SAME_AS_VENDOR); secondaryStuff.addFieldSeqPair(Hotel.DESCRIPTION, Vendor.VENDOR_NAME, DBConstants.MOVE_TO_DEPENDENT, DBConstants.DONT_MOVE_DEPENDENT_BACK, checkMark, null); secondaryStuff.addFieldSeqPair(Hotel.ADDRESS_LINE_1, Vendor.ADDRESS_LINE_1, DBConstants.MOVE_TO_DEPENDENT,DBConstants.DONT_MOVE_DEPENDENT_BACK, checkMark, null); secondaryStuff.addFieldSeqPair(Hotel.ADDRESS_LINE_2, Vendor.ADDRESS_LINE_2, DBConstants.MOVE_TO_DEPENDENT,DBConstants.DONT_MOVE_DEPENDENT_BACK, checkMark, null); secondaryStuff.addFieldSeqPair(Hotel.CITY_OR_TOWN, Vendor.CITY_OR_TOWN, DBConstants.MOVE_TO_DEPENDENT, DBConstants.DONT_MOVE_DEPENDENT_BACK, checkMark, null); secondaryStuff.addFieldSeqPair(Hotel.STATE_OR_REGION, Vendor.STATE_OR_REGION, DBConstants.MOVE_TO_DEPENDENT, DBConstants.DONT_MOVE_DEPENDENT_BACK, checkMark, null); secondaryStuff.addFieldSeqPair(Hotel.POSTAL_CODE, Vendor.POSTAL_CODE, DBConstants.MOVE_TO_DEPENDENT, DBConstants.DONT_MOVE_DEPENDENT_BACK, checkMark, null); secondaryStuff.addFieldSeqPair(Hotel.COUNTRY, Vendor.COUNTRY, DBConstants.MOVE_TO_DEPENDENT, DBConstants.DONT_MOVE_DEPENDENT_BACK, checkMark, null); secondaryStuff.addFieldSeqPair(Hotel.TEL, Vendor.TEL, DBConstants.MOVE_TO_DEPENDENT, DBConstants.DONT_MOVE_DEPENDENT_BACK, checkMark, null); secondaryStuff.addFieldSeqPair(Hotel.FAX, Vendor.FAX, DBConstants.MOVE_TO_DEPENDENT, DBConstants.DONT_MOVE_DEPENDENT_BACK, checkMark, null); secondaryStuff.addFieldSeqPair(Hotel.EMAIL, Vendor.EMAIL, DBConstants.MOVE_TO_DEPENDENT, DBConstants.DONT_MOVE_DEPENDENT_BACK, checkMark, null); } /**
/** * Add all the screen listeners. */ public void addListeners() { super.addListeners(); this.addMainKeyBehavior(); Hotel bkHotel = (Hotel)this.getMainRecord(); Vendor apVendor = (Vendor)this.getRecord(Vendor.VENDOR_FILE); ReadSecondaryHandler secondaryStuff = new ReadSecondaryHandler(apVendor, Vendor.ID_KEY); bkHotel.getField(Hotel.VENDOR_ID).addListener(secondaryStuff); ReadSecondaryHandler currSecond = new ReadSecondaryHandler(this.getRecord(Currencys.CURRENCYS_FILE), Currencys.CURRENCY_CODE_KEY); apVendor.getField(Vendor.CURRENCYS_ID).addListener(currSecond); BaseField checkMark = bkHotel.getField(Hotel.SAME_AS_VENDOR); secondaryStuff.addFieldSeqPair(Hotel.DESCRIPTION, Vendor.VENDOR_NAME, DBConstants.MOVE_TO_DEPENDENT, DBConstants.DONT_MOVE_DEPENDENT_BACK, checkMark, null); secondaryStuff.addFieldSeqPair(Hotel.ADDRESS_LINE_1, Vendor.ADDRESS_LINE_1, DBConstants.MOVE_TO_DEPENDENT,DBConstants.DONT_MOVE_DEPENDENT_BACK, checkMark, null); secondaryStuff.addFieldSeqPair(Hotel.ADDRESS_LINE_2, Vendor.ADDRESS_LINE_2, DBConstants.MOVE_TO_DEPENDENT,DBConstants.DONT_MOVE_DEPENDENT_BACK, checkMark, null); secondaryStuff.addFieldSeqPair(Hotel.CITY_OR_TOWN, Vendor.CITY_OR_TOWN, DBConstants.MOVE_TO_DEPENDENT, DBConstants.DONT_MOVE_DEPENDENT_BACK, checkMark, null); secondaryStuff.addFieldSeqPair(Hotel.STATE_OR_REGION, Vendor.STATE_OR_REGION, DBConstants.MOVE_TO_DEPENDENT, DBConstants.DONT_MOVE_DEPENDENT_BACK, checkMark, null); secondaryStuff.addFieldSeqPair(Hotel.POSTAL_CODE, Vendor.POSTAL_CODE, DBConstants.MOVE_TO_DEPENDENT, DBConstants.DONT_MOVE_DEPENDENT_BACK, checkMark, null); secondaryStuff.addFieldSeqPair(Hotel.COUNTRY, Vendor.COUNTRY, DBConstants.MOVE_TO_DEPENDENT, DBConstants.DONT_MOVE_DEPENDENT_BACK, checkMark, null); secondaryStuff.addFieldSeqPair(Hotel.TEL, Vendor.TEL, DBConstants.MOVE_TO_DEPENDENT, DBConstants.DONT_MOVE_DEPENDENT_BACK, checkMark, null); secondaryStuff.addFieldSeqPair(Hotel.FAX, Vendor.FAX, DBConstants.MOVE_TO_DEPENDENT, DBConstants.DONT_MOVE_DEPENDENT_BACK, checkMark, null); secondaryStuff.addFieldSeqPair(Hotel.EMAIL, Vendor.EMAIL, DBConstants.MOVE_TO_DEPENDENT, DBConstants.DONT_MOVE_DEPENDENT_BACK, checkMark, null); } /**
recRequest.getField(Request.PROFILE_CODE).addListener(pSecondaryBehavior); pSecondaryBehavior.addFieldSeqPair(Request.PROFILE_ID); pSecondaryBehavior.addFieldSeqPair(Request.PROFILE_CODE, Profile.PROFILE_CODE, DBConstants.MOVE_TO_DEPENDENT, DBConstants.DONT_MOVE_DEPENDENT_BACK); pSecondaryBehavior.addFieldSeqPair(Request.GENERIC_NAME, Profile.GENERIC_NAME, DBConstants.MOVE_TO_DEPENDENT, DBConstants.DONT_MOVE_DEPENDENT_BACK); pSecondaryBehavior.addFieldSeqPair(Request.ADDRESS_LINE_1, Profile.ADDRESS_LINE_1, DBConstants.MOVE_TO_DEPENDENT, DBConstants.DONT_MOVE_DEPENDENT_BACK); pSecondaryBehavior.addFieldSeqPair(Request.ADDRESS_LINE_2, Profile.ADDRESS_LINE_2, DBConstants.MOVE_TO_DEPENDENT, DBConstants.DONT_MOVE_DEPENDENT_BACK); pSecondaryBehavior.addFieldSeqPair(Request.CITY_OR_TOWN, Profile.CITY_OR_TOWN, DBConstants.MOVE_TO_DEPENDENT, DBConstants.DONT_MOVE_DEPENDENT_BACK); pSecondaryBehavior.addFieldSeqPair(Request.STATE_OR_REGION, Profile.STATE_OR_REGION, DBConstants.MOVE_TO_DEPENDENT, DBConstants.DONT_MOVE_DEPENDENT_BACK); pSecondaryBehavior.addFieldSeqPair(Request.POSTAL_CODE, Profile.POSTAL_CODE, DBConstants.MOVE_TO_DEPENDENT, DBConstants.DONT_MOVE_DEPENDENT_BACK); pSecondaryBehavior.addFieldSeqPair(Request.COUNTRY, Profile.COUNTRY, DBConstants.MOVE_TO_DEPENDENT, DBConstants.DONT_MOVE_DEPENDENT_BACK); pSecondaryBehavior.addFieldSeqPair(Request.ATTENTION, Profile.NAME_ORDERED, DBConstants.MOVE_TO_DEPENDENT, DBConstants.DONT_MOVE_DEPENDENT_BACK); pSecondaryBehavior.addFieldSeqPair(Request.EMAIL, Profile.EMAIL, DBConstants.MOVE_TO_DEPENDENT, DBConstants.DONT_MOVE_DEPENDENT_BACK);
recRequest.getField(Request.PROFILE_CODE).addListener(pSecondaryBehavior); pSecondaryBehavior.addFieldSeqPair(Request.PROFILE_ID); pSecondaryBehavior.addFieldSeqPair(Request.PROFILE_CODE, Profile.PROFILE_CODE, DBConstants.MOVE_TO_DEPENDENT, DBConstants.DONT_MOVE_DEPENDENT_BACK); pSecondaryBehavior.addFieldSeqPair(Request.GENERIC_NAME, Profile.GENERIC_NAME, DBConstants.MOVE_TO_DEPENDENT, DBConstants.DONT_MOVE_DEPENDENT_BACK); pSecondaryBehavior.addFieldSeqPair(Request.ADDRESS_LINE_1, Profile.ADDRESS_LINE_1, DBConstants.MOVE_TO_DEPENDENT, DBConstants.DONT_MOVE_DEPENDENT_BACK); pSecondaryBehavior.addFieldSeqPair(Request.ADDRESS_LINE_2, Profile.ADDRESS_LINE_2, DBConstants.MOVE_TO_DEPENDENT, DBConstants.DONT_MOVE_DEPENDENT_BACK); pSecondaryBehavior.addFieldSeqPair(Request.CITY_OR_TOWN, Profile.CITY_OR_TOWN, DBConstants.MOVE_TO_DEPENDENT, DBConstants.DONT_MOVE_DEPENDENT_BACK); pSecondaryBehavior.addFieldSeqPair(Request.STATE_OR_REGION, Profile.STATE_OR_REGION, DBConstants.MOVE_TO_DEPENDENT, DBConstants.DONT_MOVE_DEPENDENT_BACK); pSecondaryBehavior.addFieldSeqPair(Request.POSTAL_CODE, Profile.POSTAL_CODE, DBConstants.MOVE_TO_DEPENDENT, DBConstants.DONT_MOVE_DEPENDENT_BACK); pSecondaryBehavior.addFieldSeqPair(Request.COUNTRY, Profile.COUNTRY, DBConstants.MOVE_TO_DEPENDENT, DBConstants.DONT_MOVE_DEPENDENT_BACK); pSecondaryBehavior.addFieldSeqPair(Request.ATTENTION, Profile.NAME_ORDERED, DBConstants.MOVE_TO_DEPENDENT, DBConstants.DONT_MOVE_DEPENDENT_BACK); pSecondaryBehavior.addFieldSeqPair(Request.EMAIL, Profile.EMAIL, DBConstants.MOVE_TO_DEPENDENT, DBConstants.DONT_MOVE_DEPENDENT_BACK);