incubator-sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From stefane...@apache.org
Subject svn commit: r1521426 - /sling/trunk/tooling/ide/eclipse-ui/src/org/apache/sling/ide/eclipse/ui/wizards/np/SetupServerWizardPage.java
Date Tue, 10 Sep 2013 10:26:53 GMT
Author: stefanegli
Date: Tue Sep 10 10:26:52 2013
New Revision: 1521426

URL: http://svn.apache.org/r1521426
Log:
SLING-3032 : choosing better defaults and setting 'installLocally' property accordingly

Modified:
    sling/trunk/tooling/ide/eclipse-ui/src/org/apache/sling/ide/eclipse/ui/wizards/np/SetupServerWizardPage.java

Modified: sling/trunk/tooling/ide/eclipse-ui/src/org/apache/sling/ide/eclipse/ui/wizards/np/SetupServerWizardPage.java
URL: http://svn.apache.org/viewvc/sling/trunk/tooling/ide/eclipse-ui/src/org/apache/sling/ide/eclipse/ui/wizards/np/SetupServerWizardPage.java?rev=1521426&r1=1521425&r2=1521426&view=diff
==============================================================================
--- sling/trunk/tooling/ide/eclipse-ui/src/org/apache/sling/ide/eclipse/ui/wizards/np/SetupServerWizardPage.java
(original)
+++ sling/trunk/tooling/ide/eclipse-ui/src/org/apache/sling/ide/eclipse/ui/wizards/np/SetupServerWizardPage.java
Tue Sep 10 10:26:52 2013
@@ -209,9 +209,9 @@ public class SetupServerWizardPage exten
 		};
 		useExistingServer.addSelectionListener(radioListener);
 		setupNewServer.addSelectionListener(radioListener);
-	    useExistingServer.setSelection(true);
-	    setupNewServer.setSelection(false);
-	    installToolingSupportBundle.setSelection(false);
+	    useExistingServer.setSelection(false);
+	    setupNewServer.setSelection(true);
+	    installToolingSupportBundle.setSelection(true);
 	    
 	    ModifyListener ml = new ModifyListener() {
 			
@@ -383,20 +383,28 @@ public class SetupServerWizardPage exten
 				}
 			}
 			
-			if (installToolingSupportBundle.getSelection() && !containsToolingSupportBundle())
{
-				// then auto-install it if possible
-				try {
-					int status = installToolingSupportBundle();
-					
-					if (status!=HttpStatus.SC_OK) {
+			boolean installedLocally = false;
+			if (installToolingSupportBundle.getSelection()) {
+				if (containsToolingSupportBundle()) {
+					// then nothing to overwrite
+					installedLocally = true;
+				} else {
+					// then auto-install it if possible
+					try {
+						int status = installToolingSupportBundle();
+						
+						if (status!=HttpStatus.SC_OK) {
+							MessageDialog.openError(getShell(), "Could not install sling tooling support bundle",

+									"Could not install sling tooling support bundle: "+status);
+						} else {
+							installedLocally = true;
+						}
+					} catch (IOException e) {
+						//TODO proper logging
+						e.printStackTrace();
 						MessageDialog.openError(getShell(), "Could not install sling tooling support bundle",

-								"Could not install sling tooling support bundle: "+status);
+								"Could not install sling tooling support bundle: "+e.getMessage());
 					}
-				} catch (IOException e) {
-					//TODO proper logging
-					e.printStackTrace();
-					MessageDialog.openError(getShell(), "Could not install sling tooling support bundle",

-							"Could not install sling tooling support bundle: "+e.getMessage());
 				}
 			}
 			
@@ -409,6 +417,7 @@ public class SetupServerWizardPage exten
 				wc.setName(newServerName.getText() + " (external)");
 				wc.setAttribute(ISlingLaunchpadServer.PROP_PORT, getPort());
 				wc.setAttribute(ISlingLaunchpadServer.PROP_DEBUG_PORT, Integer.parseInt(newServerDebugPort.getText()));
+				wc.setAttribute(ISlingLaunchpadServer.PROP_INSTALL_LOCALLY, installedLocally);
 				wc.setAttribute("auto-publish-setting", 2); // 2: automatically publish when resources
change
 				wc.setAttribute("auto-publish-time", 0);    // 0: zero delay after a resource change
(and the builder was kicked, I guess)
 				wc.setRuntime(runtime);



Mime
View raw message