geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tki...@apache.org
Subject svn commit: r685264 - in /geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui: ./ src/main/java/org/apache/geronimo/st/ui/actions/ src/main/java/org/apache/geronimo/st/ui/internal/
Date Tue, 12 Aug 2008 18:57:45 GMT
Author: tkirby
Date: Tue Aug 12 11:57:45 2008
New Revision: 685264

URL: http://svn.apache.org/viewvc?rev=685264&view=rev
Log:
GERONIMODEVTOOLS-477 Add a Support popup menu option to a server to launch a browser window
to Geronimo Home page

Added:
    geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/main/java/org/apache/geronimo/st/ui/actions/LaunchGeronimoSupportAction.java
  (with props)
Modified:
    geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/plugin.properties
    geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/plugin.xml
    geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/main/java/org/apache/geronimo/st/ui/internal/Messages.java
    geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/main/java/org/apache/geronimo/st/ui/internal/Messages.properties

Modified: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/plugin.properties
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/plugin.properties?rev=685264&r1=685263&r2=685264&view=diff
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/plugin.properties
(original)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/plugin.properties
Tue Aug 12 11:57:45 2008
@@ -20,4 +20,5 @@
 providerName=Apache Software Foundation
 
 PopupMenus.launchconsole=Launch Geronimo Console
+PopupMenus.launchSupport=Launch Geronimo Support
 deploymentPlanEditorName=Geronimo Deployment Plan Editor
\ No newline at end of file

Modified: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/plugin.xml
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/plugin.xml?rev=685264&r1=685263&r2=685264&view=diff
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/plugin.xml (original)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/plugin.xml Tue
Aug 12 11:57:45 2008
@@ -77,7 +77,6 @@
             class="org.apache.geronimo.st.ui.internal.GeronimoServerWizardFragment"/>
     </extension>
 
-
 	<extension point="org.eclipse.ui.popupMenus">
 		<objectContribution
 	      		adaptable="true"
@@ -95,6 +94,24 @@
 	        </action>
     	</objectContribution>
     </extension>
+
+    <extension point="org.eclipse.ui.popupMenus">
+		<objectContribution
+	      		adaptable="true"
+	      		id="org.apache.geronimo.ui.serveractions"
+	      		objectClass="org.eclipse.wst.server.core.IServer">
+	      	<enablement>
+	        	<test forcePluginActivation="true"
+	            	property="org.eclipse.wst.server.ui.serverType"
+	           		value="org.apache.geronimo.*" />
+	      	</enablement>
+	        <action id="org.apache.geronimo.ui.launchSupport"
+	        	label="%PopupMenus.launchSupport" icon="icons/obj16/littleG.gif"
+	            class="org.apache.geronimo.st.ui.actions.LaunchGeronimoSupportAction"
+	           	enablesFor="1">
+	        </action>
+    	</objectContribution>
+    </extension>
     
     <extension point="org.eclipse.wst.server.ui.editorPageSections">
         <section id="org.apache.server.geronimo.security" order="10"

Added: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/main/java/org/apache/geronimo/st/ui/actions/LaunchGeronimoSupportAction.java
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/main/java/org/apache/geronimo/st/ui/actions/LaunchGeronimoSupportAction.java?rev=685264&view=auto
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/main/java/org/apache/geronimo/st/ui/actions/LaunchGeronimoSupportAction.java
(added)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/main/java/org/apache/geronimo/st/ui/actions/LaunchGeronimoSupportAction.java
Tue Aug 12 11:57:45 2008
@@ -0,0 +1,82 @@
+package org.apache.geronimo.st.ui.actions;
+
+import java.net.MalformedURLException;
+import java.net.URL;
+
+import org.apache.geronimo.st.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.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;
+
+/**
+ * @version $Rev$ $Date: 2006-11-05 17:47:11 -0500 (Sun, 05 Nov 2006) $
+ */
+public class LaunchGeronimoSupportAction implements IActionDelegate {
+
+	public static final String WASCE_SERVER_PREFIX = "com.ibm.wasce";
+
+	private IServer server;
+
+	public LaunchGeronimoSupportAction() {
+		super();
+	}
+
+	public URL getConsoleUrl() throws MalformedURLException {
+		if (server != null) {
+			return new URL(Messages.supportWebPageURL);
+		}
+		return null;
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction)
+	 */
+	public void run(IAction action) {
+
+		try {
+			int style = IWorkbenchBrowserSupport.AS_EDITOR
+					| IWorkbenchBrowserSupport.STATUS;
+			IWebBrowser browser = WorkbenchBrowserSupport.getInstance()
+					.createBrowser(
+							style,
+							"supportWebPage",
+							Messages.bind(Messages.supportWebPage, server.getName()),
+							Messages.bind(Messages.supportWebPageTooltip, server
+									.getName()));
+			URL url = getConsoleUrl();
+			if (url != null)
+				browser.openURL(url);
+		} catch (MalformedURLException e) {
+			e.printStackTrace();
+		} catch (PartInitException e) {
+			e.printStackTrace();
+		}
+
+	}
+
+	/*
+         * (non-Javadoc)
+         * 
+         * @see org.eclipse.ui.IActionDelegate#selectionChanged(org.eclipse.jface.action.IAction,
+         *      org.eclipse.jface.viewers.ISelection)
+         */
+        public void selectionChanged(IAction action, ISelection selection) {
+
+                server = (IServer) ((StructuredSelection) selection).getFirstElement();
+
+                boolean enable = server != null
+                                && server.getServerType().getId().startsWith(WASCE_SERVER_PREFIX);
+
+                action.setEnabled(enable);
+
+        }
+
+}

Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/main/java/org/apache/geronimo/st/ui/actions/LaunchGeronimoSupportAction.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/main/java/org/apache/geronimo/st/ui/actions/LaunchGeronimoSupportAction.java
------------------------------------------------------------------------------
    svn:keywords = Id Rev

Modified: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/main/java/org/apache/geronimo/st/ui/internal/Messages.java
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/main/java/org/apache/geronimo/st/ui/internal/Messages.java?rev=685264&r1=685263&r2=685264&view=diff
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/main/java/org/apache/geronimo/st/ui/internal/Messages.java
(original)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/main/java/org/apache/geronimo/st/ui/internal/Messages.java
Tue Aug 12 11:57:45 2008
@@ -57,6 +57,9 @@
     public static String password;
     public static String console;
     public static String consoleTooltip;
+    public static String supportWebPage;
+    public static String supportWebPageTooltip;
+    public static String supportWebPageURL;
     public static String pingDelay;
     public static String pingInterval;
     public static String maxPings;

Modified: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/main/java/org/apache/geronimo/st/ui/internal/Messages.properties
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/main/java/org/apache/geronimo/st/ui/internal/Messages.properties?rev=685264&r1=685263&r2=685264&view=diff
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/main/java/org/apache/geronimo/st/ui/internal/Messages.properties
(original)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/main/java/org/apache/geronimo/st/ui/internal/Messages.properties
Tue Aug 12 11:57:45 2008
@@ -233,6 +233,10 @@
 console={0} Console
 consoleTooltip={0} Console
 
+supportWebPage={0} Support
+supportWebPageTooltip={0} Support Web Page
+supportWebPageURL  http://geronimo.apache.org/
+
 newServerWizardTitle=New {0} Server
 newServerWizardDescription=New {0} Server
 



Mime
View raw message