/** * Retrieve (in string format) from this field. * @return Concatinate the fields and return the result. */ public String getString() { String strFinal = FirstMLastConverter.partsToName(m_recThis, m_iNamePrefix, m_iNameFirst, m_iNameMiddle, m_iNameSur, m_iNameSuffix, m_iNameTitle); int maxLength = this.getMaxLength(); if (strFinal.length() > maxLength) strFinal = strFinal.substring(0, maxLength); // Truncate to max length return strFinal; } /**
/** * Convert and move string to this field. * Split the part of this string into the target fields. * 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 strSource, boolean bDisplayOption, int iMoveMode) // init this field override for other value { int iErrorReturn = FirstMLastConverter.nameToParts(strSource, bDisplayOption, iMoveMode, m_recThis, m_iNamePrefix, m_iNameFirst, m_iNameMiddle, m_iNameSur, m_iNameSuffix, m_iNameTitle); if (iErrorReturn == DBConstants.NORMAL_RETURN) if (this.getNextConverter() != null) iErrorReturn = super.setString(strSource, bDisplayOption, iMoveMode); return iErrorReturn; } /**
/** * Constructor. * @param thisFile Target record. * @param iNamePrefix Field sequence of the prefix field. * @param iNameFirst Field sequence of the First name field. * @param iNameMiddle Field sequence of the middle name field. * @param iNameSuffix Field sequence of the suffix field. */ public FirstMLastConverter(Record thisFile, int iNamePrefix, int iNameFirst, int iNameMiddle, int iNameSur) { this(); this.init(null, thisFile, iNamePrefix, iNameFirst, iNameMiddle, iNameSur, -1, -1); } /**
/** * 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) { UserInfo user = (UserInfo)this.makeReferenceRecord(); user.addListener(new StringSubFileFilter(Integer.toString(UserGroup.RES_USER), user.getField(UserInfo.USER_GROUP_ID), null, null, null, null)); Converter convName = new FirstMLastConverter(user, null, UserInfo.FIRST_NAME, null, UserInfo.LAST_NAME); ScreenComponent screenField = this.setupTableLookup(itsLocation, targetScreen, converter, iDisplayFieldDesc, user, UserInfo.USER_NAME_KEY, convName, true, false); properties = new HashMap<String,Object>(); properties.put(ScreenModel.FIELD, this); properties.put(ScreenModel.TOOLTIP, ThinMenuConstants.HOME); String userID = ((BaseApplication)this.getRecord().getRecordOwner().getTask().getApplication()).getUserID(); properties.put(ScreenModel.VALUE, userID); properties.put(ScreenModel.IMAGE, ThinMenuConstants.HOME); createScreenComponent(ScreenModel.CANNED_BOX, targetScreen.getNextLocation(ScreenConstants.RIGHT_OF_LAST, ScreenConstants.DONT_SET_ANCHOR), targetScreen, converter, ScreenConstants.DONT_DISPLAY_FIELD_DESC, properties); return screenField; }
Converter convName = new FirstMLastConverter(user, -1, UserInfo.kFirstName, -1, UserInfo.kLastName);
/** * Retrieve (in string format) from this field. * @return Concatinate the fields and return the result. */ public String getString() { String strFinal = FirstMLastConverter.partsToName(m_recThis, m_iNamePrefix, m_iNameFirst, m_iNameMiddle, m_iNameSur, m_iNameSuffix, m_iNameTitle); int maxLength = this.getMaxLength(); if (strFinal.length() > maxLength) strFinal = strFinal.substring(0, maxLength); // Truncate to max length return strFinal; } /**
/** * Convert and move string to this field. * Split the part of this string into the target fields. * 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 strSource, boolean bDisplayOption, int iMoveMode) // init this field override for other value { int iErrorReturn = FirstMLastConverter.nameToParts(strSource, bDisplayOption, iMoveMode, m_recThis, m_iNamePrefix, m_iNameFirst, m_iNameMiddle, m_iNameSur, m_iNameSuffix, m_iNameTitle); if (iErrorReturn == DBConstants.NORMAL_RETURN) if (this.getNextConverter() != null) iErrorReturn = super.setString(strSource, bDisplayOption, iMoveMode); return iErrorReturn; } /**
/** * Constructor. * @param thisFile Target record. * @param iNamePrefix Field sequence of the prefix field. * @param iNameFirst Field sequence of the First name field. * @param iNameMiddle Field sequence of the middle name field. * @param iNameSuffix Field sequence of the suffix field. */ public FirstMLastConverter(Record thisFile, String iNamePrefix, String iNameFirst, String iNameMiddle, String iNameSur) { this(); this.init(null, thisFile, iNamePrefix, iNameFirst, iNameMiddle, iNameSur, null, null); } /**
/** * SetupSFields Method. */ public void setupSFields() { this.getRecord(BookingPax.BOOKING_PAX_FILE).getField(BookingPax.PAX_CATEGORY_ID).setupDefaultView(this.getNextLocation(ScreenConstants.NEXT_LOGICAL, ScreenConstants.ANCHOR_DEFAULT), this, ScreenConstants.DEFAULT_DISPLAY); FirstMLastConverter converter = new FirstMLastConverter(this.getRecord(BookingPax.BOOKING_PAX_FILE), BookingPax.NAME_PREFIX, BookingPax.FIRST_NAME, BookingPax.MIDDLE_NAME, BookingPax.SUR_NAME); new SEditText(this.getNextLocation(ScreenConstants.NEXT_LOGICAL, ScreenConstants.ANCHOR_DEFAULT), this, converter, ScreenConstants.DEFAULT_DISPLAY); this.getRecord(BookingPax.BOOKING_PAX_FILE).getField(BookingPax.SMOKER).setupDefaultView(this.getNextLocation(ScreenConstants.NEXT_LOGICAL, ScreenConstants.ANCHOR_DEFAULT), this, ScreenConstants.DEFAULT_DISPLAY); }
/** * Retrieve (in string format) from this field. * @return Concatinate the fields and return the result. */ public String getString() { String strFinal = FirstMLastConverter.partsToName(m_recThis, m_iNamePrefix, m_iNameFirst, m_iNameMiddle, m_iNameSur, m_iNameSuffix, m_iNameTitle); int maxLength = this.getMaxLength(); if (strFinal.length() > maxLength) strFinal = strFinal.substring(0, maxLength); // Truncate to max length return strFinal; } /**
/** * Convert and move string to this field. * Split the part of this string into the target fields. * 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 strSource, boolean bDisplayOption, int iMoveMode) // init this field override for other value { int iErrorReturn = FirstMLastConverter.nameToParts(strSource, bDisplayOption, iMoveMode, m_recThis, m_iNamePrefix, m_iNameFirst, m_iNameMiddle, m_iNameSur, m_iNameSuffix, m_iNameTitle); if (iErrorReturn == DBConstants.NORMAL_RETURN) if (this.getNextConverter() != null) iErrorReturn = super.setString(strSource, bDisplayOption, iMoveMode); return iErrorReturn; } /**
/** * Constructor. * @param thisFile Target record. * @param iNamePrefix Field sequence of the prefix field. * @param iNameFirst Field sequence of the First name field. * @param iNameMiddle Field sequence of the middle name field. * @param iNameSuffix Field sequence of the suffix field. */ public FirstMLastConverter(Record thisFile, int iNamePrefix, int iNameFirst, int iNameMiddle, int iNameSur) { this(); this.init(null, thisFile, iNamePrefix, iNameFirst, iNameMiddle, iNameSur, -1, -1); } /**
/** * SetupSFields Method. */ public void setupSFields() { Record query = this.getMainRecord(); Converter converter = query.getField(Tour.TOUR_FILE, Tour.DESCRIPTION); converter = new FieldLengthConverter(converter, 30); this.addColumn(converter); this.addColumn(query.getField(Tour.TOUR_FILE, Tour.DEPARTURE_DATE)); converter = query.getField(Tour.TOUR_FILE, Tour.TOUR_STATUS_ID); this.addColumn(converter); BookingPax recBookingPax = (BookingPax)this.getRecord(BookingPax.BOOKING_PAX_FILE); converter = new FirstMLastConverter(recBookingPax, BookingPax.NAME_PREFIX, BookingPax.FIRST_NAME, BookingPax.MIDDLE_NAME, BookingPax.SUR_NAME); converter = new FieldDescConverter(converter, "Passenger Name"); this.addColumn(converter); converter = new DateConverter(query.getField(Booking.BOOKING_FILE, Booking.BOOKING_DATE), DBConstants.DATE_FORMAT); this.addColumn(converter); converter = query.getField(Booking.BOOKING_FILE, Booking.BOOKING_STATUS_ID); this.addColumn(converter); converter = new DateConverter(query.getField(Booking.BOOKING_FILE, Booking.MOD_DATE), DBConstants.DATE_FORMAT); this.addColumn(converter); this.addColumn(query.getField(Booking.BOOKING_FILE, Booking.GENERIC_NAME)); } /**
/** * Constructor. * @param thisFile Target record. * @param iNamePrefix Field sequence of the prefix field. * @param iNameFirst Field sequence of the First name field. * @param iNameMiddle Field sequence of the middle name field. * @param iNameSur Field sequence of the sur name field. * @param iNameSuffix Field sequence of the suffix field. * @param iNameTitle Field sequence of the title field. */ public FirstMLastConverter(Record thisFile, String iNamePrefix, String iNameFirst, String iNameMiddle, String iNameSur, String iNameSuffix, String iNameTitle) { this(); this.init(null, thisFile, iNamePrefix, iNameFirst, iNameMiddle, iNameSur, iNameSuffix, iNameTitle); } /**
/** * Set up all the screen fields. */ public void setupSFields() { FirstMLastConverter converter = new FirstMLastConverter(this.getRecord(BookingPax.BOOKING_PAX_FILE), BookingPax.NAME_PREFIX, BookingPax.FIRST_NAME, BookingPax.MIDDLE_NAME, BookingPax.SUR_NAME); new SEditText(this.getNextLocation(ScreenConstants.NEXT_LOGICAL, ScreenConstants.ANCHOR_DEFAULT), this, converter, ScreenConstants.DISPLAY_FIELD_DESC); this.getRecord(BookingPax.BOOKING_PAX_FILE).getField(BookingPax.PAX_CATEGORY_ID).setupDefaultView(this.getNextLocation(ScreenConstants.NEXT_LOGICAL, ScreenConstants.ANCHOR_DEFAULT), this, ScreenConstants.DEFAULT_DISPLAY); this.getRecord(BookingPax.BOOKING_PAX_FILE).getField(BookingPax.NAME_PREFIX).setupDefaultView(this.getNextLocation(ScreenConstants.NEXT_LOGICAL, ScreenConstants.ANCHOR_DEFAULT), this, ScreenConstants.DEFAULT_DISPLAY); this.getRecord(BookingPax.BOOKING_PAX_FILE).getField(BookingPax.FIRST_NAME).setupDefaultView(this.getNextLocation(ScreenConstants.RIGHT_OF_LAST, ScreenConstants.DONT_SET_ANCHOR), this, ScreenConstants.DONT_DISPLAY_FIELD_DESC); this.getRecord(BookingPax.BOOKING_PAX_FILE).getField(BookingPax.MIDDLE_NAME).setupDefaultView(this.getNextLocation(ScreenConstants.RIGHT_OF_LAST, ScreenConstants.DONT_SET_ANCHOR), this, ScreenConstants.DONT_DISPLAY_FIELD_DESC); this.getRecord(BookingPax.BOOKING_PAX_FILE).getField(BookingPax.SUR_NAME).setupDefaultView(this.getNextLocation(ScreenConstants.RIGHT_OF_LAST, ScreenConstants.DONT_SET_ANCHOR), this, ScreenConstants.DONT_DISPLAY_FIELD_DESC); this.getRecord(BookingPax.BOOKING_PAX_FILE).getField(BookingPax.DATE_OF_BIRTH).setupDefaultView(this.getNextLocation(ScreenConstants.NEXT_LOGICAL, ScreenConstants.ANCHOR_DEFAULT), this, ScreenConstants.DEFAULT_DISPLAY); this.getRecord(BookingPax.BOOKING_PAX_FILE).getField(BookingPax.GENDER).setupDefaultView(this.getNextLocation(ScreenConstants.NEXT_LOGICAL, ScreenConstants.ANCHOR_DEFAULT), this, ScreenConstants.DEFAULT_DISPLAY); this.getRecord(BookingPax.BOOKING_PAX_FILE).getField(BookingPax.SMOKER).setupDefaultView(this.getNextLocation(ScreenConstants.NEXT_LOGICAL, ScreenConstants.ANCHOR_DEFAULT), this, ScreenConstants.DEFAULT_DISPLAY); this.getRecord(BookingPax.BOOKING_PAX_FILE).getField(BookingPax.PROFILE_ID).setupDefaultView(this.getNextLocation(ScreenConstants.NEXT_LOGICAL, ScreenConstants.ANCHOR_DEFAULT), this, ScreenConstants.DEFAULT_DISPLAY); this.getRecord(BookingPax.BOOKING_PAX_FILE).getField(BookingPax.COMMENTS).setupDefaultView(this.getNextLocation(ScreenConstants.NEXT_LOGICAL, ScreenConstants.FILL_REMAINDER), this, ScreenConstants.DEFAULT_DISPLAY); }
/** * Constructor. * @param thisFile Target record. * @param iNamePrefix Field sequence of the prefix field. * @param iNameFirst Field sequence of the First name field. * @param iNameMiddle Field sequence of the middle name field. * @param iNameSur Field sequence of the sur name field. * @param iNameSuffix Field sequence of the suffix field. * @param iNameTitle Field sequence of the title field. */ public FirstMLastConverter(Record thisFile, int iNamePrefix, int iNameFirst, int iNameMiddle, int iNameSur, int iNameSuffix, int iNameTitle) { this(); this.init(null, thisFile, iNamePrefix, iNameFirst, iNameMiddle, iNameSur, iNameSuffix, iNameTitle); } /**
/** * Constructor. * @param thisFile Target record. * @param iNamePrefix Field sequence of the prefix field. * @param iNameFirst Field sequence of the First name field. * @param iNameMiddle Field sequence of the middle name field. * @param iNameSur Field sequence of the sur name field. * @param iNameSuffix Field sequence of the suffix field. * @param iNameTitle Field sequence of the title field. */ public FirstMLastConverter(Record thisFile, int iNamePrefix, int iNameFirst, int iNameMiddle, int iNameSur, int iNameSuffix, int iNameTitle) { this(); this.init(null, thisFile, iNamePrefix, iNameFirst, iNameMiddle, iNameSur, iNameSuffix, iNameTitle); } /**
/** * Constructor. * @param thisFile Target record. * @param iNamePrefix Field sequence of the prefix field. * @param iNameFirst Field sequence of the First name field. * @param iNameMiddle Field sequence of the middle name field. * @param iNameSur Field sequence of the sur name field. * @param iNameSuffix Field sequence of the suffix field. * @param iNameTitle Field sequence of the title field. */ public FirstMLastConverter(Converter convFullName, int iNamePrefix, int iNameFirst, int iNameMiddle, int iNameSur, int iNameSuffix, int iNameTitle) { this(); this.init(convFullName, ((BaseField)convFullName.getField()).getRecord(), iNamePrefix, iNameFirst, iNameMiddle, iNameSur, iNameSuffix, iNameTitle); } /**
/** * Constructor. * @param thisFile Target record. * @param iNamePrefix Field sequence of the prefix field. * @param iNameFirst Field sequence of the First name field. * @param iNameMiddle Field sequence of the middle name field. * @param iNameSur Field sequence of the sur name field. * @param iNameSuffix Field sequence of the suffix field. * @param iNameTitle Field sequence of the title field. */ public FirstMLastConverter(Converter convFullName, String iNamePrefix, String iNameFirst, String iNameMiddle, String iNameSur, String iNameSuffix, String iNameTitle) { this(); this.init(convFullName, ((BaseField)convFullName.getField()).getRecord(), iNamePrefix, iNameFirst, iNameMiddle, iNameSur, iNameSuffix, iNameTitle); } /**
/** * Constructor. * @param thisFile Target record. * @param iNamePrefix Field sequence of the prefix field. * @param iNameFirst Field sequence of the First name field. * @param iNameMiddle Field sequence of the middle name field. * @param iNameSur Field sequence of the sur name field. * @param iNameSuffix Field sequence of the suffix field. * @param iNameTitle Field sequence of the title field. */ public FirstMLastConverter(Converter convFullName, int iNamePrefix, int iNameFirst, int iNameMiddle, int iNameSur, int iNameSuffix, int iNameTitle) { this(); this.init(convFullName, ((BaseField)convFullName.getField()).getRecord(), iNamePrefix, iNameFirst, iNameMiddle, iNameSur, iNameSuffix, iNameTitle); } /**