geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ga...@apache.org
Subject svn commit: r1459957 [1/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...
Date Fri, 22 Mar 2013 19:50:38 GMT
Author: gawor
Date: Fri Mar 22 19:50:37 2013
New Revision: 1459957

URL: http://svn.apache.org/r1459957
Log:
GERONIMODEVTOOLS-795: Add support for PortOffset and saving port information into config-substitution file. Also, other improvements to editing server configuration (ensure unsaved changes are not used until saved, and fix undo functionality)

Added:
    geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.core/src/main/java/org/apache/geronimo/st/v30/core/util/ConfigSubstitutionsHelper.java   (with props)
    geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v30/ui/NumericVerifyListener.java   (with props)
    geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v30/ui/commands/CheckSetPropertyCommand.java   (with props)
    geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v30/ui/commands/SetPropertyCommand.java   (with props)
    geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v30/ui/commands/TextSetPropertyCommand.java   (with props)
    geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v30/ui/sections/PortEditor.java   (with props)
Removed:
    geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v30/ui/commands/SetCleanOSGiBundleCacheCommand.java
    geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v30/ui/commands/SetHTTPPortCommand.java
    geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v30/ui/commands/SetKarafShellCommand.java
    geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v30/ui/commands/SetKarafShellKeepAliveCommand.java
    geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v30/ui/commands/SetKarafShellPortCommand.java
    geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v30/ui/commands/SetKarafShellTimeoutCommand.java
    geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v30/ui/commands/SetNoRedeployCommand.java
    geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v30/ui/commands/SetPasswordCommand.java
    geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v30/ui/commands/SetRMIPortCommand.java
    geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v30/ui/commands/SetRefreshOSGiBundleCommand.java
    geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v30/ui/commands/SetServerInstancePropertyCommand.java
    geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v30/ui/commands/SetUsernameCommand.java
Modified:
    geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.core/src/main/java/org/apache/geronimo/st/v30/core/GeronimoServerBehaviourDelegate.java
    geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.core/src/main/java/org/apache/geronimo/st/v30/core/GeronimoServerDelegate.java
    geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v30/ui/actions/LaunchGeronimoConsoleAction.java
    geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v30/ui/commands/ServerCommand.java
    geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v30/ui/commands/SetPublishTimeoutCommand.java
    geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v30/ui/internal/GeronimoServerWizardFragment.java
    geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v30/ui/internal/Messages.java
    geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v30/ui/internal/Messages.properties
    geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v30/ui/sections/ServerEditorCleanOSGiBundleCacheSection.java
    geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v30/ui/sections/ServerEditorKarafShellSection.java
    geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v30/ui/sections/ServerEditorPortsSection.java
    geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v30/ui/sections/ServerEditorPublishAdvancedSection.java
    geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v30/ui/sections/ServerEditorSecuritySection.java
    geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v30/ui/sections/ServerEditorStartupSection.java

Modified: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.core/src/main/java/org/apache/geronimo/st/v30/core/GeronimoServerBehaviourDelegate.java
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.core/src/main/java/org/apache/geronimo/st/v30/core/GeronimoServerBehaviourDelegate.java?rev=1459957&r1=1459956&r2=1459957&view=diff
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.core/src/main/java/org/apache/geronimo/st/v30/core/GeronimoServerBehaviourDelegate.java (original)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.core/src/main/java/org/apache/geronimo/st/v30/core/GeronimoServerBehaviourDelegate.java Fri Mar 22 19:50:37 2013
@@ -1574,10 +1574,12 @@ public class GeronimoServerBehaviourDele
     }
     
     public MBeanServerConnection getServerConnection() throws Exception {
-        String host = getServer().getHost();
-        String user = getGeronimoServer().getAdminID();
-        String password = getGeronimoServer().getAdminPassword();
-        String port = getGeronimoServer().getRMINamingPort();
+        GeronimoServerDelegate delegate = getServerDelegate();
+        
+        String host = delegate.getServer().getHost();
+        String user = delegate.getAdminID();
+        String password = delegate.getAdminPassword();
+        String port = String.valueOf(delegate.getActualRMINamingPort());
         JMXConnectorInfo connectorInfo = new JMXConnectorInfo(user, password, host, port);
         
         // Using the classloader that loads the current's class as the default classloader when creating the JMXConnector

Modified: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.core/src/main/java/org/apache/geronimo/st/v30/core/GeronimoServerDelegate.java
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.core/src/main/java/org/apache/geronimo/st/v30/core/GeronimoServerDelegate.java?rev=1459957&r1=1459956&r2=1459957&view=diff
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.core/src/main/java/org/apache/geronimo/st/v30/core/GeronimoServerDelegate.java (original)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.core/src/main/java/org/apache/geronimo/st/v30/core/GeronimoServerDelegate.java Fri Mar 22 19:50:37 2013
@@ -20,11 +20,9 @@ import java.io.IOException;
 import java.net.URL;
 import java.util.ArrayList;
 import java.util.Arrays;
-import java.util.HashMap;
 import java.util.HashSet;
 import java.util.List;
 import java.util.ListIterator;
-import java.util.Map;
 import java.util.Set;
 import java.util.jar.Attributes;
 import java.util.jar.JarFile;
@@ -42,6 +40,7 @@ import org.apache.geronimo.st.v30.core.i
 import org.apache.geronimo.st.v30.core.internal.Trace;
 import org.apache.geronimo.st.v30.core.osgi.AriesHelper;
 import org.apache.geronimo.st.v30.core.osgi.OsgiConstants;
+import org.apache.geronimo.st.v30.core.util.ConfigSubstitutionsHelper;
 import org.eclipse.core.runtime.CoreException;
 import org.eclipse.core.runtime.IPath;
 import org.eclipse.core.runtime.IProgressMonitor;
@@ -54,6 +53,7 @@ import org.eclipse.jst.server.core.inter
 import org.eclipse.wst.common.componentcore.internal.util.IModuleConstants;
 import org.eclipse.wst.server.core.IModule;
 import org.eclipse.wst.server.core.IModuleType;
+import org.eclipse.wst.server.core.IRuntime;
 import org.eclipse.wst.server.core.IServer;
 import org.eclipse.wst.server.core.ServerPort;
 import org.eclipse.wst.server.core.ServerUtil;
@@ -88,6 +88,8 @@ public class GeronimoServerDelegate exte
     public static final String PROPERTY_RMI_PORT = "RMIRegistry";
 
     public static final String PROPERTY_HTTP_PORT = "WebConnector";
+    
+    public static final String PROPERTY_PORT_OFFSET = "PortOffset";
 
     public static final String PROPERTY_CLEAN_OSGI_BUNDLE_CACHE = "cleanOSGiBundleCache";
     
@@ -171,7 +173,8 @@ public class GeronimoServerDelegate exte
      * @see org.apache.geronimo.st.v30.core.IGeronimoServer#getDeployerURL()
      */
     public String getDeployerURL() {
-        return "deployer:geronimo:jmx://" + getServer().getHost() + ":" + getRMINamingPort();
+        String host = getServer().getHost();
+        return "deployer:geronimo:jmx://" + host + ":" + getActualRMINamingPort();
     }
     
     /*
@@ -181,7 +184,7 @@ public class GeronimoServerDelegate exte
      */
     public String getJMXServiceURL() {
         String host = getServer().getHost();
-        return "service:jmx:rmi://" + host + "/jndi/rmi://" + host + ":" + getRMINamingPort() + "/JMXConnector";
+        return "service:jmx:rmi://" + host + "/jndi/rmi://" + host + ":" + getActualRMINamingPort() + "/JMXConnector";
     }
 
     /*
@@ -445,8 +448,8 @@ public class GeronimoServerDelegate exte
         Trace.tracePoint("Entry", Activator.traceCore, "GeronimoServerDelegate.getServerPorts");
 
         List<ServerPort> ports = new ArrayList<ServerPort>();
-        ports.add(new ServerPort(PROPERTY_HTTP_PORT, "Web Connector", Integer.parseInt(getHTTPPort()), "http"));
-        ports.add(new ServerPort(PROPERTY_RMI_PORT, "RMI Naming", Integer.parseInt(getRMINamingPort()), "rmi"));
+        ports.add(new ServerPort(PROPERTY_HTTP_PORT, "Web Connector", getActualHTTPPort(), "http"));
+        ports.add(new ServerPort(PROPERTY_RMI_PORT, "RMI Naming", getActualRMINamingPort(), "rmi"));
 
         ServerPort[] serverPorts = ports.toArray(new ServerPort[ports.size()]);
         Trace.tracePoint("Entry", Activator.traceCore, "GeronimoServerDelegate.getServerPorts", serverPorts);
@@ -503,7 +506,7 @@ public class GeronimoServerDelegate exte
                 String host = getServer().getHost();
                 StringBuilder urlSB = new StringBuilder("http://");
                 urlSB.append(host);
-                int port = Integer.parseInt(getHTTPPort());
+                int port = getActualHTTPPort();
                 port = ServerMonitorManager.getInstance().getMonitoredPort(getServer(), port, "web");
                 if (port != 80) {
                     urlSB.append(":").append(port);
@@ -545,29 +548,61 @@ public class GeronimoServerDelegate exte
     public void setDefaults(IProgressMonitor monitor) {
         Trace.tracePoint("Entry", Activator.traceCore, "GeronimoServerDelegate.setDefaults", monitor);
         suspendArgUpdates();
+        
         setAdminID("system");
         setAdminPassword("manager");
         setHTTPPort("8080");
         setRMINamingPort("1099");
+        setPortOffset(0);
         setConsoleLogLevel(CONSOLE_INFO);
         setCleanOSGiBundleCache(false);
         setRefreshOSGiBundle(false);
         setKarafShell(false);
-        setPingDelay(new Integer(10000));
-        setMaxPings(new Integer(40));
-        setPingInterval(new Integer(5000));
+        setPingDelay(10000);
+        setMaxPings(40);
+        setPingInterval(5000);
         setPublishTimeout(900000);
         setInPlaceSharedLib(false);
         setRunFromWorkspace(false);
         setSelectClasspathContainers(false);
+        
+        IServer server = getServer();
+        if (server != null) {
+            IRuntime runtime = server.getRuntime();
+            if (runtime != null) {
+                ConfigSubstitutionsHelper configSubstitutions = new ConfigSubstitutionsHelper(runtime.getLocation());
+                configSubstitutions.load();
+                setAttribute(configSubstitutions, ConfigSubstitutionsHelper.PORT_OFFSET, PROPERTY_PORT_OFFSET);
+                setAttribute(configSubstitutions, ConfigSubstitutionsHelper.HTTP_PORT, PROPERTY_HTTP_PORT);
+                setAttribute(configSubstitutions, ConfigSubstitutionsHelper.NAMING_PORT, PROPERTY_RMI_PORT);
+            }
+        }
+
         resumeArgUpdates();
         Trace.tracePoint("Exit", Activator.traceCore, "GeronimoServerDelegate.setDefaults", monitor);
     }
+    
+    private void setAttribute(ConfigSubstitutionsHelper configSubstitutions, String substProperty, String property) {
+        String value = configSubstitutions.getProperty(substProperty);
+        if (value != null) {
+            setAttribute(property, value);
+        }
+    }
 
     @Override
     public void saveConfiguration(IProgressMonitor monitor) throws CoreException {
         Trace.tracePoint("Enter", Activator.traceCore, "GeronimoServerDelegate.saveConfiguration", monitor);
         super.saveConfiguration(monitor);
+        
+        if (SocketUtil.isLocalhost(getServer().getHost())) {
+            ConfigSubstitutionsHelper configSubstitutions = new ConfigSubstitutionsHelper(getServer().getRuntime().getLocation());
+            configSubstitutions.load();
+            configSubstitutions.setProperty(ConfigSubstitutionsHelper.PORT_OFFSET, String.valueOf(getPortOffset()));
+            configSubstitutions.setProperty(ConfigSubstitutionsHelper.HTTP_PORT, getHTTPPort());
+            configSubstitutions.setProperty(ConfigSubstitutionsHelper.NAMING_PORT, getRMINamingPort());
+            configSubstitutions.store();            
+        }
+
         Trace.tracePoint("Exit", Activator.traceCore, "GeronimoServerDelegate.saveConfiguration", monitor);
     }
     
@@ -582,10 +617,10 @@ public class GeronimoServerDelegate exte
     // PROPERTY_ADMIN_ID 
     // 
     public String getAdminID() {
-        return getInstanceProperty(PROPERTY_ADMIN_ID);
+        return getAttribute(PROPERTY_ADMIN_ID, "system");
     }
     public void setAdminID(String value) {
-        setInstanceProperty(PROPERTY_ADMIN_ID, value);
+        setAttribute(PROPERTY_ADMIN_ID, value);
     }
 
 
@@ -593,45 +628,62 @@ public class GeronimoServerDelegate exte
     // PROPERTY_ADMIN_PW 
     // 
     public String getAdminPassword() {
-        String password = getInstanceProperty(PROPERTY_ADMIN_PW);
+        String password = getAttribute(PROPERTY_ADMIN_PW, "manager");
         return password == null ? null : (String) EncryptionManager.decrypt(password);
     }
     
     public void setAdminPassword(String value) {
         String password = value == null ? null : EncryptionManager.encrypt(value);
-        setInstanceProperty(PROPERTY_ADMIN_PW, password);
+        setAttribute(PROPERTY_ADMIN_PW, password);
     }
 
     // 
+    // PROPERTY_PORT_OFFSET
+    // 
+    public int getPortOffset() {
+        return getAttribute(PROPERTY_PORT_OFFSET, 0);
+    }
+    
+    public void setPortOffset(int value) {
+        setAttribute(PROPERTY_PORT_OFFSET, value);
+    }
+    
+    // 
     // PROPERTY_RMI_PORT 
     // 
     public String getRMINamingPort() {
-        return getInstanceProperty(PROPERTY_RMI_PORT);
+        return getAttribute(PROPERTY_RMI_PORT, "1099");
     }
     public void setRMINamingPort(String value) {
-        setInstanceProperty(PROPERTY_RMI_PORT, value);
+        setAttribute(PROPERTY_RMI_PORT, value);
     }
-
-
+    public int getActualRMINamingPort() {
+        int port = getAttribute(PROPERTY_RMI_PORT, 1099);
+        return port + getPortOffset();
+    }
+    
     // 
     // PROPERTY_HTTP_PORT 
     // 
     public String getHTTPPort() {
-        return getInstanceProperty(PROPERTY_HTTP_PORT);
+        return getAttribute(PROPERTY_HTTP_PORT, "8080");
     }
     public void setHTTPPort(String value) {
-        setInstanceProperty(PROPERTY_HTTP_PORT, value);
+        setAttribute(PROPERTY_HTTP_PORT, value);        
+    }
+    public int getActualHTTPPort() {
+        int port = getAttribute(PROPERTY_HTTP_PORT, 8080);
+        return port + getPortOffset();
     }
-
 
     // 
     // PROPERTY_LOG_LEVEL
     // 
     public String getConsoleLogLevel() {
-        return getInstanceProperty(PROPERTY_LOG_LEVEL);
+        return getAttribute(PROPERTY_LOG_LEVEL, CONSOLE_INFO);
     }
     public void setConsoleLogLevel(String value) {
-        setInstanceProperty(PROPERTY_LOG_LEVEL, value);
+        setAttribute(PROPERTY_LOG_LEVEL, value);
         updateProgramArgsFromProperties();
     }
     
@@ -640,12 +692,11 @@ public class GeronimoServerDelegate exte
     // CLEAR_OSGI_BUNDLE_CACHE
     //
     public boolean isCleanOSGiBundleCache() {
-        String enable = getInstanceProperty(PROPERTY_CLEAN_OSGI_BUNDLE_CACHE);
-        return Boolean.valueOf(enable);
+        return getAttribute(PROPERTY_CLEAN_OSGI_BUNDLE_CACHE, false);
     }
 
     public void setCleanOSGiBundleCache(boolean value) {
-        setInstanceProperty(PROPERTY_CLEAN_OSGI_BUNDLE_CACHE, Boolean.toString(value));
+        setAttribute(PROPERTY_CLEAN_OSGI_BUNDLE_CACHE, value);
         updateProgramArgsFromProperties();
     }
     
@@ -653,12 +704,11 @@ public class GeronimoServerDelegate exte
     // REFRESH_OSGI_BUNDLE
     //
     public boolean isRefreshOSGiBundle() {
-        String enable = getInstanceProperty(PROPERTY_REFRESH_OSGI_BUNDLE);
-        return Boolean.valueOf(enable);
+        return getAttribute(PROPERTY_REFRESH_OSGI_BUNDLE, false);
     }
     
     public void setRefreshOSGiBundle(boolean value) {
-        setInstanceProperty(PROPERTY_REFRESH_OSGI_BUNDLE, Boolean.toString(value));
+        setAttribute(PROPERTY_REFRESH_OSGI_BUNDLE, value);
     }
     
     
@@ -947,7 +997,7 @@ public class GeronimoServerDelegate exte
     // PROPERTY_VM_ARGS
     // 
     public String getVMArgs() {
-        String superVMArgs = getInstanceProperty(PROPERTY_VM_ARGS);
+        String superVMArgs = getAttribute(PROPERTY_VM_ARGS);
         if (superVMArgs != null && superVMArgs.trim().length() > 0) {
             return superVMArgs;
         }
@@ -984,7 +1034,7 @@ public class GeronimoServerDelegate exte
     }
     
     public void setVMArgs(String value) {
-        setInstanceProperty(PROPERTY_VM_ARGS, value);
+        setAttribute(PROPERTY_VM_ARGS, value);
     }
 
     public Set<String> getVMArgsSet() {
@@ -999,7 +1049,7 @@ public class GeronimoServerDelegate exte
     // PROPERTY_PROGRAM_ARGS
     // 
     public String getProgramArgs() {
-        String superVMArgs = getInstanceProperty(PROPERTY_PROGRAM_ARGS);
+        String superVMArgs = getAttribute(PROPERTY_PROGRAM_ARGS);
         if (superVMArgs != null && superVMArgs.trim().length() > 0) {
             return superVMArgs;
         }
@@ -1020,19 +1070,18 @@ public class GeronimoServerDelegate exte
     }
     
     public void setProgramArgs(String value) {
-        setInstanceProperty(PROPERTY_PROGRAM_ARGS, value);
+        setAttribute(PROPERTY_PROGRAM_ARGS, value);
     }
-    
+
 
     // 
     // PROPERTY_PING_DELAY
     // 
     public int getPingDelay() {
-        String pingDelay = getInstanceProperty(PROPERTY_PING_DELAY);
-        return Integer.parseInt(pingDelay);
+        return getAttribute(PROPERTY_PING_DELAY, 10000);
     }
-    public void setPingDelay(Integer delay) {
-        setInstanceProperty(PROPERTY_PING_DELAY, delay.toString());
+    public void setPingDelay(int delay) {
+        setAttribute(PROPERTY_PING_DELAY, delay);
     }
     
     
@@ -1040,11 +1089,10 @@ public class GeronimoServerDelegate exte
     // PROPERTY_PING_INTERVAL
     // 
     public int getPingInterval() {
-        String pingInterval = getInstanceProperty(PROPERTY_PING_INTERVAL);
-        return Integer.parseInt(pingInterval);
+        return getAttribute(PROPERTY_PING_INTERVAL, 5000);
     }
-    public void setPingInterval(Integer interval) {
-        setInstanceProperty(PROPERTY_PING_INTERVAL, interval.toString());
+    public void setPingInterval(int interval) {
+        setAttribute(PROPERTY_PING_INTERVAL, interval);
     }
     
     
@@ -1052,11 +1100,10 @@ public class GeronimoServerDelegate exte
     // PROPERTY_MAX_PINGS
     // 
     public int getMaxPings() {
-        String maxPings = getInstanceProperty(PROPERTY_MAX_PINGS);
-        return Integer.parseInt(maxPings);
+        return getAttribute(PROPERTY_MAX_PINGS, 40);
     }
-    public void setMaxPings(Integer maxPings) {
-        setInstanceProperty(PROPERTY_MAX_PINGS, maxPings.toString());
+    public void setMaxPings(int maxPings) {
+        setAttribute(PROPERTY_MAX_PINGS, maxPings);
     }
     
     
@@ -1064,11 +1111,11 @@ public class GeronimoServerDelegate exte
     // PROPERTY_PUBLISH_TIMEOUT
     // 
     public long getPublishTimeout() {
-        String timeout = getInstanceProperty(PROPERTY_PUBLISH_TIMEOUT);
-        return Long.parseLong(timeout);
+        String value = getAttribute(PROPERTY_PUBLISH_TIMEOUT, "900000");
+        return Long.parseLong(value);
     }
     public void setPublishTimeout(long timeout) {
-        setInstanceProperty(PROPERTY_PUBLISH_TIMEOUT, Long.toString(timeout));
+        setAttribute(PROPERTY_PUBLISH_TIMEOUT, String.valueOf(timeout));
     }
     
     
@@ -1187,23 +1234,9 @@ public class GeronimoServerDelegate exte
         }
         return null;
     }
-
-    public String getInstanceProperty(String name) {
-        return (String) getServerInstanceProperties().get(name);
-    }
-
-    public void setInstanceProperty(String name, String value) {
-        Map map = getServerInstanceProperties();
-        map.put(name, value);
-        setServerInstanceProperties(map);
-    }
-
-    public Map getServerInstanceProperties() {
-        return getAttribute(GeronimoRuntimeDelegate.SERVER_INSTANCE_PROPERTIES, new HashMap());
-    }
-
-    public void setServerInstanceProperties(Map map) {
-        setAttribute(GeronimoRuntimeDelegate.SERVER_INSTANCE_PROPERTIES, map);
+    
+    private String getAttribute(String name) {
+        return getAttribute(name, (String) null);
     }
 
 }

Added: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.core/src/main/java/org/apache/geronimo/st/v30/core/util/ConfigSubstitutionsHelper.java
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.core/src/main/java/org/apache/geronimo/st/v30/core/util/ConfigSubstitutionsHelper.java?rev=1459957&view=auto
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.core/src/main/java/org/apache/geronimo/st/v30/core/util/ConfigSubstitutionsHelper.java (added)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.core/src/main/java/org/apache/geronimo/st/v30/core/util/ConfigSubstitutionsHelper.java Fri Mar 22 19:50:37 2013
@@ -0,0 +1,101 @@
+/**
+ *  Licensed to the Apache Software Foundation (ASF) under one or more
+ *  contributor license agreements.  See the NOTICE file distributed with
+ *  this work for additional information regarding copyright ownership.
+ *  The ASF licenses this file to You under the Apache License, Version 2.0
+ *  (the "License"); you may not use this file except in compliance with
+ *  the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+package org.apache.geronimo.st.v30.core.util;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileOutputStream;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.util.Properties;
+
+import org.apache.geronimo.kernel.util.IOUtils;
+import org.apache.geronimo.st.v30.core.Activator;
+import org.apache.geronimo.st.v30.core.internal.Trace;
+import org.eclipse.core.runtime.IPath;
+
+
+public class ConfigSubstitutionsHelper {
+    
+    private static final String INSTRUCTION = ("# Put variables and their substitution values in this file. \n"
+            + "# They will be used when processing the corresponding config.xml. \n"
+            + "# Values in this file can be overridden by environment variables and system properties \n"
+            + "# by prefixing the property name with 'org.apache.geronimo.config.substitution.' \n"
+            + "# For example, an entry such as hostName=localhost \n"
+            + "# can be overridden by an environment variable or system property org.apache.geronimo.config.substitution.hostName=foo \n"
+            + "# When running multiple instances of Geronimo choose a PortOffset value such that none of the ports conflict. \n"
+            + "# For example, try PortOffset=10 \n");
+    
+    public static final String PORT_OFFSET = "PortOffset";
+    public static final String NAMING_PORT = "NamingPort";
+    public static final String HTTP_PORT = "HTTPPort";
+    
+    private final File configSubstitutionsFile;
+    private Properties properties;
+    private boolean dirty;
+    
+    public ConfigSubstitutionsHelper(IPath installDirectory) {
+        configSubstitutionsFile = installDirectory.append("var/config/config-substitutions.properties").toFile();
+    }
+    
+    public void load() {
+        properties = new Properties();
+        InputStream in = null;
+        try {
+            in = new FileInputStream(configSubstitutionsFile);
+            properties.load(in);
+        } catch (Exception e) {
+            // ignore - file does not have to be there
+        } finally {
+            IOUtils.close(in);
+        }
+    }
+ 
+    public void store() {
+        if (dirty) {
+            save();
+            dirty = false;
+        }
+    }
+    
+    private void save() {
+        OutputStream out = null;
+        try {
+            out = new FileOutputStream(configSubstitutionsFile);
+            properties.store(out, INSTRUCTION);
+        } catch (Exception e) {
+            Trace.trace(Trace.ERROR, "Error saving config-substitutions.properties file", e, Activator.traceCore);
+        } finally {
+            IOUtils.close(out);
+        }
+    }
+    
+    public String getProperty(String name) {
+        return properties.getProperty(name);
+    }
+    
+    public String getProperty(String name, String defaultValue) {
+        return properties.getProperty(name, defaultValue);
+    }
+    
+    public void setProperty(String name, String value) {
+        Object oldValue = properties.setProperty(name, value);
+        if (oldValue == null || !oldValue.equals(value)) {
+            dirty = true;
+        }
+    }
+}

Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.core/src/main/java/org/apache/geronimo/st/v30/core/util/ConfigSubstitutionsHelper.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.core/src/main/java/org/apache/geronimo/st/v30/core/util/ConfigSubstitutionsHelper.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.core/src/main/java/org/apache/geronimo/st/v30/core/util/ConfigSubstitutionsHelper.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v30/ui/NumericVerifyListener.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/NumericVerifyListener.java?rev=1459957&view=auto
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v30/ui/NumericVerifyListener.java (added)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v30/ui/NumericVerifyListener.java Fri Mar 22 19:50:37 2013
@@ -0,0 +1,36 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.geronimo.st.v30.ui;
+
+import org.eclipse.swt.events.VerifyEvent;
+import org.eclipse.swt.events.VerifyListener;
+
+public class NumericVerifyListener implements VerifyListener {
+
+    @Override
+    public void verifyText(VerifyEvent e) {
+        String text = e.text;
+        int length = text.length();
+        for (int i = 0; i < length; i++) {
+            char ch = text.charAt(i);
+            if (!('0' <= ch && ch <= '9')) {
+                e.doit = false;
+                break;
+            }
+        }       
+    }
+}

Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v30/ui/NumericVerifyListener.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v30/ui/NumericVerifyListener.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v30/ui/NumericVerifyListener.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v30/ui/actions/LaunchGeronimoConsoleAction.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/actions/LaunchGeronimoConsoleAction.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/actions/LaunchGeronimoConsoleAction.java (original)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v30/ui/actions/LaunchGeronimoConsoleAction.java Fri Mar 22 19:50:37 2013
@@ -66,7 +66,7 @@ public class LaunchGeronimoConsoleAction
         if (server != null) {
             GeronimoServerDelegate gs = (GeronimoServerDelegate) server.getAdapter(GeronimoServerDelegate.class);
             return new URL("http://" + server.getHost() + ":"
-                    + gs.getHTTPPort() + "/console/");
+                    + gs.getActualHTTPPort() + "/console/");
         }
         return null;
     }

Added: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v30/ui/commands/CheckSetPropertyCommand.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/commands/CheckSetPropertyCommand.java?rev=1459957&view=auto
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v30/ui/commands/CheckSetPropertyCommand.java (added)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v30/ui/commands/CheckSetPropertyCommand.java Fri Mar 22 19:50:37 2013
@@ -0,0 +1,48 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.geronimo.st.v30.ui.commands;
+
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Event;
+import org.eclipse.wst.server.core.IServerWorkingCopy;
+
+public class CheckSetPropertyCommand extends SetPropertyCommand {
+    
+    private Button checkButton;
+
+    public CheckSetPropertyCommand(IServerWorkingCopy server, String propertyName, Button checkButton) {
+        super(server, propertyName, boolean.class, checkButton.getSelection());
+        this.checkButton = checkButton;
+    }
+
+    public IStatus undo(IProgressMonitor monitor, IAdaptable adapt) {
+        IStatus status = super.undo(monitor, adapt);
+        if (status.isOK()) {
+            checkButton.setData("undo");
+            boolean value = !((Boolean)newValue).booleanValue();
+            checkButton.setSelection(value);
+            // setSelection does not fire Selection event so have to do it manually
+            checkButton.notifyListeners(SWT.Selection, new Event());
+        }
+        return status;
+    }
+
+}

Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v30/ui/commands/CheckSetPropertyCommand.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v30/ui/commands/CheckSetPropertyCommand.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v30/ui/commands/CheckSetPropertyCommand.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v30/ui/commands/ServerCommand.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/commands/ServerCommand.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/commands/ServerCommand.java (original)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v30/ui/commands/ServerCommand.java Fri Mar 22 19:50:37 2013
@@ -16,17 +16,22 @@
  */
 package org.apache.geronimo.st.v30.ui.commands;
 
+import org.apache.geronimo.st.v30.core.GeronimoServerDelegate;
 import org.eclipse.core.commands.operations.AbstractOperation;
 import org.eclipse.core.runtime.IAdaptable;
 import org.eclipse.core.runtime.IProgressMonitor;
 import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.core.runtime.Status;
 import org.eclipse.wst.server.core.IServerWorkingCopy;
 
 /**
  * @version $Rev$ $Date$
  */
 public abstract class ServerCommand extends AbstractOperation {
+    
     protected IServerWorkingCopy server;
+    protected GeronimoServerDelegate gs;
 
     public ServerCommand(IServerWorkingCopy server, String name) {
         super(name);
@@ -37,17 +42,25 @@ public abstract class ServerCommand exte
 
     public IStatus execute(IProgressMonitor monitor, IAdaptable adapt) {
         execute();
-        return null;
+        return Status.OK_STATUS;
     }
 
     public abstract void undo();
 
     public IStatus undo(IProgressMonitor monitor, IAdaptable adapt) {
         undo();
-        return null;
+        return Status.OK_STATUS;
     }
 
     public IStatus redo(IProgressMonitor monitor, IAdaptable adapt) {
         return execute(monitor, adapt);
     }
+    
+    protected GeronimoServerDelegate getGeronimoServerDelegate() {
+        gs = (GeronimoServerDelegate) server.getAdapter(GeronimoServerDelegate.class);
+        if (gs == null) {
+            gs = (GeronimoServerDelegate) server.loadAdapter(GeronimoServerDelegate.class, new NullProgressMonitor());
+        }
+        return gs;
+    }
 }

Added: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v30/ui/commands/SetPropertyCommand.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/commands/SetPropertyCommand.java?rev=1459957&view=auto
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v30/ui/commands/SetPropertyCommand.java (added)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v30/ui/commands/SetPropertyCommand.java Fri Mar 22 19:50:37 2013
@@ -0,0 +1,109 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.geronimo.st.v30.ui.commands;
+
+import java.lang.reflect.Method;
+
+import org.apache.geronimo.st.v30.core.GeronimoServerDelegate;
+import org.apache.geronimo.st.v30.ui.Activator;
+import org.apache.geronimo.st.v30.ui.internal.Trace;
+import org.eclipse.core.commands.operations.AbstractOperation;
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.wst.server.core.IServerWorkingCopy;
+
+public class SetPropertyCommand extends AbstractOperation {
+    
+    protected final IServerWorkingCopy server;
+    protected GeronimoServerDelegate gs;
+    
+    protected Object newValue;
+    protected Object oldValue;
+    
+    private final String propertyName;
+    private final Class<?> propertyType;
+    
+    private Method getterMethod;
+    private Method setterMethod;
+
+    public SetPropertyCommand(IServerWorkingCopy server, String propertyName, Class<?> propertyType, Object newValue) {
+        super(propertyName);
+        this.server = server;
+        this.propertyName = propertyName;
+        this.propertyType = propertyType;
+        this.newValue = newValue;
+    }
+
+    private void init() throws Exception {
+        try {
+            this.getterMethod = GeronimoServerDelegate.class.getMethod("get" + propertyName);
+        } catch (NoSuchMethodException e) {
+            this.getterMethod = GeronimoServerDelegate.class.getMethod("is" + propertyName);
+        }
+        
+        String setterName = "set" + propertyName;
+        this.setterMethod = GeronimoServerDelegate.class.getMethod(setterName, new Class[] {propertyType} );
+    }
+    
+    public IStatus execute(IProgressMonitor monitor, IAdaptable adapt) {
+        try {
+            init();
+        } catch (Exception e) {
+            Trace.trace(Trace.ERROR, "Internal operation error", e, Activator.logUi);
+            return new Status(Status.ERROR, Activator.PLUGIN_ID, "Internal operation error", e);
+        }
+        
+        GeronimoServerDelegate gs = getGeronimoServerDelegate();
+        
+        try {
+            oldValue = getterMethod.invoke(gs);
+            setterMethod.invoke(gs, new Object[] {newValue});
+        } catch (Exception e) {
+            Trace.trace(Trace.ERROR, "Error setting " + propertyName + " property", e, Activator.logUi);
+            return new Status(Status.ERROR, Activator.PLUGIN_ID, "Error setting " + propertyName + " property", e);
+        } 
+        
+        return Status.OK_STATUS;
+    }
+
+    public IStatus undo(IProgressMonitor monitor, IAdaptable adapt) {
+        if (gs != null) {
+            try {
+                setterMethod.invoke(gs, new Object[] {oldValue});
+            } catch (Exception e) {
+                Trace.trace(Trace.ERROR, "Error unsetting " + propertyName + " property", e, Activator.logUi);
+                return new Status(Status.ERROR, Activator.PLUGIN_ID, "Error unsetting " + propertyName + " property", e);
+            } 
+        }
+        return Status.OK_STATUS;
+    }
+
+    public IStatus redo(IProgressMonitor monitor, IAdaptable adapt) {
+        return execute(monitor, adapt);
+    }
+    
+    protected GeronimoServerDelegate getGeronimoServerDelegate() {
+        gs = (GeronimoServerDelegate) server.getAdapter(GeronimoServerDelegate.class);
+        if (gs == null) {
+            gs = (GeronimoServerDelegate) server.loadAdapter(GeronimoServerDelegate.class, new NullProgressMonitor());
+        }
+        return gs;
+    }
+}

Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v30/ui/commands/SetPropertyCommand.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v30/ui/commands/SetPropertyCommand.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v30/ui/commands/SetPropertyCommand.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v30/ui/commands/SetPublishTimeoutCommand.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/commands/SetPublishTimeoutCommand.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/commands/SetPublishTimeoutCommand.java (original)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v30/ui/commands/SetPublishTimeoutCommand.java Fri Mar 22 19:50:37 2013
@@ -16,42 +16,39 @@
  */
 package org.apache.geronimo.st.v30.ui.commands;
 
-import org.apache.geronimo.st.v30.core.GeronimoServerDelegate;
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.swt.widgets.Spinner;
 import org.eclipse.wst.server.core.IServerWorkingCopy;
+
 /**
  * @version $Rev$ $Date$
  *
  * Command to change the server's auto-publish setting.
  */
-public class SetPublishTimeoutCommand extends ServerCommand {
-    protected long timeOut;
-    protected long oldTimeOut;
-
+public class SetPublishTimeoutCommand extends SetPropertyCommand {
+    
+    private Spinner spinner;
+    
     /**
      * SetServerAutoPublishDefaultCommand constructor.
      *
      * @param server a server
      * @param time a publish time
      */
-    public SetPublishTimeoutCommand(IServerWorkingCopy server, long timeOut) {
-        super(server, "SetServerAutoPublishTimeOutCommand");
-        this.timeOut = timeOut;
-    }
-
-    /**
-     * Execute the command.
-     */
-    public void execute() {
-        GeronimoServerDelegate gs = (GeronimoServerDelegate) server.getAdapter(GeronimoServerDelegate.class);
-        oldTimeOut = gs.getPublishTimeout();
-        gs.setPublishTimeout(timeOut);
+    public SetPublishTimeoutCommand(IServerWorkingCopy server, Spinner spinner) {
+        super(server, "PublishTimeout", long.class, spinner.getSelection() * 1000);
+        this.spinner = spinner;
     }
 
-    /**
-     * Undo the command.
-     */
-    public void undo() {
-        GeronimoServerDelegate gs = (GeronimoServerDelegate) server.getAdapter(GeronimoServerDelegate.class);
-        gs.setPublishTimeout(oldTimeOut);
+    public IStatus undo(IProgressMonitor monitor, IAdaptable adapt) {
+        IStatus status = super.undo(monitor, adapt);
+        if (status.isOK()) {
+            int value = (int) ((Long)oldValue).longValue() / 1000;
+            spinner.setSelection(value);
+        }
+        return status;
     }
+    
 }

Added: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v30/ui/commands/TextSetPropertyCommand.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/commands/TextSetPropertyCommand.java?rev=1459957&view=auto
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v30/ui/commands/TextSetPropertyCommand.java (added)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v30/ui/commands/TextSetPropertyCommand.java Fri Mar 22 19:50:37 2013
@@ -0,0 +1,43 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.geronimo.st.v30.ui.commands;
+
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.swt.widgets.Text;
+import org.eclipse.wst.server.core.IServerWorkingCopy;
+
+public class TextSetPropertyCommand extends SetPropertyCommand {
+    
+    private Text text;
+
+    public TextSetPropertyCommand(IServerWorkingCopy server, String propertyName, Class<?> propertyType, Object newValue, Text text) {
+        super(server, propertyName, propertyType, newValue);
+        this.text = text;
+    }
+
+    public IStatus undo(IProgressMonitor monitor, IAdaptable adapt) {
+        IStatus status = super.undo(monitor, adapt);
+        if (status.isOK()) {
+            text.setData("undo");
+            text.setText(String.valueOf(oldValue));
+        }
+        return status;
+    }
+
+}

Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v30/ui/commands/TextSetPropertyCommand.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v30/ui/commands/TextSetPropertyCommand.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v30/ui/commands/TextSetPropertyCommand.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v30/ui/internal/GeronimoServerWizardFragment.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/internal/GeronimoServerWizardFragment.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/internal/GeronimoServerWizardFragment.java (original)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v30/ui/internal/GeronimoServerWizardFragment.java Fri Mar 22 19:50:37 2013
@@ -18,12 +18,7 @@ package org.apache.geronimo.st.v30.ui.in
 
 import org.apache.geronimo.st.v30.core.GeronimoServerDelegate;
 import org.apache.geronimo.st.v30.ui.Activator;
-import org.eclipse.jface.viewers.CellEditor;
-import org.eclipse.jface.viewers.ColumnWeightData;
-import org.eclipse.jface.viewers.ICellModifier;
-import org.eclipse.jface.viewers.TableLayout;
-import org.eclipse.jface.viewers.TableViewer;
-import org.eclipse.jface.viewers.TextCellEditor;
+import org.apache.geronimo.st.v30.ui.sections.PortEditor;
 import org.eclipse.swt.SWT;
 import org.eclipse.swt.events.ModifyEvent;
 import org.eclipse.swt.events.ModifyListener;
@@ -31,14 +26,9 @@ import org.eclipse.swt.layout.GridData;
 import org.eclipse.swt.layout.GridLayout;
 import org.eclipse.swt.widgets.Composite;
 import org.eclipse.swt.widgets.Group;
-import org.eclipse.swt.widgets.Item;
 import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Table;
-import org.eclipse.swt.widgets.TableColumn;
-import org.eclipse.swt.widgets.TableItem;
 import org.eclipse.swt.widgets.Text;
 import org.eclipse.wst.server.core.IServerWorkingCopy;
-import org.eclipse.wst.server.core.ServerPort;
 import org.eclipse.wst.server.core.TaskModel;
 import org.eclipse.wst.server.ui.wizard.IWizardHandle;
 import org.eclipse.wst.server.ui.wizard.WizardFragment;
@@ -54,10 +44,6 @@ public class GeronimoServerWizardFragmen
 
     protected Text password;
 
-    protected Table ports;
-
-    protected TableViewer viewer;
-
     /* (non-Javadoc)
      * @see org.eclipse.wst.server.ui.wizard.WizardFragment#hasComposite()
      */
@@ -124,98 +110,59 @@ public class GeronimoServerWizardFragmen
 		Group portsGroup = new Group(parent, SWT.SHADOW_IN);
 		portsGroup.setText(Messages.specifyPorts);
 		
-		portsGroup.setLayout(new GridLayout(2, true));
-		GridData gd = new GridData();
-		gd.verticalIndent = 15;
-		gd.horizontalAlignment = GridData.FILL;
-		gd.horizontalSpan = 2;
-		portsGroup.setLayoutData(gd);
-		// ports
-		ports = new Table(portsGroup, SWT.V_SCROLL | SWT.H_SCROLL
-				| SWT.FULL_SELECTION);
-		ports.setHeaderVisible(true);
-		ports.setLinesVisible(false);
-
-		TableColumn col = new TableColumn(ports, SWT.NONE);
-		col.setText(Messages.portName);
-		col.setResizable(false);
-		ColumnWeightData colData = new ColumnWeightData(15, 100, false);
-		TableLayout tableLayout = new TableLayout();
-		tableLayout.addColumnData(colData);
-
-		col = new TableColumn(ports, SWT.NONE);
-		col.setText(Messages.portValue);
-		col.setResizable(false);
-		colData = new ColumnWeightData(8, 100, false);
-		tableLayout.addColumnData(colData);
-
-
-        GridData data = new GridData(GridData.FILL_HORIZONTAL
-                | GridData.VERTICAL_ALIGN_FILL);
-        data.horizontalSpan = 2;
-        data.heightHint = 100;
-        ports.setLayoutData(data);
-        ports.setLayout(tableLayout);
-
-        viewer = new TableViewer(ports);
-        viewer.setColumnProperties(new String[] { "name", "port" });
-
-        fillTable(ports);
-        addCellEditor(ports);
-    }
-
-    private void addCellEditor(Table ports) {
-        viewer.setCellEditors(new CellEditor[] { null,
-                new TextCellEditor(ports) });
-
-        ICellModifier cellModifier = new ICellModifier() {
-            public Object getValue(Object element, String property) {
-                ServerPort sp = (ServerPort) element;
-                return sp.getPort() + "";
-            }
+        GridLayout layout = new GridLayout();
+        layout.numColumns = 3;
+        layout.marginHeight = 5;
+        layout.marginWidth = 10;
+        layout.verticalSpacing = 5;
+        layout.horizontalSpacing = 15;
+        portsGroup.setLayout(layout);
+        
+        GridData gd = new GridData();
+        gd.verticalIndent = 15;
+        gd.horizontalAlignment = GridData.FILL;
+        gd.horizontalSpan = 2;
+        portsGroup.setLayoutData(gd);
 
-            public boolean canModify(Object element, String property) {
-                return "port".equals(property);
-            }
+		PortEditor editor = new ServerWizardPortEditor(getServer());
+		editor.init(portsGroup);
+    }
 
-            public void modify(Object element, String property, Object value) {
-                Item item = (Item) element;
-                ServerPort sp = (ServerPort) item.getData();
-                GeronimoServerDelegate gs = getGeronimoServer();
-                gs.setInstanceProperty(sp.getId(), (String) value);
-                changePortNumber(sp.getId(), Integer.parseInt((String) value));
-            }
-        };
+    class ServerWizardPortEditor extends PortEditor {
 
-        viewer.setCellModifier(cellModifier);
-    }
+        public ServerWizardPortEditor(IServerWorkingCopy server) {
+            super(server);
+        }
 
-    private void fillTable(Table ports) {
-        ServerPort[] serverPorts = getServer().getServerPorts(null);
-        if (serverPorts != null) {
-            for (int i = 0; i < serverPorts.length; i++) {
-                ServerPort port = serverPorts[i];
-                TableItem item = new TableItem(ports, SWT.NONE);
-                String[] s = new String[] { port.getName(),
-                        Integer.toString(port.getPort()) };
-                item.setText(s);
-                item.setImage(Activator.getImage(Activator.IMG_PORT));
-                item.setData(port);
-            }
+        @Override
+        protected void setPortOffset(Text portOffset) {
+            getGeronimoServer().setPortOffset(Integer.parseInt(portOffset.getText()));
         }
-    }
 
-    protected void changePortNumber(String id, int port) {
-        TableItem[] items = ports.getItems();
-        int size = items.length;
-        for (int i = 0; i < size; i++) {
-            ServerPort sp = (ServerPort) items[i].getData();
-            if (sp.getId().equals(id)) {
-                items[i].setData(new ServerPort(id, sp.getName(), port, sp.getProtocol()));
-                items[i].setText(1, port + "");
-                return;
-            }
+        @Override
+        protected void setRmiPort(Text rmiPort) {
+            getGeronimoServer().setRMINamingPort(rmiPort.getText());
+        }
+
+        @Override
+        protected void setHttpPort(Text httpPort) {
+            getGeronimoServer().setHTTPPort(httpPort.getText());
+        }
+
+        @Override
+        protected Label createLabel(Composite parent, String text) {
+            Label label = new Label(parent, SWT.NONE);
+            label.setText(text);
+            return label;
+        }
+
+        @Override
+        protected Text createText(Composite parent, String value, int style) {
+            Text text = new Text(parent, style);
+            text.setText(value);
+            return text;
         }
+        
     }
 
     private String getServerName() {

Modified: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v30/ui/internal/Messages.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/internal/Messages.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/internal/Messages.java (original)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v30/ui/internal/Messages.java Fri Mar 22 19:50:37 2013
@@ -89,6 +89,7 @@ public class Messages extends NLS {
     public static String debug;
     public static String httpPort;
     public static String rmiPort;
+    public static String portOffset;
     public static String username;
     public static String password;
     public static String console;

Modified: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v30/ui/internal/Messages.properties
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/internal/Messages.properties?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/internal/Messages.properties (original)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v30/ui/internal/Messages.properties Fri Mar 22 19:50:37 2013
@@ -92,6 +92,7 @@ editorSectionPortsTitle=Port Configurati
 editorSectionPortsDescription=Specify the ports for this server instance.
 httpPort=HTTP Port:
 rmiPort=RMI Naming Port:
+portOffset=Port Offset:
 
 editorSectionLogLevelTitle=Console Output
 editorSectionLogLevelDescription=Select the server console output log level.

Added: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v30/ui/sections/PortEditor.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/PortEditor.java?rev=1459957&view=auto
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v30/ui/sections/PortEditor.java (added)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v30/ui/sections/PortEditor.java Fri Mar 22 19:50:37 2013
@@ -0,0 +1,149 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.geronimo.st.v30.ui.sections;
+
+import org.apache.geronimo.st.v30.core.GeronimoServerDelegate;
+import org.apache.geronimo.st.v30.ui.NumericVerifyListener;
+import org.apache.geronimo.st.v30.ui.internal.Messages;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.ModifyEvent;
+import org.eclipse.swt.events.ModifyListener;
+import org.eclipse.swt.graphics.Font;
+import org.eclipse.swt.graphics.FontData;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Text;
+import org.eclipse.wst.server.core.IServerWorkingCopy;
+
+public abstract class PortEditor {
+    
+    private IServerWorkingCopy server;
+    private Text portOffset;
+    private Text httpPort;
+    private Text rmiPort;
+    private Label rmiPortLabel;
+    private Label httpPortLabel;
+
+    public PortEditor(IServerWorkingCopy server) { 
+        this.server = server;
+    }
+    
+    public void init(Composite composite) {
+
+        final GeronimoServerDelegate delegate = getGeronimoServer();
+        
+        // ------- Label and text field for the port offset -------
+        createLabel(composite, Messages.portOffset);
+
+        portOffset = createText(composite, String.valueOf(delegate.getPortOffset()), SWT.BORDER);
+        portOffset.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
+        portOffset.addModifyListener(new ModifyListener() {
+            public void modifyText(ModifyEvent e) {
+                if (portOffset.getData() == null) {
+                    setPortOffset(portOffset);
+                } else {
+                    portOffset.setData(null);
+                }
+                httpPortLabel.setText(getActualHttpPortText());
+                rmiPortLabel.setText(getActualRmiPortText());
+            }
+        });
+        portOffset.addVerifyListener(new NumericVerifyListener());
+        
+        createLabel(composite, "");
+        
+        
+        // ------- Label and text field for the http port -------
+        createLabel(composite, Messages.httpPort);
+
+        httpPort = createText(composite, delegate.getHTTPPort(), SWT.BORDER);
+        httpPort.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
+        httpPort.addModifyListener(new ModifyListener() {
+            public void modifyText(ModifyEvent e) {
+                if (httpPort.getData() == null) {
+                    setHttpPort(httpPort);
+                } else {
+                    httpPort.setData(null);
+                }
+                httpPortLabel.setText(getActualHttpPortText());
+            }
+        });
+        httpPort.addVerifyListener(new NumericVerifyListener());
+        
+        httpPortLabel = createItalicLabel(composite, getActualHttpPortText());
+        httpPortLabel.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false));
+        
+        // ------- Label and text field for the rmi port -------
+        createLabel(composite, Messages.rmiPort);
+
+        rmiPort = createText(composite, delegate.getRMINamingPort(), SWT.BORDER);
+        rmiPort.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false));
+        rmiPort.addModifyListener(new ModifyListener() {
+            public void modifyText(ModifyEvent e) {
+                if (rmiPort.getData() == null) {
+                    setRmiPort(rmiPort);
+                } else {
+                    rmiPort.setData(null);
+                }
+                rmiPortLabel.setText(getActualRmiPortText());
+            }
+        });
+        rmiPort.addVerifyListener(new NumericVerifyListener());
+        
+        rmiPortLabel = createItalicLabel(composite, getActualRmiPortText());
+        rmiPortLabel.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false));
+    }
+
+    private String getActualRmiPortText() {
+        GeronimoServerDelegate delegate = getGeronimoServer();
+        return "Actual: " + delegate.getActualRMINamingPort() + "  ";
+    }
+    
+    private String getActualHttpPortText() {
+        GeronimoServerDelegate delegate = getGeronimoServer();
+        return "Actual: " + delegate.getActualHTTPPort() + "  ";
+    }
+    
+    protected abstract void setPortOffset(Text portOffset);
+    
+    protected abstract void setRmiPort(Text rmiPort);
+
+    protected abstract void setHttpPort(Text httpPort);
+    
+    
+
+    protected Label createItalicLabel(Composite parent, String text) {
+        Label l =  createLabel(parent, text);
+        FontData fontData = l.getFont().getFontData()[0];
+        Font font = new Font(l.getDisplay(), new FontData(fontData.getName(), fontData.getHeight(), SWT.ITALIC));
+        l.setFont(font);
+        return l;
+    }
+    
+    protected abstract Label createLabel(Composite parent, String text);
+    
+    protected abstract Text createText(Composite parent, String value, int style);
+     
+    protected GeronimoServerDelegate getGeronimoServer() {
+        GeronimoServerDelegate gs = (GeronimoServerDelegate) server.getAdapter(GeronimoServerDelegate.class);
+        if (gs == null)
+            gs = (GeronimoServerDelegate) server.loadAdapter(GeronimoServerDelegate.class, null);
+        return gs;
+    }
+
+}   

Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v30/ui/sections/PortEditor.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v30/ui/sections/PortEditor.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v30/ui/sections/PortEditor.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v30/ui/sections/ServerEditorCleanOSGiBundleCacheSection.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/ServerEditorCleanOSGiBundleCacheSection.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/ServerEditorCleanOSGiBundleCacheSection.java (original)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v30/ui/sections/ServerEditorCleanOSGiBundleCacheSection.java Fri Mar 22 19:50:37 2013
@@ -17,7 +17,7 @@
 package org.apache.geronimo.st.v30.ui.sections;
 
 import org.apache.geronimo.st.v30.core.GeronimoServerDelegate;
-import org.apache.geronimo.st.v30.ui.commands.SetCleanOSGiBundleCacheCommand;
+import org.apache.geronimo.st.v30.ui.commands.CheckSetPropertyCommand;
 import org.apache.geronimo.st.v30.ui.internal.Messages;
 import org.eclipse.swt.SWT;
 import org.eclipse.swt.events.SelectionEvent;
@@ -76,7 +76,11 @@ public class ServerEditorCleanOSGiBundle
         cleanOGSiBundelCache.addSelectionListener(new SelectionListener() {
 
             public void widgetSelected(SelectionEvent e) {
-                execute(new SetCleanOSGiBundleCacheCommand(server, cleanOGSiBundelCache.getSelection()));
+                if (cleanOGSiBundelCache.getData() == null) {
+                    execute(new CheckSetPropertyCommand(server, "CleanOSGiBundleCache", cleanOGSiBundelCache));
+                } else {
+                    cleanOGSiBundelCache.setData(null);
+                }
             }
 
             public void widgetDefaultSelected(SelectionEvent e) {

Modified: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v30/ui/sections/ServerEditorKarafShellSection.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/ServerEditorKarafShellSection.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/ServerEditorKarafShellSection.java (original)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v30/ui/sections/ServerEditorKarafShellSection.java Fri Mar 22 19:50:37 2013
@@ -17,10 +17,9 @@
 package org.apache.geronimo.st.v30.ui.sections;
 
 import org.apache.geronimo.st.v30.core.GeronimoServerDelegate;
-import org.apache.geronimo.st.v30.ui.commands.SetKarafShellCommand;
-import org.apache.geronimo.st.v30.ui.commands.SetKarafShellKeepAliveCommand;
-import org.apache.geronimo.st.v30.ui.commands.SetKarafShellPortCommand;
-import org.apache.geronimo.st.v30.ui.commands.SetKarafShellTimeoutCommand;
+import org.apache.geronimo.st.v30.ui.NumericVerifyListener;
+import org.apache.geronimo.st.v30.ui.commands.CheckSetPropertyCommand;
+import org.apache.geronimo.st.v30.ui.commands.TextSetPropertyCommand;
 import org.apache.geronimo.st.v30.ui.internal.Messages;
 import org.eclipse.jface.dialogs.MessageDialog;
 import org.eclipse.swt.SWT;
@@ -125,7 +124,11 @@ public class ServerEditorKarafShellSecti
             }
             
             private void executeAndEnableWidgets() {
-                execute(new SetKarafShellCommand(server, enable.getSelection()));
+                if (enable.getData() == null) {
+                    execute(new CheckSetPropertyCommand(server, "KarafShell", enable));
+                } else {
+                    enable.setData(null);
+                }
                 timeout.setEnabled(enable.getSelection());
                 keepAlive.setEnabled(enable.getSelection());
                 port.setEnabled(enable.getSelection());
@@ -139,10 +142,16 @@ public class ServerEditorKarafShellSecti
         timeout.setToolTipText(Messages.karafShellTimeout);
         timeout.addModifyListener(new ModifyListener() {
             public void modifyText(ModifyEvent e) {
-                Integer value = Integer.valueOf(timeout.getText());
-                execute(new SetKarafShellTimeoutCommand(server, timeout, value));
+                if (timeout.getData() == null) {
+                    int value = Integer.parseInt(timeout.getText());
+                    execute(new TextSetPropertyCommand(server, "KarafShellTimeout", int.class, value, timeout));
+                } else {
+                    timeout.setData(null);
+                }
             }
         });
+        timeout.addVerifyListener(new NumericVerifyListener());
+        
         // create keep alive field
         createLabel(subComp1, Messages.karafShellkeepAlive, toolkit);
         keepAlive = toolkit.createText(subComp1, Integer.toString(gsdCopy.getKarafShellKeepAlive()), SWT.BORDER);
@@ -150,10 +159,16 @@ public class ServerEditorKarafShellSecti
         keepAlive.setToolTipText(Messages.karafShellkeepAlive);
         keepAlive.addModifyListener(new ModifyListener() {
             public void modifyText(ModifyEvent e) {
-                Integer value = Integer.valueOf(keepAlive.getText());
-                execute(new SetKarafShellKeepAliveCommand(server, keepAlive, value));
+                if (keepAlive.getData() == null) {
+                    int value = Integer.parseInt(keepAlive.getText());
+                    execute(new TextSetPropertyCommand(server, "KarafShellKeepAlive", int.class, value, keepAlive));
+                } else {
+                    keepAlive.setData(null);
+                }
             }
         });
+        keepAlive.addVerifyListener(new NumericVerifyListener());
+        
         // create port field
         createLabel(subComp1, Messages.karafShellPort, toolkit);
         port = toolkit.createText(subComp1, Integer.toString(gsdCopy.getKarafShellPort()), SWT.BORDER);
@@ -161,9 +176,14 @@ public class ServerEditorKarafShellSecti
         port.setToolTipText(Messages.karafShellPort);
         port.addModifyListener(new ModifyListener() {
             public void modifyText(ModifyEvent e) {
-                Integer value = Integer.valueOf(port.getText());
-                execute(new SetKarafShellPortCommand(server, port, value));
+                if (port.getData() == null) {
+                    int value = Integer.parseInt(port.getText());
+                    execute(new TextSetPropertyCommand(server, "KarafShellPort", int.class, value, port));
+                } else {
+                    port.setData(null);
+                }
             }
         });
+        port.addVerifyListener(new NumericVerifyListener());
     }
 }

Modified: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v30/ui/sections/ServerEditorPortsSection.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/ServerEditorPortsSection.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/ServerEditorPortsSection.java (original)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v30/ui/sections/ServerEditorPortsSection.java Fri Mar 22 19:50:37 2013
@@ -16,29 +16,24 @@
  */
 package org.apache.geronimo.st.v30.ui.sections;
 
-import org.apache.geronimo.st.v30.ui.commands.SetHTTPPortCommand;
-import org.apache.geronimo.st.v30.ui.commands.SetRMIPortCommand;
+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;
-import org.eclipse.swt.events.ModifyListener;
 import org.eclipse.swt.layout.GridData;
 import org.eclipse.swt.layout.GridLayout;
 import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Label;
 import org.eclipse.swt.widgets.Text;
 import org.eclipse.ui.forms.widgets.ExpandableComposite;
 import org.eclipse.ui.forms.widgets.FormToolkit;
 import org.eclipse.ui.forms.widgets.Section;
+import org.eclipse.wst.server.core.IServerWorkingCopy;
 
 /**
  * @version $Rev$ $Date$
  */
 public class ServerEditorPortsSection extends AbstractServerEditorSection {
-
-    Text httpPort;
-
-    Text rmiPort;
-
+    
     public ServerEditorPortsSection() {
         super();
     }
@@ -58,8 +53,9 @@ public class ServerEditorPortsSection ex
         section.setLayoutData(new GridData(SWT.FILL, SWT.FILL, false, false));
 
         Composite composite = toolkit.createComposite(section);
+        
         GridLayout layout = new GridLayout();
-        layout.numColumns = 2;
+        layout.numColumns = 3;
         layout.marginHeight = 5;
         layout.marginWidth = 10;
         layout.verticalSpacing = 5;
@@ -67,42 +63,47 @@ public class ServerEditorPortsSection ex
         composite.setLayout(layout);
         composite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false));
         section.setClient(composite);
+        
+        PortEditor editor = new ServerEditorPortEditor(toolkit, server);
+        editor.init(composite);
+    }
 
-        // ------- Label and text field for the http port -------
-        createLabel(composite, Messages.httpPort, toolkit);
+    private class ServerEditorPortEditor extends PortEditor {
 
-        httpPort = toolkit.createText(composite, getHTTPPort(), SWT.BORDER);
-        httpPort.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
-        httpPort.addModifyListener(new ModifyListener() {
-            public void modifyText(ModifyEvent e) {
-                execute(new SetHTTPPortCommand(server, httpPort.getText()));
-            }
-        });
-
-        // ------- Label and text field for the rmi port -------
-        createLabel(composite, Messages.rmiPort, toolkit);
-
-        rmiPort = toolkit.createText(composite, getRMIPort(), SWT.BORDER);
-        rmiPort.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false));
-        rmiPort.addModifyListener(new ModifyListener() {
-            public void modifyText(ModifyEvent e) {
-                execute(new SetRMIPortCommand(server, rmiPort.getText()));
-            }
-        });
-    }
+        FormToolkit toolkit;
+        
+        public ServerEditorPortEditor(FormToolkit toolkit, IServerWorkingCopy server) {
+            super(server);
+            this.toolkit = toolkit;
+        }
+        
+        @Override
+        protected Text createText(Composite parent, String value, int style) {
+            return toolkit.createText(parent, value, style);
+        }
+        
+        @Override
+        protected Label createLabel(Composite parent, String value) {
+            return ServerEditorPortsSection.this.createLabel(parent, value, toolkit);
+        }
+        
+        @Override
+        protected void setPortOffset(Text portOffset) {
+            int value = Integer.parseInt(portOffset.getText());
+            execute(new TextSetPropertyCommand(server, "PortOffset", int.class, value, portOffset));
+        }
 
-    private String getHTTPPort() {
-        if (gs != null) {
-            return gs.getHTTPPort();
+        @Override
+        protected void setRmiPort(Text rmiPort) {
+            String value = rmiPort.getText();
+            execute(new TextSetPropertyCommand(server, "RMINamingPort", String.class, value, rmiPort));
         }
-        return "";
-    }
 
-    private String getRMIPort() {
-        if (gs != null) {
-            return gs.getRMINamingPort();
+        @Override
+        protected void setHttpPort(Text httpPort) {
+            String value = httpPort.getText();
+            execute(new TextSetPropertyCommand(server, "HTTPPort", String.class, value, httpPort));
         }
-        return "";
     }
 
 }

Modified: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v30/ui/sections/ServerEditorPublishAdvancedSection.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/ServerEditorPublishAdvancedSection.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/ServerEditorPublishAdvancedSection.java (original)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v30/ui/sections/ServerEditorPublishAdvancedSection.java Fri Mar 22 19:50:37 2013
@@ -17,10 +17,9 @@
 package org.apache.geronimo.st.v30.ui.sections;
 
 import org.apache.geronimo.st.v30.core.GeronimoServerDelegate;
-import org.apache.geronimo.st.v30.ui.commands.SetNoRedeployCommand;
+import org.apache.geronimo.st.v30.ui.commands.CheckSetPropertyCommand;
 import org.apache.geronimo.st.v30.ui.commands.SetNoRedeployFilePatternCommand;
 import org.apache.geronimo.st.v30.ui.commands.SetPublishTimeoutCommand;
-import org.apache.geronimo.st.v30.ui.commands.SetRefreshOSGiBundleCommand;
 import org.apache.geronimo.st.v30.ui.internal.Messages;
 import org.apache.geronimo.st.v30.ui.wizards.ListEditorWizard;
 import org.eclipse.jface.wizard.Wizard;
@@ -86,13 +85,17 @@ public class ServerEditorPublishAdvanced
 
         publishTimeout = new Spinner(composite, SWT.BORDER);
         publishTimeout.setMinimum(0);
-        publishTimeout.setIncrement(5);
-        publishTimeout.setMaximum(900);
+        publishTimeout.setIncrement(60);
+        publishTimeout.setMaximum(60 * 60 * 4); // 4 hours
         publishTimeout.setSelection((int) gs.getPublishTimeout() / 1000);
 
         publishTimeout.addModifyListener(new ModifyListener() {
             public void modifyText(ModifyEvent e) {
-                execute(new SetPublishTimeoutCommand(server, publishTimeout.getSelection() * 1000));
+                if (publishTimeout.getData() == null) {
+                    execute(new SetPublishTimeoutCommand(server, publishTimeout));
+                } else {
+                    publishTimeout.setData(null);
+                }
             }
         });
                 
@@ -100,7 +103,11 @@ public class ServerEditorPublishAdvanced
         refreshOSGiBundle.setSelection(gs.isRefreshOSGiBundle());
         refreshOSGiBundle.addSelectionListener(new SelectionAdapter() {
             public void widgetSelected(SelectionEvent e) {
-                execute(new SetRefreshOSGiBundleCommand(server, refreshOSGiBundle.getSelection()));
+                if (refreshOSGiBundle.getData() == null) {
+                    execute(new CheckSetPropertyCommand(server, "RefreshOSGiBundle", refreshOSGiBundle));
+                } else {
+                    refreshOSGiBundle.setData(null);
+                }
             }
         });
         Label refreshOSGiLabel = toolkit.createLabel(composite, Messages.refreshOSGiBundleDescription, SWT.WRAP);
@@ -175,7 +182,11 @@ public class ServerEditorPublishAdvanced
         noRedeploy.setEnabled(!(server.getServerType().supportsRemoteHosts() && !SocketUtil.isLocalhost(server.getHost())));
         noRedeploy.addSelectionListener(new SelectionListener() {
             public void widgetSelected(SelectionEvent e) {
-                execute(new SetNoRedeployCommand(server, noRedeploy.getSelection()));                
+                if (noRedeploy.getData() == null) {
+                    execute(new CheckSetPropertyCommand(server, "NoRedeploy", noRedeploy));
+                } else {
+                    noRedeploy.setData(null);
+                }
                 includesEditor.setEnabled(noRedeploy.getSelection());
                 excludesEditor.setEnabled(noRedeploy.getSelection());
             }
@@ -184,6 +195,7 @@ public class ServerEditorPublishAdvanced
             }
 
         });
+
         noRedeploy.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false, 2, 1));
 
         Label noRedeployLabel = toolkit.createLabel(composite, Messages.noRedeployOptionDescription, SWT.WRAP);

Modified: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v30/ui/sections/ServerEditorSecuritySection.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/ServerEditorSecuritySection.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/ServerEditorSecuritySection.java (original)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v30/ui/sections/ServerEditorSecuritySection.java Fri Mar 22 19:50:37 2013
@@ -19,8 +19,7 @@ package org.apache.geronimo.st.v30.ui.se
 import org.apache.geronimo.st.v30.core.operations.GeronimoAccountManager;
 import org.apache.geronimo.st.v30.ui.Activator;
 import org.apache.geronimo.st.v30.ui.CommonMessages;
-import org.apache.geronimo.st.v30.ui.commands.SetPasswordCommand;
-import org.apache.geronimo.st.v30.ui.commands.SetUsernameCommand;
+import org.apache.geronimo.st.v30.ui.commands.TextSetPropertyCommand;
 import org.apache.geronimo.st.v30.ui.internal.Messages;
 import org.apache.geronimo.st.v30.ui.internal.Trace;
 import org.apache.geronimo.st.v30.ui.wizards.ManageAccountWizard;
@@ -37,7 +36,6 @@ import org.eclipse.swt.layout.GridLayout
 import org.eclipse.swt.widgets.Button;
 import org.eclipse.swt.widgets.Composite;
 import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Label;
 import org.eclipse.swt.widgets.Text;
 import org.eclipse.ui.forms.widgets.ExpandableComposite;
 import org.eclipse.ui.forms.widgets.FormToolkit;
@@ -96,7 +94,12 @@ public class ServerEditorSecuritySection
         username.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
         username.addModifyListener(new ModifyListener() {
             public void modifyText(ModifyEvent e) {
-                execute(new SetUsernameCommand(server, username.getText()));
+                if (username.getData() == null) {
+                    String value = username.getText();
+                    execute(new TextSetPropertyCommand(server, "AdminID", String.class, value, username));
+                } else {
+                    username.setData(null);
+                }
             }
         });
 
@@ -107,7 +110,12 @@ public class ServerEditorSecuritySection
         password.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false));
         password.addModifyListener(new ModifyListener() {
             public void modifyText(ModifyEvent e) {
-                execute(new SetPasswordCommand(server, password.getText()));
+                if (password.getData() == null) {
+                    String value = password.getText();
+                    execute(new TextSetPropertyCommand(server, "AdminPassword", String.class, value, password));
+                } else {
+                    password.setData(null);
+                }
             }
         });
         // ----- Button manage account -----



Mime
View raw message