Author: rob.stryker(a)jboss.com
Date: 2009-07-03 04:41:54 -0400 (Fri, 03 Jul 2009)
New Revision: 16377
Added:
trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.override.core/plugin.xml
trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.override.core/schema/
trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.override.core/schema/referenceResolver.exsd
trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.override.core/src/org/jboss/ide/eclipse/as/wtp/override/core/modules/IJBTModule.java
trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.override.core/src/org/jboss/ide/eclipse/as/wtp/override/core/vcf/
trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.override.core/src/org/jboss/ide/eclipse/as/wtp/override/core/vcf/ComponentUtils.java
trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.override.core/src/org/jboss/ide/eclipse/as/wtp/override/core/vcf/DefaultReferenceResolver.java
trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.override.core/src/org/jboss/ide/eclipse/as/wtp/override/core/vcf/IJBTComponent.java
trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.override.core/src/org/jboss/ide/eclipse/as/wtp/override/core/vcf/IReferenceResolver.java
trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.override.core/src/org/jboss/ide/eclipse/as/wtp/override/core/vcf/JBTVirtualArchiveComponent.java
trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.override.core/src/org/jboss/ide/eclipse/as/wtp/override/core/vcf/JBTVirtualComponent.java
trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.override.core/src/org/jboss/ide/eclipse/as/wtp/override/core/vcf/ReferenceResolverUtil.java
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.override.core/META-INF/MANIFEST.MF
trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.override.core/build.properties
trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.override.core/src/org/jboss/ide/eclipse/as/wtp/override/core/Activator.java
trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.override.ui/META-INF/MANIFEST.MF
trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.override.ui/src/org/jboss/ide/eclipse/as/wtp/override/ui/propertypage/AddModuleDependenciesPropertiesPage.java
trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.override.ui/src/org/jboss/ide/eclipse/as/wtp/override/ui/propertypage/ComponentDependencyContentProvider.java
Log:
More development. Woo Hoo.
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.override.core/META-INF/MANIFEST.MF
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.override.core/META-INF/MANIFEST.MF 2009-07-03
07:16:52 UTC (rev 16376)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.override.core/META-INF/MANIFEST.MF 2009-07-03
08:41:54 UTC (rev 16377)
@@ -1,12 +1,21 @@
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: WTP Overrides Core
-Bundle-SymbolicName: org.jboss.ide.eclipse.as.wtp.override.core
+Bundle-SymbolicName: org.jboss.ide.eclipse.as.wtp.override.core;singleton:=true
Bundle-Version: 1.0.0.qualifier
Bundle-Activator: org.jboss.ide.eclipse.as.wtp.override.core.Activator
-Require-Bundle: org.eclipse.ui,
- org.eclipse.core.runtime,
- org.eclipse.wst.server.core;bundle-version="1.1.101"
+Require-Bundle: org.eclipse.core.runtime,
+ org.eclipse.wst.server.core;bundle-version="1.1.101",
+ org.eclipse.wst.common.modulecore;bundle-version="1.1.300",
+ org.eclipse.core.resources;bundle-version="3.5.0",
+ org.eclipse.emf.common;bundle-version="2.5.0",
+ org.eclipse.emf.ecore;bundle-version="2.5.0",
+ org.eclipse.jst.jee;bundle-version="1.0.200",
+ org.eclipse.jst.j2ee.core;bundle-version="1.1.300",
+ org.eclipse.jst.j2ee;bundle-version="1.1.300",
+ org.eclipse.wst.common.project.facet.core;bundle-version="1.4.0",
+ org.eclipse.jem.util;bundle-version="2.0.200"
Bundle-ActivationPolicy: lazy
Bundle-RequiredExecutionEnvironment: J2SE-1.5
-Export-Package: org.jboss.ide.eclipse.as.wtp.override.core.modules
+Export-Package: org.jboss.ide.eclipse.as.wtp.override.core.modules,
+ org.jboss.ide.eclipse.as.wtp.override.core.vcf
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.override.core/build.properties
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.override.core/build.properties 2009-07-03
07:16:52 UTC (rev 16376)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.override.core/build.properties 2009-07-03
08:41:54 UTC (rev 16377)
@@ -1,4 +1,5 @@
source.. = src/
output.. = bin/
bin.includes = META-INF/,\
- .
+ .,\
+ plugin.xml
Added: trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.override.core/plugin.xml
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.override.core/plugin.xml
(rev 0)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.override.core/plugin.xml 2009-07-03
08:41:54 UTC (rev 16377)
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.4"?>
+<plugin>
+ <extension-point id="referenceResolver"
name="referenceResolver" schema="schema/referenceResolver.exsd"/>
+
+</plugin>
Added:
trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.override.core/schema/referenceResolver.exsd
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.override.core/schema/referenceResolver.exsd
(rev 0)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.override.core/schema/referenceResolver.exsd 2009-07-03
08:41:54 UTC (rev 16377)
@@ -0,0 +1,116 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<!-- Schema file written by PDE -->
+<schema targetNamespace="org.eclipse.wst.common.modulecore"
xmlns="http://www.w3.org/2001/XMLSchema">
+<annotation>
+ <appInfo>
+ <meta.schema plugin="org.eclipse.wst.common.modulecore"
id="referenceResolver" name="referenceResolver"/>
+ </appInfo>
+ <documentation>
+ [Enter description of this extension point.]
+ </documentation>
+ </annotation>
+
+ <element name="extension">
+ <annotation>
+ <appInfo>
+ <meta.element />
+ </appInfo>
+ </annotation>
+ <complexType>
+ <sequence minOccurs="1" maxOccurs="unbounded">
+ <element ref="resolver"/>
+ </sequence>
+ <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="resolver">
+ <complexType>
+ <attribute name="id" type="string"
use="required">
+ <annotation>
+ <documentation>
+ A required id which can be used to reference this resolver
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="class" type="string"
use="required">
+ <annotation>
+ <documentation>
+ The implementation class of this extension
+ </documentation>
+ <appInfo>
+ <meta.attribute kind="java"
basedOn=":org.eclipse.wst.common.componentcore.resolvers.IReferenceResolver"/>
+ </appInfo>
+ </annotation>
+ </attribute>
+ <attribute name="weight" type="string">
+ <annotation>
+ <documentation>
+ The weight used for sorting the resolvers. Lighter weights float to the
top and are tried first.
+ </documentation>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <annotation>
+ <appInfo>
+ <meta.section type="since"/>
+ </appInfo>
+ <documentation>
+ [Enter the first release in which this extension point appears.]
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appInfo>
+ <meta.section type="examples"/>
+ </appInfo>
+ <documentation>
+ [Enter extension point usage example here.]
+ </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>
+
+
+</schema>
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.override.core/src/org/jboss/ide/eclipse/as/wtp/override/core/Activator.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.override.core/src/org/jboss/ide/eclipse/as/wtp/override/core/Activator.java 2009-07-03
07:16:52 UTC (rev 16376)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.override.core/src/org/jboss/ide/eclipse/as/wtp/override/core/Activator.java 2009-07-03
08:41:54 UTC (rev 16377)
@@ -1,12 +1,12 @@
package org.jboss.ide.eclipse.as.wtp.override.core;
-import org.eclipse.ui.plugin.AbstractUIPlugin;
+import org.eclipse.core.runtime.Plugin;
import org.osgi.framework.BundleContext;
/**
* The activator class controls the plug-in life cycle
*/
-public class Activator extends AbstractUIPlugin {
+public class Activator extends Plugin {
// The plug-in ID
public static final String PLUGIN_ID =
"org.jboss.ide.eclipse.as.wtp.override.core"; //$NON-NLS-1$
Added:
trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.override.core/src/org/jboss/ide/eclipse/as/wtp/override/core/modules/IJBTModule.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.override.core/src/org/jboss/ide/eclipse/as/wtp/override/core/modules/IJBTModule.java
(rev 0)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.override.core/src/org/jboss/ide/eclipse/as/wtp/override/core/modules/IJBTModule.java 2009-07-03
08:41:54 UTC (rev 16377)
@@ -0,0 +1,45 @@
+package org.jboss.ide.eclipse.as.wtp.override.core.modules;
+
+import org.eclipse.wst.server.core.IModule;
+
+
+public interface IJBTModule {
+ /**
+ * Returns the modules contained within this module. The returned modules
+ * can be either modulecore projects or representations of binary jars
+ *
+ * @return a possibly empty array of modules contained within this application
+ */
+ public IModule[] getModules();
+
+ /**
+ * Returns the URI of the given module within this enterprise application.
+ *
+ * @param module a module within this application
+ * @return the URI of the given module, or <code>null</code> if the URI
could
+ * not be found
+ */
+ public String getURI(IModule module);
+
+ /**
+ * Returns true if this is a binary (zipped) module, and
+ * false if it is expanded.
+ *
+ * <p>If true, members() should return only a single element -
+ * the binary (jar or zip file) that contains the contents of
+ * this module. (a single IModuleResource, e.g.
+ * myejb.jar) Also, getLocation() should return the full path
+ * up to and including the binary itself. (e.g.
+ * c:\temp\myejb.jar)</p>
+ *
+ * <p>If false, members() should return the entire contents
+ * of the module, starting at the root. There should be no
+ * preceeding directory structure. (an array of
+ * IModuleResources, e.g. index.html, WEB-INF/web.xml,
+ * ...) In this case, getLocation() should return the path to
+ * the root folder containing these resources.</p>
+ *
+ * @return boolean
+ */
+ public boolean isBinary();
+}
Added:
trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.override.core/src/org/jboss/ide/eclipse/as/wtp/override/core/vcf/ComponentUtils.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.override.core/src/org/jboss/ide/eclipse/as/wtp/override/core/vcf/ComponentUtils.java
(rev 0)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.override.core/src/org/jboss/ide/eclipse/as/wtp/override/core/vcf/ComponentUtils.java 2009-07-03
08:41:54 UTC (rev 16377)
@@ -0,0 +1,64 @@
+package org.jboss.ide.eclipse.as.wtp.override.core.vcf;
+
+import java.util.HashMap;
+import java.util.Iterator;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.wst.common.componentcore.internal.util.IModuleConstants;
+import org.eclipse.wst.common.componentcore.resources.IVirtualComponent;
+import org.eclipse.wst.common.project.facet.core.IFacetedProject;
+import org.eclipse.wst.common.project.facet.core.IProjectFacet;
+import org.eclipse.wst.common.project.facet.core.ProjectFacetsManager;
+
+public class ComponentUtils {
+ private static HashMap<String,String> facetToExtension = null;
+ static {
+ facetToExtension = new HashMap<String, String>();
+ facetToExtension.put(IModuleConstants.JST_WEB_MODULE, ".war");
+ facetToExtension.put(IModuleConstants.JST_EJB_MODULE, ".jar");
+ facetToExtension.put(IModuleConstants.WST_WEB_MODULE, ".war");
+ facetToExtension.put(IModuleConstants.JST_APPCLIENT_MODULE, ".jar");
+ facetToExtension.put(IModuleConstants.JST_CONNECTOR_MODULE, ".rar");
+ facetToExtension.put(IModuleConstants.JST_EAR_MODULE, ".ear");
+ }
+
+ public static void addMapping(String facet, String extension) {
+ facetToExtension.put(facet, extension);
+ }
+
+ public static String getDefaultProjectExtension(IVirtualComponent component) {
+ if( !component.isBinary()) {
+ IFacetedProject fp = getFacetedProject(component.getProject());
+ if( fp != null ) {
+ Iterator i = facetToExtension.keySet().iterator();
+ String facet = null;
+ while(i.hasNext()) {
+ facet = (String)i.next();
+ if( isProjectOfType(fp, facet))
+ return facetToExtension.get(facet);
+ }
+ }
+ }
+ return ".jar";
+ }
+
+ private static IFacetedProject getFacetedProject(IProject project) {
+ IFacetedProject facetedProject = null;
+ if (null != project && project.isAccessible()) {
+ try {
+ facetedProject = ProjectFacetsManager.create(project);
+ } catch (CoreException e) {
+ }
+ }
+ return facetedProject;
+ }
+
+ private static boolean isProjectOfType(IFacetedProject facetedProject, String typeID) {
+ if (facetedProject != null &&
ProjectFacetsManager.isProjectFacetDefined(typeID)) {
+ IProjectFacet projectFacet = ProjectFacetsManager.getProjectFacet(typeID);
+ return projectFacet != null && facetedProject.hasProjectFacet(projectFacet);
+ }
+ return false;
+ }
+}
Added:
trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.override.core/src/org/jboss/ide/eclipse/as/wtp/override/core/vcf/DefaultReferenceResolver.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.override.core/src/org/jboss/ide/eclipse/as/wtp/override/core/vcf/DefaultReferenceResolver.java
(rev 0)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.override.core/src/org/jboss/ide/eclipse/as/wtp/override/core/vcf/DefaultReferenceResolver.java 2009-07-03
08:41:54 UTC (rev 16377)
@@ -0,0 +1,81 @@
+package org.jboss.ide.eclipse.as.wtp.override.core.vcf;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.emf.common.util.URI;
+import org.eclipse.wst.common.componentcore.ComponentCore;
+import org.eclipse.wst.common.componentcore.UnresolveableURIException;
+import org.eclipse.wst.common.componentcore.internal.ComponentcorePackage;
+import org.eclipse.wst.common.componentcore.internal.DependencyType;
+import org.eclipse.wst.common.componentcore.internal.ReferencedComponent;
+import org.eclipse.wst.common.componentcore.internal.StructureEdit;
+import org.eclipse.wst.common.componentcore.internal.impl.ModuleURIUtil;
+import org.eclipse.wst.common.componentcore.internal.resources.VirtualReference;
+import org.eclipse.wst.common.componentcore.resources.IVirtualComponent;
+import org.eclipse.wst.common.componentcore.resources.IVirtualReference;
+
+public class DefaultReferenceResolver implements IReferenceResolver {
+ // Does not need to implement,
+ // default is always called as last resort
+ public boolean canResolve(IVirtualComponent context,
+ ReferencedComponent referencedComponent) {
+ return false;
+ }
+
+ // Does not need to implement,
+ // default is always called as last resort
+ public boolean canResolve(IVirtualReference reference) {
+ return false;
+ }
+
+ public IVirtualReference resolve(IVirtualComponent context,
+ ReferencedComponent referencedComponent) {
+ IVirtualComponent targetComponent = null;
+ IProject targetProject = null;
+ URI uri = referencedComponent.getHandle();
+ if (uri == null)
+ return null;
+ boolean isClassPathURI = ModuleURIUtil.isClassPathURI(uri);
+ if( !isClassPathURI ){
+ try {
+ targetProject = StructureEdit.getContainingProject(uri);
+ } catch(UnresolveableURIException uurie) {
+ //Ignore
+ }
+ // if the project cannot be resolved, assume it's local - really it probably
deleted
+
+ targetComponent = ComponentCore.createComponent(targetProject);
+
+
+ }else{
+ String archiveType = ""; //$NON-NLS-1$
+ String archiveName = ""; //$NON-NLS-1$
+ try {
+ archiveType = ModuleURIUtil.getArchiveType(uri);
+ archiveName = ModuleURIUtil.getArchiveName(uri);
+
+ } catch (UnresolveableURIException e) {
+ //Ignore
+ }
+ targetComponent = ComponentCore.createArchiveComponent(context.getProject(),
archiveType + IPath.SEPARATOR + archiveName );
+ }
+ return new VirtualReference(context, targetComponent,
referencedComponent.getRuntimePath(),
referencedComponent.getDependencyType().getValue());
+ }
+
+ public ReferencedComponent resolve(IVirtualReference reference) {
+ IVirtualComponent referencedComponent = reference.getReferencedComponent();
+ ReferencedComponent refComp =
ComponentcorePackage.eINSTANCE.getComponentcoreFactory().createReferencedComponent();
+ refComp.setRuntimePath(reference.getRuntimePath());
+ refComp.setDependencyType(DependencyType.get(reference.getDependencyType()));
+ refComp.setArchiveName(reference.getArchiveName());
+ if( referencedComponent != null ) {
+ if( !referencedComponent.isBinary())
+ refComp.setHandle(ModuleURIUtil.fullyQualifyURI(referencedComponent.getProject()));
+ else
+ refComp.setHandle(ModuleURIUtil.archiveComponentfullyQualifyURI(referencedComponent.getName()));
+ }
+ return refComp;
+ }
+
+
+}
Added:
trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.override.core/src/org/jboss/ide/eclipse/as/wtp/override/core/vcf/IJBTComponent.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.override.core/src/org/jboss/ide/eclipse/as/wtp/override/core/vcf/IJBTComponent.java
(rev 0)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.override.core/src/org/jboss/ide/eclipse/as/wtp/override/core/vcf/IJBTComponent.java 2009-07-03
08:41:54 UTC (rev 16377)
@@ -0,0 +1,11 @@
+package org.jboss.ide.eclipse.as.wtp.override.core.vcf;
+
+/**
+ * Simply a marker to know if this is one of our components
+ * or one of WTP's.
+ * @author rob
+ *
+ */
+public interface IJBTComponent {
+
+}
Added:
trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.override.core/src/org/jboss/ide/eclipse/as/wtp/override/core/vcf/IReferenceResolver.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.override.core/src/org/jboss/ide/eclipse/as/wtp/override/core/vcf/IReferenceResolver.java
(rev 0)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.override.core/src/org/jboss/ide/eclipse/as/wtp/override/core/vcf/IReferenceResolver.java 2009-07-03
08:41:54 UTC (rev 16377)
@@ -0,0 +1,12 @@
+package org.jboss.ide.eclipse.as.wtp.override.core.vcf;
+
+import org.eclipse.wst.common.componentcore.internal.ReferencedComponent;
+import org.eclipse.wst.common.componentcore.resources.IVirtualComponent;
+import org.eclipse.wst.common.componentcore.resources.IVirtualReference;
+
+public interface IReferenceResolver {
+ public boolean canResolve(IVirtualComponent context, ReferencedComponent
referencedComponent);
+ public IVirtualReference resolve(IVirtualComponent context, ReferencedComponent
referencedComponent);
+ public boolean canResolve(IVirtualReference reference);
+ public ReferencedComponent resolve(IVirtualReference reference);
+}
Added:
trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.override.core/src/org/jboss/ide/eclipse/as/wtp/override/core/vcf/JBTVirtualArchiveComponent.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.override.core/src/org/jboss/ide/eclipse/as/wtp/override/core/vcf/JBTVirtualArchiveComponent.java
(rev 0)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.override.core/src/org/jboss/ide/eclipse/as/wtp/override/core/vcf/JBTVirtualArchiveComponent.java 2009-07-03
08:41:54 UTC (rev 16377)
@@ -0,0 +1,15 @@
+package org.jboss.ide.eclipse.as.wtp.override.core.vcf;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.jst.j2ee.componentcore.J2EEModuleVirtualArchiveComponent;
+
+public class JBTVirtualArchiveComponent
+ extends J2EEModuleVirtualArchiveComponent implements IJBTComponent {
+
+ public JBTVirtualArchiveComponent(IProject aComponentProject,
+ String archiveLocation, IPath aRuntimePath) {
+ super(aComponentProject, archiveLocation, aRuntimePath);
+ }
+
+}
Added:
trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.override.core/src/org/jboss/ide/eclipse/as/wtp/override/core/vcf/JBTVirtualComponent.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.override.core/src/org/jboss/ide/eclipse/as/wtp/override/core/vcf/JBTVirtualComponent.java
(rev 0)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.override.core/src/org/jboss/ide/eclipse/as/wtp/override/core/vcf/JBTVirtualComponent.java 2009-07-03
08:41:54 UTC (rev 16377)
@@ -0,0 +1,336 @@
+package org.jboss.ide.eclipse.as.wtp.override.core.vcf;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.emf.common.util.URI;
+import org.eclipse.jst.j2ee.componentcore.util.EARVirtualRootFolder;
+import org.eclipse.jst.j2ee.internal.plugin.IJ2EEModuleConstants;
+import org.eclipse.jst.j2ee.internal.project.J2EEProjectUtilities;
+import org.eclipse.jst.j2ee.project.JavaEEProjectUtilities;
+import org.eclipse.jst.jee.application.ICommonModule;
+import org.eclipse.wst.common.componentcore.internal.ComponentcoreFactory;
+import org.eclipse.wst.common.componentcore.internal.ComponentcorePackage;
+import org.eclipse.wst.common.componentcore.internal.ReferencedComponent;
+import org.eclipse.wst.common.componentcore.internal.StructureEdit;
+import org.eclipse.wst.common.componentcore.internal.WorkbenchComponent;
+import org.eclipse.wst.common.componentcore.internal.builder.DependencyGraphManager;
+import org.eclipse.wst.common.componentcore.internal.resources.VirtualComponent;
+import org.eclipse.wst.common.componentcore.internal.resources.VirtualFolder;
+import org.eclipse.wst.common.componentcore.internal.util.IComponentImplFactory;
+import org.eclipse.wst.common.componentcore.resources.IVirtualComponent;
+import org.eclipse.wst.common.componentcore.resources.IVirtualFolder;
+import org.eclipse.wst.common.componentcore.resources.IVirtualReference;
+
+public class JBTVirtualComponent
+ extends VirtualComponent implements IJBTComponent, IComponentImplFactory {
+
+ private IVirtualReference[] cachedReferences;
+ private long depGraphModStamp;
+
+ public JBTVirtualComponent() {
+ super();
+ }
+
+ public JBTVirtualComponent(IProject aProject, IPath aRuntimePath) {
+ super(aProject, aRuntimePath);
+ }
+
+ /*
+ * These methods allow this component to make new elements
+ */
+ public IVirtualComponent createComponent(IProject aProject) {
+ return new JBTVirtualComponent(aProject, new Path("/")); //$NON-NLS-1$
+ }
+
+ public IVirtualComponent createArchiveComponent(IProject aProject, String
archiveLocation, IPath aRuntimePath) {
+ return new JBTVirtualArchiveComponent(aProject, archiveLocation, aRuntimePath);
+ }
+
+ public IVirtualFolder createFolder(IProject aProject, IPath aRuntimePath) {
+ return new VirtualFolder(aProject, aRuntimePath);
+ }
+
+
+ /*
+ * The following group of methods was
+ * stolen / adapted from EarVirtualComponent.
+ */
+
+ public IVirtualReference[] getReferences() {
+
+ IVirtualReference[] cached = getCachedReferences();
+ if (cached != null)
+ return cached;
+ List<IVirtualReference> hardReferences = getHardReferences(this);
+ if( shouldExposeLooseReferences()) {
+ List dynamicReferences = getLooseArchiveReferences(this, hardReferences);
+ if (dynamicReferences != null) {
+ hardReferences.addAll(dynamicReferences);
+ }
+ }
+ cachedReferences = (IVirtualReference[]) hardReferences.toArray(new
IVirtualReference[hardReferences.size()]);
+ return cachedReferences;
+ }
+
+ protected boolean shouldExposeLooseReferences() {
+ return false;
+ }
+
+ // Returns cache if still valid or null
+ public IVirtualReference[] getCachedReferences() {
+ if (cachedReferences != null && checkIfStillValid())
+ return cachedReferences;
+ else
+ depGraphModStamp = DependencyGraphManager.getInstance().getModStamp();
+ return null;
+ }
+
+ private boolean checkIfStillValid() {
+ return DependencyGraphManager.getInstance().checkIfStillValid(depGraphModStamp);
+ }
+
+ private static List<IVirtualReference> getHardReferences(IVirtualComponent
earComponent) {
+ StructureEdit core = null;
+ List hardReferences = new ArrayList();
+ try {
+ core = StructureEdit.getStructureEditForRead(earComponent.getProject());
+ if (core != null && core.getComponent() != null) {
+ WorkbenchComponent component = core.getComponent();
+ if (component != null) {
+ List referencedComponents = component.getReferencedComponents();
+ for (Iterator iter = referencedComponents.iterator(); iter.hasNext();) {
+ ReferencedComponent referencedComponent = (ReferencedComponent) iter.next();
+ if (referencedComponent == null)
+ continue;
+ IVirtualReference vReference = createVirtualReference(earComponent,
referencedComponent);
+ if (vReference != null) {
+ IVirtualComponent referencedIVirtualComponent =
vReference.getReferencedComponent();
+ if (referencedIVirtualComponent != null &&
referencedIVirtualComponent.exists()) {
+ String archiveName = getArchiveName(referencedIVirtualComponent,
referencedComponent);
+ vReference.setArchiveName(archiveName);
+ hardReferences.add(vReference);
+ }
+ }
+ }
+ }
+ }
+ } finally {
+ if (core != null)
+ core.dispose();
+ }
+ return hardReferences;
+ }
+
+ protected static String getArchiveName(IVirtualComponent referencedIVirtualComponent,
ReferencedComponent referencedComponent) {
+ String archiveName = null;
+ if (referencedComponent.getDependentObject() != null) {
+ /*
+ * The getDependentObject part of this code needs explanation.
+ * The IVirtualComponent allows you to set some "dependent object"
+ * if you wish. WTP projects often do in the case that there's a
+ * deployment descriptor of some sort. In those cases, WTP's
+ * "dependent object" is of type ICommonModule and is an EObject.
+ * This allows virtual component to override the default archive
+ * name with one from a deployment descriptor.
+ */
+ archiveName = ((ICommonModule) referencedComponent.getDependentObject()).getUri();
+ } else {
+ if( referencedIVirtualComponent instanceof IJBTComponent ) {
+ archiveName = getJBTComponentArchiveName(referencedIVirtualComponent,
referencedComponent);
+ } else {
+ archiveName = legacy_getWTPComponentArchiveName(referencedIVirtualComponent,
referencedComponent);
+ }
+
+ }
+ return archiveName;
+ }
+
+ protected static String getJBTComponentArchiveName(IVirtualComponent moduleComp,
ReferencedComponent ref) {
+ return ref.getArchiveName();
+ }
+
+ /*
+ * Legacy WTP implementation
+ */
+
+ protected static String legacy_getWTPComponentArchiveName(IVirtualComponent moduleComp,
ReferencedComponent ref) {
+ String archiveName = null;
+ if (moduleComp.isBinary()) {
+ String uri = legacy_getJarURI(ref, moduleComp);
+ } else if(ref.getArchiveName() != null){
+ archiveName = ref.getArchiveName();
+ } else {
+ IProject referencedProject = moduleComp.getProject();
+ if (JavaEEProjectUtilities.isDynamicWebProject(referencedProject) ||
J2EEProjectUtilities.isStaticWebProject(referencedProject)) {
+ archiveName = moduleComp.getName() + IJ2EEModuleConstants.WAR_EXT;
+ } else if (JavaEEProjectUtilities.isJCAProject(referencedProject)) {
+ archiveName = moduleComp.getName() + IJ2EEModuleConstants.RAR_EXT;
+ } else if (JavaEEProjectUtilities.isUtilityProject(referencedProject)) {
+ archiveName = legacy_getJarURI(ref, moduleComp);
+ } else {
+ archiveName = moduleComp.getName() + IJ2EEModuleConstants.JAR_EXT;
+ }
+ }
+ return archiveName;
+ }
+
+ protected static String legacy_getJarURI(ReferencedComponent ref, IVirtualComponent
moduleComp) {
+ String uri = null;
+ if (uri == null || uri.length() < 0) {
+ if(moduleComp.isBinary()){
+ uri = new Path(moduleComp.getName()).lastSegment();
+ } else {
+ uri = moduleComp.getName() + IJ2EEModuleConstants.JAR_EXT;
+ }
+ } else {
+ String prefix = ref.getRuntimePath().makeRelative().toString();
+ if (prefix.length() > 0) {
+ uri = prefix + "/" + uri; //$NON-NLS-1$
+ }
+ }
+ return uri;
+ }
+
+ private static List getLooseArchiveReferences(JBTVirtualComponent component, List
hardReferences) {
+ return getLooseArchiveReferences(component, hardReferences, null,
(EARVirtualRootFolder)component.getRootFolder());
+ }
+
+ private static List getLooseArchiveReferences(JBTVirtualComponent component, List
hardReferences, List dynamicReferences, EARVirtualRootFolder folder) {
+ return null;
+ }
+
+
+ // Potentially to be overridden (awesome?)
+ protected static IVirtualReference createVirtualReference(IVirtualComponent context,
ReferencedComponent referencedComponent) {
+ IReferenceResolver res = ReferenceResolverUtil.getDefault().getResolver(context,
referencedComponent);
+ return res.resolve(context, referencedComponent);
+ }
+
+ protected static ReferencedComponent createReferencedComponent(IVirtualReference
reference) {
+ IReferenceResolver res = ReferenceResolverUtil.getDefault().getResolver(reference);
+ return res.resolve(reference);
+ }
+
+ /* *******************************************
+ * Overrides from VirtualComponent class
+ * These are mostly here because of the extrapolation
+ * of createVirtualReference into its own method.
+ * *******************************************/
+ @Override
+ public IVirtualReference[] getAllReferences() {
+ StructureEdit core = null;
+ List references = new ArrayList();
+ try {
+ core = StructureEdit.getStructureEditForRead(getProject());
+ if (core!=null && core.getComponent()!=null) {
+ WorkbenchComponent component = core.getComponent();
+ if (component!=null) {
+ List referencedComponents = component.getReferencedComponents();
+ for (Iterator iter = referencedComponents.iterator(); iter.hasNext();) {
+ ReferencedComponent referencedComponent = (ReferencedComponent) iter.next();
+ if (referencedComponent==null)
+ continue;
+ IVirtualReference vReference = createVirtualReference(this, referencedComponent);
+ if( vReference != null ){
+ vReference.setArchiveName( referencedComponent.getArchiveName() );
+ }
+ if (vReference != null && vReference.getReferencedComponent() != null)
+ references.add(vReference);
+ }
+ }
+ }
+ return (IVirtualReference[]) references.toArray(new
IVirtualReference[references.size()]);
+ } finally {
+ if(core != null)
+ core.dispose();
+ }
+ }
+
+ @Override
+ protected ReferencedComponent getWorkbenchReferencedComponent(IVirtualReference
aReference, WorkbenchComponent component) {
+ if (aReference == null || aReference.getReferencedComponent() == null || component ==
null)
+ return null;
+ List referencedComponents = component.getReferencedComponents();
+ URI uri = createReferencedComponent(aReference).getHandle();
+ for (int i=0; i<referencedComponents.size(); i++) {
+ ReferencedComponent ref = (ReferencedComponent) referencedComponents.get(i);
+ if( ref.getHandle().equals(uri))
+ return ref;
+ }
+ return null;
+ }
+
+ @Override
+ public void addReferences(IVirtualReference[] references) {
+ if (references==null || references.length==0)
+ return;
+ StructureEdit core = null;
+ try {
+ core = StructureEdit.getStructureEditForWrite(getProject());
+ if (core == null)
+ return;
+ WorkbenchComponent component = core.getComponent();
+ ReferencedComponent referencedComponent = null;
+ ComponentcoreFactory factory =
ComponentcorePackage.eINSTANCE.getComponentcoreFactory();
+ for (int i=0; i<references.length; i++) {
+ if (references[i] == null)
+ continue;
+ referencedComponent = createReferencedComponent(references[i]);
+ if( referencedComponent != null )
+ component.getReferencedComponents().add(referencedComponent);
+ }
+ //clean up any old obsolete references
+ if (component != null){
+ cleanUpReferences(component);
+ }
+ } finally {
+ if(core != null) {
+ core.saveIfNecessary(null);
+ core.dispose();
+ }
+ }
+ }
+
+ /* @Override */
+ private void cleanUpReferences(WorkbenchComponent component) {
+ List referencedComponents = component.getReferencedComponents();
+ for (Iterator iter = referencedComponents.iterator(); iter.hasNext();) {
+ ReferencedComponent referencedComponent = (ReferencedComponent) iter.next();
+ if (referencedComponent==null)
+ continue;
+ IVirtualReference vReference = createVirtualReference(this, referencedComponent);
+ if (vReference == null || vReference.getReferencedComponent() == null ||
!vReference.getReferencedComponent().exists()){
+ iter.remove();
+ }
+ }
+ }
+
+ @Override
+ public void setReferences(IVirtualReference[] references) {
+ StructureEdit core = null;
+ try {
+ core = StructureEdit.getStructureEditForWrite(getProject());
+ WorkbenchComponent component = core.getComponent();
+ ReferencedComponent referencedComponent = null;
+
+ component.getReferencedComponents().clear();
+ ComponentcoreFactory factory =
ComponentcorePackage.eINSTANCE.getComponentcoreFactory();
+ for (int i=0; i<references.length; i++) {
+ referencedComponent = createReferencedComponent(references[i]);
+ if( referencedComponent != null )
+ component.getReferencedComponents().add(referencedComponent);
+ }
+ } finally {
+ if(core != null) {
+ core.saveIfNecessary(null);
+ core.dispose();
+ }
+ }
+ }
+
+}
Added:
trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.override.core/src/org/jboss/ide/eclipse/as/wtp/override/core/vcf/ReferenceResolverUtil.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.override.core/src/org/jboss/ide/eclipse/as/wtp/override/core/vcf/ReferenceResolverUtil.java
(rev 0)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.override.core/src/org/jboss/ide/eclipse/as/wtp/override/core/vcf/ReferenceResolverUtil.java 2009-07-03
08:41:54 UTC (rev 16377)
@@ -0,0 +1,126 @@
+package org.jboss.ide.eclipse.as.wtp.override.core.vcf;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Comparator;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IConfigurationElement;
+import org.eclipse.core.runtime.IExtensionRegistry;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.wst.common.componentcore.internal.ModulecorePlugin;
+import org.eclipse.wst.common.componentcore.internal.ReferencedComponent;
+import org.eclipse.wst.common.componentcore.resources.IVirtualComponent;
+import org.eclipse.wst.common.componentcore.resources.IVirtualReference;
+import org.jboss.ide.eclipse.as.wtp.override.core.Activator;
+
+public class ReferenceResolverUtil {
+ public static ReferenceResolverUtil instance = null;
+ public static ReferenceResolverUtil getDefault() {
+ if( instance == null )
+ instance = new ReferenceResolverUtil();
+ return instance;
+ }
+
+ private HashMap<String, ReferenceResolverWrapper> resolvers = null;
+ private ArrayList<IReferenceResolver> sorted = null;
+ private DefaultReferenceResolver defaultResolver = new DefaultReferenceResolver();
+ public IReferenceResolver[] getResolvers() {
+ if( resolvers == null )
+ loadResolvers();
+ return (IReferenceResolver[]) sorted.toArray(new IReferenceResolver[sorted.size()]);
+ }
+
+ public IReferenceResolver getResolver(IVirtualComponent context, ReferencedComponent
reference) {
+ getResolvers();
+ Iterator<IReferenceResolver> i = sorted.iterator();
+ IReferenceResolver resolver;
+ while(i.hasNext()) {
+ resolver = i.next();
+ if( resolver.canResolve(context, reference))
+ return resolver;
+ }
+ return defaultResolver;
+ }
+
+ public IReferenceResolver getResolver(IVirtualReference reference) {
+ getResolvers();
+ Iterator<IReferenceResolver> i = sorted.iterator();
+ IReferenceResolver resolver;
+ while(i.hasNext()) {
+ resolver = i.next();
+ if( resolver.canResolve(reference))
+ return resolver;
+ }
+ return defaultResolver;
+ }
+
+ protected void loadResolvers() {
+ HashMap<String, ReferenceResolverWrapper> map = new HashMap<String,
ReferenceResolverWrapper>();
+
+ IExtensionRegistry registry = Platform.getExtensionRegistry();
+ IConfigurationElement[] cf = registry.getConfigurationElementsFor(Activator.PLUGIN_ID,
"referenceResolver"); //$NON-NLS-1$
+ String id = null;
+ for( int j = 0; j < cf.length; j++ ) {
+ id = cf[j].getAttribute("id");
+ try {
+ map.put(id, new ReferenceResolverWrapper(
+ id, (IReferenceResolver)
+ cf[j].createExecutableExtension("class"),
+ cf[j].getAttribute("weight")));
+ } catch( CoreException ce ) {
+ // TODO figure it out
+ }
+ }
+ resolvers = map;
+
+ // Cache the sorted ones
+ List<ReferenceResolverWrapper> list = new ArrayList(resolvers.values());
+ Comparator comparator = new Comparator() {
+ public int compare(Object o1, Object o2) {
+ if( !(o1 instanceof ReferenceResolverWrapper))
+ return -1;
+ if( !(o2 instanceof ReferenceResolverWrapper))
+ return 1;
+ return ((ReferenceResolverWrapper)o2).getWeight()
+ - ((ReferenceResolverWrapper)o1).getWeight();
+ }
+ };
+
+ Collections.sort(list, comparator);
+ ArrayList<IReferenceResolver> sorted = new
ArrayList<IReferenceResolver>();
+ Iterator i = list.iterator();
+ while(i.hasNext())
+ sorted.add(((ReferenceResolverWrapper)i.next()).getResolver());
+ this.sorted = sorted;
+ }
+
+
+ protected class ReferenceResolverWrapper {
+ private String id;
+ private IReferenceResolver resolver;
+ private int weight;
+ public ReferenceResolverWrapper(String id, IReferenceResolver resolver, String weight)
{
+ this.id = id;
+ this.resolver = resolver;
+ try {
+ this.weight = Integer.parseInt(weight);
+ } catch( NumberFormatException nfe) {
+ this.weight = 1000;
+ }
+ }
+ public int getWeight() {
+ return weight;
+ }
+ public String getId() {
+ return id;
+ }
+ public IReferenceResolver getResolver() {
+ return resolver;
+ }
+ }
+
+}
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.override.ui/META-INF/MANIFEST.MF
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.override.ui/META-INF/MANIFEST.MF 2009-07-03
07:16:52 UTC (rev 16376)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.override.ui/META-INF/MANIFEST.MF 2009-07-03
08:41:54 UTC (rev 16377)
@@ -20,6 +20,7 @@
org.eclipse.jdt.core;bundle-version="3.5.0",
org.eclipse.jem.util;bundle-version="2.0.200",
org.eclipse.jst.jee;bundle-version="1.0.200",
- org.eclipse.jdt.ui;bundle-version="3.5.0"
+ org.eclipse.jdt.ui;bundle-version="3.5.0",
+ org.jboss.ide.eclipse.as.wtp.override.core;bundle-version="1.0.0"
Bundle-ActivationPolicy: lazy
Bundle-RequiredExecutionEnvironment: J2SE-1.5
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.override.ui/src/org/jboss/ide/eclipse/as/wtp/override/ui/propertypage/AddModuleDependenciesPropertiesPage.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.override.ui/src/org/jboss/ide/eclipse/as/wtp/override/ui/propertypage/AddModuleDependenciesPropertiesPage.java 2009-07-03
07:16:52 UTC (rev 16376)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.override.ui/src/org/jboss/ide/eclipse/as/wtp/override/ui/propertypage/AddModuleDependenciesPropertiesPage.java 2009-07-03
08:41:54 UTC (rev 16377)
@@ -51,12 +51,9 @@
import org.eclipse.jface.viewers.TextCellEditor;
import org.eclipse.jface.viewers.Viewer;
import org.eclipse.jface.window.Window;
-import org.eclipse.jst.j2ee.componentcore.J2EEModuleVirtualArchiveComponent;
import org.eclipse.jst.j2ee.internal.ManifestUIResourceHandler;
-import org.eclipse.jst.j2ee.internal.plugin.IJ2EEModuleConstants;
import org.eclipse.jst.j2ee.internal.plugin.J2EEUIMessages;
import org.eclipse.jst.j2ee.internal.plugin.J2EEUIPlugin;
-import org.eclipse.jst.j2ee.project.JavaEEProjectUtilities;
import org.eclipse.jst.j2ee.project.facet.IJavaProjectMigrationDataModelProperties;
import org.eclipse.jst.j2ee.project.facet.JavaProjectMigrationDataModelProvider;
import org.eclipse.swt.SWT;
@@ -93,8 +90,9 @@
import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
import org.eclipse.wst.common.frameworks.datamodel.IDataModelOperation;
import org.eclipse.wst.common.frameworks.datamodel.IDataModelProvider;
+import org.jboss.ide.eclipse.as.wtp.override.core.vcf.ComponentUtils;
import org.jboss.ide.eclipse.as.wtp.override.ui.Messages;
-
+
public class AddModuleDependenciesPropertiesPage implements Listener,
IModuleDependenciesControl {
@@ -993,37 +991,15 @@
* Method returns the name of the given IVirtualComponent being sure the correct
extension
* is on the end of the name, this is important for internal projects. Added for [Bug
241509]
*
+ * Note (rs) : I do not believe this ever gets called with a binary virtComp
+ *
* @param virtComp the IVirtualComponent to get the name of with the correct extension
* @return the name of the given IVirtualComponent with the correct extension
*/
protected String getVirtualComponentNameWithExtension(IVirtualComponent virtComp) {
String virtCompURIMapName = this.getURIMappingName(virtComp);
-
- boolean linkedToEAR = true;
- try {
- if(virtComp.isBinary()){
- linkedToEAR = ((J2EEModuleVirtualArchiveComponent)virtComp).isLinkedToEAR();
- ((J2EEModuleVirtualArchiveComponent)virtComp).setLinkedToEAR(false);
- }
- if(JavaEEProjectUtilities.isDynamicWebComponent(virtComp)) {
- if(!virtCompURIMapName.endsWith(IJ2EEModuleConstants.WAR_EXT)) {
- //web module URIs need to end in WAR
- virtCompURIMapName += IJ2EEModuleConstants.WAR_EXT;
- }
- } else if(JavaEEProjectUtilities.isJCAComponent(virtComp)) {
- if(!virtCompURIMapName.endsWith(IJ2EEModuleConstants.RAR_EXT)) {
- //connector module URIs need to end in RAR
- virtCompURIMapName += IJ2EEModuleConstants.RAR_EXT;
- }
- } else if(!virtCompURIMapName.endsWith(IJ2EEModuleConstants.JAR_EXT)) {
- //all other modules (EJB, AppClient, Utility) need to end in JAR
- virtCompURIMapName += IJ2EEModuleConstants.JAR_EXT;
- }
- } finally {
- if(virtComp.isBinary()){
- ((J2EEModuleVirtualArchiveComponent)virtComp).setLinkedToEAR(linkedToEAR);
- }
- }
+ String extension = ComponentUtils.getDefaultProjectExtension(virtComp);
+ virtCompURIMapName += extension;
return virtCompURIMapName;
}
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.override.ui/src/org/jboss/ide/eclipse/as/wtp/override/ui/propertypage/ComponentDependencyContentProvider.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.override.ui/src/org/jboss/ide/eclipse/as/wtp/override/ui/propertypage/ComponentDependencyContentProvider.java 2009-07-03
07:16:52 UTC (rev 16376)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.override.ui/src/org/jboss/ide/eclipse/as/wtp/override/ui/propertypage/ComponentDependencyContentProvider.java 2009-07-03
08:41:54 UTC (rev 16377)
@@ -11,6 +11,7 @@
*******************************************************************************/
package org.jboss.ide.eclipse.as.wtp.override.ui.propertypage;
+import java.io.File;
import java.util.HashMap;
import org.eclipse.core.resources.IProject;
@@ -22,6 +23,7 @@
import org.eclipse.jface.viewers.LabelProvider;
import org.eclipse.jface.viewers.Viewer;
import org.eclipse.swt.graphics.Image;
+import org.eclipse.wst.common.componentcore.internal.resources.VirtualArchiveComponent;
import org.eclipse.wst.common.componentcore.resources.IVirtualComponent;
@@ -67,6 +69,12 @@
}
return runtimePaths.get(element);
} else if (columnIndex == 1) {
+ if( comp.isBinary() && comp instanceof VirtualArchiveComponent) {
+ IPath p = ((VirtualArchiveComponent)comp).getWorkspaceRelativePath();
+ if( p == null )
+ p = new
Path(((VirtualArchiveComponent)comp).getUnderlyingDiskFile().getAbsolutePath());
+ return p.toString();
+ }
return comp.getProject().getName();
}
} else if (element instanceof IProject){