[237700] Editor fixes for null runtime
diff --git a/plugins/org.eclipse.jst.server.tomcat.core/META-INF/MANIFEST.MF b/plugins/org.eclipse.jst.server.tomcat.core/META-INF/MANIFEST.MF
index 483b539..05a23f6 100644
--- a/plugins/org.eclipse.jst.server.tomcat.core/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.jst.server.tomcat.core/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@
Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-SymbolicName: org.eclipse.jst.server.tomcat.core; singleton:=true
-Bundle-Version: 1.1.101.qualifier
+Bundle-Version: 1.1.102.qualifier
Bundle-Activator: org.eclipse.jst.server.tomcat.core.internal.TomcatPlugin
Bundle-Vendor: %providerName
Bundle-Localization: plugin
diff --git a/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/TomcatServer.java b/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/TomcatServer.java
index 6e488b3..b296e35 100644
--- a/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/TomcatServer.java
+++ b/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/TomcatServer.java
@@ -227,7 +227,8 @@
*/
public boolean isServeModulesWithoutPublish() {
// If feature is supported, return current setting
- if (getTomcatVersionHandler().supportsServeModulesWithoutPublish())
+ ITomcatVersionHandler tvh = getTomcatVersionHandler();
+ if (tvh != null && tvh.supportsServeModulesWithoutPublish())
return getAttribute(PROPERTY_SERVE_MODULES_WITHOUT_PUBLISH, false);
return false;
}
@@ -240,7 +241,8 @@
*/
public boolean isSaveSeparateContextFiles() {
// If feature is supported, return current setting
- if (getTomcatVersionHandler().supportsSeparateContextFiles())
+ ITomcatVersionHandler tvh = getTomcatVersionHandler();
+ if (tvh != null && tvh.supportsSeparateContextFiles())
return getAttribute(PROPERTY_SAVE_SEPARATE_CONTEXT_FILES, false);
return false;
}
diff --git a/plugins/org.eclipse.jst.server.tomcat.ui/META-INF/MANIFEST.MF b/plugins/org.eclipse.jst.server.tomcat.ui/META-INF/MANIFEST.MF
index 281a304..fb60e90 100644
--- a/plugins/org.eclipse.jst.server.tomcat.ui/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.jst.server.tomcat.ui/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@
Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-SymbolicName: org.eclipse.jst.server.tomcat.ui; singleton:=true
-Bundle-Version: 1.1.100.qualifier
+Bundle-Version: 1.1.101.qualifier
Bundle-Activator: org.eclipse.jst.server.tomcat.ui.internal.TomcatUIPlugin
Bundle-Vendor: %providerName
Bundle-Localization: plugin
diff --git a/plugins/org.eclipse.jst.server.tomcat.ui/tomcatui/org/eclipse/jst/server/tomcat/ui/internal/editor/ServerGeneralEditorSection.java b/plugins/org.eclipse.jst.server.tomcat.ui/tomcatui/org/eclipse/jst/server/tomcat/ui/internal/editor/ServerGeneralEditorSection.java
index 1833854..da5372c 100644
--- a/plugins/org.eclipse.jst.server.tomcat.ui/tomcatui/org/eclipse/jst/server/tomcat/ui/internal/editor/ServerGeneralEditorSection.java
+++ b/plugins/org.eclipse.jst.server.tomcat.ui/tomcatui/org/eclipse/jst/server/tomcat/ui/internal/editor/ServerGeneralEditorSection.java
@@ -230,7 +230,7 @@
updating = true;
ITomcatVersionHandler tvh = tomcatServer.getTomcatVersionHandler();
- boolean supported = tvh.supportsServeModulesWithoutPublish();
+ boolean supported = tvh != null && tvh.supportsServeModulesWithoutPublish();
String label = NLS.bind(Messages.serverEditorNoPublish,
supported ? "" : Messages.serverEditorNotSupported);
noPublish.setText(label);
@@ -240,7 +240,7 @@
else
noPublish.setEnabled(true);
- supported = tvh.supportsSeparateContextFiles();
+ supported = tvh != null && tvh.supportsSeparateContextFiles();
label = NLS.bind(Messages.serverEditorSeparateContextFiles,
supported ? "" : Messages.serverEditorNotSupported);
separateContextFiles.setText(label);
@@ -252,7 +252,7 @@
secure.setSelection(tomcatServer.isSecure());
- supported = tvh.supportsDebugArgument();
+ supported = tvh != null && tvh.supportsDebugArgument();
label = NLS.bind(Messages.serverEditorDebugMode,
supported ? "" : Messages.serverEditorNotSupported);
debug.setText(label);
diff --git a/plugins/org.eclipse.jst.server.tomcat.ui/tomcatui/org/eclipse/jst/server/tomcat/ui/internal/editor/ServerLocationEditorSection.java b/plugins/org.eclipse.jst.server.tomcat.ui/tomcatui/org/eclipse/jst/server/tomcat/ui/internal/editor/ServerLocationEditorSection.java
index 9a05182..d061897 100644
--- a/plugins/org.eclipse.jst.server.tomcat.ui/tomcatui/org/eclipse/jst/server/tomcat/ui/internal/editor/ServerLocationEditorSection.java
+++ b/plugins/org.eclipse.jst.server.tomcat.ui/tomcatui/org/eclipse/jst/server/tomcat/ui/internal/editor/ServerLocationEditorSection.java
@@ -449,18 +449,16 @@
protected void updateServerDirButtons() {
if (tomcatServer.getInstanceDirectory() == null) {
IPath path = tomcatServer.getRuntimeBaseDirectory();
- if (path.equals(installDirPath)) {
+ if (path != null && path.equals(installDirPath)) {
serverDirInstall.setSelection(true);
serverDirMetadata.setSelection(false);
serverDirCustom.setSelection(false);
- }
- else {
+ } else {
serverDirMetadata.setSelection(true);
serverDirInstall.setSelection(false);
serverDirCustom.setSelection(false);
}
- }
- else {
+ } else {
serverDirCustom.setSelection(true);
serverDirMetadata.setSelection(false);
serverDirInstall.setSelection(false);
@@ -476,7 +474,9 @@
protected void updateServerDir() {
IPath path = tomcatServer.getRuntimeBaseDirectory();
- if (workspacePath.isPrefixOf(path)) {
+ if (path == null)
+ serverDir.setText("");
+ else if (workspacePath.isPrefixOf(path)) {
int cnt = path.matchingFirstSegments(workspacePath);
path = path.removeFirstSegments(cnt).setDevice(null);
serverDir.setText(path.toOSString());
@@ -485,8 +485,7 @@
if (tomcatServer.isTestEnvironment() && tomcatServer.getInstanceDirectory() == null)
tempDirPath = path;
}
- }
- else
+ } else
serverDir.setText(path.toOSString());
}
@@ -581,7 +580,7 @@
else {
IPath path = tomcatServer.getRuntimeBaseDirectory();
// If non-custom instance dir is not the install and metadata isn't the selection, return error
- if (!path.equals(installDirPath) && !serverDirMetadata.getSelection()) {
+ if (path != null && !path.equals(installDirPath) && !serverDirMetadata.getSelection()) {
setErrorMessage(NLS.bind(Messages.errorServerDirCustomNotMetadata,
NLS.bind(Messages.serverEditorServerDirMetadata, "").trim()));
}
diff --git a/plugins/org.eclipse.wst.server.ui/META-INF/MANIFEST.MF b/plugins/org.eclipse.wst.server.ui/META-INF/MANIFEST.MF
index 7a0f756..8815a61 100644
--- a/plugins/org.eclipse.wst.server.ui/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.wst.server.ui/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@
Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-SymbolicName: org.eclipse.wst.server.ui; singleton:=true
-Bundle-Version: 1.1.0.qualifier
+Bundle-Version: 1.1.1.qualifier
Bundle-Activator: org.eclipse.wst.server.ui.internal.ServerUIPlugin
Bundle-Vendor: %providerName
Bundle-Localization: plugin
diff --git a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/editor/OverviewEditorPart.java b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/editor/OverviewEditorPart.java
index 6bd3a89..29539cf 100644
--- a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/editor/OverviewEditorPart.java
+++ b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/editor/OverviewEditorPart.java
@@ -393,7 +393,7 @@
// runtime
if (server != null && server.getServerType() != null && server.getServerType().hasRuntime()) {
final IRuntime runtime = server.getRuntime();
- if (ServerUIPlugin.hasWizardFragment(runtime.getRuntimeType().getId())) {
+ if (runtime != null && ServerUIPlugin.hasWizardFragment(runtime.getRuntimeType().getId())) {
Hyperlink link = toolkit.createHyperlink(composite, Messages.serverEditorOverviewRuntime, SWT.NONE);
link.addHyperlinkListener(new HyperlinkAdapter() {
public void linkActivated(HyperlinkEvent e) {