geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tki...@apache.org
Subject svn commit: r688899 - in /geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui: ./ schema/ src/main/java/org/apache/geronimo/st/ui/actions/ src/main/java/org/apache/geronimo/st/ui/internal/
Date Mon, 25 Aug 2008 22:10:56 GMT
Author: tkirby
Date: Mon Aug 25 15:10:55 2008
New Revision: 688899

URL: http://svn.apache.org/viewvc?rev=688899&view=rev
Log:
GERONIMODEVTOOLS-171 Add extension point to remove hard-coded org.apache.geronimo name from
launch console action check
put launch console before launch support in popup menu
configure support URL in plugin.xml extension point, not Messages.properties

Added:
    geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/schema/actionURLs.exsd
  (with props)
Modified:
    geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/plugin.xml
    geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/schema/loader.exsd
  (props changed)
    geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/main/java/org/apache/geronimo/st/ui/actions/LaunchGeronimoConsoleAction.java
    geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/main/java/org/apache/geronimo/st/ui/actions/LaunchGeronimoSupportAction.java
    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.xml
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/plugin.xml?rev=688899&r1=688898&r2=688899&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 Mon
Aug 25 15:10:55 2008
@@ -22,6 +22,7 @@
 <plugin>
 
  	<extension-point id="loader" name="Source Path Computer Mapping" schema="schema/loader.exsd"/>
+ 	<extension-point id="actionURLs" name="Action ID and URL" schema="schema/actionURLs.exsd"/>
  	
  	
     <!-- =======================================================================================
-->
@@ -77,7 +78,7 @@
             class="org.apache.geronimo.st.ui.internal.GeronimoServerWizardFragment"/>
     </extension>
 
-	<extension point="org.eclipse.ui.popupMenus">
+    <extension point="org.eclipse.ui.popupMenus">
 		<objectContribution
 	      		adaptable="true"
 	      		id="org.apache.geronimo.ui.serveractions"
@@ -87,15 +88,15 @@
 	            	property="org.eclipse.wst.server.ui.serverType"
 	           		value="org.apache.geronimo.*" />
 	      	</enablement>
-	        <action id="org.apache.geronimo.ui.launchconsole"
-	        	label="%PopupMenus.launchconsole" icon="icons/obj16/littleG.gif"
-	            class="org.apache.geronimo.st.ui.actions.LaunchGeronimoConsoleAction"
+	        <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.ui.popupMenus">
+	<extension point="org.eclipse.ui.popupMenus">
 		<objectContribution
 	      		adaptable="true"
 	      		id="org.apache.geronimo.ui.serveractions"
@@ -105,9 +106,9 @@
 	            	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"
+	        <action id="org.apache.geronimo.ui.launchconsole"
+	        	label="%PopupMenus.launchconsole" icon="icons/obj16/littleG.gif"
+	            class="org.apache.geronimo.st.ui.actions.LaunchGeronimoConsoleAction"
 	           	enablesFor="1">
 	        </action>
     	</objectContribution>
@@ -199,6 +200,16 @@
       		class="org.apache.geronimo.st.ui.internal.GeronimoLaunchConfigurationTabGroup">
     	</launchConfigurationTabGroup>
   	</extension>
+  	
+  	
+   <extension
+         point="org.apache.geronimo.st.ui.actionURLs">
+         <server_prefix>org.apache.geronimo.</server_prefix>
+         <action_URL class="org.apache.geronimo.st.ui.actions.LaunchGeronimoSupportAction"
+                     URL="http://geronimo.apache.org/" />
+   </extension>
+   
     
 </plugin>
+
  
\ No newline at end of file

Added: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/schema/actionURLs.exsd
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/schema/actionURLs.exsd?rev=688899&view=auto
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/schema/actionURLs.exsd
(added)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/schema/actionURLs.exsd
Mon Aug 25 15:10:55 2008
@@ -0,0 +1,150 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<!--
+  ~ Licensed to the Apache Software Foundation (ASF) under one or more
+  ~ contributor license agreements.  See the NOTICE file distributed with
+  ~ this work for additional information regarding copyright ownership.
+  ~ The ASF licenses this file to You under the Apache License, Version 2.0
+  ~ (the "License"); you may not use this file except in compliance with
+  ~ the License.  You may obtain a copy of the License at
+  ~
+  ~    http://www.apache.org/licenses/LICENSE-2.0
+  ~
+  ~ Unless required by applicable law or agreed to in writing, software
+  ~ distributed under the License is distributed on an "AS IS" BASIS,
+  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  ~ See the License for the specific language governing permissions and
+  ~ limitations under the License.
+  -->
+
+<!-- $Rev$ $Date$ -->
+
+<!-- Schema file written by PDE -->
+<schema targetNamespace="org.apache.geronimo.st.ui" xmlns="http://www.w3.org/2001/XMLSchema">
+<annotation>
+      <appinfo>
+         <meta.schema plugin="org.apache.geronimo.st.ui" id="actionURLs" name="Action
ID and URL"/>
+      </appinfo>
+      <documentation>
+         Provide server prefix and URLs for pop-up menu actions.
+      </documentation>
+   </annotation>
+
+   <element name="extension">
+      <annotation>
+         <appinfo>
+            <meta.element />
+         </appinfo>
+      </annotation>
+      <complexType>
+         <attribute name="point" type="string" use="required">
+            <annotation>
+               <documentation>
+                  
+               </documentation>
+            </annotation>
+         </attribute>
+         <attribute name="id" type="string">
+            <annotation>
+               <documentation>
+                  
+               </documentation>
+            </annotation>
+         </attribute>
+         <attribute name="name" type="string">
+            <annotation>
+               <documentation>
+                  
+               </documentation>
+               <appinfo>
+                  <meta.attribute translatable="true"/>
+               </appinfo>
+            </annotation>
+         </attribute>
+      </complexType>
+   </element>
+
+   <element name="server_prefix" type="string">
+      <annotation>
+         <documentation>
+            eg org.apache.geronimo.
+         </documentation>
+      </annotation>
+   </element>
+
+   <element name="action_URL">
+      <complexType>
+         <sequence minOccurs="2" maxOccurs="unbounded">
+         </sequence>
+         <attribute name="class" type="string" use="required">
+            <annotation>
+               <documentation>
+                  class from  &lt;extension point=&quot;org.eclipse.ui.popupMenus&quot;&gt;
+&lt;action id=&quot;org.apache.geronimo.ui.launchSupport&quot;
+          label=&quot;%PopupMenus.launchSupport&quot; icon=&quot;icons/obj16/littleG.gif&quot;
+             class=&quot;org.apache.geronimo.st.ui.actions.LaunchGeronimoSupportAction&quot;
+             enablesFor=&quot;1&quot;&gt;
+         &lt;/action&gt;
+               </documentation>
+            </annotation>
+         </attribute>
+         <attribute name="URL" type="string" use="required">
+            <annotation>
+               <documentation>
+                  
+               </documentation>
+            </annotation>
+         </attribute>
+      </complexType>
+   </element>
+
+   <annotation>
+      <appinfo>
+         <meta.section type="since"/>
+      </appinfo>
+      <documentation>
+         2.1.3
+      </documentation>
+   </annotation>
+
+   <annotation>
+      <appinfo>
+         <meta.section type="examples"/>
+      </appinfo>
+      <documentation>
+         &lt;extension
+         point=&quot;org.apache.geronimo.st.ui.actionURLs&quot;&gt;
+         &lt;server_prefix&gt;org.apache.geronimo.&lt;/server_prefix&gt;
+         &lt;action_URL class=&quot;org.apache.geronimo.st.ui.actions.LaunchGeronimoSupportAction&quot;
+                     URL=&quot;http://geronimo.apache.org/&quot; /&gt;
+&lt;/extension&gt;
+      </documentation>
+   </annotation>
+
+   <annotation>
+      <appinfo>
+         <meta.section type="apiinfo"/>
+      </appinfo>
+      <documentation>
+         [Enter API information here.]
+      </documentation>
+   </annotation>
+
+   <annotation>
+      <appinfo>
+         <meta.section type="implementation"/>
+      </appinfo>
+      <documentation>
+         [Enter information about supplied implementation of this extension point.]
+      </documentation>
+   </annotation>
+
+   <annotation>
+      <appinfo>
+         <meta.section type="copyright"/>
+      </appinfo>
+      <documentation>
+         Copyright 2008 The Apache Software Foundation.
+      </documentation>
+   </annotation>
+
+</schema>

Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/schema/actionURLs.exsd
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/schema/actionURLs.exsd
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/schema/loader.exsd
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/main/java/org/apache/geronimo/st/ui/actions/LaunchGeronimoConsoleAction.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/LaunchGeronimoConsoleAction.java?rev=688899&r1=688898&r2=688899&view=diff
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/main/java/org/apache/geronimo/st/ui/actions/LaunchGeronimoConsoleAction.java
(original)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/main/java/org/apache/geronimo/st/ui/actions/LaunchGeronimoConsoleAction.java
Mon Aug 25 15:10:55 2008
@@ -21,6 +21,10 @@
 
 import org.apache.geronimo.st.core.GeronimoServerDelegate;
 import org.apache.geronimo.st.ui.internal.Messages;
+import org.apache.geronimo.st.ui.internal.Trace;
+import org.eclipse.core.runtime.IConfigurationElement;
+import org.eclipse.core.runtime.IExtensionRegistry;
+import org.eclipse.core.runtime.Platform;
 import org.eclipse.jface.action.IAction;
 import org.eclipse.jface.viewers.ISelection;
 import org.eclipse.jface.viewers.StructuredSelection;
@@ -36,13 +40,26 @@
  */
 public class LaunchGeronimoConsoleAction implements IActionDelegate {
 
-	public static final String G_SERVER_PREFIX = "org.apache.geronimo";
-
 	private IServer server;
 
+	private String serverPrefix;
+
 	public LaunchGeronimoConsoleAction() {
-		super();
-	}
+        super();
+        IExtensionRegistry reg = Platform.getExtensionRegistry();
+        IConfigurationElement[] extensions = reg
+                .getConfigurationElementsFor("org.apache.geronimo.st.ui.actionURLs");
+        for (IConfigurationElement element : extensions) {
+            Trace.trace(Trace.INFO, element.getName() + " = "
+                    + element.getValue() + ".");
+            if (element.getName().equals("server_prefix")) {
+                serverPrefix = element.getValue();
+                Trace
+                        .trace(Trace.INFO, "server_prefix = " + serverPrefix
+                                + ".");
+            }
+        }
+    }
 
 	public URL getConsoleUrl() throws MalformedURLException {
 		if (server != null) {
@@ -89,7 +106,7 @@
 		server = (IServer) ((StructuredSelection) selection).getFirstElement();
 
 		boolean enable = server != null
-				&& server.getServerType().getId().startsWith(G_SERVER_PREFIX)
+				&& server.getServerType().getId().startsWith(serverPrefix)
 				&& server.getServerState() == IServer.STATE_STARTED;
 
 		action.setEnabled(enable);

Modified: 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=688899&r1=688898&r2=688899&view=diff
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/main/java/org/apache/geronimo/st/ui/actions/LaunchGeronimoSupportAction.java
(original)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/main/java/org/apache/geronimo/st/ui/actions/LaunchGeronimoSupportAction.java
Mon Aug 25 15:10:55 2008
@@ -20,6 +20,10 @@
 import java.net.URL;
 
 import org.apache.geronimo.st.ui.internal.Messages;
+import org.apache.geronimo.st.ui.internal.Trace;
+import org.eclipse.core.runtime.IConfigurationElement;
+import org.eclipse.core.runtime.IExtensionRegistry;
+import org.eclipse.core.runtime.Platform;
 import org.eclipse.jface.action.IAction;
 import org.eclipse.jface.viewers.ISelection;
 import org.eclipse.jface.viewers.StructuredSelection;
@@ -34,18 +38,40 @@
  * @version $Rev$ $Date: 2006-11-05 17:47:11 -0500 (Sun, 05 Nov 2006) $
  */
 public class LaunchGeronimoSupportAction implements IActionDelegate {
-
-    public static final String GERONIMO_SERVER_PREFIX = "org.apache.geronimo";
+    
+    private String serverPrefix;
+    
+    private String supportURL;
     
     private IServer server;
     
     public LaunchGeronimoSupportAction() {
         super();
+        IExtensionRegistry reg = Platform.getExtensionRegistry();
+        IConfigurationElement[] extensions = reg
+                .getConfigurationElementsFor("org.apache.geronimo.st.ui.actionURLs");
+        for (IConfigurationElement element : extensions) {
+            Trace.trace(Trace.INFO, element.getName() + " = "
+                    + element.getValue() + ".");
+            if (element.getName().equals("server_prefix")) {
+                serverPrefix = element.getValue();
+                Trace
+                        .trace(Trace.INFO, "server_prefix = " + serverPrefix
+                                + ".");
+            } else if (element.getName().equals("action_URL")
+                    && element
+                            .getAttribute("class")
+                            .equals(
+                                    "org.apache.geronimo.st.ui.actions.LaunchGeronimoSupportAction"))
{
+                supportURL = element.getAttribute("URL");
+                Trace.trace(Trace.INFO, "support URL = " + supportURL + ".");
+            }
+        }
     }
 
     public URL getConsoleUrl() throws MalformedURLException {
         if (server != null) {
-            return new URL(Messages.supportWebPageURL);
+            return new URL(supportURL);
         }
         return null;
     }
@@ -64,7 +90,7 @@
                     .createBrowser(
                             style,
                             "supportWebPage",
-                            Messages.bind(Messages.supportWebPage, server.getName()),
+                            supportURL,
                             Messages.bind(Messages.supportWebPageTooltip, server
                                     .getName()));
             URL url = getConsoleUrl();
@@ -89,7 +115,7 @@
         server = (IServer) ((StructuredSelection) selection).getFirstElement();
 
         boolean enable = server != null
-                         && server.getServerType().getId().startsWith(GERONIMO_SERVER_PREFIX);
+                         && server.getServerType().getId().startsWith(serverPrefix);
 
         action.setEnabled(enable);
 

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=688899&r1=688898&r2=688899&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
Mon Aug 25 15:10:55 2008
@@ -59,7 +59,6 @@
     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=688899&r1=688898&r2=688899&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
Mon Aug 25 15:10:55 2008
@@ -246,7 +246,6 @@
 
 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