/** * Get the field on the end of this converter chain. * @return The field on the end of the chain. */ public FieldInfo getField() { if (this.getNextConverter() != null) return this.getNextConverter().getField(); else return super.getField(); } // Return the source BaseField (if linked to a field!) /**
/** * Encode and write this field's data to the stream. * @param daOut The output stream to marshal the data to. * @param converter The field to serialize. */ public void writeField(ObjectOutputStream daOut, Converter converter) throws IOException { String strFieldName = DBConstants.BLANK; if (converter != null) if (converter.getField() != null) strFieldName = converter.getField().getClass().getName(); Object data = null; if (converter != null) data = converter.getData(); daOut.writeUTF(strFieldName); daOut.writeObject(data); } /**
/** * 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)); } } /**
/** * 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)); } } /**
/** * 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)); } } /**
/** * Free. */ public void free() { if (m_DependentConverter != null) { if (m_DependentConverter.getField() == null) m_DependentConverter.free(); // Special case, must remove converter m_DependentConverter = null; } super.free(); } /**
/** * This field changed, if this is the main record, lock it! * @param field The field that changed. */ public void fieldChanged(BaseField field) { BasePanel screenParent = this.getParentScreen(); if (field == null) if (m_converterField != null) field = (BaseField)m_converterField.getField(); // This field changed if (screenParent != null) screenParent.fieldChanged(field); } /**
/** * Free. */ public void free() { if (m_DependentConverter != null) { if (m_DependentConverter.getField() == null) m_DependentConverter.free(); // Special case, must remove converter m_DependentConverter = null; } super.free(); } /**
/** * Constructor. * @param thisFile Target record. * @param iNamePrefix Field sequence of the prefix field. * @param iNameFirst Field sequence of the First name field. * @param iNameMiddle Field sequence of the middle name field. * @param iNameSur Field sequence of the sur name field. * @param iNameSuffix Field sequence of the suffix field. * @param iNameTitle Field sequence of the title field. */ public FirstMLastConverter(Converter convFullName, String iNamePrefix, String iNameFirst, String iNameMiddle, String iNameSur, String iNameSuffix, String iNameTitle) { this(); this.init(convFullName, ((BaseField)convFullName.getField()).getRecord(), iNamePrefix, iNameFirst, iNameMiddle, iNameSur, iNameSuffix, iNameTitle); } /**
/** * Constructor. * @param thisFile Target record. * @param iNamePrefix Field sequence of the prefix field. * @param iNameFirst Field sequence of the First name field. * @param iNameMiddle Field sequence of the middle name field. * @param iNameSur Field sequence of the sur name field. * @param iNameSuffix Field sequence of the suffix field. * @param iNameTitle Field sequence of the title field. */ public FirstMLastConverter(Converter convFullName, int iNamePrefix, int iNameFirst, int iNameMiddle, int iNameSur, int iNameSuffix, int iNameTitle) { this(); this.init(convFullName, ((BaseField)convFullName.getField()).getRecord(), iNamePrefix, iNameFirst, iNameMiddle, iNameSur, iNameSuffix, iNameTitle); } /**
/** * Constructor. * @param thisFile Target record. * @param iNamePrefix Field sequence of the prefix field. * @param iNameFirst Field sequence of the First name field. * @param iNameMiddle Field sequence of the middle name field. * @param iNameSur Field sequence of the sur name field. * @param iNameSuffix Field sequence of the suffix field. * @param iNameTitle Field sequence of the title field. */ public FirstMLastConverter(Converter convFullName, int iNamePrefix, int iNameFirst, int iNameMiddle, int iNameSur, int iNameSuffix, int iNameTitle) { this(); this.init(convFullName, ((BaseField)convFullName.getField()).getRecord(), iNamePrefix, iNameFirst, iNameMiddle, iNameSur, iNameSuffix, iNameTitle); } /**
/** * Set up the screen fields (default = set them all up for the current record). * @param converter The converter to creat a default screen field for. . */ public Object addColumn(Converter converter) { if (converter.getField() instanceof ReferenceField) return new SEditText(this.getNextLocation(ScreenConstants.NEXT_INPUT_LOCATION, ScreenConstants.SET_ANCHOR), this, converter, ScreenConstants.DEFAULT_DISPLAY); else return super.addColumn(converter); } /**
/** * Set up the screen fields (default = set them all up for the current record). * @param converter The converter to creat a default screen field for. . */ public Object addColumn(Converter converter) { if (converter.getField() instanceof ReferenceField) return new SEditText(this.getNextLocation(ScreenConstants.NEXT_INPUT_LOCATION, ScreenConstants.SET_ANCHOR), this, converter, ScreenConstants.DEFAULT_DISPLAY); else return super.addColumn(converter); } /**
/** * Do the physical move operation. * @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 moveSourceToDest(boolean bDisplayOption, int iMoveMode) { if (m_fldSource instanceof BaseField) return ((BaseField)m_fldDest.getField()).moveFieldToThis((BaseField)m_fldSource, bDisplayOption, iMoveMode); // Move dependent field to here else return m_fldDest.setString(m_fldSource.getString(), bDisplayOption, iMoveMode); // Move dependent field to here } /**
/** * Do the physical move operation. * @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 moveSourceToDest(boolean bDisplayOption, int iMoveMode) { if (m_fldSource instanceof BaseField) return ((BaseField)m_fldDest.getField()).moveFieldToThis((BaseField)m_fldSource, bDisplayOption, iMoveMode); // Move dependent field to here else return m_fldDest.setString(m_fldSource.getString(), bDisplayOption, iMoveMode); // Move dependent field to here } /**
/** * Do the physical move operation. * @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 moveSourceToDest(boolean bDisplayOption, int iMoveMode) { if (m_fldSource instanceof BaseField) return ((BaseField)m_fldDest.getField()).moveFieldToThis((BaseField)m_fldSource, bDisplayOption, iMoveMode); // Move dependent field to here else return m_fldDest.setString(m_fldSource.getString(), bDisplayOption, iMoveMode); // Move dependent field to here } /**
/** * AddColumn Method. */ public Object addColumn(Converter converter) { if (converter.getField() instanceof ReferenceField) return new SEditText(this.getNextLocation(ScreenConstants.NEXT_INPUT_LOCATION, ScreenConstants.SET_ANCHOR), this, converter, ScreenConstants.DEFAULT_DISPLAY); else return converter.setupDefaultView(this.getNextLocation(ScreenConstants.NEXT_LOGICAL, ScreenConstants.SET_ANCHOR), this, ScreenConstants.DEFAULT_DISPLAY); } /**
/** * AddColumn Method. */ public Object addColumn(Converter converter) { if (converter.getField() instanceof ReferenceField) return new SEditText(this.getNextLocation(ScreenConstants.NEXT_INPUT_LOCATION, ScreenConstants.SET_ANCHOR), this, converter, ScreenConstants.DEFAULT_DISPLAY); else return converter.setupDefaultView(this.getNextLocation(ScreenConstants.NEXT_LOGICAL, ScreenConstants.SET_ANCHOR), this, ScreenConstants.DEFAULT_DISPLAY); } /**
/** * Initialize class fields. */ public void init(ScreenLocation itsLocation, BasePanel parentScreen, Converter fieldConverter, int iDisplayFieldDesc) { if (fieldConverter != null) { // Make sure this field comes back on the query ((BaseField)fieldConverter.getField()).getRecord().getField(AcctDetailDist.ACCT_DETAIL_ID).setSelected(true); } String strDesc = AcctDetailDist.DIST_SOURCE; if (parentScreen instanceof GridScreen) strDesc = null; super.init(itsLocation, parentScreen, fieldConverter, iDisplayFieldDesc, null, strDesc, AcctDetailDist.DIST_SOURCE, AcctDetailDist.DIST_SOURCE, null, null, null); } /**