/** * Enable state is dependent on this listener. * @param dependentStateListener The listener to get the enabled state from. */ public void setDependentStateListener(BaseListener dependentStateListener) { if (!(dependentStateListener instanceof FieldListener)) dependentStateListener = null; else if ((this.getOwner() == null) || (((FieldListener)dependentStateListener).getOwner() == null) || (this.getOwner().getRecord() != ((FieldListener)dependentStateListener).getOwner().getRecord())) dependentStateListener = null; super.setDependentStateListener(dependentStateListener); } }
/** * Enable state is dependent on this listener. * @param dependentStateListener The listener to get the enabled state from. */ public void setDependentStateListener(BaseListener dependentStateListener) { if (!(dependentStateListener instanceof FieldListener)) dependentStateListener = null; else if ((this.getOwner() == null) || (((FieldListener)dependentStateListener).getOwner() == null) || (this.getOwner().getRecord() != ((FieldListener)dependentStateListener).getOwner().getRecord())) dependentStateListener = null; super.setDependentStateListener(dependentStateListener); } }
/** * Enable state is dependent on this listener. * @param dependentStateListener The listener to get the enabled state from. */ public void setDependentStateListener(BaseListener dependentStateListener) { if (!(dependentStateListener instanceof FieldListener)) dependentStateListener = null; else if ((this.getOwner() == null) || (((FieldListener)dependentStateListener).getOwner() == null) || (this.getOwner().getRecord() != ((FieldListener)dependentStateListener).getOwner().getRecord())) dependentStateListener = null; super.setDependentStateListener(dependentStateListener); } }
/** * When cloning a listener, if the field is contained in the source record, get the same field is the new record. * @param field * @param listener * @return */ public BaseField getSyncedListenersField(BaseField field, FieldListener listener) { if (field != null) if (field.getRecord() == this.getOwner().getRecord()) field = listener.getOwner().getRecord().getField(field.getFieldName()); return field; } /**
/** * When cloning a listener, if the field is contained in the source record, get the same field is the new record. * @param field * @param listener * @return */ public BaseField getSyncedListenersField(BaseField field, FieldListener listener) { if (field != null) if (field.getRecord() == this.getOwner().getRecord()) field = listener.getOwner().getRecord().getField(field.getFieldName()); return field; } /**
/** * When cloning a listener, if the field is contained in the source record, get the same field is the new record. * @param field * @param listener * @return */ public BaseField getSyncedListenersField(BaseField field, FieldListener listener) { if (field != null) if (field.getRecord() == this.getOwner().getRecord()) field = listener.getOwner().getRecord().getField(field.getFieldName()); return field; } /**
/** * Merge my changed data back into field that I just restored from disk. * @param objData The value this field held before I refreshed from disk. * @return The setData error code. */ public int doMergeData(Object objData) { int iErrorCode = DBConstants.NORMAL_RETURN; FieldListener nextListener = (FieldListener)this.getNextListener(); if (nextListener != null) iErrorCode = nextListener.doMergeData(objData); else if (m_owner != null) iErrorCode = this.getOwner().doMergeData(objData); return iErrorCode; } /**
/** * Merge my changed data back into field that I just restored from disk. * @param objData The value this field held before I refreshed from disk. * @return The setData error code. */ public int doMergeData(Object objData) { int iErrorCode = DBConstants.NORMAL_RETURN; FieldListener nextListener = (FieldListener)this.getNextListener(); if (nextListener != null) iErrorCode = nextListener.doMergeData(objData); else if (m_owner != null) iErrorCode = this.getOwner().doMergeData(objData); return iErrorCode; } /**
/** * Merge my changed data back into field that I just restored from disk. * @param objData The value this field held before I refreshed from disk. * @return The setData error code. */ public int doMergeData(Object objData) { int iErrorCode = DBConstants.NORMAL_RETURN; FieldListener nextListener = (FieldListener)this.getNextListener(); if (nextListener != null) iErrorCode = nextListener.doMergeData(objData); else if (m_owner != null) iErrorCode = this.getOwner().doMergeData(objData); return iErrorCode; } /**
/** * Creates a new object of the same class as this object. * @param field The field to add the new cloned behavior to. * @return a clone of this instance. * @exception CloneNotSupportedException if the object's class does not support the <code>Cloneable</code> interface. * @see java.lang.Cloneable */ public Object clone(BaseField field) throws CloneNotSupportedException { FieldListener listener = (FieldListener)ClassServiceUtility.getClassService().makeObjectFromClassName(this.getClass().getName()); boolean bInitCalled = this.syncClonedListener(field, listener, false); if (!bInitCalled) listener.init(null); if (listener != null) if (field != null) if (listener.getOwner() == null) // Being careful field.addListener(listener); return listener; } /**
/** * Creates a new object of the same class as this object. * @param field The field to add the new cloned behavior to. * @return a clone of this instance. * @exception CloneNotSupportedException if the object's class does not support the <code>Cloneable</code> interface. * @see java.lang.Cloneable */ public Object clone(BaseField field) throws CloneNotSupportedException { FieldListener listener = (FieldListener)ClassServiceUtility.getClassService().makeObjectFromClassName(this.getClass().getName()); boolean bInitCalled = this.syncClonedListener(field, listener, false); if (!bInitCalled) listener.init(null); if (listener != null) if (field != null) if (listener.getOwner() == null) // Being careful field.addListener(listener); return listener; } /**
/** * Creates a new object of the same class as this object. * @param field The field to add the new cloned behavior to. * @return a clone of this instance. * @exception CloneNotSupportedException if the object's class does not support the <code>Cloneable</code> interface. * @see java.lang.Cloneable */ public Object clone(BaseField field) throws CloneNotSupportedException { FieldListener listener = (FieldListener)ClassServiceUtility.getClassService().makeObjectFromClassName(this.getClass().getName()); boolean bInitCalled = this.syncClonedListener(field, listener, false); if (!bInitCalled) listener.init(null); if (listener != null) if (field != null) if (listener.getOwner() == null) // Being careful field.addListener(listener); return listener; } /**
/** * Get the physical binary data from this field. * Behaviors are often used to initiate a complicated action only when the system asks for this data. * @return The field's raw data. */ public Object doGetData() { Object objData = null; FieldListener nextListener = (FieldListener)this.getNextValidListener(DBConstants.SCREEN_MOVE); if (nextListener != null) { boolean bOldState = nextListener.setEnabledListener(false); // Disable the listener to eliminate echos objData = nextListener.doGetData(); nextListener.setEnabledListener(bOldState); // Reenable } else if (m_owner != null) objData = this.getOwner().doGetData(); return objData; } /**
/** * Get the physical binary data from this field. * Behaviors are often used to initiate a complicated action only when the system asks for this data. * @return The field's raw data. */ public Object doGetData() { Object objData = null; FieldListener nextListener = (FieldListener)this.getNextValidListener(DBConstants.SCREEN_MOVE); if (nextListener != null) { boolean bOldState = nextListener.setEnabledListener(false); // Disable the listener to eliminate echos objData = nextListener.doGetData(); nextListener.setEnabledListener(bOldState); // Reenable } else if (m_owner != null) objData = this.getOwner().doGetData(); return objData; } /**
/** * Move the physical binary data to this field. * @param objData the raw data to set the basefield to. * @param bDisplayOption If true, display the change. * @param iMoveMode The type of move being done (init/read/screen). * @return The error code (or NORMAL_RETURN if okay). */ public int doSetData(Object objData, boolean bDisplayOption, int iMoveMode) { int iErrorCode = DBConstants.NORMAL_RETURN; FieldListener nextListener = (FieldListener)this.getNextValidListener(iMoveMode); if (nextListener != null) { boolean bOldState = nextListener.setEnabledListener(false); // Disable the listener to eliminate echos iErrorCode = nextListener.doSetData(objData, bDisplayOption, iMoveMode); nextListener.setEnabledListener(bOldState); // Reenable } else if (m_owner != null) iErrorCode = this.getOwner().doSetData(objData, bDisplayOption, iMoveMode); return iErrorCode; } /**
/** * Get the physical binary data from this field. * Behaviors are often used to initiate a complicated action only when the system asks for this data. * @return The field's raw data. */ public Object doGetData() { Object objData = null; FieldListener nextListener = (FieldListener)this.getNextValidListener(DBConstants.SCREEN_MOVE); if (nextListener != null) { boolean bOldState = nextListener.setEnabledListener(false); // Disable the listener to eliminate echos objData = nextListener.doGetData(); nextListener.setEnabledListener(bOldState); // Reenable } else if (m_owner != null) objData = this.getOwner().doGetData(); return objData; } /**
/** * Move the physical binary data to this field. * @param objData the raw data to set the basefield to. * @param bDisplayOption If true, display the change. * @param iMoveMode The type of move being done (init/read/screen). * @return The error code (or NORMAL_RETURN if okay). */ public int doSetData(Object objData, boolean bDisplayOption, int iMoveMode) { int iErrorCode = DBConstants.NORMAL_RETURN; FieldListener nextListener = (FieldListener)this.getNextValidListener(iMoveMode); if (nextListener != null) { boolean bOldState = nextListener.setEnabledListener(false); // Disable the listener to eliminate echos iErrorCode = nextListener.doSetData(objData, bDisplayOption, iMoveMode); nextListener.setEnabledListener(bOldState); // Reenable } else if (m_owner != null) iErrorCode = this.getOwner().doSetData(objData, bDisplayOption, iMoveMode); return iErrorCode; } /**
/** * Move the physical binary data to this field. * @param objData the raw data to set the basefield to. * @param bDisplayOption If true, display the change. * @param iMoveMode The type of move being done (init/read/screen). * @return The error code (or NORMAL_RETURN if okay). */ public int doSetData(Object objData, boolean bDisplayOption, int iMoveMode) { int iErrorCode = DBConstants.NORMAL_RETURN; FieldListener nextListener = (FieldListener)this.getNextValidListener(iMoveMode); if (nextListener != null) { boolean bOldState = nextListener.setEnabledListener(false); // Disable the listener to eliminate echos iErrorCode = nextListener.doSetData(objData, bDisplayOption, iMoveMode); nextListener.setEnabledListener(bOldState); // Reenable } else if (m_owner != null) iErrorCode = this.getOwner().doSetData(objData, bDisplayOption, iMoveMode); return iErrorCode; } /**