Esempio n. 1
0
 /**
  * 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) {
   if (targetScreen != null) {
     Record recCurrencys =
         (Record) Utility.getRecordOwner(targetScreen).getRecord(Currencys.CURRENCYS_FILE);
     if (recCurrencys != null) {
       BaseField fldCurrencyCode = recCurrencys.getField(Currencys.CURRENCY_CODE);
       Converter conv =
           new FieldDescConverter(
               fldCurrencyCode, (Converter) converter); // Use the description for this field
       ScreenComponent sfCurrency =
           createScreenComponent(
               ScreenModel.EDIT_TEXT,
               itsLocation,
               targetScreen,
               conv,
               iDisplayFieldDesc,
               properties);
       sfCurrency.setEnabled(false);
       itsLocation =
           targetScreen.getNextLocation(
               ScreenConstants.RIGHT_OF_LAST, ScreenConstants.DONT_SET_ANCHOR);
       iDisplayFieldDesc = ScreenConstants.DONT_DISPLAY_DESC; // Display it only once
     }
   }
   return super.setupDefaultView(
       itsLocation, targetScreen, converter, iDisplayFieldDesc, properties);
 }