Eclipse plugin:TextSelection cannot resoleve
eclipse-plugin, textselection
Solution
Did you try, in the Run configuration dialog, to open the "Plugins" tab and click the button "add required plug-ins" ?
It might add the right runtime dependencies for you.
See also that same button in the dependencies tab of your plugin project:
alt text http://www.vogella.de/articles/RichClientPlatform/images/product50.gif
(more in the article "Products and Branding")
See also this SO answer for more checks.
Problem
I am trying to develop my first plug-in. The plug-in should manipulate the content of the selected text in the active text editor. I started with the “hello world” example from the “Cheat sheet” which worked perfect. When tried to modify I found that project not recognizing many types. I added the following jars to the project build path libraries: - org.eclipse.jface.text_3.5.1.r351_v20090708-0800.jar - org.eclipse.text_3.5.0.v20090513-2000.jar - org.eclipse.ui.editors_3.5.0.v20090527-2000.jar Now code compiles perfect. - `ISelection iSelection = null;` - `IEditorSite iEditorSite = window.getActivePage().getActiveEditor().getEditorSite();` - `if (iEditorSite != null) {` - ` ISelectionProvider iSelectionProvider = iEditorSite.getSelectionProvider();` - ` if (iSelectionProvider != null)` - ` {` - ` iSelection = iSelectionProvider.getSelection();` - ` selectedText = ((ITextSelection)iSelection).getText();` - ` }` - ` }` The problem is in line 08. although eclipse recognize the ITextSelection interface, at runtime I get cannot resolve type exception. When trying to deploy the code I get the following line in the deploy log: The import org.eclipse.jface.text cannot be resolved