geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sppa...@apache.org
Subject svn commit: r370260 - in /geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.ui/src/org/apache/geronimo/ui/internal: GeronimoServerRuntimeWizardFragment.java Messages.properties
Date Wed, 18 Jan 2006 21:13:20 GMT
Author: sppatel
Date: Wed Jan 18 13:13:17 2006
New Revision: 370260

URL: http://svn.apache.org/viewcvs?rev=370260&view=rev
Log:
add selection listener to install server button

Modified:
    geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.ui/src/org/apache/geronimo/ui/internal/GeronimoServerRuntimeWizardFragment.java
    geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.ui/src/org/apache/geronimo/ui/internal/Messages.properties

Modified: geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.ui/src/org/apache/geronimo/ui/internal/GeronimoServerRuntimeWizardFragment.java
URL: http://svn.apache.org/viewcvs/geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.ui/src/org/apache/geronimo/ui/internal/GeronimoServerRuntimeWizardFragment.java?rev=370260&r1=370259&r2=370260&view=diff
==============================================================================
--- geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.ui/src/org/apache/geronimo/ui/internal/GeronimoServerRuntimeWizardFragment.java
(original)
+++ geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.ui/src/org/apache/geronimo/ui/internal/GeronimoServerRuntimeWizardFragment.java
Wed Jan 18 13:13:17 2006
@@ -16,6 +16,7 @@
 package org.apache.geronimo.ui.internal;
 
 import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.core.runtime.Path;
 import org.eclipse.jst.server.generic.core.internal.GenericServerRuntime;
 import org.eclipse.jst.server.generic.ui.internal.GenericServerComposite;
 import org.eclipse.jst.server.generic.ui.internal.GenericServerCompositeDecorator;
@@ -53,6 +54,9 @@
 
 	private GenericServerCompositeDecorator[] fDecorators;
 	protected Text installDir;
+	
+	private Button tomcat;
+	private Button jetty;
 
 	public GeronimoServerRuntimeWizardFragment() {
 		super();
@@ -73,11 +77,8 @@
 	 * @see org.eclipse.jst.server.generic.ui.internal.ServerDefinitionTypeAwareWizardFragment#title()
 	 */
 	public String title() {
-		String rName = getRuntimeName();
-		if (rName == null || rName.length() < 1)
-			rName = "Generic";
 		return GenericServerUIMessages.bind(
-				GenericServerUIMessages.runtimeWizardTitle, rName);
+				GenericServerUIMessages.runtimeWizardTitle, getRuntimeName());
 	}
 
 	/*
@@ -93,11 +94,6 @@
 		GenericServerComposite composite = new GenericServerComposite(parent,
 				fDecorators);
 
-		IInstallableRuntime gWithTomcat = ServerPlugin
-				.findInstallableRuntime(G_WITH_TOMCAT_ID);
-		IInstallableRuntime gWithJetty = ServerPlugin
-				.findInstallableRuntime(G_WITH_JETTY_ID);
-
 		Label label = new Label(composite, SWT.NONE);
 		label.setText(Messages.installDir);
 		GridData data = new GridData();
@@ -115,11 +111,11 @@
 			}
 		});
 
-		final Composite parentComp = composite;
+		final Composite browseComp = composite;
 		Button browse = SWTUtil.createButton(composite, Messages.browse);
 		browse.addSelectionListener(new SelectionAdapter() {
 			public void widgetSelected(SelectionEvent se) {
-				DirectoryDialog dialog = new DirectoryDialog(parentComp
+				DirectoryDialog dialog = new DirectoryDialog(browseComp
 						.getShell());
 				dialog.setMessage(Messages.installDir);
 				dialog.setFilterPath(installDir.getText());
@@ -133,34 +129,62 @@
 		data = new GridData(GridData.FILL_BOTH);
 		data.horizontalSpan = 3;
 
-		Group group = new Group(composite, SWT.NONE);
-		group.setText(Messages.downloadOptions);
-		group.setLayoutData(data);
-		group.setLayout(composite.getLayout());
-
-		Label webContainer = new Label(group, SWT.NONE);
-		webContainer.setText(Messages.chooseWebContainer);
-		data = new GridData();
-		data.horizontalSpan = 3;
-		webContainer.setLayoutData(data);
-
-		Button tomcat = new Button(group, SWT.RADIO);
-		tomcat.setSelection(true);
-		tomcat.setText(Messages.gWithTomcat);
-		data = new GridData();
-		data.horizontalSpan = 3;
-		tomcat.setLayoutData(data);
-
-		Button jetty = new Button(group, SWT.RADIO);
-		jetty.setText(Messages.gWithJetty);
-		data = new GridData();
-		data.horizontalSpan = 3;
-		jetty.setLayoutData(data);
+		final IInstallableRuntime gWithTomcat = ServerPlugin
+				.findInstallableRuntime(G_WITH_TOMCAT_ID);
+		final IInstallableRuntime gWithJetty = ServerPlugin
+				.findInstallableRuntime(G_WITH_JETTY_ID);
 
-		Button install = SWTUtil.createButton(group, Messages.install);
-		data = new GridData();
-		data.horizontalSpan = 3;
-		install.setLayoutData(data);
+		if (gWithTomcat != null && gWithJetty != null) {
+			Group group = new Group(composite, SWT.NONE);
+			group.setText(Messages.downloadOptions);
+			group.setLayoutData(data);
+			group.setLayout(composite.getLayout());
+
+			Label webContainer = new Label(group, SWT.NONE);
+			webContainer.setText(Messages.chooseWebContainer);
+			data = new GridData();
+			data.horizontalSpan = 3;
+			webContainer.setLayoutData(data);
+
+			tomcat = new Button(group, SWT.RADIO);
+			tomcat.setSelection(true);
+			tomcat.setText(Messages.gWithTomcat);
+			data = new GridData();
+			data.horizontalSpan = 3;
+			tomcat.setLayoutData(data);
+
+			jetty = new Button(group, SWT.RADIO);
+			jetty.setText(Messages.gWithJetty);
+			data = new GridData();
+			data.horizontalSpan = 3;
+			jetty.setLayoutData(data);
+
+			Button install = SWTUtil.createButton(group, Messages.install);
+			data = new GridData();
+			data.horizontalSpan = 3;
+			install.setLayoutData(data);
+			
+			install.addSelectionListener(new SelectionAdapter() {
+				public void widgetSelected(SelectionEvent se) {
+					if (installDir != null && isValidLocation()) {
+						try {
+							if(tomcat.getSelection()) {
+								gWithTomcat.install(new Path(installDir.getText()), new NullProgressMonitor());
+							} else {
+								gWithJetty.install(new Path(installDir.getText()), new NullProgressMonitor());
+							}
+							//TODO update installDir
+						} catch (Exception e) {
+							Trace.trace(Trace.SEVERE, "Error installing runtime", e);
+						}
+					} 
+				}
+				
+				boolean isValidLocation() {
+					return true;
+				}
+			});
+		}
 
 	}
 

Modified: geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.ui/src/org/apache/geronimo/ui/internal/Messages.properties
URL: http://svn.apache.org/viewcvs/geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.ui/src/org/apache/geronimo/ui/internal/Messages.properties?rev=370260&r1=370259&r2=370260&view=diff
==============================================================================
--- geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.ui/src/org/apache/geronimo/ui/internal/Messages.properties
(original)
+++ geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.ui/src/org/apache/geronimo/ui/internal/Messages.properties
Wed Jan 18 13:13:17 2006
@@ -158,9 +158,9 @@
 
 serverWizardDescription=Specify the location of an existing 1.0 Geronimo installation.  If
none exists, specify an install location and press 'Download and Install'.
 browse=Browse
-installDir=Application Server Installation Directory
+installDir=Application Server Installation Directory:
 downloadOptions=Download Options
-chooseWebContainer=Select a web container
+chooseWebContainer=Select a web container:
 gWithTomcat=Geronimo with Tomcat
 gWithJetty=Geronimo with Jetty
 install=Download and Install



Mime
View raw message