How the Eclipse implements importing project? - eclipse

How the Eclipse implements importing project and which part of the Eclipse's codes works?
OK, we all know EC has function:file->import ->exsit project ...I am looking into the code of EC, but i cant find which part of it is used to implement this loading work.

In the part of Eclipse that you want learn more about (in this case for example in the Import Projects Wizard), you can open the Plug-in Spy using Alt+Shift+F1. It will tell you the class and the plug-in contributing the functionality. You can then check out the plug-in from the Eclipse CVS.

Related

Exporting Eclipse Plugin Project with changes to Source Code

The Eclipse Plugin I am currently working on required me to import into the workspace and edit some existing source code in org.eclipse.jface.text.source.projection
because the method I needed to change happened to be private.
Now I am wondering: Can this change be somehow packaged into my plugin? Will I even be able to export this plugin and offer it for people to use?
I know AspectJ weaving would be an option but I wonder if there is another solution.

Find what plugin implements a functionality in eclipse

Most eclipse platform functionality is implemented in plugins.
I'm trying to figure out what plugin/s is/are responsible for certain functionality or actions. In my case specifically, figuring out which ones are responsible for import resolution in java files:
for the line import org.openqa.selenium.firefox.FirefoxDriver; eclipse will give me an error: the import org.openqa cannot be resolved (since I've never worked with openqa, and I haven't added it to my pom.xml file), while for the line import java.util.Iterator it just knows what we're talking about.
How can I find and dissect those behaviors, to better understand how the resolution works?
I know I can get a list of all installed plugins through: help -> about eclipse -> installation details -> plug-ins; but that isn't much help since that's just a huge list of suspects.
Conversely, I've tried running eclipse with -vm c:\jre\bin\java.exe -consoleLog to see the internal logs, but it looks like most plugins only log errors to the error log.
My guess is that using maven to enrich the project's build jars list, and some existing collection of multiple jars, eclipse will look in the project's build path to resolve the import. But that's just a guess...
Also, when the resolution fails, eclipse will give the cannot resolve import error, and allow me to figure it out through an import search window that doesn't actually find anything, which is what I'm trying to see it it's possible to improve upon.
The Maven plugin definitely plays an important role for looking up Java classes. If you right click on a project in Eclipse you should see a menu item that is called Build Path. It shows the dependencies of the project that are taken into account when Eclipse builds classes in the project. A dependency can be a jar, but it does not have to be. The dependencies include Maven dependencies.
This post is not an answer to the general question of finding a plugin that implements a functionality, but it's maybe enough for your specific case.

Java Decompiler plugin in Eclipse with JavaDoc

I add a decompiler plugin JadClipse in Eclipse but I am facing a issue that decompiler removes the JavaDoc from the code. Only the simple code is made available, can anybody suggest me any available Eclipse plugin to resolve the problem.
JAD doesn't remove the JavaDoc - there simply is no JavaDoc in compiled code.
What you want is to add JavaDoc to decompiled code. There is no plugin for that (and I think writing one wouldn't be easy).
If you have the JavaDoc as a JAR, you can tell Eclipse to show it in the project's settings. That way, you might be able to see the docs when you hover over a place where a method is used - if you hover over the decompiled method, this probably won't work (I think the decompiled source will take precedence over anything else).
The solution to add manually each javadoc is a bit heavy if you have many librairies in your project, which is often the case.
If you have Maven integration, the solution to have the javadoc accessible is to tell Maven to download it.
In Eclipse Project Explorer :
Right-click on your projet -> Maven -> Download JavaDoc
There should be an equivalent for Graddle which I've never used yet.

How to load classes in an eclipse plug-in

I want to load a class such as database driver from the user's workspace within my eclipse plug-in. Is there an easy way to do this?
I believe that you can add a project as a resource to another in Eclipse, then you just import through the package hierarchy as usual.

how to import zxing source for android into eclipse?

I have checked out the source of zxing from Subversion, and I would like to import the source to Eclipse IDE so I can examine the code and then make my project, which uses zxing.
How can I import the source?
If I choose File->Import->Existing Project into workspace, Eclipse doesn't seem to find the project!
Also, do I have to import the project to the workspace or simply add some libraries to my project in order to use it?
I followed this tutorial Click here but instead of dowloading the 2.1 version, I downloaded the 2.2 and dowload the core.jar from here. If you dont know how to import the library check this.