/** * Constructor. * @param bRefreshAfterWrite Refresh the record after write. */ public WriteOnChangeHandler(boolean bRefreshAfterWrite) { this(); this.init(null, bRefreshAfterWrite); } /**
/** * Constructor. * @param field The basefield owner of this listener (usually null and set on setOwner()). * @param bRefreshAfterWrite Refresh the record after write. */ public void init(BaseField field, boolean bRefreshAfterWrite) { super.init(field); this.setRespondsToMode(DBConstants.INIT_MOVE, false); this.setRespondsToMode(DBConstants.READ_MOVE, false); // By default, only respond to screen moves m_bRefreshAfterWrite = bRefreshAfterWrite; } /**
Record record = this.getOwner().getRecord(); if (record != null)
/** * FieldChanged Method. */ public int fieldChanged(boolean bDisplayOption, int iMoveMode) { boolean bMatch = false; if (this.getOwner().getData() == null) { if (m_objToMatch == null) bMatch = true; } else if (this.getOwner().getData().equals(m_objToMatch)) bMatch = true; if (bMatch) return super.fieldChanged(bDisplayOption, iMoveMode); return DBConstants.NORMAL_RETURN; }
Record record = this.getOwner().getRecord(); if (record != null)
/** * FieldChanged Method. */ public int fieldChanged(boolean bDisplayOption, int iMoveMode) { boolean bMatch = false; if (this.getOwner().getData() == null) { if (m_objToMatch == null) bMatch = true; } else if (this.getOwner().getData().equals(m_objToMatch)) bMatch = true; if (bMatch) return super.fieldChanged(bDisplayOption, iMoveMode); return DBConstants.NORMAL_RETURN; }
/** * Initialize class fields. */ public void init(Object objToMatch, boolean bRefreshAfterWrite) { m_objToMatch = null; m_objToMatch = objToMatch; super.init(null, bRefreshAfterWrite); } /**
/** * Constructor. * @param field The basefield owner of this listener (usually null and set on setOwner()). * @param bRefreshAfterWrite Refresh the record after write. */ public void init(BaseField field, boolean bRefreshAfterWrite) { super.init(field); this.setRespondsToMode(DBConstants.INIT_MOVE, false); this.setRespondsToMode(DBConstants.READ_MOVE, false); // By default, only respond to screen moves m_bRefreshAfterWrite = bRefreshAfterWrite; } /**
Record record = this.getOwner().getRecord(); if (record != null)
/** * Constructor. * @param bRefreshAfterWrite Refresh the record after write. */ public WriteOnChangeHandler(boolean bRefreshAfterWrite) { this(); this.init(null, bRefreshAfterWrite); } /**
/** * Constructor. * @param field The basefield owner of this listener (usually null and set on setOwner()). * @param bRefreshAfterWrite Refresh the record after write. */ public void init(BaseField field, boolean bRefreshAfterWrite) { super.init(field); this.setRespondsToMode(DBConstants.INIT_MOVE, false); this.setRespondsToMode(DBConstants.READ_MOVE, false); // By default, only respond to screen moves m_bRefreshAfterWrite = bRefreshAfterWrite; } /**
/** * Initialize class fields. */ public void init(Object objToMatch, boolean bRefreshAfterWrite) { m_objToMatch = null; m_objToMatch = objToMatch; super.init(null, bRefreshAfterWrite); } /**
/** * Constructor. * @param bRefreshAfterWrite Refresh the record after write. */ public WriteOnChangeHandler(boolean bRefreshAfterWrite) { this(); this.init(null, bRefreshAfterWrite); } /**
/** * Set this cloned listener to the same state at this listener. * @param field The field this new listener will be added to. * @param The new listener to sync to this. * @param Has the init method been called? * @return True if I called init. */ public boolean syncClonedListener(BaseField field, FieldListener listener, boolean bInitCalled) { if (!bInitCalled) ((WriteOnChangeHandler)listener).init(null, m_bRefreshAfterWrite); return super.syncClonedListener(field, listener, true); } /**
/** * Set this cloned listener to the same state at this listener. * @param field The field this new listener will be added to. * @param The new listener to sync to this. * @param Has the init method been called? * @return True if I called init. */ public boolean syncClonedListener(BaseField field, FieldListener listener, boolean bInitCalled) { if (!bInitCalled) ((WriteOnChangeHandler)listener).init(null, m_bRefreshAfterWrite); return super.syncClonedListener(field, listener, true); } /**
/** * Set this cloned listener to the same state at this listener. * @param field The field this new listener will be added to. * @param The new listener to sync to this. * @param Has the init method been called? * @return True if I called init. */ public boolean syncClonedListener(BaseField field, FieldListener listener, boolean bInitCalled) { if (!bInitCalled) ((WriteOnChangeHandler)listener).init(null, m_bRefreshAfterWrite); return super.syncClonedListener(field, listener, true); } /**