[110455] Downloadable runtimes
diff --git a/plugins/org.eclipse.jst.server.tomcat.ui/tomcatui/org/eclipse/jst/server/tomcat/ui/internal/Messages.java b/plugins/org.eclipse.jst.server.tomcat.ui/tomcatui/org/eclipse/jst/server/tomcat/ui/internal/Messages.java
index 06957d3..a3bb1c8 100644
--- a/plugins/org.eclipse.jst.server.tomcat.ui/tomcatui/org/eclipse/jst/server/tomcat/ui/internal/Messages.java
+++ b/plugins/org.eclipse.jst.server.tomcat.ui/tomcatui/org/eclipse/jst/server/tomcat/ui/internal/Messages.java
@@ -20,6 +20,7 @@
 	public static String runtimeName;
 	public static String installDir;
 	public static String browse;
+	public static String install;
 	public static String selectInstallDir;
 	public static String installedJRE;
 	public static String installedJREs;
diff --git a/plugins/org.eclipse.jst.server.tomcat.ui/tomcatui/org/eclipse/jst/server/tomcat/ui/internal/Messages.properties b/plugins/org.eclipse.jst.server.tomcat.ui/tomcatui/org/eclipse/jst/server/tomcat/ui/internal/Messages.properties
index 3b7825c..ce26994 100644
--- a/plugins/org.eclipse.jst.server.tomcat.ui/tomcatui/org/eclipse/jst/server/tomcat/ui/internal/Messages.properties
+++ b/plugins/org.eclipse.jst.server.tomcat.ui/tomcatui/org/eclipse/jst/server/tomcat/ui/internal/Messages.properties
@@ -13,6 +13,7 @@
 
 runtimeName=Na&me:
 browse=B&rowse...
+install=Ins&tall...
 installDir=Tomcat installation &directory:
 installedJRE=&JRE:
 installedJREs=&Installed JREs...
diff --git a/plugins/org.eclipse.jst.server.tomcat.ui/tomcatui/org/eclipse/jst/server/tomcat/ui/internal/TomcatRuntimeComposite.java b/plugins/org.eclipse.jst.server.tomcat.ui/tomcatui/org/eclipse/jst/server/tomcat/ui/internal/TomcatRuntimeComposite.java
index 6055d44..5e63578 100644
--- a/plugins/org.eclipse.jst.server.tomcat.ui/tomcatui/org/eclipse/jst/server/tomcat/ui/internal/TomcatRuntimeComposite.java
+++ b/plugins/org.eclipse.jst.server.tomcat.ui/tomcatui/org/eclipse/jst/server/tomcat/ui/internal/TomcatRuntimeComposite.java
@@ -14,6 +14,7 @@
 import java.util.List;
 
 import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.NullProgressMonitor;
 import org.eclipse.core.runtime.Path;
 import org.eclipse.jdt.launching.IVMInstall;
 import org.eclipse.jdt.launching.IVMInstallType;
@@ -43,6 +44,8 @@
 import org.eclipse.ui.PlatformUI;
 
 import org.eclipse.wst.server.core.IRuntimeWorkingCopy;
+import org.eclipse.wst.server.core.internal.IInstallableRuntime;
+import org.eclipse.wst.server.core.internal.ServerPlugin;
 import org.eclipse.wst.server.ui.wizard.IWizardHandle;
 /**
  * Wizard page to set the server install directory.
@@ -130,7 +133,7 @@
 				validate();
 			}
 		});
-	
+		
 		Button browse = SWTUtil.createButton(this, Messages.browse);
 		browse.addSelectionListener(new SelectionAdapter() {
 			public void widgetSelected(SelectionEvent se) {
@@ -143,6 +146,29 @@
 			}
 		});
 		
+		label = new Label(this, SWT.NONE);
+		
+		if (ServerPlugin.getInstallableRuntimes().length > 0) {
+			Button install = SWTUtil.createButton(this, Messages.install);
+			install.addSelectionListener(new SelectionAdapter() {
+				public void widgetSelected(SelectionEvent se) {
+					DirectoryDialog dialog = new DirectoryDialog(TomcatRuntimeComposite.this.getShell());
+					dialog.setMessage(Messages.selectInstallDir);
+					dialog.setFilterPath(installDir.getText());
+					String selectedDirectory = dialog.open();
+					if (selectedDirectory != null) {
+						try {
+							IInstallableRuntime ir = ServerPlugin.getInstallableRuntimes()[0];
+							ir.install(new Path(selectedDirectory), new NullProgressMonitor());
+						} catch (Exception e) {
+							e.printStackTrace();
+						}
+						installDir.setText(selectedDirectory);
+					}
+				}
+			});
+		}
+		
 		updateJREs();
 		
 		// JDK location