/** * Make this field a reference to the current object in this record info class. * @param record tour.db.Record The current record to set this field to reference. * @return The error code (or NORMAL_RETURN). */ public int setReference(Record record) { return this.setReference(record, DBConstants.DISPLAY, DBConstants.SCREEN_MOVE); } /**
/** * Add the screen fields. * Override this to create (and return) the screen record for this recordowner. * @return The screen record. */ public Record addScreenRecord() { ScreenRecord screenRecord = new VendorScreenRecord(this); ((ReferenceField)screenRecord.getField(VendorScreenRecord.VENDOR_ID)).setReferenceRecord(this.getRecord(Vendor.VENDOR_FILE)); ((ReferenceField)screenRecord.getField(VendorScreenRecord.VENDOR_ID)).setReference(this.getRecord(Vendor.VENDOR_FILE), DBConstants.DISPLAY, DBConstants.SCREEN_MOVE); return screenRecord; } /**
/** * Add the screen fields. * Override this to create (and return) the screen record for this recordowner. * @return The screen record. */ public Record addScreenRecord() { ScreenRecord screenRecord = new VendorScreenRecord(this); ((ReferenceField)screenRecord.getField(VendorScreenRecord.VENDOR_ID)).setReferenceRecord(this.getRecord(Vendor.VENDOR_FILE)); ((ReferenceField)screenRecord.getField(VendorScreenRecord.VENDOR_ID)).setReference(this.getRecord(Vendor.VENDOR_FILE), DBConstants.DISPLAY, DBConstants.SCREEN_MOVE); return screenRecord; } /**
/** * Make this field a reference to the current object in this record info class. * @param record tour.db.Record The current record to set this field to reference. * @return The error code (or NORMAL_RETURN). */ public int setReference(Record record) { return this.setReference(record, DBConstants.DISPLAY, DBConstants.SCREEN_MOVE); } /**
this.setReference(record, DBConstants.DISPLAY, DBConstants.SCREEN_MOVE); if (recordKeyField == null) return;
/** * Make this field a reference to the current object in this record info class. * @param record tour.db.Record The current record to set this field to reference. * @return The error code (or NORMAL_RETURN). */ public int setReference(Record record) { return this.setReference(record, DBConstants.DISPLAY, DBConstants.SCREEN_MOVE); } /**
this.setReference(record, DBConstants.DISPLAY, DBConstants.SCREEN_MOVE);
/** * Convert the display's index to the field value and move to field. * @param index The index to convert an set this field to. * @param bDisplayOption If true, display the change in the converters. * @param iMoveMove The type of move. */ public int convertIndexToField(int index, boolean bDisplayOption, int iMoveMode) { // User selected an item... Read it in! int iErrorCode = this.moveToIndex(index); if (iErrorCode == DBConstants.NORMAL_RETURN) m_record.handleRecordChange(null, DBConstants.SELECT_TYPE, bDisplayOption); // Record selected!!! // These next lines causes the FieldBehaviors with SCREEN_MOVE to be executed!!! FieldInfo field = this.getField(); if (iErrorCode == DBConstants.NORMAL_RETURN) if (field != null) { if (field instanceof ReferenceField) ((ReferenceField)field).setReference(m_record, bDisplayOption, iMoveMode); else if (field instanceof StringField) field.setString(m_record.getField(m_iFieldSeq).toString()); } return iErrorCode; } /**
this.setReference(record, DBConstants.DISPLAY, DBConstants.SCREEN_MOVE); if (recordKeyField == null) return;
/** * Convert the display's index to the field value and move to field. * @param index The index to convert an set this field to. * @param bDisplayOption If true, display the change in the converters. * @param iMoveMove The type of move. */ public int convertIndexToField(int index, boolean bDisplayOption, int iMoveMode) { // User selected an item... Read it in! int iErrorCode = this.moveToIndex(index); if (iErrorCode == DBConstants.NORMAL_RETURN) m_record.handleRecordChange(null, DBConstants.SELECT_TYPE, bDisplayOption); // Record selected!!! // These next lines causes the FieldBehaviors with SCREEN_MOVE to be executed!!! FieldInfo field = this.getField(); if (iErrorCode == DBConstants.NORMAL_RETURN) if (field != null) { if (field instanceof ReferenceField) ((ReferenceField)field).setReference(m_record, bDisplayOption, iMoveMode); else if (field instanceof StringField) field.setString(m_record.getField(m_iFieldSeq).toString()); } return iErrorCode; } /**
/** * Convert the display's index to the field value and move to field. * @param index The index to convert an set this field to. * @param bDisplayOption If true, display the change in the converters. * @param iMoveMove The type of move. */ public int convertIndexToField(int index, boolean bDisplayOption, int iMoveMode) { // User selected an item... Read it in! int iErrorCode = this.moveToIndex(index); if (iErrorCode == DBConstants.NORMAL_RETURN) m_record.handleRecordChange(null, DBConstants.SELECT_TYPE, bDisplayOption); // Record selected!!! // These next lines causes the FieldBehaviors with SCREEN_MOVE to be executed!!! FieldInfo field = this.getField(); if (iErrorCode == DBConstants.NORMAL_RETURN) if (field != null) { if (field instanceof ReferenceField) ((ReferenceField)field).setReference(m_record, bDisplayOption, iMoveMode); else if (field instanceof StringField) { { if (displayFieldName != null) return field.setString(m_record.getField(displayFieldName).toString()); else return field.setString(m_record.getField(m_iFieldSeq).toString()); } } } return iErrorCode; } /**
/** * Actually move the data. * @param bDisplayOption If true, display any changes. */ public void moveTheData(boolean bDisplayOption, int iMoveType) { if (m_convCheckMark != null) if (m_bDisableOnMove) m_fldDest.setEnabled(!m_convCheckMark.getState()); if ((m_convCheckMark == null) || (m_convCheckMark.getState())) { if ((this.getSourceField() != null) && ((!this.getSourceField().isNull()) || (!m_bDontMoveNullSource))) m_fldDest.moveFieldToThis(this.getSourceField(), bDisplayOption, iMoveType); // Move dependent field to here else if (m_strSource != null) m_fldDest.setString(m_strSource, bDisplayOption, iMoveType); // Move dependent field to here else if (m_fldDest instanceof ReferenceField) ((ReferenceField)m_fldDest).setReference(this.getOwner(), bDisplayOption, iMoveType); } else { if (bDisplayOption) m_fldDest.displayField(); // Redisplay based on this check mark } } /**
/** * Actually move the data. * @param bDisplayOption If true, display any changes. */ public void moveTheData(boolean bDisplayOption, int iMoveType) { if (m_convCheckMark != null) if (m_bDisableOnMove) m_fldDest.setEnabled(!m_convCheckMark.getState()); if ((m_convCheckMark == null) || (m_convCheckMark.getState())) { if ((this.getSourceField() != null) && ((!this.getSourceField().isNull()) || (!m_bDontMoveNullSource))) m_fldDest.moveFieldToThis(this.getSourceField(), bDisplayOption, iMoveType); // Move dependent field to here else if (m_strSource != null) m_fldDest.setString(m_strSource, bDisplayOption, iMoveType); // Move dependent field to here else if (m_fldDest instanceof ReferenceField) ((ReferenceField)m_fldDest).setReference(this.getOwner(), bDisplayOption, iMoveType); } else { if (bDisplayOption) m_fldDest.displayField(); // Redisplay based on this check mark } } /**
/** * Actually move the data. * @param bDisplayOption If true, display any changes. */ public void moveTheData(boolean bDisplayOption, int iMoveType) { if (m_convCheckMark != null) if (m_bDisableOnMove) m_fldDest.setEnabled(!m_convCheckMark.getState()); if ((m_convCheckMark == null) || (m_convCheckMark.getState())) { if ((this.getSourceField() != null) && ((!this.getSourceField().isNull()) || (!m_bDontMoveNullSource))) m_fldDest.moveFieldToThis(this.getSourceField(), bDisplayOption, iMoveType); // Move dependent field to here else if (m_strSource != null) m_fldDest.setString(m_strSource, bDisplayOption, iMoveType); // Move dependent field to here else if (m_fldDest instanceof ReferenceField) ((ReferenceField)m_fldDest).setReference(this.getOwner(), bDisplayOption, iMoveType); } else { if (bDisplayOption) m_fldDest.displayField(); // Redisplay based on this check mark } } /**
((ReferenceField)m_rAmReqDetail.getField(RequestDetail.REQUEST_ID)).setReference(m_rAmRequests, DBConstants.DONT_DISPLAY, DBConstants.SCREEN_MOVE); m_rAmReqDetail.getField(RequestDetail.BROCHURE_ID).moveFieldToThis(m_rAmReqInput.getField(RequestInput.BROCHURE_ID), DBConstants.DONT_DISPLAY, DBConstants.SCREEN_MOVE); m_rAmReqDetail.getField(RequestDetail.BROCHURE_QTY).moveFieldToThis(m_rAmReqInput.getField(RequestInput.BROCHURE_QTY), DBConstants.DONT_DISPLAY, DBConstants.SCREEN_MOVE);
((ReferenceField)m_rAmReqDetail.getField(RequestDetail.REQUEST_ID)).setReference(m_rAmRequests, DBConstants.DONT_DISPLAY, DBConstants.SCREEN_MOVE); m_rAmReqDetail.getField(RequestDetail.BROCHURE_ID).moveFieldToThis(m_rAmReqInput.getField(RequestInput.BROCHURE_ID), DBConstants.DONT_DISPLAY, DBConstants.SCREEN_MOVE); m_rAmReqDetail.getField(RequestDetail.BROCHURE_QTY).moveFieldToThis(m_rAmReqInput.getField(RequestInput.BROCHURE_QTY), DBConstants.DONT_DISPLAY, DBConstants.SCREEN_MOVE);
/** * Add all the screen listeners. */ public void addListeners() { super.addListeners(); Record recUserInfo = this.getMainRecord(); recUserInfo.setKeyArea(UserInfo.kUserNameKey); if (m_recHeader != null) ((ReferenceField)this.getScreenRecord().getField(UserScreenRecord.kUserGroupID)).setReference(m_recHeader); recUserInfo.addListener(new ExtractRangeFilter(UserInfo.kUserName, this.getScreenRecord().getField(UserScreenRecord.kNameSort))); recUserInfo.addListener(new CompareFileFilter(UserInfo.kUserGroupID, this.getScreenRecord().getField(UserScreenRecord.kUserGroupID), "=", null, true)); this.getScreenRecord().getField(UserScreenRecord.kNameSort).addListener(new FieldReSelectHandler(this)); this.getScreenRecord().getField(UserScreenRecord.kUserGroupID).addListener(new FieldReSelectHandler(this)); this.getMainRecord(). addListener(new SetupNewUserHandler(null)); } /**
/** * SetupSFields Method. */ public void setupSFields() { // This will synchronize the screen field and make sure the lookup uses the header record ((ReferenceField)this.getScreenRecord().getField(AcctDetailScreenRecord.ACCOUNT_ID)).setReference(this.getRecord(Account.ACCOUNT_FILE), DBConstants.DISPLAY, DBConstants.SCREEN_MOVE); this.getRecord(AcctDetailScreenRecord.ACCT_DETAIL_SCREEN_RECORD_FILE).getField(AcctDetailScreenRecord.ACCOUNT_ID).setupDefaultView(this.getNextLocation(ScreenConstants.NEXT_LOGICAL, ScreenConstants.ANCHOR_DEFAULT), this, ScreenConstants.DEFAULT_DISPLAY); this.getRecord(AcctDetailScreenRecord.ACCT_DETAIL_SCREEN_RECORD_FILE).getField(AcctDetailScreenRecord.START_DATE).setupDefaultView(this.getNextLocation(ScreenConstants.NEXT_LOGICAL, ScreenConstants.ANCHOR_DEFAULT), this, ScreenConstants.DEFAULT_DISPLAY); this.getRecord(AcctDetailScreenRecord.ACCT_DETAIL_SCREEN_RECORD_FILE).getField(AcctDetailScreenRecord.START_BALANCE).setupDefaultView(this.getNextLocation(ScreenConstants.RIGHT_WITH_DESC, ScreenConstants.DONT_SET_ANCHOR), this, ScreenConstants.DEFAULT_DISPLAY); this.getRecord(AcctDetailScreenRecord.ACCT_DETAIL_SCREEN_RECORD_FILE).getField(AcctDetailScreenRecord.CALC_START).setupDefaultView(this.getNextLocation(ScreenConstants.RIGHT_WITH_DESC, ScreenConstants.DONT_SET_ANCHOR), this, ScreenConstants.DEFAULT_DISPLAY); this.getRecord(AcctDetailScreenRecord.ACCT_DETAIL_SCREEN_RECORD_FILE).getField(AcctDetailScreenRecord.END_DATE).setupDefaultView(this.getNextLocation(ScreenConstants.NEXT_LOGICAL, ScreenConstants.ANCHOR_DEFAULT), this, ScreenConstants.DEFAULT_DISPLAY); this.getRecord(AcctDetailScreenRecord.ACCT_DETAIL_SCREEN_RECORD_FILE).getField(AcctDetailScreenRecord.END_BALANCE).setupDefaultView(this.getNextLocation(ScreenConstants.RIGHT_WITH_DESC, ScreenConstants.DONT_SET_ANCHOR), this, ScreenConstants.DEFAULT_DISPLAY); this.getRecord(AcctDetailScreenRecord.ACCT_DETAIL_SCREEN_RECORD_FILE).getField(AcctDetailScreenRecord.CHANGE_BALANCE).setupDefaultView(this.getNextLocation(ScreenConstants.RIGHT_WITH_DESC, ScreenConstants.DONT_SET_ANCHOR), this, ScreenConstants.DEFAULT_DISPLAY); }
((ReferenceField)this.getScreenRecord().getField(BrokerScreenRecord.VENDOR_ID)).setReference(this.getRecord(Vendor.VENDOR_FILE)); this.getScreenRecord().getField(BrokerScreenRecord.VENDOR_ID).addListener(new ReadSecondaryHandler(this.getRecord(Vendor.VENDOR_FILE))); if (this.getScreenRecord().getField(BrokerScreenRecord.VENDOR_ID).isNull())
((ReferenceField)this.getScreenRecord().getField(BrokerScreenRecord.VENDOR_ID)).setReference(this.getRecord(Vendor.VENDOR_FILE)); this.getScreenRecord().getField(BrokerScreenRecord.VENDOR_ID).addListener(new ReadSecondaryHandler(this.getRecord(Vendor.VENDOR_FILE))); if (this.getScreenRecord().getField(BrokerScreenRecord.VENDOR_ID).isNull())