Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 140678 Details for
Bug 282269
Extension point for allowing extension points to interpret reference handles in component.xml
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
[patch]
non-behavior-changing cleanup
282269.patch (text/plain), 6.63 KB, created by
Rob Stryker
on 2009-07-02 05:29:41 EDT
(
hide
)
Description:
non-behavior-changing cleanup
Filename:
MIME Type:
Creator:
Rob Stryker
Created:
2009-07-02 05:29:41 EDT
Size:
6.63 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.wst.common.modulecore >Index: modulecore-src/org/eclipse/wst/common/componentcore/internal/resources/VirtualComponent.java >=================================================================== >RCS file: /cvsroot/webtools/common/plugins/org.eclipse.wst.common.modulecore/modulecore-src/org/eclipse/wst/common/componentcore/internal/resources/VirtualComponent.java,v >retrieving revision 1.62 >diff -u -r1.62 VirtualComponent.java >--- modulecore-src/org/eclipse/wst/common/componentcore/internal/resources/VirtualComponent.java 4 Sep 2008 05:47:27 -0000 1.62 >+++ modulecore-src/org/eclipse/wst/common/componentcore/internal/resources/VirtualComponent.java 2 Jul 2009 09:30:20 -0000 >@@ -16,6 +16,7 @@ > import java.util.List; > import java.util.Map; > import java.util.Properties; >+import java.util.Set; > > import org.eclipse.core.resources.IProject; > import org.eclipse.core.runtime.CoreException; >@@ -24,6 +25,7 @@ > import org.eclipse.core.runtime.IStatus; > import org.eclipse.core.runtime.Path; > import org.eclipse.core.runtime.Platform; >+import org.eclipse.emf.common.util.URI; > import org.eclipse.wst.common.componentcore.ComponentCore; > import org.eclipse.wst.common.componentcore.ModuleCoreNature; > import org.eclipse.wst.common.componentcore.internal.ComponentcoreFactory; >@@ -34,7 +36,7 @@ > 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.builder.IDependencyGraph; > import org.eclipse.wst.common.componentcore.internal.impl.ModuleURIUtil; > import org.eclipse.wst.common.componentcore.resources.IVirtualComponent; > import org.eclipse.wst.common.componentcore.resources.IVirtualFolder; >@@ -272,6 +274,17 @@ > return getReferences(); > } > >+ protected IVirtualReference createVirtualReference( ReferencedComponent ref) { >+ return StructureEdit.createVirtualReference(this, ref); >+ } >+ >+ protected URI getHandle(IVirtualReference reference) { >+ if(reference.getReferencedComponent().isBinary()) >+ return ModuleURIUtil.fullyQualifyURI(reference.getReferencedComponent().getProject()); >+ else >+ return ModuleURIUtil.archiveComponentfullyQualifyURI(reference.getReferencedComponent().getName()); >+ } >+ > public IVirtualReference[] getReferences() { > StructureEdit core = null; > List references = new ArrayList(); >@@ -285,7 +298,7 @@ > ReferencedComponent referencedComponent = (ReferencedComponent) iter.next(); > if (referencedComponent==null) > continue; >- IVirtualReference vReference = StructureEdit.createVirtualReference(this, referencedComponent); >+ IVirtualReference vReference = createVirtualReference(referencedComponent); > if( vReference != null ){ > vReference.setArchiveName( referencedComponent.getArchiveName() ); > } >@@ -320,10 +333,8 @@ > referencedComponent.setRuntimePath(references[i].getRuntimePath()); > > IVirtualComponent comp = references[i].getReferencedComponent(); >- if(comp!=null && !comp.isBinary()) >- referencedComponent.setHandle(ModuleURIUtil.fullyQualifyURI(comp.getProject())); >- else if (comp!=null) >- referencedComponent.setHandle(ModuleURIUtil.archiveComponentfullyQualifyURI(comp.getName())); >+ if( comp != null ) >+ referencedComponent.setHandle(getHandle(references[i])); > if (component != null) > component.getReferencedComponents().add(referencedComponent); > referencedComponent.setArchiveName(references[i].getArchiveName()); >@@ -346,7 +357,7 @@ > ReferencedComponent referencedComponent = (ReferencedComponent) iter.next(); > if (referencedComponent==null) > continue; >- IVirtualReference vReference = StructureEdit.createVirtualReference(this, referencedComponent); >+ IVirtualReference vReference = createVirtualReference(referencedComponent); > if (vReference == null || vReference.getReferencedComponent() == null || !vReference.getReferencedComponent().exists()){ > iter.remove(); > } >@@ -368,11 +379,9 @@ > referencedComponent.setRuntimePath(references[i].getRuntimePath()); > > IVirtualComponent comp = references[i].getReferencedComponent(); >- if( !comp.isBinary()) >- referencedComponent.setHandle(ModuleURIUtil.fullyQualifyURI(references[i].getReferencedComponent().getProject())); >- else >- referencedComponent.setHandle(ModuleURIUtil.archiveComponentfullyQualifyURI(references[i].getReferencedComponent().getName())); >- >+ if( comp != null ) >+ referencedComponent.setHandle(getHandle(references[i])); >+ > referencedComponent.setArchiveName(references[i].getArchiveName()); > component.getReferencedComponents().add(referencedComponent); > } >@@ -434,10 +443,11 @@ > * @return array of components > */ > public IVirtualComponent[] getReferencingComponents() { >- IProject[] handles = DependencyGraphManager.getInstance().getDependencyGraph().getReferencingComponents(getProject()); >- IVirtualComponent[] result = new IVirtualComponent[handles.length]; >- for (int i=0; i<handles.length; i++) >- result[i] = ComponentCore.createComponent(handles[i]); >+ Set<IProject> projects = IDependencyGraph.INSTANCE.getReferencingComponents(getProject()); >+ IVirtualComponent[] result = new IVirtualComponent[projects.size()]; >+ Iterator<IProject> i = projects.iterator(); >+ for (int j=0; j<projects.size(); j++) >+ result[j] = ComponentCore.createComponent(i.next()); > return result; > } > >@@ -479,14 +489,8 @@ > List referencedComponents = component.getReferencedComponents(); > for (int i=0; i<referencedComponents.size(); i++) { > ReferencedComponent ref = (ReferencedComponent) referencedComponents.get(i); >- if (!aReference.getReferencedComponent().isBinary()) { >- if (ref.getHandle().equals(ModuleURIUtil.fullyQualifyURI(aReference.getReferencedComponent().getProject()))) >- return ref; >- } >- else { >- if (ref.getHandle().equals(ModuleURIUtil.archiveComponentfullyQualifyURI(aReference.getReferencedComponent().getName()))) >- return ref; >- } >+ if( ref.getHandle().equals(getHandle(aReference))) >+ return ref; > } > return null; > } >@@ -508,7 +512,7 @@ > ReferencedComponent referencedComponent = (ReferencedComponent) iter.next(); > if (referencedComponent==null) > continue; >- IVirtualReference vReference = StructureEdit.createVirtualReference(this, referencedComponent); >+ IVirtualReference vReference = createVirtualReference(referencedComponent); > if( vReference != null ){ > vReference.setArchiveName( referencedComponent.getArchiveName() ); > }
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 282269
:
140678
|
140694
|
148568