Ejemplo n.º 1
0
 /** Add this field in the Record's field sequence. */
 public BaseField setupField(int iFieldSeq) {
   BaseField field = null;
   // if (iFieldSeq == 0)
   // {
   //  field = new CounterField(this, ID, Constants.DEFAULT_FIELD_LENGTH, null, null);
   //  field.setHidden(true);
   // }
   // if (iFieldSeq == 1)
   // {
   //  field = new RecordChangedField(this, LAST_CHANGED, Constants.DEFAULT_FIELD_LENGTH, null,
   // null);
   //  field.setHidden(true);
   // }
   // if (iFieldSeq == 2)
   // {
   //  field = new BooleanField(this, DELETED, Constants.DEFAULT_FIELD_LENGTH, null, new
   // Boolean(false));
   //  field.setHidden(true);
   // }
   if (iFieldSeq == 3) field = new StringField(this, NAME, 40, null, null);
   if (iFieldSeq == 4) field = new StringField(this, CODE, 2, null, null);
   if (iFieldSeq == 5)
     field = new CurrencysField(this, CURRENCYS_ID, Constants.DEFAULT_FIELD_LENGTH, null, null);
   if (iFieldSeq == 6)
     field = new LanguageField(this, LANGUAGE_ID, Constants.DEFAULT_FIELD_LENGTH, null, null);
   if (iFieldSeq == 7) field = new StringField(this, ICAO_COUNTRY_CODE, 3, null, null);
   if (iFieldSeq == 8) {
     field = new StringField(this, FAX_PREFIX, 10, null, null);
     field.addListener(new InitOnceFieldHandler(null));
   }
   if (iFieldSeq == 9) {
     field = new DoubleField(this, INTERNATIONAL_TAX, 10, null, null);
     field.addListener(new InitOnceFieldHandler(null));
   }
   if (iFieldSeq == 10) {
     field = new DoubleField(this, DOMESTIC_TAX, 10, null, null);
     field.addListener(new InitOnceFieldHandler(null));
   }
   if (iFieldSeq == 11) field = new DoubleField(this, ARRIVAL_TAX, 10, null, null);
   if (iFieldSeq == 12) {
     field = new FloatField(this, GMT_OFFSET, 5, null, null);
     field.addListener(new InitOnceFieldHandler(null));
   }
   if (iFieldSeq == 13)
     field = new RegionField(this, REGION_ID, Constants.DEFAULT_FIELD_LENGTH, null, null);
   if (iFieldSeq == 14) field = new MemoField(this, DESCRIPTION, 9999, null, null);
   if (iFieldSeq == 15) field = new ImageField(this, PICTURE, 9999, null, null);
   if (field == null) field = super.setupField(iFieldSeq);
   return field;
 }