示例#1
0
 /**
  * Copy all the settings regarding a field configuration to an other field configuration Used only
  * by override (for rendering the settings to the user the getSettingsJSON() is used)
  *
  * @param srcSettings
  * @param destSettings
  * @param destConfigID
  */
 @Override
 public void copySettings(
     Map<Integer, Object> srcSettings, Map<Integer, Object> destSettings, Integer destConfigID) {
   TOptionSettingsBean srcOptionSettingsBean =
       (TOptionSettingsBean) srcSettings.get(mapParameterCode);
   TOptionSettingsBean destOptionSettingsBean =
       (TOptionSettingsBean) destSettings.get(mapParameterCode);
   if (destOptionSettingsBean == null) {
     destOptionSettingsBean = new TOptionSettingsBean();
     destOptionSettingsBean.setConfig(destConfigID);
     destSettings.put(mapParameterCode, destOptionSettingsBean);
   }
   // only if there are specific source settings
   if (srcOptionSettingsBean != null) {
     destOptionSettingsBean.setList(srcOptionSettingsBean.getList());
     destOptionSettingsBean.setParameterCode(srcOptionSettingsBean.getParameterCode());
   }
 }
示例#2
0
 /**
  * Saves the configuration settings for a field
  *
  * @param settings
  * @param configID
  */
 @Override
 public void saveSettings(Map<Integer, Object> settings, Integer configID) {
   TOptionSettingsBean optionSettingsBean = (TOptionSettingsBean) settings.get(mapParameterCode);
   optionSettingsBean.setConfig(configID);
   OptionSettingsBL.save(optionSettingsBean);
 }