[306430] New server wizard performance is poor
diff --git a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/wizard/fragment/ModifyModulesWizardFragment.java b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/wizard/fragment/ModifyModulesWizardFragment.java
index 498555d..fa2c8ce 100644
--- a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/wizard/fragment/ModifyModulesWizardFragment.java
+++ b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/wizard/fragment/ModifyModulesWizardFragment.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2003, 2007 IBM Corporation and others.
+ * Copyright (c) 2003, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -65,12 +65,13 @@
 	}
 
 	public List getChildFragments() {
-		updateModules();
 		return super.getChildFragments();
 	}
 
 	public void enter() {
 		updateModules();
+		// ask the composite to refresh
+		comp.refresh();
 	}
 
 	protected void updateModules() {
diff --git a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/wizard/page/ModifyModulesComposite.java b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/wizard/page/ModifyModulesComposite.java
index b22f4b3..d06dc07 100644
--- a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/wizard/page/ModifyModulesComposite.java
+++ b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/wizard/page/ModifyModulesComposite.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2003, 2009 IBM Corporation and others.
+ * Copyright (c) 2003, 2010 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -243,8 +243,6 @@
 	}
 
 	public void setServer(IServerAttributes server) {
-		if (isVisible())
-			return;
 		
 		// see bug 185875, 205869
 		if (refreshModules == taskModel.getObject(TASK_REFRESH_MODULES) && server == this.server) {
@@ -290,7 +288,7 @@
 		
 		// get currently deployed modules
 		IModule[] currentModules = server.getModules();
-		if (currentModules != null) {
+		if ((currentModules != null) && (currentModules.length > 0)) {
 			int size = currentModules.length;
 			for (int i = 0; i < size; i++) {
 				originalModules.add(currentModules[i]);
@@ -410,23 +408,31 @@
 
 	public void setVisible(boolean b) {
 		if (b) {
-			Display.getDefault().syncExec(new Runnable() {
-				public void run() {
-					if (availableTreeViewer == null || availableTreeViewer.getControl().isDisposed())
-						return;
-					try { // update trees if we can
-						availableTreeViewer.refresh();
-						deployedTreeViewer.refresh();
-						setEnablement();
-					} catch (Exception e) {
-						// ignore
-					}
-				}
-			});
+			this.refresh();
 		}
 		super.setVisible(b);
 	}
 
+	/**
+	 * Refresh the composite
+	 */
+	public void refresh() {
+
+		Display.getDefault().syncExec(new Runnable() {
+			public void run() {
+				if (availableTreeViewer == null || availableTreeViewer.getControl().isDisposed())
+					return;
+				try { // update trees if we can
+					availableTreeViewer.refresh();
+					deployedTreeViewer.refresh();
+					setEnablement();
+				} catch (Exception e) {
+					// ignore
+				}
+			}
+		});
+	}
+	
 	public void setTaskModel(TaskModel model) {
 		this.taskModel = model;
 	}