|
|
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  |
Eclipse User |
|
|
|
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!
|
|
|
Powered by
FUDForum. Page generated in 0.03113 seconds