fixed email validator in report schedule creation dialog
authorVictor Kirhenshtein <victor@netxms.org>
Mon, 30 May 2016 13:15:36 +0000 (16:15 +0300)
committerVictor Kirhenshtein <victor@netxms.org>
Mon, 30 May 2016 13:15:36 +0000 (16:15 +0300)
src/java/netxms-eclipse/Reporter/META-INF/MANIFEST.MF
src/java/netxms-eclipse/Reporter/src/org/netxms/ui/eclipse/reporter/propertypages/Notifications.java
webui/webapp/Reporter/META-INF/MANIFEST.MF
webui/webapp/Reporter/src/org/netxms/ui/eclipse/reporter/propertypages/Notifications.java

index c713906..fe12f28 100644 (file)
@@ -2,16 +2,16 @@ Manifest-Version: 1.0
 Bundle-ManifestVersion: 2
 Bundle-Name: NXMC Reporter Plug-in
 Bundle-SymbolicName: org.netxms.ui.eclipse.reporter;singleton:=true
-Bundle-Version: 2.0.1
+Bundle-Version: 2.0.2
 Bundle-Activator: org.netxms.ui.eclipse.reporter.Activator
 Bundle-Vendor: netxms.org
 Require-Bundle: org.eclipse.ui;bundle-version="3.8.2",
  org.eclipse.core.runtime;bundle-version="3.8.0",
- org.netxms.ui.eclipse.clientlibrary;bundle-version="2.0.6",
- org.netxms.ui.eclipse.console;bundle-version="2.0.5",
- org.netxms.ui.eclipse.objectbrowser;bundle-version="2.0.3",
+ org.netxms.ui.eclipse.clientlibrary;bundle-version="2.0.10",
+ org.netxms.ui.eclipse.console;bundle-version="2.0.10",
+ org.netxms.ui.eclipse.objectbrowser;bundle-version="2.0.7",
  org.eclipse.ui.forms;bundle-version="3.5.101",
- org.netxms.ui.eclipse.usermanager;bundle-version="2.0.4",
- org.netxms.ui.eclipse.eventmanager;bundle-version="2.0.0"
+ org.netxms.ui.eclipse.usermanager;bundle-version="2.0.8",
+ org.netxms.ui.eclipse.eventmanager;bundle-version="2.0.1"
 Bundle-RequiredExecutionEnvironment: JavaSE-1.6
 Bundle-ActivationPolicy: lazy
index 7cf1c40..3f8cb5c 100644 (file)
@@ -160,17 +160,17 @@ public class Notifications extends PropertyPage
         */
        private void addMail()
        {
-               InputDialog dlg = new InputDialog(emailGroup.getShell(), "Add mail", "Enter mail", "", new IInputValidator() //$NON-NLS-1$
-               {
-                       @Override
-                       public String isValid(String newText)
-                       {
-                               String emailreg = "^[_A-Za-z0-9-]+(\\.[_A-Za-z0-9-]+)*@[A-Za-z0-9]+(\\.[A-Za-z0-9]+)*(\\.[A-Za-z]{2,})$"; //$NON-NLS-1$
-                if (!newText.matches(emailreg))
-                       return "Invalid mail";
-                               return null;
-                       }
-               });
+      InputDialog dlg = new InputDialog(emailGroup.getShell(), "Add mail", "Enter mail", "", new IInputValidator() { //$NON-NLS-1$
+         private static final String VALIDATOR_REGEXP = "^[_A-Za-z0-9-]+(\\.[_A-Za-z0-9-]+)*@[A-Za-z0-9-]+(\\.[A-Za-z0-9-]+)*(\\.[A-Za-z]{2,})$"; //$NON-NLS-1$
+         
+         @Override
+         public String isValid(String newText)
+         {
+            if (!newText.matches(VALIDATOR_REGEXP))
+               return "Invalid email address";
+            return null;
+         }
+      });
                if (dlg.open() == Window.OK)
                {
                        job.getEmailRecipients().add(dlg.getValue());
index a1e3bc8..687cec3 100644 (file)
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
 Bundle-ManifestVersion: 2
 Bundle-Name: NXMC Reporter Plug-in
 Bundle-SymbolicName: org.netxms.ui.eclipse.reporter;singleton:=true
-Bundle-Version: 2.0.0
+Bundle-Version: 2.0.2
 Bundle-Activator: org.netxms.ui.eclipse.reporter.Activator
 Bundle-Vendor: netxms.org
 Require-Bundle: org.eclipse.core.runtime;bundle-version="3.8.0",
index 7cf1c40..3f8cb5c 100644 (file)
@@ -160,17 +160,17 @@ public class Notifications extends PropertyPage
         */
        private void addMail()
        {
-               InputDialog dlg = new InputDialog(emailGroup.getShell(), "Add mail", "Enter mail", "", new IInputValidator() //$NON-NLS-1$
-               {
-                       @Override
-                       public String isValid(String newText)
-                       {
-                               String emailreg = "^[_A-Za-z0-9-]+(\\.[_A-Za-z0-9-]+)*@[A-Za-z0-9]+(\\.[A-Za-z0-9]+)*(\\.[A-Za-z]{2,})$"; //$NON-NLS-1$
-                if (!newText.matches(emailreg))
-                       return "Invalid mail";
-                               return null;
-                       }
-               });
+      InputDialog dlg = new InputDialog(emailGroup.getShell(), "Add mail", "Enter mail", "", new IInputValidator() { //$NON-NLS-1$
+         private static final String VALIDATOR_REGEXP = "^[_A-Za-z0-9-]+(\\.[_A-Za-z0-9-]+)*@[A-Za-z0-9-]+(\\.[A-Za-z0-9-]+)*(\\.[A-Za-z]{2,})$"; //$NON-NLS-1$
+         
+         @Override
+         public String isValid(String newText)
+         {
+            if (!newText.matches(VALIDATOR_REGEXP))
+               return "Invalid email address";
+            return null;
+         }
+      });
                if (dlg.open() == Window.OK)
                {
                        job.getEmailRecipients().add(dlg.getValue());