You are viewing a plain text version of this content. The canonical link for it is here.
Posted to scm@geronimo.apache.org by ga...@apache.org on 2013/03/22 20:50:38 UTC

svn commit: r1459957 [2/2] - in /geronimo/devtools/eclipse-plugin/trunk/plugins: org.apache.geronimo.st.v30.core/src/main/java/org/apache/geronimo/st/v30/core/ org.apache.geronimo.st.v30.core/src/main/java/org/apache/geronimo/st/v30/core/util/ org.apac...

Modified: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v30/ui/sections/ServerEditorStartupSection.java
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v30/ui/sections/ServerEditorStartupSection.java?rev=1459957&r1=1459956&r2=1459957&view=diff
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v30/ui/sections/ServerEditorStartupSection.java (original)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v30/ui/sections/ServerEditorStartupSection.java Fri Mar 22 19:50:37 2013
@@ -16,8 +16,8 @@
  */
 package org.apache.geronimo.st.v30.ui.sections;
 
-import org.apache.geronimo.st.v30.core.IGeronimoServer;
-import org.apache.geronimo.st.v30.ui.commands.SetServerInstancePropertyCommand;
+import org.apache.geronimo.st.v30.ui.NumericVerifyListener;
+import org.apache.geronimo.st.v30.ui.commands.TextSetPropertyCommand;
 import org.apache.geronimo.st.v30.ui.internal.Messages;
 import org.eclipse.swt.SWT;
 import org.eclipse.swt.events.ModifyEvent;
@@ -82,10 +82,15 @@ public class ServerEditorStartupSection 
         pingDelay.setToolTipText(Messages.pingDelayTooltip);
         pingDelay.addModifyListener(new ModifyListener() {
             public void modifyText(ModifyEvent e) {
-                Integer value = Integer.valueOf(pingDelay.getText());
-                execute(new SetServerInstancePropertyCommand(server, value, "setPingDelay", Integer.class, IGeronimoServer.class));
+                if (pingDelay.getData() == null) {
+                    int value = Integer.parseInt(pingDelay.getText());
+                    execute(new TextSetPropertyCommand(server, "PingDelay", int.class, value, pingDelay));
+                } else {
+                    pingDelay.setData(null);
+                }
             }
         });
+        pingDelay.addVerifyListener(new NumericVerifyListener());
 
         // ------- Label and text field for the ping interval -------
         createLabel(composite, Messages.pingInterval, toolkit);
@@ -94,10 +99,15 @@ public class ServerEditorStartupSection 
         pingInterval.setToolTipText(Messages.pingIntervalTooltip);
         pingInterval.addModifyListener(new ModifyListener() {
             public void modifyText(ModifyEvent e) {
-                Integer value = Integer.valueOf(pingInterval.getText());
-                execute(new SetServerInstancePropertyCommand(server, value, "setPingInterval", Integer.class, IGeronimoServer.class));
+                if (pingInterval.getData() == null) {
+                    int value = Integer.parseInt(pingInterval.getText());
+                    execute(new TextSetPropertyCommand(server, "PingInterval", int.class, value, pingInterval));
+                } else {
+                    pingInterval.setData(null);
+                }
             }
         });
+        pingInterval.addVerifyListener(new NumericVerifyListener());
         
         // ------- Label and text field for the max pings -------
         createLabel(composite, Messages.maxPings, toolkit);
@@ -106,10 +116,15 @@ public class ServerEditorStartupSection 
         maxPings.setToolTipText(Messages.maxPingsTooltip);
         maxPings.addModifyListener(new ModifyListener() {
             public void modifyText(ModifyEvent e) {
-                Integer value = Integer.valueOf(maxPings.getText());
-                execute(new SetServerInstancePropertyCommand(server, value, "setMaxPings", Integer.class, IGeronimoServer.class));
+                if (maxPings.getData() == null) {
+                    int value = Integer.parseInt(maxPings.getText());
+                    execute(new TextSetPropertyCommand(server, "MaxPings", int.class, value, maxPings));
+                } else {
+                    maxPings.setData(null);
+                }
             }
         });
+        maxPings.addVerifyListener(new NumericVerifyListener());
     }
 
     public String getMaxPings() {