facebook

Eclipse plugin:TextSelection cannot resoleve.

  1. MyEclipse IDE
  2.  > 
  3. General Development
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #303251 Reply

    ronen malka
    Member

    Hi,

    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.

       1. ISelection iSelection = null;
       2. IEditorSite iEditorSite = window.getActivePage().getActiveEditor().getEditorSite();
       3. if (iEditorSite != null) {
       4. ISelectionProvider iSelectionProvider = iEditorSite.getSelectionProvider();
       5. if (iSelectionProvider != null)
       6.   {
       7.    iSelection = iSelectionProvider.getSelection();
       8.    [b]selectedText = ((ITextSelection)iSelection).getText();[/b]
       9.   }
      10. }

    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

    #303281 Reply

    support-joy
    Member

    ronenmalka,

    Can you please send the sample project with minimal files to test here.
    Also explain the steps to reproduce the issue.
    You can PM the zip file or send an e-mail to support@genuitec.com.
    Please mention “Attn: Joy” in the subject line. Also, refer this post url in the e-mail, this will help us in quick tracking.

Viewing 2 posts - 1 through 2 (of 2 total)
Reply To: Eclipse plugin:TextSelection cannot resoleve.

You must be logged in to post in the forum log in