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 191917 Details for
Bug 339857
It is possible to import package from fragment, but classes are invisible
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
Proposed Fix
clipboard.txt (text/plain), 2.98 KB, created by
Curtis Windatt
on 2011-03-25 11:57:26 EDT
(
hide
)
Description:
Proposed Fix
Filename:
MIME Type:
Creator:
Curtis Windatt
Created:
2011-03-25 11:57:26 EDT
Size:
2.98 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.pde.ui >Index: src/org/eclipse/pde/internal/ui/editor/plugin/ImportPackageSection.java >=================================================================== >RCS file: /cvsroot/eclipse/pde/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/plugin/ImportPackageSection.java,v >retrieving revision 1.52 >diff -u -r1.52 ImportPackageSection.java >--- src/org/eclipse/pde/internal/ui/editor/plugin/ImportPackageSection.java 22 Feb 2011 22:36:29 -0000 1.52 >+++ src/org/eclipse/pde/internal/ui/editor/plugin/ImportPackageSection.java 25 Mar 2011 15:56:45 -0000 >@@ -482,6 +482,11 @@ > > for (int i = 0; i < models.length; i++) { > BundleDescription desc = models[i].getBundleDescription(); >+ >+ // If the current model is a fragment, it must have hasExtensibleAPI set to export its packages >+ if (isFragmentThatCannotExportPackages(models[i])) >+ continue; >+ > String id = desc == null ? null : desc.getSymbolicName(); > if (id == null || forbidden.contains(id)) > continue; >@@ -520,6 +525,11 @@ > IProject project = resource != null ? resource.getProject() : null; > if (project == null || !project.hasNature(JavaCore.NATURE_ID) || WorkspaceModelManager.isBinaryProject(project) || !PDEProject.getManifest(project).exists()) > continue; >+ >+ // If the current model is a fragment, it must have hasExtensibleAPI set to export its packages >+ if (isFragmentThatCannotExportPackages(models[i])) >+ continue; >+ > IJavaProject jp = JavaCore.create(project); > IPackageFragmentRoot[] roots = jp.getPackageFragmentRoots(); > for (int j = 0; j < roots.length; j++) { >@@ -543,6 +553,39 @@ > dialog.setConditionalElements(conditional.toArray()); > } > >+ /** >+ * Returns whether the provided plug-in model is a fragment that cannot export >+ * its packages to other bundles (<code>hasExtensibleAPI</code> is not set). Will >+ * return false if the model does not represent a fragment. >+ * >+ * @param fragment the model to test >+ * @return <code>true</code> if the model is a fragment that cannot export packages >+ */ >+ private boolean isFragmentThatCannotExportPackages(IPluginModelBase fragment) { >+ if (!fragment.isFragmentModel()) { >+ // Not a fragment >+ return false; >+ } >+ BundleDescription bundleDescription = fragment.getBundleDescription(); >+ if (bundleDescription == null) { >+ // Classic plugin, do not change the behavior >+ return false; >+ } >+ HostSpecification hostSpec = bundleDescription.getHost(); >+ if (hostSpec == null) { >+ // Not a fragment >+ return false; >+ } >+ BundleDescription[] hosts = hostSpec.getHosts(); >+ for (int i = 0; i < hosts.length; i++) { >+ // Hosts have extensible API so they packages can be exported >+ if (ClasspathUtilCore.hasExtensibleAPI(PluginRegistry.findModel(hosts[i]))) >+ return false; >+ } >+ // Fragment that cannot export >+ return true; >+ } >+ > public void modelChanged(IModelChangedEvent event) { > if (event.getChangeType() == IModelChangedEvent.WORLD_CHANGED) { > fHeader = null;
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 339857
:
191101
| 191917 |
192251