/** * Constructor. * @param field The basefield owner of this listener (usually null and set on setOwner()). * @param fieldToDisable The field to disable when this listener's owner matches the target string. * @param strCompareString The string to compare to this listener's owner. * @param bDisableIfMatch If true, disables if the string matches, if false, enables on match. */ public void init(BaseField field, BaseField fieldToDisable, String strCompareString, boolean bDisableIfMatch) { super.init(field); m_fldToDisable = fieldToDisable; m_strCompareString = strCompareString; m_bDisableIfMatch = bDisableIfMatch; if (m_fldToDisable != null) m_fldToDisable.addListener(new FieldRemoveBOnCloseHandler(this)); // Remove this listener if closed } /**
/** * Constructor. */ public FieldRemoveBOnCloseHandler(BaseListener listener) { this(); this.init(null, listener); } /**
/** * Constructor. * @param field The basefield owner of this listener (usually null and set on setOwner()). */ public void init(BaseField field, BaseListener listener) { super.init(field); this.setDependentListener(listener); // If either of these are deleted, the other is also } /**
/** * Constructor. * @param field The basefield owner of this listener (usually null and set on setOwner()). * @param fieldToDisable The field to disable when this listener's owner matches the target string. * @param strCompareString The string to compare to this listener's owner. * @param bDisableIfMatch If true, disables if the string matches, if false, enables on match. */ public void init(BaseField field, BaseField fieldToDisable, String strCompareString, boolean bDisableIfMatch) { super.init(field); m_fldToDisable = fieldToDisable; m_strCompareString = strCompareString; m_bDisableIfMatch = bDisableIfMatch; if (m_fldToDisable != null) m_fldToDisable.addListener(new FieldRemoveBOnCloseHandler(this)); // Remove this listener if closed } /**
/** * Constructor. */ public FieldRemoveBOnCloseHandler(BaseListener listener) { this(); this.init(null, listener); } /**
/** * Constructor. * @param field The basefield owner of this listener (usually null and set on setOwner()). */ public void init(BaseField field, BaseListener listener) { super.init(field); this.setDependentListener(listener); // If either of these are deleted, the other is also } /**
/** * Constructor. * @param field The basefield owner of this listener (usually null and set on setOwner()). * @param fieldToDisable The field to disable when this listener's owner matches the target string. * @param strCompareString The string to compare to this listener's owner. * @param bDisableIfMatch If true, disables if the string matches, if false, enables on match. */ public void init(BaseField field, BaseField fieldToDisable, String strCompareString, boolean bDisableIfMatch) { super.init(field); m_fldToDisable = fieldToDisable; m_strCompareString = strCompareString; m_bDisableIfMatch = bDisableIfMatch; if (m_fldToDisable != null) m_fldToDisable.addListener(new FieldRemoveBOnCloseHandler(this)); // Remove this listener if closed } /**
/** * Constructor. */ public FieldRemoveBOnCloseHandler(BaseListener listener) { this(); this.init(null, listener); } /**
/** * Constructor. * @param field The basefield owner of this listener (usually null and set on setOwner()). */ public void init(BaseField field, BaseListener listener) { super.init(field); this.setDependentListener(listener); // If either of these are deleted, the other is also } /**
/** * Set the field or file that owns this listener. * @param owner My owner. */ public void setOwner(ListenerOwner owner) { super.setOwner(owner); if (owner != null) if (m_fldMain != null) if (m_fldMain.getRecord() != owner) m_fldMain.addListener(new FieldRemoveBOnCloseHandler(this)); } /**
/** * Set the field or file that owns this listener. * @param owner My owner. */ public void setOwner(ListenerOwner owner) { super.setOwner(owner); if (owner != null) if (m_fldMain != null) if (m_fldMain.getRecord() != owner) m_fldMain.addListener(new FieldRemoveBOnCloseHandler(this)); } /**
/** * Set the field or file that owns this listener. * @param owner My owner. */ public void setOwner(ListenerOwner owner) { super.setOwner(owner); if (owner != null) if (m_fldMain != null) if (m_fldMain.getRecord() != owner) m_fldMain.addListener(new FieldRemoveBOnCloseHandler(this)); } /**
/** * Constructor. * @param record My owner (usually passed as null, and set on addListener in setOwner()). * @param iMainFilesField The sequence of the date changed field in this record. * @param field The date changed field in this record. */ public void init(Record record, DateTimeField field, String mainFilesFieldName) { super.init(record); m_field = field; if (field != null) if (field.getRecord() != record) field.addListener(new FieldRemoveBOnCloseHandler(this)); this.mainFilesFieldName = mainFilesFieldName; } /**
/** * Set the field or file that owns this listener. * @param owner My owner. */ public void setOwner(ListenerOwner owner) { super.setOwner(owner); if (owner != null) { BaseField field = m_field; if (field != null) if (field.getRecord() != owner) { // Points to different file... make sure this is removed if the other file is closed field.addListener(new FieldRemoveBOnCloseHandler(this)); } } } /**
/** * Set the field or file that owns this listener. * @param owner My owner. */ public void setOwner(ListenerOwner owner) { super.setOwner(owner); if (owner != null) { BaseField field = m_field; if (field != null) if (field.getRecord() != owner) { // Points to different file... make sure this is removed if the other file is closed field.addListener(new FieldRemoveBOnCloseHandler(this)); } } } /**
/** * Set the field or file that owns this listener. * @param owner My owner. */ public void setOwner(ListenerOwner owner) { super.setOwner(owner); if (owner != null) { BaseField field = m_field; if (field != null) if (field.getRecord() != owner) { // Points to different file... make sure this is removed if the other file is closed field.addListener(new FieldRemoveBOnCloseHandler(this)); } } } /**
/** * Set the field or file that owns this listener. * Besides inherited, this method closes the owner record. * @param owner My owner. */ public void setOwner(ListenerOwner owner) { super.setOwner(owner); if (owner == null) return; if ((m_strFieldNameToCheck != null) && (m_strFieldNameToCheck.length() > 0)) if ((m_fldToCheck == null) || (m_fldToCheck.getFieldName() == null) || (m_fldToCheck.getFieldName().length() == 0)) m_fldToCheck = this.getOwner().getField(m_strFieldNameToCheck); // If you have the fieldname, but not the field, get the field. if (m_fldToCompare != null) if (m_fldToCompare.getRecord() != this.getOwner()) m_fldToCompare.addListener(new FieldRemoveBOnCloseHandler(this)); if (m_fldToCheck != null) if (m_fldToCheck.getRecord() != this.getOwner()) // If field is not in this file, remember to remove it m_fldToCheck.addListener(new FieldRemoveBOnCloseHandler(this)); //x this.getOwner().close(); // Must requery after setting dependent fields! } /**
/** * Set the field or file that owns this listener. * Besides inherited, this method closes the owner record. * @param owner My owner. */ public void setOwner(ListenerOwner owner) { super.setOwner(owner); if (owner == null) return; if ((m_strFieldNameToCheck != null) && (m_strFieldNameToCheck.length() > 0)) if ((m_fldToCheck == null) || (m_fldToCheck.getFieldName() == null) || (m_fldToCheck.getFieldName().length() == 0)) m_fldToCheck = this.getOwner().getField(m_strFieldNameToCheck); // If you have the fieldname, but not the field, get the field. if (m_fldToCompare != null) if (m_fldToCompare.getRecord() != this.getOwner()) m_fldToCompare.addListener(new FieldRemoveBOnCloseHandler(this)); if (m_fldToCheck != null) if (m_fldToCheck.getRecord() != this.getOwner()) // If field is not in this file, remember to remove it m_fldToCheck.addListener(new FieldRemoveBOnCloseHandler(this)); //x this.getOwner().close(); // Must requery after setting dependent fields! } /**
/** * Set the field or file that owns this listener. * Besides inherited, this method closes the owner record. * @param owner My owner. */ public void setOwner(ListenerOwner owner) { super.setOwner(owner); if (owner == null) return; if ((m_strFieldNameToCheck != null) && (m_strFieldNameToCheck.length() > 0)) if ((m_fldToCheck == null) || (m_fldToCheck.getFieldName() == null) || (m_fldToCheck.getFieldName().length() == 0)) m_fldToCheck = this.getOwner().getField(m_strFieldNameToCheck); // If you have the fieldname, but not the field, get the field. if (m_fldToCompare != null) if (m_fldToCompare.getRecord() != this.getOwner()) m_fldToCompare.addListener(new FieldRemoveBOnCloseHandler(this)); if (m_fldToCheck != null) if (m_fldToCheck.getRecord() != this.getOwner()) // If field is not in this file, remember to remove it m_fldToCheck.addListener(new FieldRemoveBOnCloseHandler(this)); //x this.getOwner().close(); // Must requery after setting dependent fields! } /**
/** * Set the field or file that owns this listener. * @param owner My owner. */ public void setOwner(ListenerOwner owner) { super.setOwner(owner); if (owner != null) if (m_converter != null) if (m_converter.getField() != null) if (((BaseField)m_converter.getField()).getRecord() != owner) { // Points to different file... make sure this is removed if the other file is closed ((BaseField)m_converter.getField()).addListener(new FieldRemoveBOnCloseHandler(this)); } } /**