Author: lemovice
Date: Sat Sep 14 11:21:43 2013
New Revision: 4549
Log:
remove password memorization and add multiple to email address management
Added:
trunk/AncestrisExtensions/feedback/src/ancestris/modules/feedback/PasswordPanel.form
trunk/AncestrisExtensions/feedback/src/ancestris/modules/feedback/PasswordPanel.java
Modified:
trunk/AncestrisExtensions/feedback/src/ancestris/modules/feedback/Bundle.properties
trunk/AncestrisExtensions/feedback/src/ancestris/modules/feedback/Bundle_es.properties
trunk/AncestrisExtensions/feedback/src/ancestris/modules/feedback/Bundle_fr.properties
trunk/AncestrisExtensions/feedback/src/ancestris/modules/feedback/Bundle_it.properties
trunk/AncestrisExtensions/feedback/src/ancestris/modules/feedback/Bundle_sv.properties
trunk/AncestrisExtensions/feedback/src/ancestris/modules/feedback/FeedBackOptionPanel.form
trunk/AncestrisExtensions/feedback/src/ancestris/modules/feedback/FeedBackOptionPanel.java
trunk/AncestrisExtensions/feedback/src/ancestris/modules/feedback/SendAction.java
trunk/AncestrisExtensions/feedback/src/ancestris/modules/feedback/SendMailWorker.java
Modified:
trunk/AncestrisExtensions/feedback/src/ancestris/modules/feedback/Bundle.properties
==============================================================================
---
trunk/AncestrisExtensions/feedback/src/ancestris/modules/feedback/Bundle.properties
(original)
+++
trunk/AncestrisExtensions/feedback/src/ancestris/modules/feedback/Bundle.properties
Sat Sep 14 11:21:43 2013
@@ -54,12 +54,10 @@
FeedBackOptionPanel.jLabel1.text=SMTP Port
FeedBackOptionPanel.textFieldSMTPPort.text=25
FeedBackOptionPanel.textFieldLoginName.text=Your login name
-FeedBackOptionPanel.passwordField.text=Your Password
FeedBackOptionPanel.textFieldName.text=Your Name
FeedBackOptionPanel.textFieldEmailAddress.text=Your e-mail address
FeedBackOptionPanel.checkBoxAuthenticationRequired.text=Server require an
authentication
FeedBackOptionPanel.labelLoginName.text=Login name
-FeedBackOptionPanel.labelPassord.text=Password
FeedBackOptionPanel.labelName.text=Your Name
FeedBackOptionPanel.labelEmailAddress.text=Your e-mail
FeedBackOptionPanel.labelSMTPHost.text=Outgoing mail server
@@ -69,3 +67,4 @@
FeedBackOptionPanel.noEncryptioncheckBox.text=None
FeedBackOptionPanel.SSLEncryptioncheckBox.text=SSL
SendMailWorker.Sending-In-Progress= Sending
+FeedBackPasswordPanel.title=Your mail server Password
Modified:
trunk/AncestrisExtensions/feedback/src/ancestris/modules/feedback/Bundle_es.properties
==============================================================================
---
trunk/AncestrisExtensions/feedback/src/ancestris/modules/feedback/Bundle_es.properties
(original)
+++
trunk/AncestrisExtensions/feedback/src/ancestris/modules/feedback/Bundle_es.properties
Sat Sep 14 11:21:43 2013
@@ -54,12 +54,10 @@
FeedBackOptionPanel.jLabel1.text=Puerto SMTP
FeedBackOptionPanel.textFieldSMTPPort.text=25
FeedBackOptionPanel.textFieldLoginName.text=Su nombre de inicio de sesi\u00f3n
-FeedBackOptionPanel.passwordField.text=Su contrase\u00f1a
FeedBackOptionPanel.textFieldName.text=
FeedBackOptionPanel.textFieldEmailAddress.text=
FeedBackOptionPanel.checkBoxAuthenticationRequired.text=Servidor requiere una
autenticaci\u00f3n
FeedBackOptionPanel.labelLoginName.text=Nombre de inicio de sesi\u00f3n
-FeedBackOptionPanel.labelPassord.text=Contrase\u00f1a
FeedBackOptionPanel.labelName.text=Su nombre
FeedBackOptionPanel.labelEmailAddress.text=Su correo electr\u00f3nico
FeedBackOptionPanel.labelSMTPHost.text=Servidor de correo saliente
Modified:
trunk/AncestrisExtensions/feedback/src/ancestris/modules/feedback/Bundle_fr.properties
==============================================================================
---
trunk/AncestrisExtensions/feedback/src/ancestris/modules/feedback/Bundle_fr.properties
(original)
+++
trunk/AncestrisExtensions/feedback/src/ancestris/modules/feedback/Bundle_fr.properties
Sat Sep 14 11:21:43 2013
@@ -54,12 +54,10 @@
FeedBackOptionPanel.jLabel1.text=Port SMTP
FeedBackOptionPanel.textFieldSMTPPort.text=25
FeedBackOptionPanel.textFieldLoginName.text=Votre Nom de login
-FeedBackOptionPanel.passwordField.text=Votre mot de passe
FeedBackOptionPanel.textFieldName.text=Votre Nom
FeedBackOptionPanel.textFieldEmailAddress.text=Votre Adresse email
FeedBackOptionPanel.checkBoxAuthenticationRequired.text=le serveur exige une
authentification
FeedBackOptionPanel.labelLoginName.text=Utilisateur
-FeedBackOptionPanel.labelPassord.text=Mot de passe
FeedBackOptionPanel.labelName.text=Votre Nom
FeedBackOptionPanel.labelEmailAddress.text=Votre adresse e-mail
FeedBackOptionPanel.labelSMTPHost.text=Serveur de mail sortant (SMTP)
Modified:
trunk/AncestrisExtensions/feedback/src/ancestris/modules/feedback/Bundle_it.properties
==============================================================================
---
trunk/AncestrisExtensions/feedback/src/ancestris/modules/feedback/Bundle_it.properties
(original)
+++
trunk/AncestrisExtensions/feedback/src/ancestris/modules/feedback/Bundle_it.properties
Sat Sep 14 11:21:43 2013
@@ -54,12 +54,10 @@
FeedBackOptionPanel.jLabel1.text=SMTP Port
FeedBackOptionPanel.textFieldSMTPPort.text=25
FeedBackOptionPanel.textFieldLoginName.text=Il vostro nome di login
-FeedBackOptionPanel.passwordField.text=Password
FeedBackOptionPanel.textFieldName.text=Vostro Cognome
FeedBackOptionPanel.textFieldEmailAddress.text=Vostro indirizzo email
FeedBackOptionPanel.checkBoxAuthenticationRequired.text=Il server esige una
autenticazione
FeedBackOptionPanel.labelLoginName.text=Utente
-FeedBackOptionPanel.labelPassord.text=Password
FeedBackOptionPanel.labelName.text=Vostro Cognome
FeedBackOptionPanel.labelEmailAddress.text=Vostro indirizzo e-mail
FeedBackOptionPanel.labelSMTPHost.text=Server di posta in uscita (SMTP)
Modified:
trunk/AncestrisExtensions/feedback/src/ancestris/modules/feedback/Bundle_sv.properties
==============================================================================
---
trunk/AncestrisExtensions/feedback/src/ancestris/modules/feedback/Bundle_sv.properties
(original)
+++
trunk/AncestrisExtensions/feedback/src/ancestris/modules/feedback/Bundle_sv.properties
Sat Sep 14 11:21:43 2013
@@ -50,12 +50,10 @@
FeedBackOptionPanel.jLabel1.text=SMTP-port
FeedBackOptionPanel.textFieldSMTPPort.text=25
FeedBackOptionPanel.textFieldLoginName.text=Din inloggning
-FeedBackOptionPanel.passwordField.text=Ditt l\u00f6senord
FeedBackOptionPanel.textFieldName.text=Ditt namn
FeedBackOptionPanel.textFieldEmailAddress.text=Din e-postadress
FeedBackOptionPanel.checkBoxAuthenticationRequired.text=Servern kr\u00e4ver
autentisering
FeedBackOptionPanel.labelLoginName.text=Login-namn
-FeedBackOptionPanel.labelPassord.text=L\u00f6senord
FeedBackOptionPanel.labelName.text=Ditt namn
FeedBackOptionPanel.labelEmailAddress.text=Din e-postadress
FeedBackOptionPanel.labelSMTPHost.text=Server f\u00f6r utg\u00e5ende e-post
(SMTP)
Modified:
trunk/AncestrisExtensions/feedback/src/ancestris/modules/feedback/FeedBackOptionPanel.form
==============================================================================
---
trunk/AncestrisExtensions/feedback/src/ancestris/modules/feedback/FeedBackOptionPanel.form
(original)
+++
trunk/AncestrisExtensions/feedback/src/ancestris/modules/feedback/FeedBackOptionPanel.form
Sat Sep 14 11:21:43 2013
@@ -1,4 +1,4 @@
-<?xml version="1.1" encoding="UTF-8" ?>
+<?xml version="1.0" encoding="UTF-8" ?>
<Form version="1.5" maxVersion="1.7"
type="org.netbeans.modules.form.forminfo.JPanelFormInfo">
<NonVisualComponents>
@@ -24,15 +24,9 @@
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="0" attributes="0">
- <Group type="103" groupAlignment="0" attributes="0">
- <Component id="labelLoginName" alignment="0"
min="-2" max="-2" attributes="0"/>
- <Component id="labelPassord" alignment="0" min="-2"
max="-2" attributes="0"/>
- </Group>
+ <Component id="labelLoginName" min="-2" max="-2"
attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
- <Group type="103" groupAlignment="0" attributes="0">
- <Component id="textFieldLoginName" alignment="0"
pref="379" max="32767" attributes="0"/>
- <Component id="passwordField" alignment="0"
pref="379" max="32767" attributes="0"/>
- </Group>
+ <Component id="textFieldLoginName" pref="379"
max="32767" attributes="0"/>
</Group>
<Component id="checkBoxAuthenticationRequired" alignment="0"
min="-2" max="-2" attributes="0"/>
<Group type="102" alignment="0" attributes="0">
@@ -100,11 +94,6 @@
<Component id="labelLoginName" alignment="3" min="-2"
max="-2" attributes="0"/>
<Component id="textFieldLoginName" alignment="3" min="-2"
max="-2" attributes="0"/>
</Group>
- <EmptySpace max="-2" attributes="0"/>
- <Group type="103" groupAlignment="3" attributes="0">
- <Component id="labelPassord" alignment="3" min="-2" max="-2"
attributes="0"/>
- <Component id="passwordField" alignment="3" min="-2"
max="-2" attributes="0"/>
- </Group>
<EmptySpace max="32767" attributes="0"/>
</Group>
</Group>
@@ -221,14 +210,6 @@
<Property name="enabled" type="boolean" value="false"/>
</Properties>
</Component>
- <Component class="javax.swing.JLabel" name="labelPassord">
- <Properties>
- <Property name="text" type="java.lang.String"
editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
- <ResourceString
bundle="ancestris/modules/feedback/Bundle.properties"
key="FeedBackOptionPanel.labelPassord.text"
replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class,
"{key}")"/>
- </Property>
- <Property name="enabled" type="boolean" value="false"/>
- </Properties>
- </Component>
<Component class="javax.swing.JTextField" name="textFieldLoginName">
<Properties>
<Property name="text" type="java.lang.String"
editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
@@ -237,14 +218,6 @@
<Property name="enabled" type="boolean" value="false"/>
</Properties>
</Component>
- <Component class="javax.swing.JPasswordField" name="passwordField">
- <Properties>
- <Property name="text" type="java.lang.String"
editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
- <ResourceString
bundle="ancestris/modules/feedback/Bundle.properties"
key="FeedBackOptionPanel.passwordField.text"
replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class,
"{key}")"/>
- </Property>
- <Property name="enabled" type="boolean" value="false"/>
- </Properties>
- </Component>
<Component class="javax.swing.JCheckBox" name="noEncryptioncheckBox">
<Properties>
<Property name="buttonGroup" type="javax.swing.ButtonGroup"
editor="org.netbeans.modules.form.RADComponent$ButtonGroupPropertyEditor">
Modified:
trunk/AncestrisExtensions/feedback/src/ancestris/modules/feedback/FeedBackOptionPanel.java
==============================================================================
---
trunk/AncestrisExtensions/feedback/src/ancestris/modules/feedback/FeedBackOptionPanel.java
(original)
+++
trunk/AncestrisExtensions/feedback/src/ancestris/modules/feedback/FeedBackOptionPanel.java
Sat Sep 14 11:21:43 2013
@@ -39,9 +39,7 @@
TLSEncryptioncheckBox = new javax.swing.JCheckBox();
checkBoxAuthenticationRequired = new javax.swing.JCheckBox();
labelLoginName = new javax.swing.JLabel();
- labelPassord = new javax.swing.JLabel();
textFieldLoginName = new javax.swing.JTextField();
- passwordField = new javax.swing.JPasswordField();
noEncryptioncheckBox = new javax.swing.JCheckBox();
jLabel2 = new javax.swing.JLabel();
@@ -88,15 +86,9 @@
org.openide.awt.Mnemonics.setLocalizedText(labelLoginName,
org.openide.util.NbBundle.getMessage(FeedBackOptionPanel.class,
"FeedBackOptionPanel.labelLoginName.text")); // NOI18N
labelLoginName.setEnabled(false);
- org.openide.awt.Mnemonics.setLocalizedText(labelPassord,
org.openide.util.NbBundle.getMessage(FeedBackOptionPanel.class,
"FeedBackOptionPanel.labelPassord.text")); // NOI18N
- labelPassord.setEnabled(false);
-
textFieldLoginName.setText(org.openide.util.NbBundle.getMessage(FeedBackOptionPanel.class,
"FeedBackOptionPanel.textFieldLoginName.text")); // NOI18N
textFieldLoginName.setEnabled(false);
-
passwordField.setText(org.openide.util.NbBundle.getMessage(FeedBackOptionPanel.class,
"FeedBackOptionPanel.passwordField.text")); // NOI18N
- passwordField.setEnabled(false);
-
buttonGroup1.add(noEncryptioncheckBox);
org.openide.awt.Mnemonics.setLocalizedText(noEncryptioncheckBox,
org.openide.util.NbBundle.getMessage(FeedBackOptionPanel.class,
"FeedBackOptionPanel.noEncryptioncheckBox.text")); // NOI18N
noEncryptioncheckBox.addActionListener(new
java.awt.event.ActionListener() {
@@ -115,13 +107,9 @@
.addContainerGap()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
-
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
- .addComponent(labelLoginName)
- .addComponent(labelPassord))
+ .addComponent(labelLoginName)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
-
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
- .addComponent(textFieldLoginName,
javax.swing.GroupLayout.DEFAULT_SIZE, 379, Short.MAX_VALUE)
- .addComponent(passwordField,
javax.swing.GroupLayout.DEFAULT_SIZE, 379, Short.MAX_VALUE)))
+ .addComponent(textFieldLoginName,
javax.swing.GroupLayout.DEFAULT_SIZE, 379, Short.MAX_VALUE))
.addComponent(checkBoxAuthenticationRequired)
.addGroup(layout.createSequentialGroup()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
@@ -175,10 +163,6 @@
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(labelLoginName)
.addComponent(textFieldLoginName,
javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.PREFERRED_SIZE))
-
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
-
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
- .addComponent(labelPassord)
- .addComponent(passwordField,
javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.PREFERRED_SIZE))
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE,
Short.MAX_VALUE))
);
}// </editor-fold>//GEN-END:initComponents
@@ -187,17 +171,10 @@
if (checkBoxAuthenticationRequired.isSelected() == true) {
labelLoginName.setEnabled(true);
textFieldLoginName.setEnabled(true);
-
- labelPassord.setEnabled(true);
- passwordField.setEnabled(true);
} else {
labelLoginName.setEnabled(false);
textFieldLoginName.setEnabled(false);
textFieldLoginName.setText("");
-
- labelPassord.setEnabled(false);
- passwordField.setEnabled(false);
- passwordField.setText("");
}
}//GEN-LAST:event_checkBoxAuthenticationRequiredActionPerformed
@@ -231,17 +208,10 @@
textFieldLoginName.setEnabled(true);
textFieldLoginName.setText(modulePreferences.get("mail.host.login",
NbBundle.getMessage(FeedBackOptionPanel.class,
"FeedBackOptionPanel.textFieldLoginName.text")));
- labelPassord.setEnabled(true);
- passwordField.setEnabled(true);
- passwordField.setText(modulePreferences.get("mail.host.password",
""));
} else {
labelLoginName.setEnabled(false);
textFieldLoginName.setEnabled(false);
textFieldLoginName.setText("");
-
- labelPassord.setEnabled(false);
- passwordField.setEnabled(false);
- passwordField.setText("");
}
}
@@ -257,7 +227,6 @@
modulePreferences.putBoolean("mail.host.AuthenticationRequired",
checkBoxAuthenticationRequired.isSelected());
if (checkBoxAuthenticationRequired.isSelected() == true) {
modulePreferences.put("mail.host.login",
textFieldLoginName.getText());
- modulePreferences.put("mail.host.password",
String.copyValueOf(passwordField.getPassword()));
} else {
modulePreferences.put("mail.host.login", "");
modulePreferences.put("mail.host.password", "");
@@ -278,10 +247,8 @@
private javax.swing.JLabel labelEmailAddress;
private javax.swing.JLabel labelLoginName;
private javax.swing.JLabel labelName;
- private javax.swing.JLabel labelPassord;
private javax.swing.JLabel labelSMTPHost;
private javax.swing.JCheckBox noEncryptioncheckBox;
- private javax.swing.JPasswordField passwordField;
javax.swing.JFormattedTextField textFieldEmailAddress;
private javax.swing.JTextField textFieldLoginName;
javax.swing.JFormattedTextField textFieldName;
Added:
trunk/AncestrisExtensions/feedback/src/ancestris/modules/feedback/PasswordPanel.form
==============================================================================
--- (empty file)
+++
trunk/AncestrisExtensions/feedback/src/ancestris/modules/feedback/PasswordPanel.form
Sat Sep 14 11:21:43 2013
@@ -0,0 +1,43 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+
+<Form version="1.5" maxVersion="1.8"
type="org.netbeans.modules.form.forminfo.JPanelFormInfo">
+ <AuxValues>
+ <AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer"
value="1"/>
+ <AuxValue name="FormSettings_autoSetComponentName"
type="java.lang.Boolean" value="false"/>
+ <AuxValue name="FormSettings_generateFQN" type="java.lang.Boolean"
value="true"/>
+ <AuxValue name="FormSettings_generateMnemonicsCode"
type="java.lang.Boolean" value="false"/>
+ <AuxValue name="FormSettings_i18nAutoMode" type="java.lang.Boolean"
value="true"/>
+ <AuxValue name="FormSettings_layoutCodeTarget" type="java.lang.Integer"
value="1"/>
+ <AuxValue name="FormSettings_listenerGenerationStyle"
type="java.lang.Integer" value="0"/>
+ <AuxValue name="FormSettings_variablesLocal" type="java.lang.Boolean"
value="false"/>
+ <AuxValue name="FormSettings_variablesModifier" type="java.lang.Integer"
value="2"/>
+ </AuxValues>
+
+ <Layout>
+ <DimensionLayout dim="0">
+ <Group type="103" groupAlignment="0" attributes="0">
+ <Group type="102" attributes="0">
+ <EmptySpace max="-2" attributes="0"/>
+ <Component id="passwordField" max="32767" attributes="0"/>
+ <EmptySpace max="-2" attributes="0"/>
+ </Group>
+ </Group>
+ </DimensionLayout>
+ <DimensionLayout dim="1">
+ <Group type="103" groupAlignment="0" attributes="0">
+ <Group type="102" alignment="0" attributes="0">
+ <EmptySpace max="-2" attributes="0"/>
+ <Component id="passwordField" min="-2" max="-2" attributes="0"/>
+ <EmptySpace max="32767" attributes="0"/>
+ </Group>
+ </Group>
+ </DimensionLayout>
+ </Layout>
+ <SubComponents>
+ <Component class="javax.swing.JPasswordField" name="passwordField">
+ <Properties>
+ <Property name="columns" type="int" value="15"/>
+ </Properties>
+ </Component>
+ </SubComponents>
+</Form>
Added:
trunk/AncestrisExtensions/feedback/src/ancestris/modules/feedback/PasswordPanel.java
==============================================================================
--- (empty file)
+++
trunk/AncestrisExtensions/feedback/src/ancestris/modules/feedback/PasswordPanel.java
Sat Sep 14 11:21:43 2013
@@ -0,0 +1,58 @@
+package ancestris.modules.feedback;
+
+/**
+ *
+ * @author dominique
+ */
+
+
+public class PasswordPanel extends javax.swing.JPanel {
+
+ /**
+ * Creates new form password
+ */
+ public PasswordPanel() {
+ initComponents();
+ }
+
+ /**
+ * This method is called from within the constructor to initialize the
form.
+ * WARNING: Do NOT modify this code. The content of this method is always
+ * regenerated by the Form Editor.
+ */
+ @SuppressWarnings("unchecked")
+ // <editor-fold defaultstate="collapsed" desc="Generated
Code">//GEN-BEGIN:initComponents
+ private void initComponents() {
+
+ passwordField = new javax.swing.JPasswordField();
+
+ passwordField.setColumns(15);
+
+ javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
+ this.setLayout(layout);
+ layout.setHorizontalGroup(
+
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+ .addGroup(layout.createSequentialGroup()
+ .addContainerGap()
+ .addComponent(passwordField)
+ .addContainerGap())
+ );
+ layout.setVerticalGroup(
+
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+ .addGroup(layout.createSequentialGroup()
+ .addContainerGap()
+ .addComponent(passwordField,
javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.PREFERRED_SIZE)
+ .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE,
Short.MAX_VALUE))
+ );
+ }// </editor-fold>//GEN-END:initComponents
+ // Variables declaration - do not modify//GEN-BEGIN:variables
+ private javax.swing.JPasswordField passwordField;
+ // End of variables declaration//GEN-END:variables
+
+ /**
+ * @return the jTextField1
+ */
+ public String getPassword() {
+ return String.copyValueOf(passwordField.getPassword());
+ }
+}
Modified:
trunk/AncestrisExtensions/feedback/src/ancestris/modules/feedback/SendAction.java
==============================================================================
---
trunk/AncestrisExtensions/feedback/src/ancestris/modules/feedback/SendAction.java
(original)
+++
trunk/AncestrisExtensions/feedback/src/ancestris/modules/feedback/SendAction.java
Sat Sep 14 11:21:43 2013
@@ -45,6 +45,7 @@
modulePreferences.put("mail.address", panel.jtEmail.getText().trim());
}
+ @Override
public void actionPerformed(ActionEvent e) {
try {
Modified:
trunk/AncestrisExtensions/feedback/src/ancestris/modules/feedback/SendMailWorker.java
==============================================================================
---
trunk/AncestrisExtensions/feedback/src/ancestris/modules/feedback/SendMailWorker.java
(original)
+++
trunk/AncestrisExtensions/feedback/src/ancestris/modules/feedback/SendMailWorker.java
Sat Sep 14 11:21:43 2013
@@ -22,6 +22,7 @@
import javax.mail.internet.MimeMultipart;
import org.netbeans.api.progress.ProgressHandle;
import org.netbeans.api.progress.ProgressHandleFactory;
+import org.openide.DialogDescriptor;
import org.openide.DialogDisplayer;
import org.openide.NotifyDescriptor;
import org.openide.util.Exceptions;
@@ -68,7 +69,12 @@
logger.log(Level.INFO, "Get no encryption session ...");
session = this.createSession();
}
- logger.log(Level.INFO, "... done");
+ if (session != null)
+ logger.log(Level.INFO, "... done");
+ else {
+ logger.log(Level.INFO, "... canceled by user");
+ return;
+ }
/*
* Construct the message and send it.
@@ -95,6 +101,20 @@
}
}
+ private String getPassword() {
+ PasswordPanel passwordPanel = new PasswordPanel();
+
+ DialogDescriptor dd = new DialogDescriptor(passwordPanel,
NbBundle.getMessage(this.getClass(), "FeedBackPasswordPanel.title"));
+ DialogDisplayer.getDefault().createDialog(dd);
+ DialogDisplayer.getDefault().notify(dd);
+ if (dd.getValue().equals(DialogDescriptor.OK_OPTION)) {
+ return passwordPanel.getPassword ();
+ } else {
+ return null;
+ }
+
+ }
+
private Session createSSLSession() {
Session session = null;
Properties props = new Properties();
@@ -106,12 +126,15 @@
if (modulePreferences.getBoolean("mail.host.AuthenticationRequired",
false) == true) {
logger.log(Level.INFO, "Authenticated SSL session");
props.put("mail.smtp.auth", "true");
+ final String password = getPassword ();
+ if (password == null)
+ return null;
session = Session.getDefaultInstance(props,
new javax.mail.Authenticator() {
@Override
protected PasswordAuthentication
getPasswordAuthentication() {
- return new
PasswordAuthentication(modulePreferences.get("mail.host.login", "username"),
modulePreferences.get("mail.host.password", "password"));
+ return new
PasswordAuthentication(modulePreferences.get("mail.host.login", "username"),
password);
}
});
} else {
@@ -123,7 +146,7 @@
return session;
}
- private Session createTLSSession() {
+ private Session createTLSSession( ) {
Session session = null;
Properties props = new Properties();
@@ -134,12 +157,15 @@
if (modulePreferences.getBoolean("mail.host.AuthenticationRequired",
false) == true) {
logger.log(Level.INFO, "Authenticated TLS session");
+ final String password = getPassword ();
+ if (password == null)
+ return null;
session = Session.getInstance(props,
new javax.mail.Authenticator() {
@Override
protected PasswordAuthentication
getPasswordAuthentication() {
- return new
PasswordAuthentication(modulePreferences.get("mail.host.login", "username"),
modulePreferences.get("mail.host.password", "password"));
+ return new
PasswordAuthentication(modulePreferences.get("mail.host.login", "username"),
password);
}
});
} else {
@@ -184,9 +210,11 @@
InternetAddress fromInternetAddress = new InternetAddress(from);
logger.log(Level.INFO, "setFrom {0}", fromInternetAddress);
message.setFrom(fromInternetAddress);
- InternetAddress toInternetAddress = new InternetAddress(to);
- logger.log(Level.INFO, "setRecipient {0}", toInternetAddress);
- message.setRecipient(Message.RecipientType.TO, new
InternetAddress(to));
+ for (String recipient : to.split(",")) {
+ InternetAddress recipientInternetAddress = new
InternetAddress(recipient);
+ logger.log(Level.INFO, "addRecipient {0}",
recipientInternetAddress);
+ message.addRecipient(Message.RecipientType.TO,
recipientInternetAddress);
+ }
logger.log(Level.INFO, "setSubject {0}", subject);
message.setSubject(subject);
if (attachedFile != null) {
---------------------------------------------------------------------
Site Web Ancestris : http://www.ancestris.org
<*> Pour vous desinscrire de cette liste, envoyez un mail a :
[email protected]
<*> Pour obtenir de l'aide sur les commandes de la liste :
[email protected]
Pour obtenir tous les messages lies a ce fil de discussion, cliquez sur le
lien ci-dessous, cela ouvrira votre logiciel de messagerie. Il vous suffira
d'envoyer le message :
[email protected]