简体   繁体   中英

How can I import org.eclipse.pde.internal with sources?

The problem is, that this package and its children are not seen in the list of packages of "import". When I import all pde packages, org.eclipse.pde.internal somehow becomes usable anyway. But I don't see its sources. How can I manage this package?

Here are some rules from the Eclipse community that might help:

  1. Package names should match plug-in names. If they don't strip from the right. The code you seek should be in the plug-in org.eclipse.pde.internal (doesn't exist). Strip internal and you get an existing plug-in.

  2. OSGi allows to hide packages in plug-in X from other plugins. This feature isn't really used. You can still import the classes but Eclipse don't show them in code completion and you will get warnings. There is an option for the OSGi/bundle classloader to throw NoClassDefFoundError but that option is usually disabled. You can find the exports list in the MANIFEST.MF of the plug-in that you try to import from.

    Most of the non-exported packages are in below a package internal , so this is a hint: Don't use this code. It's not part of the official API. It can change in the next version of Eclipse or the plug-in and nobody will care if your code breaks (unlike with the official API).

Of course, the world isn't that simple. Which is why using internal code is frowned upon but the classloader option is disabled (= Eclipse could enforce this behavior but they don't).

If you think some internal API would be great to use, file a bug report at https://bugs.eclipse.org/bugs/

The problem was solved by my colleague.

  1. org.eclipse.pde.internal is in org.eclipse.pde.ui .

  2. Eclipse 3.7.2 simply haven't the PDE sources. Appropriate directories in repository are empty. I downshifted to 3.7.0 and it is OK now.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM