/** * Get the autosequence field if it exists. * @return The counterfield or null. */ public FieldInfo getCounterField() { return this.getField(Constants.MAIN_FIELD); } /**
/** * Get this field in the record. * Same as getFieldInfo, but casts the field to BaseField. * @param iFieldSeq The sequence of the field in the record. * @return The field. */ public BaseField getField(int iFieldSeq) { return (BaseField)super.getField(iFieldSeq); } /**
/** * Get this field in the record. * Same as getFieldInfo, but casts the field to BaseField. * @param iFieldSeq The sequence of the field in the record. * @return The field. */ public BaseField getField(int iFieldSeq) { return (BaseField)super.getField(iFieldSeq); } /**
public int setPax(int iPax) { return m_recMain.getField(Booking.PAX).setValue(iPax); } /**
/** * Get the menu name. */ public String getMenuName(FieldList record) { return record.getField(Tour.DESCRIPTION).toString(); } /**
/** * Get the menu icon. */ public String getMenuIcon(FieldList record) { if (record.getField(Booking.ID).getValue() != 0) return "tour/buttons/Tour"; // For now else return Constants.FORM; } /**
/** * Add this field to this Key Area. * @param iFieldSeq The field to add. * @param bKeyArea The order (ascending/descending). */ public void addKeyField(int iFieldSeq, boolean bKeyOrder) { this.addKeyField(m_record.getField(iFieldSeq), bKeyOrder); } /**
public int getPax() { return (int)m_recMain.getField(Booking.PAX).getValue(); } public int setPax(int iPax)
/** * Utility method to add the data in this screen field to this key in the property object. */ public void addScreenFieldProperty(Map properties, String strFieldName, String strKey) { properties.put(strKey, this.getFieldList().getField(strFieldName).getData()); } /**
public Object doGetData() { // Move raw data from this field double dPrice = this.getRecord().getField(BookingLine.PRICE).getValue(); double dQuantity = this.getRecord().getField(BookingLine.QUANTITY).getValue(); double dGross = Math.floor(dPrice * dQuantity * 100 + 0.5) / 100; return new Double(dGross); } };
/** * Get this field (or return null if this field doesn't belong on the screen). * This is the method to use to filter the items to display on the screen. */ public Converter getFieldForScreen(int iIndex) { if (iIndex == 2) return this.getFieldList().getField(TourHeader.DAYS); if (iIndex > 2) iIndex--; return super.getFieldForScreen(iIndex); } /**
/** * Free. */ public void free() { JCellRemoteComboBox box = (JCellRemoteComboBox)this.getFieldList().getField(BookingPax.PAX_CATEGORY_ID).getComponent(0); box.setRecord(null); // Don't free this record. box = (JCellRemoteComboBox)this.getFieldList().getField(BookingPax.PAX_CATEGORY_ID).getComponent(1); box.setRecord(null); // Don't free this record. super.free(); } /**
/** * Move the data record(s) to the screen controls. * This is usually not necessary, used only when a screen is first displayed. */ public void fieldsToControls() { super.fieldsToControls(); // Also need to display the local currency code. TourGeekScreen TourGeekScreen = (TourGeekScreen)this.getTargetScreen(TourGeekScreen.class); TourGeekScreen.getCurrencyRecord().getField(Currencys.CURRENCY_CODE).displayField(); // Display local currency code } /**
/** * Free. */ public void free() { JRemoteComboBox box = (JRemoteComboBox)this.getFieldList().getField(BookingPax.PAX_CATEGORY_ID).getComponent(CONTROL); box.setRecord(null); // Don't free this record. super.free(); } /**
/** * Move the data record(s) to the screen controls. * This is usually not necessary, used only when a screen is first displayed. */ public void fieldsToControls() { super.fieldsToControls(); // Also need to display the local currency code. TourGeekScreen TourGeekScreen = (TourGeekScreen)this.getTargetScreen(TourGeekScreen.class); TourGeekScreen.getCurrencyRecord().getField(Currencys.CURRENCY_CODE).displayField(); // Display local currency code } /**
/** * Move the data in this record to the thin version. * @param fieldList. */ public void moveDataToThin(Record record, FieldList fieldList) { if (!record.getField(OTACodes.VALUE).isNull()) fieldList.getField(record.getField(OTACode.ID).getFieldName()).setString(record.getField(OTACodes.VALUE).toString()); this.moveFieldToThin(fieldList.getField(record.getField(OTACodes.NAME).getFieldName()), null, record); } /**
/** * Move the data in this record to the thin version. * @param fieldList. */ public void moveDataToThin(Record record, FieldList fieldList) { if (!record.getField(OTACodes.VALUE).isNull()) fieldList.getField(record.getField(OTACode.ID).getFieldName()).setString(record.getField(OTACodes.VALUE).toString()); this.moveFieldToThin(fieldList.getField(record.getField(OTACodes.NAME).getFieldName()), null, record); } /**
/** * Redisplay the screen. */ public void refreshItinerary() { TourGeekScreen screenMain = (TourGeekScreen)getTargetScreen(TourGeekScreen.class); FieldList record = screenMain.getFieldList(); String strID = record.getField(Params.ID).toString(); ItinScreen itinScreen = (ItinScreen)JBasePanel.getSubScreen(this, ItinScreen.class); itinScreen.displayItinerary(strID); } /**