/** * Add this field in the Record's field sequence. */ public BaseField setupField(int iFieldSeq) { BaseField field = null; if (iFieldSeq == 0) field = new StringField(this, DESCRIPTION, 10, null, null); if (iFieldSeq == 1) field = new CountryField(this, COUNTRY_ID, Constants.DEFAULT_FIELD_LENGTH, null, null); if (iFieldSeq == 2) field = new StateField(this, STATE_ID, Constants.DEFAULT_FIELD_LENGTH, null, null); if (field == null) field = super.setupField(iFieldSeq); return field; }
/** * Constructor. * @param record The parent record. * @param strName The field name. * @param iDataLength The maximum string length (pass -1 for default). * @param strDesc The string description (usually pass null, to use the resource file desc). * @param strDefault The default value (if object, this value is the default value, if string, the string is the default). */ public CountryField(Record record, String strName, int iDataLength, String strDesc, Object strDefault) { this(); this.init(record, strName, iDataLength, strDesc, strDefault); } /**
/** * 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) { Record record = this.makeReferenceRecord(); Converter fldDisplayFieldDesc = record.getField(Country.NAME); fldDisplayFieldDesc = new FieldLengthConverter(fldDisplayFieldDesc, 25); return this.setupTableLookup(itsLocation, targetScreen, converter, iDisplayFieldDesc, record, Country.CODE_KEY, fldDisplayFieldDesc, true, true); }
field = new StringField(this, VENDOR_NAME, 10, null, null); if (iFieldSeq == 2) field = new CountryField(this, VENDOR_COUNTRY, Constants.DEFAULT_FIELD_LENGTH, null, null); if (iFieldSeq == 3) field = new FullCurrencyField(this, BALANCE, Constants.DEFAULT_FIELD_LENGTH, null, null);
field = new StringField(this, STATE_POSTAL_CODE, 20, null, null); if (iFieldSeq == 5) field = new CountryField(this, COUNTRY_ID, Constants.DEFAULT_FIELD_LENGTH, null, null); if (iFieldSeq == 6) field = new MemoField(this, DESCRIPTION, Constants.DEFAULT_FIELD_LENGTH, null, null);
field = new RegionField(this, REGION_ID, Constants.DEFAULT_FIELD_LENGTH, null, null); if (iFieldSeq == 8) field = new CountryField(this, COUNTRY_ID, Constants.DEFAULT_FIELD_LENGTH, null, null); if (iFieldSeq == 9) field = new StateField(this, STATE_ID, Constants.DEFAULT_FIELD_LENGTH, null, null);
field = new VendorField(this, BROKER_VENDOR_ID, Constants.DEFAULT_FIELD_LENGTH, null, null); if (iFieldSeq == 7) field = new CountryField(this, COUNTRY_ID, Constants.DEFAULT_FIELD_LENGTH, null, null); if (iFieldSeq == 8) field = new CurrencysField(this, CURRENCYS_ID, Constants.DEFAULT_FIELD_LENGTH, null, null);
if (iFieldSeq == 9) field = new CountryField(this, COUNTRY_ID, 2, null, null); field.addListener(new InitOnceFieldHandler(null));
field = new StringField(this, ICAO_CODE, 4, null, null); if (iFieldSeq == 7) field = new CountryField(this, COUNTRY_ID, Constants.DEFAULT_FIELD_LENGTH, null, null); if (iFieldSeq == 8) field = new ShortField(this, AIRLINE_NO, 4, null, null);
field = new CountryField(this, COUNTRY_ID, 2, null, null); if (iFieldSeq == 42) field = new RegionField(this, REGION_ID, Constants.DEFAULT_FIELD_LENGTH, null, null);
if (iFieldSeq == 25) field = new CountryField(this, COUNTRY_ID, 2, null, null); field.addListener(new InitOnceFieldHandler(null));