/** * Convert the native data type (date) to a string. * Calls the DateConverter method. * @param tempBinary The physical data convert to a string (must be the raw data class). * @return A display string representing this binary data. * @see DateConverter#binaryToString(tempBinary, DBConstants.DATE_ONLY_FORMAT). */ public String binaryToString(Object tempBinary) { return DateConverter.binaryToString(tempBinary, DBConstants.DATE_ONLY_FORMAT); } /**
/** * Retrieve (in string format) from this field. * Data is already in binary format, so convert it and return the string. * @return This converter as a (date) string. */ public String getString() { Object tempBinary = this.getData(); // Get the physical data if (tempBinary != null) return DateConverter.binaryToString(tempBinary, m_sDateFormat); else return Constants.BLANK; // Clear BaseField } /**
/** * Constructor. * @param converter The next converter in the converter chain. * @param dateFormat The date format. */ public DateConverter(Converter converter, int dateFormat) { this(); this.init(converter, dateFormat); } /**
int maxLength = this.getMaxLength(); if ((fieldLength > maxLength) || (fieldLength > 40)) fieldLength = maxLength; Date dateOld = new Date((long)this.getValue()); // Save current time try { tempBinary = DateConverter.stringToBinary(strField, dateOld, m_sDateFormat); } catch (Exception ex) { String strError = ex.getMessage(); strError = ex.getClass().getName(); Task task = null; if (this.getField() != null) if (((BaseField)this.getField()).getRecord() != null) if (((BaseField)this.getField()).getRecord().getRecordOwner() != null) task = ((BaseField)this.getField()).getRecord().getRecordOwner().getTask(); return this.setData(tempBinary, bDisplayOption, iMoveMode);
initGlobals(); if (sDateFormat == DBConstants.HYBRID_DATE_TIME_FORMAT) sDateFormat = DBConstants.LONG_DATE_TIME_FORMAT; return DateConverter.stringToBinary(tempString + " AM", dateOld, spDateFormat);
converter = new DateConverter((Converter)converter, DBConstants.HYBRID_DATE_TIME_FORMAT); int iFormatType = ((DateConverter)converter).getDateFormat(); ScreenComponent screenField = createScreenComponent(ScreenModel.EDIT_TEXT, itsLocation, targetScreen, converter, iDisplayFieldDesc, properties); if ((iFormatType == DBConstants.DATE_FORMAT)
return aStr; if (gDateFormat == null) initGlobals(); synchronized (gCalendar)
/** * Set up the default control for this field (Using a DateConverter). * @param itsLocation Location of this component on screen (ie., GridBagConstraint). * @param targetScreen Where to place this component (ie., Parent screen or GridBagLayout). * @param iDisplayFieldDesc Display the label? (optional). * @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) { converter = new DateConverter((Converter)converter, DBConstants.TIME_FORMAT); return super.setupDefaultView(itsLocation, targetScreen, converter, iDisplayFieldDesc, properties); } /**
int maxLength = this.getMaxLength(); if ((fieldLength > maxLength) || (fieldLength > 40)) fieldLength = maxLength; Date dateOld = new Date((long)this.getValue()); // Save current time try { tempBinary = DateConverter.stringToBinary(strField, dateOld, m_sDateFormat); } catch (Exception ex) { String strError = ex.getMessage(); strError = ex.getClass().getName(); Task task = null; if (this.getField() != null) if (((BaseField)this.getField()).getRecord() != null) if (((BaseField)this.getField()).getRecord().getRecordOwner() != null) task = ((BaseField)this.getField()).getRecord().getRecordOwner().getTask(); if (task == null) task = BaseApplet.getSharedInstance(); return this.setData(tempBinary, bDisplayOption, iMoveMode);
initGlobals(); if (sDateFormat == DBConstants.HYBRID_DATE_TIME_FORMAT) sDateFormat = DBConstants.LONG_DATE_TIME_FORMAT; return DateConverter.stringToBinary(tempString + " AM", dateOld, spDateFormat);
converter = new DateConverter(converter, DBConstants.HYBRID_DATE_TIME_FORMAT); int iFormatType = ((DateConverter)converter).getDateFormat(); SEditText screenField = new SEditText(itsLocation, targetScreen, converter, iDisplayFieldDesc); if ((iFormatType == DBConstants.DATE_FORMAT)
return aStr; if (gDateFormat == null) initGlobals(); synchronized (gCalendar)
/** * Set up the default control for this field (Using a DateConverter). * @param itsLocation Location of this component on screen (ie., GridBagConstraint). * @param targetScreen Where to place this component (ie., Parent screen or GridBagLayout). * @param iDisplayFieldDesc Display the label? (optional). * @return Return the component or ScreenField that is created for this field. */ public ScreenField setupDefaultView(ScreenLocation itsLocation, BasePanel targetScreen, Converter converter, int iDisplayFieldDesc) // Add this view to the list { converter = new DateConverter(converter, DBConstants.TIME_FORMAT); return super.setupDefaultView(itsLocation, targetScreen, converter, iDisplayFieldDesc); } /**
int maxLength = this.getMaxLength(); if ((fieldLength > maxLength) || (fieldLength > 40)) fieldLength = maxLength; Date dateOld = new Date((long)this.getValue()); // Save current time try { tempBinary = DateConverter.stringToBinary(strField, dateOld, m_sDateFormat); } catch (Exception ex) { String strError = ex.getMessage(); strError = ex.getClass().getName(); Task task = null; if (this.getField() != null) if (((BaseField)this.getField()).getRecord() != null) if (((BaseField)this.getField()).getRecord().getRecordOwner() != null) task = ((BaseField)this.getField()).getRecord().getRecordOwner().getTask(); if (task == null) task = BaseApplet.getSharedInstance(); return this.setData(tempBinary, bDisplayOption, iMoveMode);
initGlobals(); if (sDateFormat == DBConstants.HYBRID_DATE_TIME_FORMAT) sDateFormat = DBConstants.LONG_DATE_TIME_FORMAT; return DateConverter.stringToBinary(tempString + " AM", dateOld, spDateFormat);
/** * Convert the native data type (date) to a string. * Calls the DateConverter method. * @param tempBinary The physical data convert to a string (must be the raw data class). * @return A display string representing this binary data. * @see DateConverter#binaryToString(tempBinary, DBConstants.DATE_ONLY_FORMAT). */ public String binaryToString(Object tempBinary) { return DateConverter.binaryToString(tempBinary, DBConstants.DATE_ONLY_FORMAT); } /**
converter = new DateConverter(converter, DBConstants.HYBRID_DATE_TIME_FORMAT); int iFormatType = ((DateConverter)converter).getDateFormat(); SEditText screenField = new SEditText(itsLocation, targetScreen, converter, iDisplayFieldDesc); if ((iFormatType == DBConstants.DATE_FORMAT)
return aStr; if (gDateFormat == null) initGlobals(); synchronized (gCalendar)
/** * Set up the default control for this field (Using a DateConverter). * @param itsLocation Location of this component on screen (ie., GridBagConstraint). * @param targetScreen Where to place this component (ie., Parent screen or GridBagLayout). * @param iDisplayFieldDesc Display the label? (optional). * @return Return the component or ScreenField that is created for this field. */ public ScreenField setupDefaultView(ScreenLocation itsLocation, BasePanel targetScreen, Converter converter, int iDisplayFieldDesc) // Add this view to the list { converter = new DateConverter(converter, DBConstants.TIME_FORMAT); return super.setupDefaultView(itsLocation, targetScreen, converter, iDisplayFieldDesc); } /**
/** * Retrieve (in string format) from this field. * Data is already in binary format, so convert it and return the string. * @return This converter as a (date) string. */ public String getString() { Object tempBinary = this.getData(); // Get the physical data if (tempBinary != null) return DateConverter.binaryToString(tempBinary, m_sDateFormat); else return Constants.BLANK; // Clear BaseField } /**