public HCNamedSMTPSettingsSelect (@Nonnull final IHCRequestField aRF, @Nonnull final List <NamedSMTPSettings> aSettings, @Nonnull final Locale aDisplayLocale) { super (aRF); for (final NamedSMTPSettings aCurObject : aSettings) { final ISMTPSettings aSMTP = aCurObject.getSMTPSettings (); String sUserName = ""; if (StringHelper.hasText (aSMTP.getUserName ())) sUserName = aSMTP.getUserName () + "@"; addOption (aCurObject.getID (), aCurObject.getName () + " (" + sUserName + aSMTP.getHostName () + ":" + aSMTP.getPort () + ")"); } addOptionPleaseSelect (aDisplayLocale); } }
.setCtrl (aSettings.getHostName ()); .setCtrl (aSettings.getPort () > 0 ? Integer.toString (aSettings.getPort ()) : EText.PORT_DEFAULT.getDisplayText (aDisplayLocale)); .setCtrl (aSettings.getUserName ()); .setCtrl (StringHelper.hasText (aSettings.getPassword ()) ? "***" : EText.MSG_NO_PASSWORD_SET.getDisplayText (aDisplayLocale)); .setCtrl (aSettings.getCharset ()); .setCtrl (EWebBasicsText.getYesOrNo (aSettings.isSSLEnabled (), aDisplayLocale)); .setCtrl (EWebBasicsText.getYesOrNo (aSettings.isSTARTTLSEnabled (), aDisplayLocale)); .setCtrl (Long.toString (aSettings.getConnectionTimeoutMilliSecs ())); .setCtrl (Long.toString (aSettings.getTimeoutMilliSecs ()));
sPassword = aSelectedObject.getSMTPSettings ().getPassword ();
aTable.createItemRow () .setLabelMandatory (sHostName) .setCtrl (new HCEdit (new RequestField (FIELD_HOSTNAME, aSettings == null ? null : aSettings.getHostName ())).setPlaceholder (sHostName)) .setErrorList (aFormErrors.getListOfField (FIELD_HOSTNAME)); .setLabelMandatory (sPort) .setCtrl (new HCAutoNumericInt (new RequestField (FIELD_PORT, aSettings == null || aSettings.getPort () < 0 ? "" : Integer.toString (aSettings.getPort ())), aDisplayLocale).setMin (CNetworkPort.MINIMUM_PORT_NUMBER) .setMax (CNetworkPort.MAXIMUM_PORT_NUMBER) aTable.createItemRow () .setLabel (sUserName) .setCtrl (new HCEdit (new RequestField (FIELD_USERNAME, aSettings == null ? null : aSettings.getUserName ())).setPlaceholder (sUserName)) .setErrorList (aFormErrors.getListOfField (FIELD_USERNAME)); .setLabelMandatory (sCharset) .setCtrl (new HCCharsetSelect (new RequestField (FIELD_CHARSET, aSettings == null ? DEFAULT_CHARSET : aSettings.getCharset ()), true, aDisplayLocale)) .setCtrl (new HCCheckBox (new RequestFieldBoolean (FIELD_SSL, aSettings == null ? EmailGlobalSettings.isUseSSL () : aSettings.isSSLEnabled ()))) .setErrorList (aFormErrors.getListOfField (FIELD_SSL)); .setCtrl (new HCCheckBox (new RequestFieldBoolean (FIELD_STARTTLS,
aRow.addCell (aSettings.getHostName () + (aSettings.getPort () > 0 ? ":" + aSettings.getPort () : "")); aRow.addCell (aSettings.getUserName ());