Import org.eclipse.core packages for the Eclipse plugin

I am trying to create a plugin to mimic the Eclipse open resources dialog (CTRL + SHIFT + R). I learned how to create FilteredItemsSelectionDialog following an example. But the missing element is filling the dialogue with workspace resources. I found OpenResourceHandler and am trying to duplicate this function in my plugin, so I can go and see how it works. Therefore, I copy the source and rename it to avoid a collision with the real one. The problem is that I cannot import these classes:

import org.eclipse.core.resources.IContainer;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.resources.ResourcesPlugin;

I tried editing my manifest, but it will not allow me to import org.eclipse.core (although I can import org.eclipse.core.runtime). So where can I find these classes and how can I import them? And, more importantly, in general, how would I find a package in which a given class exists and import it?

+3
source share
1 answer

You need to import org.eclipse.core.resources.

In general, you can open the "Plug-ins" view (Window -> Show View -> Other -> Plug-in Development -> Plug-ins). Then select interesting plugins and right click → Add to Java Search. Then you can use Open Type (Ctrl + Shift + T) to open the class.

, , " ". " " , , .

+7

Source: https://habr.com/ru/post/1751057/


All Articles