geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sppa...@apache.org
Subject svn commit: r314981 - in /geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.ui/src/org/apache/geronimo/ui: actions/LaunchGeronimoConsoleAction.java internal/Messages.java internal/Messages.properties
Date Wed, 12 Oct 2005 18:03:59 GMT
Author: sppatel
Date: Wed Oct 12 11:03:54 2005
New Revision: 314981

URL: http://svn.apache.org/viewcvs?rev=314981&view=rev
Log:
reimplement run

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

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=314981&r1=314980&r2=314981&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
Wed Oct 12 11:03:54 2005
@@ -18,21 +18,22 @@
 import java.net.MalformedURLException;
 import java.net.URL;
 
+import org.apache.geronimo.ui.internal.Messages;
 import org.eclipse.jface.action.IAction;
 import org.eclipse.jface.viewers.ISelection;
 import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.ui.IObjectActionDelegate;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.ui.internal.browser.BrowserViewer;
-import org.eclipse.ui.internal.browser.WebBrowserEditor;
-import org.eclipse.ui.internal.browser.WebBrowserEditorInput;
+import org.eclipse.ui.IActionDelegate;
+import org.eclipse.ui.PartInitException;
+import org.eclipse.ui.browser.IWebBrowser;
+import org.eclipse.ui.browser.IWorkbenchBrowserSupport;
+import org.eclipse.ui.internal.browser.WorkbenchBrowserSupport;
 import org.eclipse.wst.server.core.IServer;
 
 /**
  * 
  * 
  */
-public class LaunchGeronimoConsoleAction implements IObjectActionDelegate {
+public class LaunchGeronimoConsoleAction implements IActionDelegate {
 
     public static final String serverID = "org.eclipse.jst.server.geronimo.10";
 
@@ -41,18 +42,10 @@
      */
     public LaunchGeronimoConsoleAction() {
         super();
-        // TODO Auto-generated constructor stub
     }
-
-    /*
-     * (non-Javadoc)
-     * 
-     * @see org.eclipse.ui.IObjectActionDelegate#setActivePart(org.eclipse.jface.action.IAction,
-     *      org.eclipse.ui.IWorkbenchPart)
-     */
-    public void setActivePart(IAction action, IWorkbenchPart targetPart) {
-        // TODO Auto-generated method stub
-
+    
+    public URL getConsoleUrl() throws MalformedURLException {
+        return new URL("http://localhost:8080/console/login.jsp");
     }
 
     /*
@@ -63,12 +56,13 @@
     public void run(IAction action) {
 
         try {
-            URL url = new URL("http://localhost:8080/console/login.jsp");
-            WebBrowserEditorInput input = new WebBrowserEditorInput(url,
-                    BrowserViewer.LOCATION_BAR);
-            WebBrowserEditor.open(input);
+            int style = IWorkbenchBrowserSupport.AS_EDITOR | IWorkbenchBrowserSupport.LOCATION_BAR
| IWorkbenchBrowserSupport.STATUS;
+            IWebBrowser browser = WorkbenchBrowserSupport.getInstance().createBrowser(style,
"console", Messages.console, Messages.consoleTooltip);
+            browser.openURL(getConsoleUrl());
         } catch (MalformedURLException e) {
             e.printStackTrace();
+        } catch (PartInitException e) {
+            e.printStackTrace();
         }
 
     }
@@ -80,12 +74,12 @@
      *      org.eclipse.jface.viewers.ISelection)
      */
     public void selectionChanged(IAction action, ISelection selection) {
-        
+
         IServer server = (IServer) ((StructuredSelection) selection)
                 .getFirstElement();
-        
-        
-        boolean enable = server != null && serverID.equals(server.getServerType().getId())
+
+        boolean enable = server != null
+                && serverID.equals(server.getServerType().getId())
                 && server.getServerState() == IServer.STATE_STARTED;
 
         action.setEnabled(enable);

Modified: geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.ui/src/org/apache/geronimo/ui/internal/Messages.java
URL: http://svn.apache.org/viewcvs/geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.ui/src/org/apache/geronimo/ui/internal/Messages.java?rev=314981&r1=314980&r2=314981&view=diff
==============================================================================
--- geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.ui/src/org/apache/geronimo/ui/internal/Messages.java
(original)
+++ geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.ui/src/org/apache/geronimo/ui/internal/Messages.java
Wed Oct 12 11:03:54 2005
@@ -197,6 +197,10 @@
     public static String username;
 
     public static String password;
+    
+    public static String console;
+    
+    public static String consoleTooltip;
 
     static {
         NLS.initializeMessages(GeronimoUIPlugin.PLUGIN_ID

Modified: geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.ui/src/org/apache/geronimo/ui/internal/Messages.properties
URL: http://svn.apache.org/viewcvs/geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.ui/src/org/apache/geronimo/ui/internal/Messages.properties?rev=314981&r1=314980&r2=314981&view=diff
==============================================================================
--- geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.ui/src/org/apache/geronimo/ui/internal/Messages.properties
(original)
+++ geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.ui/src/org/apache/geronimo/ui/internal/Messages.properties
Wed Oct 12 11:03:54 2005
@@ -91,4 +91,7 @@
 editorTabSource=Source
 
 name=Name
-description=Description
\ No newline at end of file
+description=Description
+
+console=Geronimo Console
+consoleTooltip=Apache Geronimo Console
\ No newline at end of file



Mime
View raw message