/** * Constructor. * @param iFieldSeq The field sequence in this record to move this listener's field to. */ public CopyFieldHandler(int iFieldSeq) { this(); this.init(null, null, null, iFieldSeq); } /**
/** * Constructor. * @param field The basefield owner of this listener (usually null and set on setOwner()). * @param iFieldSeq The field sequence in this record to move this listener's field to. * @param field The field to move this listener's field to. * @param fldCheckMark Only move if this field evaluates to true. */ public void init(BaseField field, BaseField fldDest, Converter fldCheckMark, String fieldName) { BaseField fldSource = null; boolean bClearIfThisNull = true; boolean bOnlyIfDestNull = false; boolean bDontMoveNull = false; super.init(field, fldDest, fldSource, bClearIfThisNull, bOnlyIfDestNull, bDontMoveNull); this.setRespondsToMode(DBConstants.INIT_MOVE, false); // By default, only respond to screen and init moves this.setRespondsToMode(DBConstants.READ_MOVE, false); // Usually, you only want to move a string on screen change this.fieldName = fieldName; m_convCheckMark = fldCheckMark; } /**
/** * Add all standard file & field behaviors. * Override this to add record listeners and filters. */ public void addListeners() { this.getField(CheckScreenRecord.CHECK_AMOUNT).addListener(new CopyFieldHandler(CheckScreenRecord.CHECK_AMOUNT_TEXT)); super.addListeners(); }
CopyFieldHandler listener = new CopyFieldHandler(fldSource, convBackconvCheckMark);
CopyFieldHandler listener = new CopyFieldHandler(fldSource, convBackconvCheckMark);
/** * Constructor. * @param iFieldSeq The field sequence in this record to move this listener's field to. */ public CopyFieldHandler(String fieldName) { this(); this.init(null, null, null, fieldName); } /**
/** * Constructor. * @param field The basefield owner of this listener (usually null and set on setOwner()). * @param iFieldSeq The field sequence in this record to move this listener's field to. * @param field The field to move this listener's field to. * @param fldCheckMark Only move if this field evaluates to true. */ public void init(BaseField field, BaseField fldDest, Converter fldCheckMark, int iFieldSeq) { BaseField fldSource = null; boolean bClearIfThisNull = true; boolean bOnlyIfDestNull = false; boolean bDontMoveNull = false; super.init(field, fldDest, fldSource, bClearIfThisNull, bOnlyIfDestNull, bDontMoveNull); this.setRespondsToMode(DBConstants.INIT_MOVE, false); // By default, only respond to screen and init moves this.setRespondsToMode(DBConstants.READ_MOVE, false); // Usually, you only want to move a string on screen change m_iFieldSeq = iFieldSeq; m_convCheckMark = fldCheckMark; } /**
CopyFieldHandler listener = new CopyFieldHandler(fldSource, convBackconvCheckMark);
/** * Constructor. * @param field The field to move this listener's field to. * @param fldCheckMark Only move if this field evaluates to true. */ public CopyFieldHandler(BaseField field, Converter fldCheckMark) { this(); this.init(null, field, fldCheckMark, null); } /**
/** * Constructor. * @param field The basefield owner of this listener (usually null and set on setOwner()). * @param iFieldSeq The field sequence in this record to move this listener's field to. * @param field The field to move this listener's field to. * @param fldCheckMark Only move if this field evaluates to true. */ public void init(BaseField field, BaseField fldDest, Converter fldCheckMark, int iFieldSeq) { BaseField fldSource = null; boolean bClearIfThisNull = true; boolean bOnlyIfDestNull = false; boolean bDontMoveNull = false; super.init(field, fldDest, fldSource, bClearIfThisNull, bOnlyIfDestNull, bDontMoveNull); this.setRespondsToMode(DBConstants.INIT_MOVE, false); // By default, only respond to screen and init moves this.setRespondsToMode(DBConstants.READ_MOVE, false); // Usually, you only want to move a string on screen change m_iFieldSeq = iFieldSeq; m_convCheckMark = fldCheckMark; } /**
/** * AddMasterListeners Method. */ public void addMasterListeners() { super.addMasterListeners(); BaseField productDesc = this.getField(Product.DESCRIPTION); BaseField productSort = this.getField(Product.DESC_SORT); CopyFieldHandler copyField = new CopyFieldHandler(Product.DESC_SORT); productDesc.addListener(copyField); FieldToUpperHandler toUpper = new FieldToUpperHandler(null); productSort.addListener(toUpper); CheckForTheHandler checkThe = new CheckForTheHandler(null); productSort.addListener(checkThe); this.getField(Product.PRODUCT_TYPE).addListener(new GetProductDescHandler(null)); } /**
/** * Constructor. * @param field The basefield owner of this listener (usually null and set on setOwner()). * @param field The destination last name field. * @param iFieldSeq The sequence of the last name field in this record. * @param checkMark If false, do not move the last name. */ public void init(BaseField field, BaseField fldTarget, Converter checkMark, int iFieldSeq) { super.init(field, fldTarget, checkMark, iFieldSeq); } /**
/** * AddMasterListeners Method. */ public void addMasterListeners() { super.addMasterListeners(); BaseField productDesc = this.getField(Product.DESCRIPTION); BaseField productSort = this.getField(Product.DESC_SORT); CopyFieldHandler copyField = new CopyFieldHandler(Product.DESC_SORT); productDesc.addListener(copyField); FieldToUpperHandler toUpper = new FieldToUpperHandler(null); productSort.addListener(toUpper); CheckForTheHandler checkThe = new CheckForTheHandler(null); productSort.addListener(checkThe); this.getField(Product.PRODUCT_TYPE).addListener(new GetProductDescHandler(null)); } /**
/** * Constructor. * @param field The field to move this listener's field to. * @param fldCheckMark Only move if this field evaluates to true. */ public CopyFieldHandler(BaseField field, Converter fldCheckMark) { this(); this.init(null, field, fldCheckMark, -1); } /**
/** * Add all standard file & field behaviors. * Override this to add record listeners and filters. */ public void addListeners() { super.addListeners(); this.addListener(new DateChangedHandler(Person.kDateChanged)); this.addListener(new SetUserIDHandler(Person.kChangedID, false)); this.getField(Person.kName).addListener(new CopyLastHandler(Person.kNameSort)); // Only if dest is null (ie., company name is null) this.getField(Person.kNameSort).addListener(new FieldToUpperHandler(null)); this.getField(Person.kPostalCode).addListener(new CopyFieldHandler(Person.kPostalCodeSort)); } /**
/** * Constructor. * @param field The field to move this listener's field to. * @param fldCheckMark Only move if this field evaluates to true. */ public CopyFieldHandler(BaseField field, Converter fldCheckMark) { this(); this.init(null, field, fldCheckMark, -1); } /**
/** * AddMasterListeners Method. */ public void addMasterListeners() { super.addMasterListeners(); CopyLastHandler copyLast = new CopyLastHandler(Employee.NAME_SORT); // This should be somewhere else! this.getField(Employee.NAME).addListener(copyLast); CopyFieldHandler copyFirst = new CopyFieldHandler(Employee.FIRST_NAME); this.getField(Employee.NAME).addListener(copyFirst); FieldToUpperHandler upper = new FieldToUpperHandler(null); this.getField(Employee.FIRST_NAME).addListener(upper); CopyFieldHandler copyState = new CopyFieldHandler(Employee.STATE_TAX_CODE); this.getField(Employee.STATE_OR_REGION).addListener(copyState); FileListener disableKey = new EnableOnValidHandler(Employee.ID, EnableOnValidHandler.DISABLE_ON_VALID, EnableOnValidHandler.ENABLE_ON_NEW); this.addListener(disableKey); FieldListener calcOvertime = new CalcOvertimeHandler(this.getField(Employee.OVERTIME_RATE)); this.getField(Employee.HOURLY_RATE).addListener(calcOvertime); FieldListener calcHourly = new CalcHourlyHandler(this.getField(Employee.HOURLY_RATE)); this.getField(Employee.SALARY).addListener(calcHourly); } /**
/** * Constructor. * @param field The basefield owner of this listener (usually null and set on setOwner()). * @param field The destination last name field. * @param iFieldSeq The sequence of the last name field in this record. * @param checkMark If false, do not move the last name. */ public void init(BaseField field, BaseField fldTarget, Converter checkMark, String fieldName) { super.init(field, fldTarget, checkMark, fieldName); } /**
/** * Add all standard file & field behaviors. * Override this to add record listeners and filters. */ public void addListeners() { super.addListeners(); this.getField(Person.kName).removeListener(this.getField(Person.kName).getListener(CopyLastHandler.class), true); // Only if dest is null (ie., company name is null) this.getField(Person.kName).addListener(new CopyFieldHandler(Person.kNameSort)); this.getField(Company.kNameSort).addListener(new CheckForTheHandler(null)); CopyLastHandler listener = new CopyLastHandler(Company.kNameSort); this.getField(Company.kContact).addListener(listener); // Only if dest is null (ie., company name is null) listener.setOnlyIfDestNull(true); }
/** * Constructor. * @param field The field to move this listener's field to. * @param fldCheckMark Only move if this field evaluates to true. */ public CopyFieldHandler(BaseField field) { this(); this.init(null, field, null, null); } /**