/** * 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). * @return Return the component or ScreenField that is created for this field. */ public ScreenField setupDefaultView(ScreenLocation itsLocation, BasePanel targetScreen, Converter converter, int iDisplayFieldDesc) { converter = new FieldLengthConverter(converter, 30); return super.setupDefaultView(itsLocation, targetScreen, converter, iDisplayFieldDesc); }
/** * Constructor. * @param converter The next converter in the converter chain. * @param iFakeLength The maximum field length to return. */ public FieldLengthConverter(Converter converter, int iFakeLength) { this(); this.init(converter, iFakeLength, -1); } /**
this.getRecord(Vendor.VENDOR_FILE).getField(Vendor.EMAIL).setupDefaultView(this.getNextLocation(ScreenConstants.NEXT_LOGICAL, ScreenConstants.ANCHOR_DEFAULT), this, ScreenConstants.DEFAULT_DISPLAY); this.getRecord(Vendor.VENDOR_FILE).getField(Vendor.WEB).setupDefaultView(this.getNextLocation(ScreenConstants.NEXT_LOGICAL, ScreenConstants.ANCHOR_DEFAULT), this, ScreenConstants.DEFAULT_DISPLAY); FieldLengthConverter converter = new FieldLengthConverter(this.getRecord(Vendor.VENDOR_FILE).getField(Vendor.MESSAGE_SERVER), 60); converter.setupDefaultView(this.getNextLocation(ScreenConstants.NEXT_LOGICAL, ScreenConstants.ANCHOR_DEFAULT), this, ScreenConstants.DEFAULT_DISPLAY); converter = new FieldLengthConverter(this.getRecord(Vendor.VENDOR_FILE).getField(Vendor.WSDL_PATH), 60); converter.setupDefaultView(this.getNextLocation(ScreenConstants.NEXT_LOGICAL, ScreenConstants.ANCHOR_DEFAULT), this, ScreenConstants.DEFAULT_DISPLAY); BaseApplication application = (BaseApplication)this.getTask().getApplication(); String strRefresh = application.getResources(ResourceConstants.DEFAULT_RESOURCE, true).getString(MenuConstants.REFRESH);
/** * */ public int setString(String strValue, boolean bDisplayOption, int iMoveMode) { BaseField field = (BaseField)this.getField(); if ((strValue == null) || (strValue.length() == 0)) return super.setString(strValue, bDisplayOption, iMoveMode); // Don't trip change or display if (m_iMinimumLength != -1) if (strValue.length() < m_iMinimumLength) { Task task = field.getRecord().getRecordOwner().getTask(); App application = task.getApplication(); return task.setLastError(MessageFormat.format(application.getResources(ResourceConstants.ERROR_RESOURCE, true).getString("Too Short"), m_iMinimumLength)); } return super.setString(strValue, bDisplayOption, iMoveMode); } }
this.getRecord(Vendor.VENDOR_FILE).getField(Vendor.EMAIL).setupDefaultView(this.getNextLocation(ScreenConstants.NEXT_LOGICAL, ScreenConstants.ANCHOR_DEFAULT), this, ScreenConstants.DEFAULT_DISPLAY); this.getRecord(Vendor.VENDOR_FILE).getField(Vendor.WEB).setupDefaultView(this.getNextLocation(ScreenConstants.NEXT_LOGICAL, ScreenConstants.ANCHOR_DEFAULT), this, ScreenConstants.DEFAULT_DISPLAY); FieldLengthConverter converter = new FieldLengthConverter(this.getRecord(Vendor.VENDOR_FILE).getField(Vendor.MESSAGE_SERVER), 60); converter.setupDefaultView(this.getNextLocation(ScreenConstants.NEXT_LOGICAL, ScreenConstants.ANCHOR_DEFAULT), this, ScreenConstants.DEFAULT_DISPLAY); converter = new FieldLengthConverter(this.getRecord(Vendor.VENDOR_FILE).getField(Vendor.WSDL_PATH), 60); converter.setupDefaultView(this.getNextLocation(ScreenConstants.NEXT_LOGICAL, ScreenConstants.ANCHOR_DEFAULT), this, ScreenConstants.DEFAULT_DISPLAY); BaseApplication application = (BaseApplication)this.getTask().getApplication(); String strRefresh = application.getResources(ResourceConstants.DEFAULT_RESOURCE, true).getString(MenuConstants.REFRESH);
/** * */ public int setString(String strValue, boolean bDisplayOption, int iMoveMode) { BaseField field = (BaseField)this.getField(); if ((strValue == null) || (strValue.length() == 0)) return super.setString(strValue, bDisplayOption, iMoveMode); // Don't trip change or display if (m_iMinimumLength != -1) if (strValue.length() < m_iMinimumLength) { Task task = field.getRecord().getRecordOwner().getTask(); App application = task.getApplication(); return task.setLastError(MessageFormat.format(application.getResources(ResourceConstants.ERROR_RESOURCE, true).getString("Too Short"), m_iMinimumLength)); } return super.setString(strValue, bDisplayOption, iMoveMode); } }
/** * 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) { converter = new FieldLengthConverter((Converter)converter, 30); return super.setupDefaultView(itsLocation, targetScreen, converter, iDisplayFieldDesc, properties); }
/** * Constructor. * @param converter The next converter in the converter chain. * @param iFakeLength The maximum field length to return. */ public FieldLengthConverter(Converter converter, int iFakeLength, int iMinimumLength) { this(); this.init(converter, iFakeLength, iMinimumLength); } /**
/** * */ public int setString(String strValue, boolean bDisplayOption, int iMoveMode) { BaseField field = (BaseField)this.getField(); if ((strValue == null) || (strValue.length() == 0)) return super.setString(strValue, bDisplayOption, iMoveMode); // Don't trip change or display if (m_iMinimumLength != -1) if (strValue.length() < m_iMinimumLength) { Task task = field.getRecord().getRecordOwner().getTask(); App application = task.getApplication(); return task.setLastError(MessageFormat.format(application.getResources(ResourceConstants.ERROR_RESOURCE, true).getString("Too Short"), m_iMinimumLength)); } return super.setString(strValue, bDisplayOption, iMoveMode); } }
/** * 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). * @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) { if (converter.getMaxLength() > ScreenConstants.MAX_SINGLE_CHARS) converter = new FieldLengthConverter((Converter)converter, ScreenConstants.MAX_SINGLE_CHARS); // Show as a single line. ScreenComponent sScreenField = super.setupDefaultView(itsLocation, targetScreen, converter, iDisplayFieldDesc, properties); properties = new HashMap<String,Object>(); properties.put(ScreenModel.FIELD, this); properties.put(ScreenModel.COMMAND, ScreenModel.URL); properties.put(ScreenModel.IMAGE, ScreenModel.URL); ScreenComponent pSScreenField = createScreenComponent(ScreenModel.CANNED_BOX, targetScreen.getNextLocation(ScreenConstants.RIGHT_OF_LAST, ScreenConstants.DONT_SET_ANCHOR), targetScreen, converter, iDisplayFieldDesc, properties); pSScreenField.setRequestFocusEnabled(false); return sScreenField; } }
/** * Constructor. * @param converter The next converter in the converter chain. * @param iFakeLength The maximum field length to return. */ public FieldLengthConverter(Converter converter, int iFakeLength) { this(); this.init(converter, iFakeLength, -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). * @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 XorEncryptedConverter((Converter)converter); converter = new FieldLengthConverter((Converter)converter, m_iMaxLength / 2); converter = new MaskConverter((Converter)converter); return super.setupDefaultView(itsLocation, targetScreen, converter, iDisplayFieldDesc, properties); } }
/** * Constructor. * @param converter The next converter in the converter chain. * @param iFakeLength The maximum field length to return. */ public FieldLengthConverter(Converter converter, int iFakeLength, int iMinimumLength) { this(); this.init(converter, iFakeLength, iMinimumLength); } /**
/** * 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) { Record recBooking = this.getReferenceRecord(); Converter fldDisplayFieldDesc = recBooking.getField(BookingModel.DESCRIPTION); fldDisplayFieldDesc = new FieldLengthConverter(fldDisplayFieldDesc, 30); return this.setupTableLookup(itsLocation, targetScreen, converter, iDisplayFieldDesc, recBooking, BookingModel.CODE_KEY, fldDisplayFieldDesc, true, true); }
/** * Constructor. * @param converter The next converter in the converter chain. * @param iFakeLength The maximum field length to return. */ public FieldLengthConverter(Converter converter, int iFakeLength) { this(); this.init(converter, iFakeLength, -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) { Record record = this.makeReferenceRecord(); Converter fldDisplayFieldDesc = record.getField(Country.NAME); fldDisplayFieldDesc = new FieldLengthConverter(fldDisplayFieldDesc, 25); return this.setupTableLookup(itsLocation, targetScreen, converter, iDisplayFieldDesc, record, Country.CODE_KEY, fldDisplayFieldDesc, true, true); }
/** * Constructor. * @param converter The next converter in the converter chain. * @param iFakeLength The maximum field length to return. */ public FieldLengthConverter(Converter converter, int iFakeLength, int iMinimumLength) { this(); this.init(converter, iFakeLength, iMinimumLength); } /**
/** * 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). * @return Return the component or ScreenField that is created for this field. */ public ScreenField setupDefaultView(ScreenLocation itsLocation, BasePanel targetScreen, Converter converter, int iDisplayFieldDesc) { converter = new XorEncryptedConverter(converter); converter = new FieldLengthConverter(converter, m_iMaxLength / 2); converter = new MaskConverter(converter); ScreenField screenField = super.setupDefaultView(itsLocation, targetScreen, converter, iDisplayFieldDesc); return screenField; } }
/** * 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). * @return Return the component or ScreenField that is created for this field. */ public ScreenField setupDefaultView(ScreenLocation itsLocation, BasePanel targetScreen, Converter converter, int iDisplayFieldDesc) { converter = new XorEncryptedConverter(converter); converter = new FieldLengthConverter(converter, m_iMaxLength / 2); converter = new MaskConverter(converter); ScreenField screenField = super.setupDefaultView(itsLocation, targetScreen, converter, iDisplayFieldDesc); return screenField; } }
/** * 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). * @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 PropertiesConverter((Converter)converter, "value"); converter = new RsaEncryptedConverter((Converter)converter); converter = new FieldLengthConverter((Converter)converter, m_iFakeFieldLength); converter = new RsaPropertyConverter((Converter)converter); return createScreenComponent(ScreenModel.EDIT_TEXT, itsLocation, targetScreen, converter, iDisplayFieldDesc, properties); } /**