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 105189 Details for
Bug 232841
imported source plugins not picked up
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]
Work In Progress
clipboard.txt (text/plain), 10.31 KB, created by
Curtis Windatt
on 2008-06-17 14:43:00 EDT
(
hide
)
Description:
Work In Progress
Filename:
MIME Type:
Creator:
Curtis Windatt
Created:
2008-06-17 14:43:00 EDT
Size:
10.31 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.pde.core >Index: src/org/eclipse/pde/internal/core/SourceLocationManager.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/SourceLocationManager.java,v >retrieving revision 1.47 >diff -u -r1.47 SourceLocationManager.java >--- src/org/eclipse/pde/internal/core/SourceLocationManager.java 7 May 2008 16:22:52 -0000 1.47 >+++ src/org/eclipse/pde/internal/core/SourceLocationManager.java 17 Jun 2008 18:41:35 -0000 >@@ -58,6 +58,9 @@ > result = searchBundleManifestLocations(pluginBase); > if (result == null) { > result = searchExtensionLocations(relativePath); >+ if (result == null) { >+ result = searchWorkspaceBundleManifestLocations(pluginBase); >+ } > } > } > return result; >@@ -88,7 +91,12 @@ > PDECore.log(e); > } > } >+ > result = searchExtensionLocations(relativePath); >+ >+ if (result == null) { >+ result = searchWorkspaceBundleManifestLocations(pluginBase); >+ } > } > if (result != null) { > try { >@@ -297,6 +305,16 @@ > return null; > } > >+ private IPath searchWorkspaceBundleManifestLocations(IPluginBase pluginBase) { >+ BundleManifestSourceLocationManager manager = new BundleManifestSourceLocationManager(); >+ manager.setPlugins(PDECore.getDefault().getModelManager().getWorkspaceModels()); >+ SourceLocation location = manager.getSourceLocation(pluginBase.getId(), new Version(pluginBase.getVersion())); >+ if (location != null && location.getPath().toFile().exists()) { >+ return location.getPath(); >+ } >+ return null; >+ } >+ > /** > * Parses serialized source locations into an array list of user specified source locations > * @param text text to parse >Index: src/org/eclipse/pde/internal/core/BundleManifestSourceLocationManager.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/BundleManifestSourceLocationManager.java,v >retrieving revision 1.3 >diff -u -r1.3 BundleManifestSourceLocationManager.java >--- src/org/eclipse/pde/internal/core/BundleManifestSourceLocationManager.java 2 Jan 2008 15:56:17 -0000 1.3 >+++ src/org/eclipse/pde/internal/core/BundleManifestSourceLocationManager.java 17 Jun 2008 18:41:35 -0000 >@@ -10,26 +10,15 @@ > *******************************************************************************/ > package org.eclipse.pde.internal.core; > >-import java.util.ArrayList; >-import java.util.Collection; >-import java.util.HashMap; >-import java.util.HashSet; >-import java.util.Iterator; >-import java.util.Map; >-import java.util.Set; >- >-import org.eclipse.core.runtime.IPath; >-import org.eclipse.core.runtime.IStatus; >-import org.eclipse.core.runtime.Path; >-import org.eclipse.core.runtime.Status; >+import java.util.*; >+import org.eclipse.core.runtime.*; > import org.eclipse.osgi.util.ManifestElement; > import org.eclipse.osgi.util.NLS; > import org.eclipse.pde.core.plugin.IPluginBase; > import org.eclipse.pde.core.plugin.IPluginModelBase; >+import org.eclipse.pde.internal.core.bundle.BundlePluginBase; > import org.eclipse.pde.internal.core.plugin.PluginBase; >-import org.osgi.framework.BundleException; >-import org.osgi.framework.Constants; >-import org.osgi.framework.Version; >+import org.osgi.framework.*; > > /** > * Stores location information about bundles that provide source for >@@ -202,35 +191,38 @@ > fPluginToSourceBundle = new HashMap(); > for (int i = 0; i < externalModels.length; i++) { > IPluginBase currentPlugin = externalModels[i].getPluginBase(); >+ String bundleSourceEntry = null; > if (currentPlugin instanceof PluginBase) { >- String bundleSourceEntry = ((PluginBase) currentPlugin).getBundleSourceEntry(); >- if (bundleSourceEntry != null) { >- ManifestElement[] manifestElements = null; >- try { >- manifestElements = ManifestElement.parseHeader(ICoreConstants.ECLIPSE_SOURCE_BUNDLE, bundleSourceEntry); >- } catch (BundleException e) { >- PDECore.log(new Status(IStatus.ERROR, PDECore.PLUGIN_ID, PDECoreMessages.SourceLocationManager_problemProcessingBundleManifestSourceHeader, e)); >- manifestElements = null; >- } >- if (manifestElements != null) { >- IPath path = new Path(externalModels[i].getInstallLocation()); >- if (path.toFile().exists()) { >- for (int j = 0; j < manifestElements.length; j++) { >- ManifestElement currentElement = manifestElements[j]; >- String binaryPluginName = currentElement.getValue(); >- String versionEntry = currentElement.getAttribute(Constants.VERSION_ATTRIBUTE); >- // Currently the version attribute is required >- if (binaryPluginName != null && binaryPluginName.length() > 0 && versionEntry != null && versionEntry.length() > 0) { >- Version version = null; >- try { >- version = new Version(versionEntry); >- } catch (IllegalArgumentException e) { >- PDECore.log(new Status(IStatus.ERROR, PDECore.PLUGIN_ID, PDECoreMessages.SourceLocationManager_problemProcessingBundleManifestSourceHeader, e)); >- } >- fPluginToSourceBundle.put(new SourceLocationKey(binaryPluginName, version), externalModels[i]); >- } else { >- PDECore.log(new Status(IStatus.WARNING, PDECore.PLUGIN_ID, NLS.bind(PDECoreMessages.BundleManifestSourceLocationManager_problemProcessBundleManifestHeaderAttributeMissing, currentPlugin.getName()))); >+ bundleSourceEntry = ((PluginBase) currentPlugin).getBundleSourceEntry(); >+ } else if (currentPlugin instanceof BundlePluginBase) { >+ bundleSourceEntry = ((BundlePluginBase) currentPlugin).getBundleSourceEntry(); >+ } >+ if (bundleSourceEntry != null) { >+ ManifestElement[] manifestElements = null; >+ try { >+ manifestElements = ManifestElement.parseHeader(ICoreConstants.ECLIPSE_SOURCE_BUNDLE, bundleSourceEntry); >+ } catch (BundleException e) { >+ PDECore.log(new Status(IStatus.ERROR, PDECore.PLUGIN_ID, PDECoreMessages.SourceLocationManager_problemProcessingBundleManifestSourceHeader, e)); >+ manifestElements = null; >+ } >+ if (manifestElements != null) { >+ IPath path = new Path(externalModels[i].getInstallLocation()); >+ if (path.toFile().exists()) { >+ for (int j = 0; j < manifestElements.length; j++) { >+ ManifestElement currentElement = manifestElements[j]; >+ String binaryPluginName = currentElement.getValue(); >+ String versionEntry = currentElement.getAttribute(Constants.VERSION_ATTRIBUTE); >+ // Currently the version attribute is required >+ if (binaryPluginName != null && binaryPluginName.length() > 0 && versionEntry != null && versionEntry.length() > 0) { >+ Version version = null; >+ try { >+ version = new Version(versionEntry); >+ } catch (IllegalArgumentException e) { >+ PDECore.log(new Status(IStatus.ERROR, PDECore.PLUGIN_ID, PDECoreMessages.SourceLocationManager_problemProcessingBundleManifestSourceHeader, e)); > } >+ fPluginToSourceBundle.put(new SourceLocationKey(binaryPluginName, version), externalModels[i]); >+ } else { >+ PDECore.log(new Status(IStatus.WARNING, PDECore.PLUGIN_ID, NLS.bind(PDECoreMessages.BundleManifestSourceLocationManager_problemProcessBundleManifestHeaderAttributeMissing, currentPlugin.getName()))); > } > } > } >Index: src/org/eclipse/pde/internal/core/bundle/BundlePluginBase.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/bundle/BundlePluginBase.java,v >retrieving revision 1.47 >diff -u -r1.47 BundlePluginBase.java >--- src/org/eclipse/pde/internal/core/bundle/BundlePluginBase.java 21 Jan 2008 17:56:34 -0000 1.47 >+++ src/org/eclipse/pde/internal/core/bundle/BundlePluginBase.java 17 Jun 2008 18:41:35 -0000 >@@ -974,4 +974,9 @@ > throw ce; > } > >+ public String getBundleSourceEntry() { >+ IManifestHeader header = getManifestHeader(ICoreConstants.ECLIPSE_SOURCE_BUNDLE); >+ return header != null ? header.getValue() : null; >+ } >+ > } >#P org.eclipse.pde.ui >Index: src/org/eclipse/pde/internal/ui/preferences/TargetSourceTab.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/preferences/TargetSourceTab.java,v >retrieving revision 1.16 >diff -u -r1.16 TargetSourceTab.java >--- src/org/eclipse/pde/internal/ui/preferences/TargetSourceTab.java 25 Apr 2008 23:27:42 -0000 1.16 >+++ src/org/eclipse/pde/internal/ui/preferences/TargetSourceTab.java 17 Jun 2008 18:41:37 -0000 >@@ -44,6 +44,7 @@ > public class TargetSourceTab { > private Image fFolderImage; > private TreeViewer fTreeViewer; >+ private Image fJarImage; > private Image fExtensionImage; > private Image fUserImage; > >@@ -103,15 +104,22 @@ > public String getText(Object obj) { > if (obj instanceof SourceLocation) { > SourceLocation location = (SourceLocation) obj; >- return location.getPath().toOSString(); >+ IPath path = location.getPath(); >+ if (path.toFile().isDirectory()) { >+ return path.toOSString(); >+ } >+ return new StringBuffer().append(path.lastSegment()).append(" (").append(path.toOSString()).append(")").toString(); //$NON-NLS-1$//$NON-NLS-2$ > } > return super.getText(obj); > } > > public Image getImage(Object obj) { >- if (obj instanceof SourceLocation) >- return fFolderImage; >- >+ if (obj instanceof SourceLocation) { >+ if (((SourceLocation) obj).getPath().toFile().isDirectory()) { >+ return fFolderImage; >+ } >+ return fJarImage; >+ } > return obj.equals(fUserNode) ? fUserImage : fExtensionImage; > } > } >@@ -131,6 +139,7 @@ > > private void initializeImages() { > fExtensionImage = PDEPluginImages.DESC_SOURCE_ATTACHMENT_OBJ.createImage(); >+ fJarImage = PDEPluginImages.DESC_JAR_LIB_OBJ.createImage(); > ImageDescriptor userDesc = new OverlayIcon(PDEPluginImages.DESC_SOURCE_ATTACHMENT_OBJ, new ImageDescriptor[][] {{PDEPluginImages.DESC_DOC_CO}}); > fUserImage = userDesc.createImage(); > fFolderImage = PlatformUI.getWorkbench().getSharedImages().getImage(ISharedImages.IMG_OBJ_FOLDER); >@@ -153,6 +162,7 @@ > } > > public void dispose() { >+ fJarImage.dispose(); > fExtensionImage.dispose(); > fUserImage.dispose(); > }
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 232841
: 105189 |
105190