geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sppa...@apache.org
Subject svn commit: r351554 - /geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.ui/src/org/apache/geronimo/ui/actions/LaunchGeronimoConsoleAction.java
Date Fri, 02 Dec 2005 01:44:37 GMT
Author: sppatel
Date: Thu Dec  1 17:44:34 2005
New Revision: 351554

URL: http://svn.apache.org/viewcvs?rev=351554&view=rev
Log:
fix launching console

Modified:
    geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.ui/src/org/apache/geronimo/ui/actions/LaunchGeronimoConsoleAction.java

Modified: geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.ui/src/org/apache/geronimo/ui/actions/LaunchGeronimoConsoleAction.java
URL: http://svn.apache.org/viewcvs/geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.ui/src/org/apache/geronimo/ui/actions/LaunchGeronimoConsoleAction.java?rev=351554&r1=351553&r2=351554&view=diff
==============================================================================
--- geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.ui/src/org/apache/geronimo/ui/actions/LaunchGeronimoConsoleAction.java
(original)
+++ geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.ui/src/org/apache/geronimo/ui/actions/LaunchGeronimoConsoleAction.java
Thu Dec  1 17:44:34 2005
@@ -18,6 +18,8 @@
 import java.net.MalformedURLException;
 import java.net.URL;
 
+import org.apache.geronimo.core.internal.GeronimoSchemaNS;
+import org.apache.geronimo.core.internal.GeronimoServer;
 import org.apache.geronimo.ui.internal.Messages;
 import org.eclipse.jface.action.IAction;
 import org.eclipse.jface.viewers.ISelection;
@@ -35,17 +37,19 @@
  */
 public class LaunchGeronimoConsoleAction implements IActionDelegate {
 
-    public static final String serverID = "org.eclipse.jst.server.geronimo.10";
+    public static final String serverID = "org.apache.geronimo.generic.server.10";
+    
+    private IServer server;
 
-    /**
-     * 
-     */
     public LaunchGeronimoConsoleAction() {
         super();
     }
     
     public URL getConsoleUrl() throws MalformedURLException {
-        return new URL("http://localhost:8080/console/login.jsp");
+    	if(server != null ) {
+    		return new URL("http://" + server.getHost() + ":" + ((GeronimoServer) server).getHTTPPort()
+ "/console/");
+    	}
+        return null;
     }
 
     /*
@@ -58,7 +62,9 @@
         try {
             int style = IWorkbenchBrowserSupport.AS_EDITOR | IWorkbenchBrowserSupport.LOCATION_BAR
| IWorkbenchBrowserSupport.STATUS;
             IWebBrowser browser = WorkbenchBrowserSupport.getInstance().createBrowser(style,
"console", Messages.console, Messages.consoleTooltip);
-            browser.openURL(getConsoleUrl());
+            URL url = getConsoleUrl();
+            if(url != null) 
+            	browser.openURL(url);
         } catch (MalformedURLException e) {
             e.printStackTrace();
         } catch (PartInitException e) {
@@ -75,7 +81,7 @@
      */
     public void selectionChanged(IAction action, ISelection selection) {
 
-        IServer server = (IServer) ((StructuredSelection) selection)
+        server = (IServer) ((StructuredSelection) selection)
                 .getFirstElement();
 
         boolean enable = server != null



Mime
View raw message