Skip to main content



      Home
Home » Eclipse Projects » Eclipse Platform » The type org.eclipse.core.resources.IFile cannot be resolved. It is indirectly referenced from , req
The type org.eclipse.core.resources.IFile cannot be resolved. It is indirectly referenced from , req [message #310508] Wed, 06 December 2006 09:14 Go to next message
Eclipse UserFriend
Hi all,

I've got a problem using IFileEditorInput. After adding
org.eclipse.ui.ide to the dependencies of my plug-in the following error
appears while trying to use the IFileEditorInput.getFile() method.

The type org.eclipse.core.resources.IFile cannot be resolved. It is
indirectly referenced from required .class files

What can I do to fix this?

Jan
Re: The type org.eclipse.core.resources.IFile cannot be resolved. It is indirectly referenced from , [message #310509 is a reply to message #310508] Wed, 06 December 2006 09:18 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: merks.ca.ibm.com

Jan,

Add org.eclipse.core.resources to the plugin dependencies. For any
other issue like this, use Ctrl-Shift-T to find the class, use the
little left-right arrow in the navigator/project explorer to find out
where that class lives, and then add the containing plugin to the
dependencies.

Jan Weidauer wrote:
> Hi all,
>
> I've got a problem using IFileEditorInput. After adding
> org.eclipse.ui.ide to the dependencies of my plug-in the following error
> appears while trying to use the IFileEditorInput.getFile() method.
>
> The type org.eclipse.core.resources.IFile cannot be resolved. It is
> indirectly referenced from required .class files
>
> What can I do to fix this?
>
> Jan
>
Re: The type org.eclipse.core.resources.IFile cannot be resolved. It is indirectly referenced from , [message #311141 is a reply to message #310509] Sun, 31 December 2006 14:12 Go to previous message
Eclipse UserFriend
Originally posted by: mcfaddin.us.ibm.com

Ed, Jan,

I have a similar problem with IFile -- except it happens at run time. I
have a snippet of code in a menu action delegate that checks the current
selection to see if it is a file, e.g.

ISelection current_selection = null;

public void selectionChanged(IAction action, ISelection selection) {
current_selection = selection;
}

public void run(IAction action) {
if( current_selection instanceof IStructuredSelection ) {
IStructuredSelection s = (IStructuredSelection) current_selection;
Object ob = s.getFirstElement();
IFile ifile = null;
if( ob instanceof IFile ) ifile = (IFile) ob;

.. code to open and read the file ..

}


At runtime I get a NoClassDefFoundError thrown at the "instanceof IFile"
evaluation. Doesnt seem to happen on the preceeding "instanceof
IStructuredSelection" evaluation, however.

I have org.eclipse.core.resources in my plugin dependencies but it looks
like the runtime can't get at the IFile class def. Do I need to force the
loading of the org.eclipse.core.resources plugin? Any idea what I am
missing? I'm not an eclipse expert so this is probably something really
simple.

FYI I'm testing the plugin in my WID 6.0.1 environment.

Thanks!
Previous Topic:Trying to use the ANT-Editor for Canoo Webtest
Next Topic:Load external File / Where is EFS?
Goto Forum:
  


Current Time: Wed May 07 12:48:47 EDT 2025

Powered by FUDForum. Page generated in 0.04350 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top