Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRob Stryker2016-10-05 22:25:26 +0000
committerRob Stryker2016-10-07 23:55:09 +0000
commite9265e8cceaa2f6477c3b0a2ba91e8705de71ee7 (patch)
tree81972efc61fcbe571b300aaff953d2e298feb4a2
parent52bfc2f58180260a6f827a4af568092220e963f4 (diff)
downloadwebtools.servertools-e9265e8cceaa2f6477c3b0a2ba91e8705de71ee7.tar.gz
webtools.servertools-e9265e8cceaa2f6477c3b0a2ba91e8705de71ee7.tar.xz
webtools.servertools-e9265e8cceaa2f6477c3b0a2ba91e8705de71ee7.zip
[481726] - setDefaults is being called too often in new server wizard
[481726] - changed method name and re-instated past behavior [481726] - updates copyright, version, and other small fixes Change-Id: I83b0bd968b17e17f9b697db5b88a02580c1fc0c9 Signed-off-by: Rob Stryker <stryker@redhat.com>
-rw-r--r--plugins/org.eclipse.wst.server.core/META-INF/MANIFEST.MF2
-rw-r--r--plugins/org.eclipse.wst.server.core/pom.xml2
-rw-r--r--plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/ServerWorkingCopy.java30
-rw-r--r--plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/model/ServerDelegate.java17
-rw-r--r--plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/wizard/page/NewManualServerComposite.java4
5 files changed, 46 insertions, 9 deletions
diff --git a/plugins/org.eclipse.wst.server.core/META-INF/MANIFEST.MF b/plugins/org.eclipse.wst.server.core/META-INF/MANIFEST.MF
index 58c9c4c64..5d0d47cc8 100644
--- a/plugins/org.eclipse.wst.server.core/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.wst.server.core/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-SymbolicName: org.eclipse.wst.server.core; singleton:=true
-Bundle-Version: 1.8.100.qualifier
+Bundle-Version: 1.9.0.qualifier
Bundle-Activator: org.eclipse.wst.server.core.internal.ServerPlugin
Bundle-Vendor: %providerName
Bundle-Localization: plugin
diff --git a/plugins/org.eclipse.wst.server.core/pom.xml b/plugins/org.eclipse.wst.server.core/pom.xml
index 7244b2248..4bedb776b 100644
--- a/plugins/org.eclipse.wst.server.core/pom.xml
+++ b/plugins/org.eclipse.wst.server.core/pom.xml
@@ -22,6 +22,6 @@
<groupId>org.eclipse.webtools.servertools</groupId>
<artifactId>org.eclipse.wst.server.core</artifactId>
- <version>1.8.100-SNAPSHOT</version>
+ <version>1.9.0-SNAPSHOT</version>
<packaging>eclipse-plugin</packaging>
</project>
diff --git a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/ServerWorkingCopy.java b/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/ServerWorkingCopy.java
index 92358d714..54e318453 100644
--- a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/ServerWorkingCopy.java
+++ b/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/ServerWorkingCopy.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2003, 2015 IBM Corporation and others.
+ * Copyright (c) 2003, 2016 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -30,6 +30,7 @@ import org.eclipse.wst.server.core.model.InternalInitializer;
import org.eclipse.wst.server.core.model.PublishOperation;
import org.eclipse.wst.server.core.model.ServerBehaviourDelegate;
import org.eclipse.wst.server.core.model.ServerDelegate;
+
/**
*
*/
@@ -659,9 +660,9 @@ public class ServerWorkingCopy extends Server implements IServerWorkingCopy {
}
/**
- * Sets the defaults for this server, including the name. This method should be
- * called when creating a server, or when any major settings (e.g. runtime, host)
- * change.
+ * Sets the defaults for this server, including the name.
+ *
+ * This method will only be called when creating a new server.
*
* @param monitor a progress monitor, or null
*/
@@ -675,6 +676,27 @@ public class ServerWorkingCopy extends Server implements IServerWorkingCopy {
}
}
}
+
+ /**
+ * The new server's host or runtime has changed.
+ *
+ * This method allows delegates to reset the default values
+ * for the server in the context of the new runtime and host combination.
+ *
+ * This method should only be called when creating a new server.
+ *
+ * @param monitor a progress monitor, or null
+ */
+ public void newServerDetailsChanged(IProgressMonitor monitor) {
+ try {
+ getWorkingCopyDelegate(monitor).newServerDetailsChanged(monitor);
+ } catch (Exception e) {
+ if (Trace.SEVERE) {
+ Trace.trace(Trace.STRING_SEVERE, "Error calling delegate newServerDetailsChanged() " + toString(), e);
+ }
+ }
+ }
+
public void renameFiles(IProgressMonitor monitor) throws CoreException {
if (getServerConfiguration() != null) {
diff --git a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/model/ServerDelegate.java b/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/model/ServerDelegate.java
index d34d417aa..93ddf913a 100644
--- a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/model/ServerDelegate.java
+++ b/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/model/ServerDelegate.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2005, 2010 IBM Corporation and others.
+ * Copyright (c) 2005, 2016 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -275,6 +275,21 @@ public abstract class ServerDelegate {
}
/**
+ * The new server's host or runtime has changed.
+ *
+ * This method allows subclasses to reset the default values
+ * for the server in the context of the new runtime and host combination.
+ *
+ * This method should only be called when creating a new server.
+ *
+ * @param monitor a progress monitor, or null
+ * @since 1.9
+ */
+ public void newServerDetailsChanged(IProgressMonitor monitor) {
+ setDefaults(monitor);
+ }
+
+ /**
* Sets the value of the specified integer-valued attribute of this
* element.
*
diff --git a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/wizard/page/NewManualServerComposite.java b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/wizard/page/NewManualServerComposite.java
index 0e24fb3a8..73891164a 100644
--- a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/wizard/page/NewManualServerComposite.java
+++ b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/wizard/page/NewManualServerComposite.java
@@ -491,7 +491,7 @@ public class NewManualServerComposite extends Composite implements IUIControlLis
server = cache.getCachedServer(serverType, isLocalhost);
if (server != null) {
server.setHost(host);
- ((ServerWorkingCopy)server).setDefaults(null);
+ ((ServerWorkingCopy)server).newServerDetailsChanged(null);
runtime = server.getRuntime();
listener.runtimeSelected(runtime);
fireServerWorkingCopyChanged();
@@ -654,7 +654,7 @@ public class NewManualServerComposite extends Composite implements IUIControlLis
runtime = runtime2;
if (server != null) {
server.setRuntime(runtime);
- ((ServerWorkingCopy)server).setDefaults(null);
+ ((ServerWorkingCopy)server).newServerDetailsChanged(null);
if (!serverNameModified) {
updatingServerName = true;
serverName.setText(server.getName());

Back to the top