geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sppa...@apache.org
Subject svn commit: r395023 - in /geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v1.ui/src/org/apache/geronimo/st/v1/ui/internal: GeronimoServerRuntimeWizardFragment.java Messages.java Messages.properties
Date Tue, 18 Apr 2006 20:19:28 GMT
Author: sppatel
Date: Tue Apr 18 13:19:26 2006
New Revision: 395023

URL: http://svn.apache.org/viewcvs?rev=395023&view=rev
Log:
GERONIMODEVTOOLS-78

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

Modified: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v1.ui/src/org/apache/geronimo/st/v1/ui/internal/GeronimoServerRuntimeWizardFragment.java
URL: http://svn.apache.org/viewcvs/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v1.ui/src/org/apache/geronimo/st/v1/ui/internal/GeronimoServerRuntimeWizardFragment.java?rev=395023&r1=395022&r2=395023&view=diff
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v1.ui/src/org/apache/geronimo/st/v1/ui/internal/GeronimoServerRuntimeWizardFragment.java
(original)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v1.ui/src/org/apache/geronimo/st/v1/ui/internal/GeronimoServerRuntimeWizardFragment.java
Tue Apr 18 13:19:26 2006
@@ -15,6 +15,7 @@
  */
 package org.apache.geronimo.st.v1.ui.internal;
 
+import java.io.File;
 import java.lang.reflect.InvocationTargetException;
 import java.util.HashMap;
 import java.util.List;
@@ -266,25 +267,37 @@
 		getRuntimeDelegate().setServerDefinitionId(runtime.getRuntimeType().getId());
 		getRuntimeDelegate().setServerInstanceProperties(getValues());
 
-		IStatus status = runtimeWC.validate(null);
-		if (status == null || status.isOK()) {
-			getWizard().setMessage(null, IMessageProvider.NONE);
-			group.setEnabled(false);
+		if (installDir.getText() == null || installDir.getText().length() == 0) {
+			// installDir field has not been entered
+			getWizard().setMessage(Messages.installDirInfo, IMessageProvider.ERROR);
 		} else {
-			getWizard().setMessage(status.getMessage(), IMessageProvider.ERROR);
-			Path installPath = new Path(installDir.getText());
-			if (installPath.toFile().exists()) {
-				group.setEnabled(true);
+			IStatus status = runtimeWC.validate(null);
+			if (status == null || status.isOK()) {
+				getWizard().setMessage(null, IMessageProvider.NONE);
+				group.setEnabled(false);
+			} else {
+				File file = new Path(installDir.getText()).toFile();
+				if (file.isDirectory()) {
+					boolean canWrite = file.canWrite();
+					String message = canWrite ? Messages.noImageFound
+							: Messages.cannotInstallAtLocation;
+					if (canWrite)
+						group.setEnabled(true);
+					getWizard().setMessage(message, IMessageProvider.ERROR);
+				} else {
+					group.setEnabled(false);
+					getWizard().setMessage(Messages.noSuchDir, IMessageProvider.ERROR);
+				}
+				return;
 			}
-			return;
-		}
 
-		if (!isValidVM()) {
-			getWizard().setMessage(Messages.jvmWarning, IMessageProvider.WARNING);
-			return;
-		}
+			if (!isValidVM()) {
+				getWizard().setMessage(Messages.jvmWarning, IMessageProvider.WARNING);
+				return;
+			}
 
-		getWizard().setMessage(null, IMessageProvider.NONE);
+			getWizard().setMessage(null, IMessageProvider.NONE);
+		}
 
 		// validateDecorators();
 	}

Modified: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v1.ui/src/org/apache/geronimo/st/v1/ui/internal/Messages.java
URL: http://svn.apache.org/viewcvs/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v1.ui/src/org/apache/geronimo/st/v1/ui/internal/Messages.java?rev=395023&r1=395022&r2=395023&view=diff
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v1.ui/src/org/apache/geronimo/st/v1/ui/internal/Messages.java
(original)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v1.ui/src/org/apache/geronimo/st/v1/ui/internal/Messages.java
Tue Apr 18 13:19:26 2006
@@ -160,6 +160,10 @@
 	public static String serverWizardDescription;
 	public static String browse;
 	public static String installDir;
+	public static String installDirInfo;
+	public static String noSuchDir;
+	public static String noImageFound;
+	public static String cannotInstallAtLocation;
 	public static String downloadOptions;
 	public static String chooseWebContainer;
 	public static String gWithTomcat;

Modified: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v1.ui/src/org/apache/geronimo/st/v1/ui/internal/Messages.properties
URL: http://svn.apache.org/viewcvs/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v1.ui/src/org/apache/geronimo/st/v1/ui/internal/Messages.properties?rev=395023&r1=395022&r2=395023&view=diff
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v1.ui/src/org/apache/geronimo/st/v1/ui/internal/Messages.properties
(original)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v1.ui/src/org/apache/geronimo/st/v1/ui/internal/Messages.properties
Tue Apr 18 13:19:26 2006
@@ -159,6 +159,10 @@
 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:
+installDirInfo=Please enter the directory where Geronimo is currently installed or where
you would like it to be installed.
+noSuchDir=The specified directory does not exist.
+noImageFound=A Geronimo installation does not exist at this location.
+cannotInstallAtLocation=A Geronimo installation does not exist and cannot be installed at
this location.
 downloadOptions=Download Options
 chooseWebContainer=Select a web container:
 gWithTomcat=Geronimo with Tomcat



Mime
View raw message