sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From romb...@apache.org
Subject svn commit: r1597170 - /sling/trunk/tooling/ide/eclipse-ui/src/org/apache/sling/ide/eclipse/ui/wizards/SetupServerWizardPage.java
Date Fri, 23 May 2014 20:08:00 GMT
Author: rombert
Date: Fri May 23 20:08:00 2014
New Revision: 1597170

URL: http://svn.apache.org/r1597170
Log:
SLING-3604 - Usability improvements in the Sling bundle module wizard

Preselect 'Add to existing server' if at least one server is defined.

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

Modified: sling/trunk/tooling/ide/eclipse-ui/src/org/apache/sling/ide/eclipse/ui/wizards/SetupServerWizardPage.java
URL: http://svn.apache.org/viewvc/sling/trunk/tooling/ide/eclipse-ui/src/org/apache/sling/ide/eclipse/ui/wizards/SetupServerWizardPage.java?rev=1597170&r1=1597169&r2=1597170&view=diff
==============================================================================
--- sling/trunk/tooling/ide/eclipse-ui/src/org/apache/sling/ide/eclipse/ui/wizards/SetupServerWizardPage.java
(original)
+++ sling/trunk/tooling/ide/eclipse-ui/src/org/apache/sling/ide/eclipse/ui/wizards/SetupServerWizardPage.java
Fri May 23 20:08:00 2014
@@ -152,23 +152,12 @@ public class SetupServerWizardPage exten
 	    
 	    SelectionAdapter radioListener = new SelectionAdapter() {
 			public void widgetSelected(SelectionEvent e) {
-                existingServerCombo.getWidget().setEnabled(useExistingServer.getSelection());
-				newServerName.setEnabled(setupNewServer.getSelection());
-				newServerHostnameName.setEnabled(setupNewServer.getSelection());
-				newServerPort.setEnabled(setupNewServer.getSelection());
-				newServerDebugPort.setEnabled(setupNewServer.getSelection());
-                newServerUsername.setEnabled(setupNewServer.getSelection());
-                newServerPassword.setEnabled(setupNewServer.getSelection());
-				installToolingSupportBundle.setEnabled(setupNewServer.getSelection());
+                updateEnablements();
 				dialogChanged();
 			}
         };
 		useExistingServer.addSelectionListener(radioListener);
 		setupNewServer.addSelectionListener(radioListener);
-	    useExistingServer.setSelection(false);
-        existingServerCombo.getWidget().setEnabled(false);
-	    setupNewServer.setSelection(true);
-	    installToolingSupportBundle.setSelection(true);
 	    
 	    ModifyListener ml = new ModifyListener() {
 			
@@ -197,6 +186,13 @@ public class SetupServerWizardPage exten
 		newServerPort.addKeyListener(kl);
 		newServerDebugPort.addModifyListener(ml);
 		newServerDebugPort.addKeyListener(kl);
+
+        useExistingServer.setSelection(existingServerCombo.hasServers());
+        existingServerCombo.getWidget().setEnabled(existingServerCombo.hasServers());
+        setupNewServer.setSelection(!existingServerCombo.hasServers());
+        installToolingSupportBundle.setSelection(true);
+
+        updateEnablements();
 		
 		setPageComplete(false);
 		setControl(container);
@@ -248,6 +244,18 @@ public class SetupServerWizardPage exten
 		updateStatus(null);
 	}
 
+    private void updateEnablements() {
+
+        existingServerCombo.getWidget().setEnabled(useExistingServer.getSelection());
+        newServerName.setEnabled(setupNewServer.getSelection());
+        newServerHostnameName.setEnabled(setupNewServer.getSelection());
+        newServerPort.setEnabled(setupNewServer.getSelection());
+        newServerDebugPort.setEnabled(setupNewServer.getSelection());
+        newServerUsername.setEnabled(setupNewServer.getSelection());
+        newServerPassword.setEnabled(setupNewServer.getSelection());
+        installToolingSupportBundle.setEnabled(setupNewServer.getSelection());
+    }
+
 	private void updateStatus(String message) {
 		setErrorMessage(message);
 		setPageComplete(message == null);



Mime
View raw message