/** * Set the field that owns this listener. * @owner The field that this listener is being added to (if null, this listener is being removed). */ public void setOwner(ListenerOwner owner) { super.setOwner(owner); if (this.getOwner() != null) { if (m_fldSource != null) if (m_fldSource.getRecord() != this.getOwner().getRecord()) m_fldSource.getRecord().addListener(new FileRemoveBOnCloseHandler(this)); // Not same file, if target file closes, remove this listener! InitOnceFieldHandler behavior = (InitOnceFieldHandler)this.getOwner().getListener(InitOnceFieldHandler.class.getName()); if (this.getOwner().getRecord().getEditMode() == DBConstants.EDIT_CURRENT) behavior = null; // Special case - if there is a current record, make sure initonce works. if (behavior != null) behavior.setFirstTime(true); // If this listener exists it doesn't init initially everything up, so disable for a sec. this.syncBehaviorToRecord(null); // Init now if (this.getOwner() instanceof ReferenceField) if (this.getOwner().getListener(ReadSecondaryHandler.class.getName()) != null) { if (behavior != null) behavior.setEnabledListener(false); // If this listener exists it doesn't init initially everything up, so disable for a sec. ((FieldListener)this.getOwner().getListener(ReadSecondaryHandler.class.getName())).syncBehaviorToRecord(null); } } } /**
/** * Set the field that owns this listener. * @owner The field that this listener is being added to (if null, this listener is being removed). */ public void setOwner(ListenerOwner owner) { super.setOwner(owner); if (this.getOwner() != null) { if (m_fldSource != null) if (m_fldSource.getRecord() != this.getOwner().getRecord()) m_fldSource.getRecord().addListener(new FileRemoveBOnCloseHandler(this)); // Not same file, if target file closes, remove this listener! InitOnceFieldHandler behavior = (InitOnceFieldHandler)this.getOwner().getListener(InitOnceFieldHandler.class.getName()); if (this.getOwner().getRecord().getEditMode() == DBConstants.EDIT_CURRENT) behavior = null; // Special case - if there is a current record, make sure initonce works. if (behavior != null) behavior.setFirstTime(true); // If this listener exists it doesn't init initially everything up, so disable for a sec. this.syncBehaviorToRecord(null); // Init now if (this.getOwner() instanceof ReferenceField) if (this.getOwner().getListener(ReadSecondaryHandler.class.getName()) != null) { if (behavior != null) behavior.setEnabledListener(false); // If this listener exists it doesn't init initially everything up, so disable for a sec. ((FieldListener)this.getOwner().getListener(ReadSecondaryHandler.class.getName())).syncBehaviorToRecord(null); } } } /**
/** * Set the field that owns this listener. * @owner The field that this listener is being added to (if null, this listener is being removed). */ public void setOwner(ListenerOwner owner) { super.setOwner(owner); if (this.getOwner() != null) { if (m_fldSource != null) if (m_fldSource.getRecord() != this.getOwner().getRecord()) m_fldSource.getRecord().addListener(new FileRemoveBOnCloseHandler(this)); // Not same file, if target file closes, remove this listener! InitOnceFieldHandler behavior = (InitOnceFieldHandler)this.getOwner().getListener(InitOnceFieldHandler.class.getName()); if (this.getOwner().getRecord().getEditMode() == DBConstants.EDIT_CURRENT) behavior = null; // Special case - if there is a current record, make sure initonce works. if (behavior != null) behavior.setFirstTime(true); // If this listener exists it doesn't init initially everything up, so disable for a sec. this.syncBehaviorToRecord(null); // Init now if (this.getOwner() instanceof ReferenceField) if (this.getOwner().getListener(ReadSecondaryHandler.class.getName()) != null) { if (behavior != null) behavior.setEnabledListener(false); // If this listener exists it doesn't init initially everything up, so disable for a sec. ((FieldListener)this.getOwner().getListener(ReadSecondaryHandler.class.getName())).syncBehaviorToRecord(null); } } } /**