geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sppa...@apache.org
Subject svn commit: r450100 - in /geronimo/devtools/eclipse-plugin/trunk/plugins: org.apache.geronimo.st.core/ org.apache.geronimo.st.core/schema/ org.apache.geronimo.st.core/src/org/apache/geronimo/st/core/ org.apache.geronimo.st.ui/
Date Tue, 26 Sep 2006 16:10:22 GMT
Author: sppatel
Date: Tue Sep 26 09:10:21 2006
New Revision: 450100

URL: http://svn.apache.org/viewvc?view=rev&rev=450100
Log:
launchconfigtype only takes one sourcelocator, provide pluggable solution to bind additional

Added:
    geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/schema/
    geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/schema/sourcePathComputerMapping.exsd
Modified:
    geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/plugin.xml
    geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/pom.xml
    geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/org/apache/geronimo/st/core/GeronimoSourcePathComputerDelegate.java
    geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/plugin.xml
    geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/pom.xml

Modified: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/plugin.xml
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/plugin.xml?view=diff&rev=450100&r1=450099&r2=450100
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/plugin.xml
(original)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/plugin.xml
Tue Sep 26 09:10:21 2006
@@ -2,6 +2,8 @@
 <?eclipse version="3.0"?>
 <plugin>
 
+	<extension-point id="sourcePathComputerMapping" name="Geronimo Deployment Plan Loader"
schema="schema/sourcePathComputerMapping.exsd"/>
+
 	<extension point="org.eclipse.debug.core.launchConfigurationTypes">
 		<launchConfigurationType
 	        id="org.apache.geronimo.st.core.launchConfigurationType"

Modified: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/pom.xml?view=diff&rev=450100&r1=450099&r2=450100
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/pom.xml (original)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/pom.xml Tue
Sep 26 09:10:21 2006
@@ -21,6 +21,13 @@
                 </includes>
             </resource>
             <resource>
+                <targetPath>schema/</targetPath>
+                <directory>schema/</directory>
+                <includes>
+                    <include>*.exsd</include>
+                </includes>
+            </resource>
+            <resource>
                 <targetPath>lib</targetPath>
                 <directory>lib</directory>
                 <includes>

Added: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/schema/sourcePathComputerMapping.exsd
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/schema/sourcePathComputerMapping.exsd?view=auto&rev=450100
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/schema/sourcePathComputerMapping.exsd
(added)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/schema/sourcePathComputerMapping.exsd
Tue Sep 26 09:10:21 2006
@@ -0,0 +1,87 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<!-- Schema file written by PDE -->
+<schema targetNamespace="org.apache.geronimo.st.core">
+<annotation>
+      <appInfo>
+         <meta.schema plugin="org.apache.geronimo.st.core" id="sourcePathComputerMapping"
name="Source Path Computer Mapping"/>
+      </appInfo>
+      <documentation>
+         Binds a set of source path computers to the Geronimo Server Launch Configuration.
+      </documentation>
+   </annotation>
+
+   <element name="extension">
+      <complexType>
+         <sequence>
+            <element ref="sourcePathComputer" minOccurs="1" maxOccurs="unbounded"/>
+         </sequence>
+         <attribute name="point" type="string" use="required">
+            <annotation>
+               <documentation>
+                  
+               </documentation>
+            </annotation>
+         </attribute>
+      </complexType>
+   </element>
+
+   <element name="sourcePathComputer">
+      <complexType>
+         <attribute name="id" type="string" use="required">
+            <annotation>
+               <documentation>
+                  id of an existing sourcePathComputer extension
+               </documentation>
+            </annotation>
+         </attribute>
+      </complexType>
+   </element>
+
+   <annotation>
+      <appInfo>
+         <meta.section type="since"/>
+      </appInfo>
+      <documentation>
+         1.2
+      </documentation>
+   </annotation>
+
+   <annotation>
+      <appInfo>
+         <meta.section type="examples"/>
+      </appInfo>
+      <documentation>
+         &lt;extension point=&quot;org.apache.geronimo.st.core.sourcePathComputerMapping&quot;&gt;
+	&lt;sourcePathComputer id=&quot;org.eclipse.jst.server.generic.core.sourcePathComputer&quot;/&gt;
+&lt;/extension&gt;
+      </documentation>
+   </annotation>
+
+   <annotation>
+      <appInfo>
+         <meta.section type="apiInfo"/>
+      </appInfo>
+      <documentation>
+         This class does not directly require a class implementation.
+      </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>
+         
+      </documentation>
+   </annotation>
+
+</schema>

Modified: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/org/apache/geronimo/st/core/GeronimoSourcePathComputerDelegate.java
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/org/apache/geronimo/st/core/GeronimoSourcePathComputerDelegate.java?view=diff&rev=450100&r1=450099&r2=450100
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/org/apache/geronimo/st/core/GeronimoSourcePathComputerDelegate.java
(original)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/org/apache/geronimo/st/core/GeronimoSourcePathComputerDelegate.java
Tue Sep 26 09:10:21 2006
@@ -16,13 +16,22 @@
 package org.apache.geronimo.st.core;
 
 import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.HashSet;
+import java.util.Iterator;
 import java.util.List;
 
 import org.eclipse.core.resources.IProject;
 import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IConfigurationElement;
+import org.eclipse.core.runtime.IExtensionPoint;
 import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.debug.core.DebugPlugin;
 import org.eclipse.debug.core.ILaunchConfiguration;
+import org.eclipse.debug.core.ILaunchManager;
 import org.eclipse.debug.core.sourcelookup.ISourceContainer;
+import org.eclipse.debug.core.sourcelookup.ISourcePathComputer;
 import org.eclipse.debug.core.sourcelookup.ISourcePathComputerDelegate;
 import org.eclipse.jdt.core.IJavaProject;
 import org.eclipse.jdt.core.JavaCore;
@@ -33,6 +42,8 @@
 import org.eclipse.wst.server.core.ServerUtil;
 
 public class GeronimoSourcePathComputerDelegate implements ISourcePathComputerDelegate {
+	
+	private HashSet additionalSrcPathComputerIds = null;
 
 	/*
 	 * (non-Javadoc)
@@ -41,7 +52,7 @@
 	 *      org.eclipse.core.runtime.IProgressMonitor)
 	 */
 	public ISourceContainer[] computeSourceContainers(ILaunchConfiguration configuration, IProgressMonitor
monitor) throws CoreException {
-
+		
 		IServer server = ServerUtil.getServer(configuration);
 		IModule[] modules = server.getModules();
 
@@ -62,11 +73,19 @@
 		System.arraycopy(projectEntries, 0, entries, unresolvedEntries.length, projectEntries.length);
 
 		IRuntimeClasspathEntry[] resolved = JavaRuntime.resolveSourceLookupPath(entries, configuration);
-		ISourceContainer[] javaSourceContainers = JavaRuntime.getSourceContainers(resolved);
-
+		ISourceContainer[] defaultContainers = JavaRuntime.getSourceContainers(resolved);
+		HashSet allContainers = new HashSet(Arrays.asList(defaultContainers));
+		Iterator i = getAdditionalSrcPathComputers().iterator();
+		ILaunchManager mgr = DebugPlugin.getDefault().getLaunchManager();
+		while(i.hasNext()) {
+			ISourcePathComputer computer = mgr.getSourcePathComputer((String) i.next());
+			ISourceContainer[] jsc = computer.computeSourceContainers(configuration, monitor);
+			allContainers.addAll(Arrays.asList(jsc));
+		}
+		
 		// TODO support resolving from geronimo source distribution
 
-		return javaSourceContainers;
+		return (ISourceContainer[])allContainers.toArray(new ISourceContainer[allContainers.size()]);
 	}
 
 	private void processModules(IModule[] modules, List javaProjectList, IServer server, IProgressMonitor
monitor) {
@@ -91,6 +110,22 @@
 				}
 			}
 		}
+	}
+	
+	private synchronized void init() {
+		if(additionalSrcPathComputerIds == null) {
+			additionalSrcPathComputerIds = new HashSet();
+			IExtensionPoint extensionPoint= Platform.getExtensionRegistry().getExtensionPoint(Activator.PLUGIN_ID,
"sourcePathComputerMapping");
+			IConfigurationElement[] extensions = extensionPoint.getConfigurationElements();
+			for (int i = 0; i < extensions.length; i++) {
+				additionalSrcPathComputerIds.add(extensions[i].getAttribute("id"));
+			}
+		}
+	}
+
+	public HashSet getAdditionalSrcPathComputers() {
+		init();
+		return additionalSrcPathComputerIds;
 	}
 
 }

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?view=diff&rev=450100&r1=450099&r2=450100
==============================================================================
--- 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
Sep 26 09:10:21 2006
@@ -2,7 +2,7 @@
 <?eclipse version="3.0"?>
 <plugin>
 
- 	<extension-point id="loader" name="Geronimo Deployment Plan Loader" schema="schema/loader.exsd"/>
+ 	<extension-point id="sourcePathComputerMapping" name="Source Path Computer Mapping"
schema="schema/loader.exsd"/>
  	
  	<extension point="org.eclipse.wst.common.project.facet.ui.images">
         <image facet="org.apache.geronimo.facet"

Modified: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/pom.xml?view=diff&rev=450100&r1=450099&r2=450100
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/pom.xml (original)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/pom.xml Tue Sep
26 09:10:21 2006
@@ -21,6 +21,13 @@
                 </includes>
             </resource>
             <resource>
+                <targetPath>schema/</targetPath>
+                <directory>schema/</directory>
+                <includes>
+                    <include>*.exsd</include>
+                </includes>
+            </resource>
+            <resource>
                 <targetPath>icons/</targetPath>
                 <directory>icons/</directory>
                 <includes>



Mime
View raw message