/** * Free this converter. */ public void free() { super.free(); m_recordTarget = null; } }
iErrorCode = this.setString((String)m_objTarget, bDisplayOption, iMoveMode); else String thisString = this.getString(); if (m_objTarget.equals(thisString)) // If == target, clear iErrorCode = this.setString(Constants.BLANK, bDisplayOption, iMoveMode); iErrorCode = this.setData(m_objTarget, bDisplayOption, iMoveMode); else Object thisString = this.getData(); if (m_objTarget.equals(thisString)) // If == target, clear iErrorCode = this.setData(null, bDisplayOption, iMoveMode);
/** * Constructor. * @param converter The next converter in the converter chain. * @param strTarget If the radio button is set, set this converter to this target string. * @param bTrueIfMatch If true, sets value on setState(true), otherwise sets it to blank. */ public RadioConverter(Converter converter, Object objTarget, boolean bTrueIfMatch) { this(); this.init(converter, objTarget, bTrueIfMatch); } /**
/** * For binary fields, return the current state. * @param True is this field is true. */ public boolean getState() { boolean returnValue = true; if (m_objTarget instanceof String) { String fieldString = this.getString(); returnValue = m_objTarget.equals(fieldString); // True if == target value } else { Object fieldString = this.getData(); returnValue = m_objTarget.equals(fieldString); // True if == target value } if (m_bTrueIfMatch) return returnValue; else return !returnValue; } /**
/** * Set up the default screen control for this field. * @param itsLocation Location of this component on screen (ie., GridBagConstraint). * @param targetScreen Where to place this component (ie., Parent screen or GridBagLayout). * @param converter The converter to set the screenfield to. * @param iDisplayFieldDesc Display the label? (optional). * @param properties Extra properties * @return Return the component or ScreenField that is created for this field. */ public ScreenComponent setupDefaultView(ScreenLoc itsLocation, ComponentParent targetScreen, Convert converter, int iDisplayFieldDesc, Map<String, Object> properties) { ScreenComponent screenField = null; for (int iBitPosition = ALL; iBitPosition <= PREPAYMENTS; iBitPosition++) // Calendar.SUNDAY -> Calendar.SATURDAY { FieldConverter convBit = new RadioConverter((Converter)converter, Integer.toString(iBitPosition), true); convBit = new FieldDescConverter(convBit, this.getBitDesc(iBitPosition)); screenField = createScreenComponent(ScreenModel.RADIO_BUTTON, itsLocation, targetScreen, convBit, iDisplayFieldDesc, properties); itsLocation = targetScreen.getNextLocation(ScreenConstants.RIGHT_WITH_DESC, ScreenConstants.DONT_SET_ANCHOR); } return screenField; } /**
/** * Set up the default screen control for this field. * @param itsLocation Location of this component on screen (ie., GridBagConstraint). * @param targetScreen Where to place this component (ie., Parent screen or GridBagLayout). * @param converter The converter to set the screenfield to. * @param iDisplayFieldDesc Display the label? (optional). * @param properties Extra properties * @return Return the component or ScreenField that is created for this field. */ public ScreenComponent setupDefaultView(ScreenLoc itsLocation, ComponentParent targetScreen, Convert converter, int iDisplayFieldDesc, Map<String, Object> properties) { ScreenComponent screenField = null; for (int iBitPosition = ALL; iBitPosition <= PREPAYMENTS; iBitPosition++) // Calendar.SUNDAY -> Calendar.SATURDAY { FieldConverter convBit = new RadioConverter((Converter)converter, Integer.toString(iBitPosition), true); convBit = new FieldDescConverter(convBit, this.getBitDesc(iBitPosition)); screenField = createScreenComponent(ScreenModel.RADIO_BUTTON, itsLocation, targetScreen, convBit, iDisplayFieldDesc, properties); itsLocation = targetScreen.getNextLocation(ScreenConstants.RIGHT_WITH_DESC, ScreenConstants.DONT_SET_ANCHOR); } return screenField; } /**
/** * For binary fields, return the current state. * @param True is this field is true. */ public boolean getState() { boolean returnValue = true; if (m_objTarget instanceof String) { String fieldString = this.getString(); returnValue = m_objTarget.equals(fieldString); // True if == target value } else { Object fieldString = this.getData(); returnValue = m_objTarget.equals(fieldString); // True if == target value } if (m_bTrueIfMatch) return returnValue; else return !returnValue; } /**
/** * SetupSFields Method. */ public void setupSFields() { super.setupSFields(); this.getRecord(GenPaymentScreenRecord.GEN_PAYMENT_SCREEN_RECORD_FILE).getField(GenPaymentScreenRecord.BANK_ACCT_ID).setupDefaultView(this.getNextLocation(ScreenConstants.NEXT_INPUT_LOCATION, ScreenConstants.ANCHOR_DEFAULT), this, ScreenConstants.DEFAULT_DISPLAY); this.getRecord(GenPaymentScreenRecord.GEN_PAYMENT_SCREEN_RECORD_FILE).getField(GenPaymentScreenRecord.PAYMENT_CODE_ID).setupDefaultView(this.getNextLocation(ScreenConstants.NEXT_INPUT_LOCATION, ScreenConstants.ANCHOR_DEFAULT), this, ScreenConstants.DEFAULT_DISPLAY); Converter converter = this.getScreenRecord().getField(GenPaymentScreenRecord.USE_CURRENT_SELECTION); Converter convTrue = new RadioConverter(converter, Boolean.TRUE, true); new SRadioButton(this.getNextLocation(ScreenConstants.NEXT_INPUT_LOCATION, ScreenConstants.ANCHOR_DEFAULT), this, convTrue, ScreenConstants.DEFAULT_DISPLAY); Converter convFalse = new RadioConverter(converter, Boolean.FALSE, true); convFalse = new FieldDescConverter(convFalse, "Select Balance?"); new SRadioButton(this.getNextLocation(ScreenConstants.RIGHT_WITH_DESC, ScreenConstants.DONT_SET_ANCHOR), this, convFalse, ScreenConstants.DEFAULT_DISPLAY); new SCannedBox(this.getNextLocation(ScreenConstants.NEXT_INPUT_LOCATION, ScreenConstants.SET_ANCHOR), this, null, ScreenConstants.DEFAULT_DISPLAY, null, MenuConstants.SELECT, MenuConstants.SELECT, MenuConstants.SELECT, null); }
iErrorCode = this.setString((String)m_objTarget, bDisplayOption, iMoveMode); else String thisString = this.getString(); if (m_objTarget.equals(thisString)) // If == target, clear iErrorCode = this.setString(Constants.BLANK, bDisplayOption, iMoveMode); iErrorCode = this.setData(m_objTarget, bDisplayOption, iMoveMode); else Object thisString = this.getData(); if (m_objTarget.equals(thisString)) // If == target, clear iErrorCode = this.setData(null, bDisplayOption, iMoveMode);
/** * For binary fields, return the current state. * @param True is this field is true. */ public boolean getState() { boolean returnValue = true; if (m_objTarget instanceof String) { String fieldString = this.getString(); returnValue = m_objTarget.equals(fieldString); // True if == target value } else { Object fieldString = this.getData(); returnValue = m_objTarget.equals(fieldString); // True if == target value } if (m_bTrueIfMatch) return returnValue; else return !returnValue; } /**
/** * Constructor. * @param converter The next converter in the converter chain. * @param strTarget If the radio button is set, set this converter to this target string. * @param bTrueIfMatch If true, sets value on setState(true), otherwise sets it to blank. */ public RadioConverter(Converter converter, Object objTarget, boolean bTrueIfMatch) { this(); this.init(converter, objTarget, bTrueIfMatch); } /**
/** * Free this converter. */ public void free() { super.free(); m_recordTarget = null; } }
/** * SetupSFields Method. */ public void setupSFields() { super.setupSFields(); this.getRecord(GenPaymentScreenRecord.GEN_PAYMENT_SCREEN_RECORD_FILE).getField(GenPaymentScreenRecord.BANK_ACCT_ID).setupDefaultView(this.getNextLocation(ScreenConstants.NEXT_INPUT_LOCATION, ScreenConstants.ANCHOR_DEFAULT), this, ScreenConstants.DEFAULT_DISPLAY); this.getRecord(GenPaymentScreenRecord.GEN_PAYMENT_SCREEN_RECORD_FILE).getField(GenPaymentScreenRecord.PAYMENT_CODE_ID).setupDefaultView(this.getNextLocation(ScreenConstants.NEXT_INPUT_LOCATION, ScreenConstants.ANCHOR_DEFAULT), this, ScreenConstants.DEFAULT_DISPLAY); Converter converter = this.getScreenRecord().getField(GenPaymentScreenRecord.USE_CURRENT_SELECTION); Converter convTrue = new RadioConverter(converter, Boolean.TRUE, true); new SRadioButton(this.getNextLocation(ScreenConstants.NEXT_INPUT_LOCATION, ScreenConstants.ANCHOR_DEFAULT), this, convTrue, ScreenConstants.DEFAULT_DISPLAY); Converter convFalse = new RadioConverter(converter, Boolean.FALSE, true); convFalse = new FieldDescConverter(convFalse, "Select Balance?"); new SRadioButton(this.getNextLocation(ScreenConstants.RIGHT_WITH_DESC, ScreenConstants.DONT_SET_ANCHOR), this, convFalse, ScreenConstants.DEFAULT_DISPLAY); new SCannedBox(this.getNextLocation(ScreenConstants.NEXT_INPUT_LOCATION, ScreenConstants.SET_ANCHOR), this, null, ScreenConstants.DEFAULT_DISPLAY, null, MenuConstants.SELECT, MenuConstants.SELECT, MenuConstants.SELECT, null); }
iErrorCode = this.setString((String)m_objTarget, bDisplayOption, iMoveMode); else String thisString = this.getString(); if (m_objTarget.equals(thisString)) // If == target, clear iErrorCode = this.setString(Constants.BLANK, bDisplayOption, iMoveMode); iErrorCode = this.setData(m_objTarget, bDisplayOption, iMoveMode); else Object thisString = this.getData(); if (m_objTarget.equals(thisString)) // If == target, clear iErrorCode = this.setData(null, bDisplayOption, iMoveMode);
/** * Constructor. * @param converter The next converter in the converter chain. * @param strTarget If the radio button is set, set this converter to this target string. * @param bTrueIfMatch If true, sets value on setState(true), otherwise sets it to blank. */ public RadioConverter(Converter converter, Object objTarget, boolean bTrueIfMatch) { this(); this.init(converter, objTarget, bTrueIfMatch); } /**
/** * Free this converter. */ public void free() { super.free(); m_recordTarget = null; } }
/** * Add all the screen listeners. */ public void addListeners() { super.addListeners(); // Link the screen field to the passed in record ((ReferenceField)this.getScreenRecord().getField(MessageInfoScreenRecord.kMessageInfoID)).syncReference(this.getHeaderRecord()); String strManualTransportID = Integer.toString(((ReferenceField)this.getMainRecord().getField(MessageProcessInfo.kDefaultMessageTransportID)).getIDFromCode(MessageTransport.MANUAL)); this.getMainRecord().getField(MessageProcessInfo.kDefaultMessageTransportID).addListener(new DisableOnFieldHandler(this.getMainRecord().getField(MessageProcessInfo.kInitialMessageStatusID), strManualTransportID, false)); Converter convCheckMark = new RadioConverter(this.getMainRecord().getField(MessageProcessInfo.kDefaultMessageTransportID), strManualTransportID, false); this.getMainRecord().getField(MessageProcessInfo.kDefaultMessageTransportID).addListener(new RemoveConverterOnFreeHandler(convCheckMark)); this.getMainRecord().getField(MessageProcessInfo.kDefaultMessageTransportID).addListener(new CopyDataHandler(this.getMainRecord().getField(MessageProcessInfo.kInitialMessageStatusID), null, convCheckMark)); } /**
/** * Init this converter. */ public void init(Converter converter, Record recordTarget, int iKeyArea) { super.init(converter, Constants.BLANK, true); m_iKeyArea = iKeyArea; m_recordTarget = recordTarget; m_objTarget = Integer.toString(iKeyArea); m_strAltDesc = "Key " + m_objTarget; // Default if (m_recordTarget != null) { BaseField mainField = m_recordTarget.getTable().getCurrentTable().getRecord().getKeyArea(m_iKeyArea).getField(DBConstants.MAIN_KEY_FIELD); m_strAltDesc = mainField.getFieldDesc(); } } /**
/** * Add all the screen listeners. */ public void addListeners() { super.addListeners(); ((MessageDetail)this.getMainRecord()).addPropertyListeners(); this.getMainRecord().addListener(new MessageDetailDefTransHandler(null)); String strManualTransportID = Integer.toString(((ReferenceField)this.getMainRecord().getField(MessageDetail.kMessageTransportID)).getIDFromCode(MessageTransport.MANUAL)); this.getMainRecord().getField(MessageDetail.kMessageTransportID).addListener(new DisableOnFieldHandler(this.getMainRecord().getField(MessageDetail.kInitialManualTransportStatusID), strManualTransportID, false)); Converter convCheckMark = new RadioConverter(this.getMainRecord().getField(MessageDetail.kMessageTransportID), strManualTransportID, false); this.getMainRecord().getField(MessageDetail.kMessageTransportID).addListener(new RemoveConverterOnFreeHandler(convCheckMark)); this.getMainRecord().getField(MessageDetail.kMessageTransportID).addListener(new CopyDataHandler(this.getMainRecord().getField(MessageDetail.kInitialManualTransportStatusID), null, convCheckMark)); } /**
/** * Init this converter. */ public void init(Converter converter, Record recordTarget, int iKeyArea) { super.init(converter, Constants.BLANK, true); m_iKeyArea = iKeyArea; m_recordTarget = recordTarget; m_objTarget = Integer.toString(iKeyArea); m_strAltDesc = "Key " + m_objTarget; // Default if (m_recordTarget != null) { BaseField mainField = m_recordTarget.getTable().getCurrentTable().getRecord().getKeyArea(m_iKeyArea).getField(DBConstants.MAIN_KEY_FIELD); m_strAltDesc = mainField.getFieldDesc(); } } /**