 (defn- open-browser
   "Open a browser for the running labrepl web page"
   [monitor]
-	(if (wait-for-resource check-server *timeout* *step* monitor)
+	(if (wait-for-resource check-server "REPL" *timeout* *step* monitor)
 	   (let
 		  [browser-support (.getBrowserSupport (PlatformUI/getWorkbench))
 		   browser

	        (if resource
	          resource
	          (try
              (println (str "Remaing wait time " self-timeout))
              (.subTask sub-monitor (str "Remaing wait time " self-timeout))
	            (Thread/sleep step)
	            (.worked sub-monitor 1)
	            (recur (- self-timeout step))

      project (config-new-project root project-name (.newChild progress 10))
      page-state @(.state page)
      run-lein-deps (.getSelection (:run-lein-deps-button page-state))
      run-repl (.getSelection (:run-repl-button page-state))]
        (.subTask progress "Doing imports")
		    (do-imports project (.newChild progress 30) overwrite-query)
		    (.worked progress 1)
		    (if run-lein-deps
		      (let
		        [leiningen-pfile (.toOSString (.getLocation (.getFile project "project.clj")))
		          labrepl-leiningen-project (read-project (str leiningen-pfile))]
            (println "run-lein-deps is true")
            (binding [lancet/ant-project (make-ant-project-with-progress progress)]
              (.subTask progress "Running  \"lein deps\"")
			        (deps labrepl-leiningen-project)
              (.worked progress 1)
              
              (.subTask progress "Fixing classpath")
			        (fix-libraries project)
              (.worked progress 1)
              
			        (if run-repl
			         (let
                [startup-file-selection (StructuredSelection. (.getFile (.getFolder project "src") "labrepl.clj"))
                  repl-browser-job 
                    (proxy [WorkbenchJob] ["Setup of Labrepl Project"]
		                  (runInUIThread [monitor]
		                    (let
                          [job-progress (SubMonitor/convert monitor 100)]
	                        (.subTask job-progress "Launching REPL")
						              (.launch (ClojureLaunchShortcut.) startup-file-selection ILaunchManager/RUN_MODE)
			                    (.worked job-progress 1)
			                    
													(let [console (wait-for-resource #(ClojureClient/findActiveReplConsole) "Console" *timeout* *step* (.newChild job-progress 30))]
			                      (if console
			                        (do
				                        (EvaluateTextAction/evaluateText console "(labrepl/-main)")
													      (open-browser (.newChild job-progress 30)))
			                        Status/CANCEL_STATUS)))))]
                  (println "run-repl is true")
                  (.schedule repl-browser-job))))))))

(defn -run
  [this monitor]
