/** * Get the next field and fill it with data from this buffer. * You must override this method. * @param field The field to set. * @param bDisplayOption The display option for setting the field. * @param iMoveMove The move mode for setting the field. * @return The error code. */ public int getNextField(FieldInfo field, boolean bDisplayOption, int iMoveMode) // Must be to call right Get calls { Object objNext = this.getNextData(); if (DATA_ERROR.equals(objNext)) return Constants.ERROR_RETURN; // EOF if (DATA_EOF.equals(objNext)) return Constants.ERROR_RETURN; // EOF if (DATA_SKIP.equals(objNext)) return Constants.NORMAL_RETURN; // Don't set this field return field.setData(objNext, bDisplayOption, iMoveMode); } /**
/** * Set the status of this item. */ public int setStatus(int iStatus) { this.getField(BookingDetail.STATUS_SUMMARY).setData(new Integer(iStatus)); return this.getStatus(); } public void setAvailability(int p1) throws java.rmi.RemoteException {
/** * Move the key area to the record. * @param destBuffer A BaseBuffer to fill with data (ignored for thin). * @param iAreaDesc The (optional) temporary area to copy the current fields to (). */ public void reverseKeyBuffer(BaseBuffer bufferSource, int iAreaDesc) // Move these keys back to the record { int iKeyFields = this.getKeyFields(); for (int iKeyFieldSeq = Constants.MAIN_KEY_FIELD; iKeyFieldSeq < iKeyFields + Constants.MAIN_KEY_FIELD; iKeyFieldSeq++) { this.getField(iKeyFieldSeq).setData(m_rgobjTempData != null ? m_rgobjTempData[iKeyFieldSeq] : null); } } /**
else if (classData == String.class) objData = new Double(dValue).toString(); return this.setData(objData, bDisplayOption, iMoveMode);
/** * Set the data in this field to true or false. */ public int setState(boolean bState, boolean bDisplayOption, int iMoveMode) { Boolean objData = new Boolean(bState); if (this.getDataClass() == Boolean.class) return this.setData(objData, bDisplayOption, iMoveMode); else if (Number.class.isAssignableFrom(this.getDataClass())) return this.setValue(objData.booleanValue() ? 1 : 0, bDisplayOption, iMoveMode); else if (this.getDataClass() == String.class) return this.setString(objData.booleanValue() ? Constants.TRUE : Constants.FALSE, bDisplayOption, iMoveMode); return super.setState(bState, bDisplayOption, iMoveMode); } /**
/** * Set the state of this field for binary fields (don't override this). * Usually overidden. * @param bState the state to set the data to. * @param bDisplayOption Display the data on the screen if true. * @param iMoveMode INIT, SCREEN, or READ move mode. * @return The error code. */ public int setState(boolean bState, boolean bDisplayOption, int iMoveMode) { if (bState) return ((BaseField)this.getField()).moveFieldToThis((BaseField)m_fldTargetValue, bDisplayOption, iMoveMode); else return this.getField().setData(null, bDisplayOption, iMoveMode); }
/** * */ private void copyFieldList(FieldList fieldList, FieldList item) { for (int i = 0; i < item.getFieldCount(); i++) { FieldInfo fldSource = item.getField(i); FieldInfo fldDest = fieldList.getField(i); fldDest.setData(fldSource.getData(), Constants.DISPLAY, Constants.READ_MOVE); } } /**
/** * A field changed on this screen. */ public void propertyChange(PropertyChangeEvent evt) { String strFieldName = evt.getPropertyName(); FieldList fieldList = this.getFieldList(); FieldInfo field = fieldList.getField(strFieldName); if (field != null) { if (BookingHotel.NIGHTS.equals(field.getFieldName())) { Short shNights = (Short)field.getData(); Date date = (Date)fieldList.getField(BookingDetail.DETAIL_DATE).getData(); if (date != null) if (shNights != null) { Converter.initGlobals(); Calendar calendar = Converter.gCalendar; calendar.setTime(date); calendar.add(Calendar.DATE, shNights.shortValue()); fieldList.getField(BookingDetail.DETAIL_END_DATE).setData(calendar.getTime()); } } } super.propertyChange(evt); } }
/** * Set this field back to the original value. * @param bDisplayOption If true, display the data. * @return The error code. */ public int initField(boolean bDisplayOption) // Init this field override for other value { if ((this.getDefault() == null) || (this.getDefault() instanceof String)) return this.setString((String)this.getDefault(), bDisplayOption, Constants.INIT_MOVE); // zero out the field return this.setData(this.getDefault(), bDisplayOption, Constants.INIT_MOVE); } /**
/** * Change the start time of this service. */ public void updateField(String strFieldName, Object objData) { try { FieldInfo fieldInfo = m_table.getRecord().getField(strFieldName); if (fieldInfo != null) { m_table.edit(); fieldInfo.setData(objData); m_table.set(m_table.getRecord()); m_table.seek(null); // Read this record } } catch (Exception ex) { ex.printStackTrace(); } } }
Date timeStartOld = (Date)fieldList.getField(BookingDetail.DETAIL_DATE).getData(); if (timeStart != null) fieldList.getField(BookingDetail.DETAIL_DATE).setData(timeStart); if (timeEnd == null) timeEnd = new Date(timeStart.getTime() + lTimeDifference); fieldList.getField(BookingDetail.DETAIL_END_DATE).setData(timeEnd); try { if ((fieldList.getEditMode() == Constants.EDIT_CURRENT) || (fieldList.getEditMode() == Constants.EDIT_IN_PROGRESS))
/** * Convert and move string to this field. * Override this method to convert the String to the actual Physical Data Type. * @param bState the state to set the data to. * @param bDisplayOption Display the data on the screen if true. * @param iMoveMode INIT, SCREEN, or READ move mode. * @return The error code (or NORMAL_RETURN). */ public int setString(String strString, boolean bDisplayOption, int iMoveMode) // init this field override for other value { try { Object objData = Converter.convertObjectToDatatype(strString, this.getDataClass(), null, m_ibScale); if (objData == null) if (this.getDataClass() != Boolean.class) if (!(Number.class.isAssignableFrom(this.getDataClass()))) if (this.getDataClass() != java.util.Date.class) objData = Constants.BLANK; // To set a null internally, you must call setData directly return this.setData(objData, bDisplayOption, iMoveMode); } catch (Exception ex) { String strError = ex.getMessage(); if (strError == null) strError = ex.getClass().getName(); if (this.getRecord() != null) if (this.getRecord().getTask() != null) return this.getRecord().getTask().setLastError(strError); return Constants.ERROR_RETURN; } } /**
/** * Move the data in this record to the thin version. * @param fieldInfo The destination thin field. * @param field The source field (or null to auto-find) * @param record The source record (or null if field supplied) */ public void moveFieldToThin(FieldInfo fieldInfo, BaseField field, Record record) { if ((field == null) || (!field.getFieldName().equals(fieldInfo.getFieldName()))) { field = null; if (record != null) field = record.getField(fieldInfo.getFieldName()); } if (field != null) { if (field.getDataClass() == fieldInfo.getDataClass()) fieldInfo.setData(field.getData()); else fieldInfo.setString(field.toString()); } } /**
/** * Move the data in this record to the thin version. * @param fieldInfo The destination thin field. * @param field The source field (or null to auto-find) * @param record The source record (or null if field supplied) */ public void moveFieldToThin(FieldInfo fieldInfo, BaseField field, Record record) { if ((field == null) || (!field.getFieldName().equals(fieldInfo.getFieldName()))) { field = null; if (record != null) field = record.getField(fieldInfo.getFieldName()); } if (field != null) { if (field.getDataClass() == fieldInfo.getDataClass()) fieldInfo.setData(field.getData()); else fieldInfo.setString(field.toString()); } } /**
/** * Move the data in this record to the thin version. * @param fieldInfo The destination thin field. * @param field The source field (or null to auto-find) * @param record The source record (or null if field supplied) */ public void moveFieldToThin(FieldInfo fieldInfo, BaseField field, Record record) { if ((field == null) || (!field.getFieldName().equals(fieldInfo.getFieldName()))) { field = null; if (record != null) field = record.getField(fieldInfo.getFieldName()); } if (field != null) { if (field.getDataClass() == fieldInfo.getDataClass()) fieldInfo.setData(field.getData()); else fieldInfo.setString(field.toString()); } } /**
recTourHeader.addNew(); recTourHeader.setKeyArea(Tour.ID_KEY); recTourHeader.getCounterField().setData(objID); if (recTourHeader.seek(DBConstants.EQUALS))
recTourHeader.addNew(); recTourHeader.setKeyArea(Tour.ID_KEY); recTourHeader.getCounterField().setData(objID); if (recTourHeader.seek(DBConstants.EQUALS))
fieldCalendar.setData(field.getData()); try { calendarModel.cacheCurrentLockedData(iRowIndex, fieldList);
/** * Reposition to this record using this bookmark. * @param bookmark The handle to use to position the record. * @param iHandleType The type of handle (DATA_SOURCE/OBJECT_ID,OBJECT_SOURCE,BOOKMARK). * @return - true - record found/false - record not found * @exception FILE_NOT_OPEN. * @exception DBException File exception. */ public boolean doSetHandle(Object bookmark, int iHandleType) throws DBException { String strCurrentOrder = this.getRecord().getKeyName(); this.getRecord().setKeyArea(Constants.PRIMARY_KEY); this.getRecord().getCounterField().setData(bookmark); boolean bSuccess = this.seek(Constants.EQUALS); this.getRecord().setKeyArea(strCurrentOrder); return bSuccess; } /**
recPricingType.getField("ID").setData(intID); try { if (recPricingType.getTable().seek(null))