/** * 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 raw data for this field. */ public Object getData() { Object objData = null; FieldListener nextListener = (FieldListener)this.getNextValidListener(DBConstants.SCREEN_MOVE); // Fix this if (nextListener != null) { boolean bOldState = nextListener.setEnabledListener(false); // Disable the listener to eliminate echos objData = nextListener.doGetData(); nextListener.setEnabledListener(bOldState); // Reenable } else objData = this.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 raw data for this field. */ public Object getData() { Object objData = null; FieldListener nextListener = (FieldListener)this.getNextValidListener(DBConstants.SCREEN_MOVE); // Fix this if (nextListener != null) { boolean bOldState = nextListener.setEnabledListener(false); // Disable the listener to eliminate echos objData = nextListener.doGetData(); nextListener.setEnabledListener(bOldState); // Reenable } else objData = this.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 raw data for this field. */ public Object getData() { Object objData = null; FieldListener nextListener = (FieldListener)this.getNextValidListener(DBConstants.SCREEN_MOVE); // Fix this if (nextListener != null) { boolean bOldState = nextListener.setEnabledListener(false); // Disable the listener to eliminate echos objData = nextListener.doGetData(); nextListener.setEnabledListener(bOldState); // Reenable } else objData = this.doGetData(); return objData; } /**
/** * Get the status of the the FieldChanged behaviors? * @return The handle field change flag (if false field change handling is disabled). */ public void setEnableListeners(boolean[] rgbEnabled) { int iIndex = 0; FieldListener fieldBehavior = this.getListener(); while (fieldBehavior != null) { boolean bEnable = true; if ((rgbEnabled != null) && (iIndex < rgbEnabled.length)) bEnable = rgbEnabled[iIndex]; fieldBehavior.setEnabledListener(bEnable); fieldBehavior = (FieldListener)fieldBehavior.getNextListener(); iIndex++; } } /**
/** * Get the status of the the FieldChanged behaviors? * @return The handle field change flag (if false field change handling is disabled). */ public void setEnableListeners(boolean[] rgbEnabled) { int iIndex = 0; FieldListener fieldBehavior = this.getListener(); while (fieldBehavior != null) { boolean bEnable = true; if ((rgbEnabled != null) && (iIndex < rgbEnabled.length)) bEnable = rgbEnabled[iIndex]; fieldBehavior.setEnabledListener(bEnable); fieldBehavior = (FieldListener)fieldBehavior.getNextListener(); iIndex++; } } /**
/** * 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 status of the the FieldChanged behaviors? * @return The handle field change flag (if false field change handling is disabled). */ public void setEnableListeners(boolean[] rgbEnabled) { int iIndex = 0; FieldListener fieldBehavior = this.getListener(); while (fieldBehavior != null) { boolean bEnable = true; if ((rgbEnabled != null) && (iIndex < rgbEnabled.length)) bEnable = rgbEnabled[iIndex]; fieldBehavior.setEnabledListener(bEnable); fieldBehavior = (FieldListener)fieldBehavior.getNextListener(); iIndex++; } } /**
/** * 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; } /**
/** * 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; } /**
/** * A field changed, call the listener(s). * Also, for screen moves, notify the record that this field changed it (FIELD_CHANGED_TYPE). * @param bDisplayOption Display changed fields if true. * @param iMoveMode The move mode. * @return An error code (NORMAL if successful). */ public int handleFieldChanged(boolean bDisplayOption, int iMoveMode) { int iErrorCode = DBConstants.NORMAL_RETURN; FieldListener nextListener = (FieldListener)this.getNextValidListener(iMoveMode); while (nextListener != null) { boolean bOldState = nextListener.setEnabledListener(false); // Disable the listener to eliminate echos iErrorCode = nextListener.fieldChanged(bDisplayOption, iMoveMode); nextListener.setEnabledListener(bOldState); // Reenable if (iErrorCode != DBConstants.NORMAL_RETURN) return iErrorCode; nextListener = (FieldListener)nextListener.getNextValidListener(iMoveMode); } if (iMoveMode == DBConstants.SCREEN_MOVE) if (iErrorCode == DBConstants.NORMAL_RETURN) if (this.getRecord() != null) iErrorCode = this.getRecord().handleRecordChange(this, DBConstants.FIELD_CHANGED_TYPE, bDisplayOption); // Tell table that I'm getting changed (if not locked) return iErrorCode; } /**
/** * If the current key starts with a date, convert the search field to a date and compare. */ public void fakeTheDate() { int ecErrorCode; BaseField fldToCompare = m_fldToCompare; // Cache this in case it is changed if (m_fldToCompare.isNull()) return; // Don't convert the date if this is NULL! if (m_fldFakeDate == null) m_fldFakeDate = new DateField(null, FAKE_DATE, DBConstants.DEFAULT_FIELD_LENGTH, FAKE_DATE, null); //m_FieldToCompare->GetFile()->GetField(kBkFakeDate); m_fldToCompare = m_fldFakeDate; ecErrorCode = m_fldToCompare.moveFieldToThis(fldToCompare, DBConstants.DISPLAY, DBConstants.SCREEN_MOVE); // Convert the date boolean bOldState = fldToCompare.getListener(FieldReSelectHandler.class.getName()).setEnabledListener(false); // Disable the reselect listener for a second if ((ecErrorCode == DBConstants.NORMAL_RETURN) && (((NumberField)m_fldToCompare).getValue() != 0)) fldToCompare.moveFieldToThis(m_fldToCompare, DBConstants.DISPLAY, DBConstants.SCREEN_MOVE); // Reformat and display the date else { fldToCompare.initField(DBConstants.DISPLAY); // Clear this wierd field m_fldToCompare.initField(DBConstants.DISPLAY); // Clear this wierd field } fldToCompare.getListener(FieldReSelectHandler.class.getName()).setEnabledListener(bOldState); // Reenable the reselect listener for a second } /**
public boolean enableReselect(boolean bEnable) { boolean bOldReselect = false; if (this.getMainFileKeyField(true) != null) if (this.getMainFileKeyField(true).getListener(FieldReSelectHandler.class) != null) bOldReselect = this.getMainFileKeyField(true).getListener(FieldReSelectHandler.class).setEnabledListener(bEnable); return bOldReselect; } public BaseField getMainFileKeyField(boolean bReturnCounterField)
/** * If the current key starts with a date, convert the search field to a date and compare. */ public void fakeTheDate() { int ecErrorCode; BaseField fldToCompare = m_fldToCompare; // Cache this in case it is changed if (m_fldToCompare.isNull()) return; // Don't convert the date if this is NULL! if (m_fldFakeDate == null) m_fldFakeDate = new DateField(null, FAKE_DATE, DBConstants.DEFAULT_FIELD_LENGTH, FAKE_DATE, null); //m_FieldToCompare->GetFile()->GetField(kBkFakeDate); m_fldToCompare = m_fldFakeDate; ecErrorCode = m_fldToCompare.moveFieldToThis(fldToCompare, DBConstants.DISPLAY, DBConstants.SCREEN_MOVE); // Convert the date boolean bOldState = fldToCompare.getListener(FieldReSelectHandler.class.getName()).setEnabledListener(false); // Disable the reselect listener for a second if ((ecErrorCode == DBConstants.NORMAL_RETURN) && (((NumberField)m_fldToCompare).getValue() != 0)) fldToCompare.moveFieldToThis(m_fldToCompare, DBConstants.DISPLAY, DBConstants.SCREEN_MOVE); // Reformat and display the date else { fldToCompare.initField(DBConstants.DISPLAY); // Clear this wierd field m_fldToCompare.initField(DBConstants.DISPLAY); // Clear this wierd field } fldToCompare.getListener(FieldReSelectHandler.class.getName()).setEnabledListener(bOldState); // Reenable the reselect listener for a second } /**
public boolean enableReselect(boolean bEnable) { boolean bOldReselect = false; if (this.getMainFileKeyField(true) != null) if (this.getMainFileKeyField(true).getListener(FieldReSelectHandler.class) != null) bOldReselect = this.getMainFileKeyField(true).getListener(FieldReSelectHandler.class).setEnabledListener(bEnable); return bOldReselect; } public BaseField getMainFileKeyField(boolean bReturnCounterField)
public boolean enableReselect(boolean bEnable) { boolean bOldReselect = false; if (this.getMainFileKeyField(true) != null) if (this.getMainFileKeyField(true).getListener(FieldReSelectHandler.class) != null) bOldReselect = this.getMainFileKeyField(true).getListener(FieldReSelectHandler.class).setEnabledListener(bEnable); return bOldReselect; } public BaseField getMainFileKeyField(boolean bReturnCounterField)
/** * Add the behaviors. */ public void addListeners() { super.addListeners(); Record recBookingDetail = (BookingDetail)this.getMainRecord(); if (recBookingDetail != null) if (!BookingDetail.INFO_STATUS_ID.equalsIgnoreCase(this.getStatusFieldName())) // An info change CAN trigger a pricing change { Record recBooking = ((ReferenceField)recBookingDetail.getField(BookingDetail.BOOKING_ID)).getReferenceRecord(); FieldListener listener = recBooking.getField(Booking.TOUR_PRICING_TYPE_ID).getListener(ChangePricingTypeHandler.class); if (listener != null) listener.setEnabledListener(false); // A price change from a message can't change the pricing scheme } } /**
/** * Move from the target field to this field * If this field is unmodified and the target is not null. * @param recTarget The source record * @param iDetailField The destinatation field in BookingDetail * @param iTargetField The source field. * @return true If the field was changed. */ public boolean moveTargetField(Rec recTarget, String iDetailField, String iTargetField) { if (!this.getField(iDetailField).isModified()) if (!recTarget.getField(iTargetField).isNull()) { FieldListener listener = this.getField(iDetailField).getListener(InitOnceFieldHandler.class); boolean bOldState = false; if (listener != null) bOldState = listener.setEnabledListener(false); this.getField(iDetailField).moveFieldToThis((BaseField)recTarget.getField(iTargetField), DBConstants.DISPLAY, DBConstants.INIT_MOVE); if (listener != null) listener.setEnabledListener(bOldState); return true; } return false; } /**